Merge "Add debug log for Task resize info" into main
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index df4a3e5..bd17d6d 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -20,6 +20,7 @@
java_aconfig_libraries: [
// !!! KEEP THIS LIST ALPHABETICAL !!!
"aconfig_mediacodec_flags_java_lib",
+ "android-sdk-flags-java",
"android.adaptiveauth.flags-aconfig-java",
"android.app.appfunctions.flags-aconfig-java",
"android.app.contextualsearch.flags-aconfig-java",
diff --git a/Android.bp b/Android.bp
index f8907f3..258440f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -98,6 +98,7 @@
":android.frameworks.location.altitude-V2-java-source",
":android.hardware.biometrics.common-V4-java-source",
":android.hardware.biometrics.fingerprint-V5-java-source",
+ ":android.hardware.biometrics.fingerprint.virtualhal-java-source",
":android.hardware.biometrics.face-V4-java-source",
":android.hardware.gnss-V2-java-source",
":android.hardware.graphics.common-V3-java-source",
diff --git a/BROADCASTS_OWNERS b/BROADCASTS_OWNERS
index 01f1f8a..f0cbe46 100644
--- a/BROADCASTS_OWNERS
+++ b/BROADCASTS_OWNERS
@@ -1,5 +1,5 @@
# Bug component: 316181
-ctate@android.com
-jsharkey@google.com
+set noparent
+
sudheersai@google.com
yamasani@google.com #{LAST_RESORT_SUGGESTION}
diff --git a/android-sdk-flags/Android.bp b/android-sdk-flags/Android.bp
new file mode 100644
index 0000000..79a0b9a
--- /dev/null
+++ b/android-sdk-flags/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+aconfig_declarations {
+ name: "android-sdk-flags",
+ package: "android.sdk",
+ container: "system",
+ srcs: ["flags.aconfig"],
+}
+
+java_aconfig_library {
+ name: "android-sdk-flags-java",
+ aconfig_declarations: "android-sdk-flags",
+ defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
diff --git a/android-sdk-flags/flags.aconfig b/android-sdk-flags/flags.aconfig
new file mode 100644
index 0000000..cfe298e
--- /dev/null
+++ b/android-sdk-flags/flags.aconfig
@@ -0,0 +1,12 @@
+package: "android.sdk"
+container: "system"
+
+flag {
+ name: "major_minor_versioning_scheme"
+ namespace: "android_sdk"
+ description: "Use the new SDK major.minor versioning scheme (e.g. Android 40.1) which replaces the old single-integer scheme (e.g. Android 15)."
+ bug: "350458259"
+
+ # Use is_fixed_read_only because DeviceConfig may not be available when Build.VERSION_CODES is first accessed
+ is_fixed_read_only: true
+}
diff --git a/apct-tests/perftests/core/Android.bp b/apct-tests/perftests/core/Android.bp
index 65bc8cc..1e299cd 100644
--- a/apct-tests/perftests/core/Android.bp
+++ b/apct-tests/perftests/core/Android.bp
@@ -52,7 +52,7 @@
"guava",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
java_resources: [":GoogleFontDancingScript"],
diff --git a/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ClientSocketPerfTest.java b/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ClientSocketPerfTest.java
index f20b170..3577fcd 100644
--- a/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ClientSocketPerfTest.java
+++ b/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ClientSocketPerfTest.java
@@ -194,7 +194,7 @@
/**
* Simple benchmark for the amount of time to send a given number of messages
*/
- @Test
+ // @Test Temporarily disabled
@Parameters(method = "getParams")
public void time(Config config) throws Exception {
reset();
diff --git a/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ServerSocketPerfTest.java b/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ServerSocketPerfTest.java
index af3c405..ac57100 100644
--- a/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ServerSocketPerfTest.java
+++ b/apct-tests/perftests/core/src/android/conscrypt/conscrypt/ServerSocketPerfTest.java
@@ -198,7 +198,7 @@
executor.awaitTermination(5, TimeUnit.SECONDS);
}
- @Test
+ // @Test Temporarily disabled
@Parameters(method = "getParams")
public void throughput(Config config) throws Exception {
setup(config);
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java
index 4cf46e5..f01ac02 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java
@@ -565,7 +565,6 @@
}
@Test
- @Parameters(method = "getData")
public void time_new_byteArray() throws Exception {
final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
@@ -574,7 +573,6 @@
}
@Test
- @Parameters(method = "getData")
public void time_ByteBuffer_allocate() throws Exception {
final BenchmarkState state = mBenchmarkRule.getState();
while (state.keepRunning()) {
diff --git a/apct-tests/perftests/healthconnect/Android.bp b/apct-tests/perftests/healthconnect/Android.bp
index c38a24e..072010e 100644
--- a/apct-tests/perftests/healthconnect/Android.bp
+++ b/apct-tests/perftests/healthconnect/Android.bp
@@ -37,7 +37,7 @@
"collector-device-lib-platform",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
test_suites: ["device-tests"],
data: [":perfetto_artifacts"],
diff --git a/apct-tests/perftests/packagemanager/Android.bp b/apct-tests/perftests/packagemanager/Android.bp
index 02fc12c..b262691 100644
--- a/apct-tests/perftests/packagemanager/Android.bp
+++ b/apct-tests/perftests/packagemanager/Android.bp
@@ -28,7 +28,7 @@
"services.core",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
diff --git a/apct-tests/perftests/permission/Android.bp b/apct-tests/perftests/permission/Android.bp
index bc8e769..f4c7fbb 100644
--- a/apct-tests/perftests/permission/Android.bp
+++ b/apct-tests/perftests/permission/Android.bp
@@ -43,7 +43,7 @@
"cts-install-lib-java",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
diff --git a/apct-tests/perftests/settingsprovider/Android.bp b/apct-tests/perftests/settingsprovider/Android.bp
index e4aa14c..3828039 100644
--- a/apct-tests/perftests/settingsprovider/Android.bp
+++ b/apct-tests/perftests/settingsprovider/Android.bp
@@ -28,7 +28,7 @@
"services.core",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
platform_apis: true,
diff --git a/apex/blobstore/OWNERS b/apex/blobstore/OWNERS
index a53bbea..676cbc7 100644
--- a/apex/blobstore/OWNERS
+++ b/apex/blobstore/OWNERS
@@ -1,2 +1,5 @@
+# Bug component: 25692
+set noparent
+
sudheersai@google.com
-yamasani@google.com
+yamasani@google.com #{LAST_RESORT_SUGGESTION}
diff --git a/apex/jobscheduler/framework/aconfig/job.aconfig b/apex/jobscheduler/framework/aconfig/job.aconfig
index 80db264..5f55075 100644
--- a/apex/jobscheduler/framework/aconfig/job.aconfig
+++ b/apex/jobscheduler/framework/aconfig/job.aconfig
@@ -23,3 +23,10 @@
description: "Introduce a new RUN_BACKUP_JOBS permission and exemption logic allowing for longer running jobs for apps whose primary purpose is to backup or sync content."
bug: "318731461"
}
+
+flag {
+ name: "cleanup_empty_jobs"
+ namespace: "backstage_power"
+ description: "Enables automatic cancellation of jobs due to leaked JobParameters, reducing unnecessary battery drain and improving system efficiency. This includes logging and traces for better issue diagnosis."
+ bug: "349688611"
+}
diff --git a/apex/jobscheduler/framework/java/android/app/job/IJobCallback.aidl b/apex/jobscheduler/framework/java/android/app/job/IJobCallback.aidl
index 96494ec..11d17ca 100644
--- a/apex/jobscheduler/framework/java/android/app/job/IJobCallback.aidl
+++ b/apex/jobscheduler/framework/java/android/app/job/IJobCallback.aidl
@@ -85,6 +85,14 @@
*/
@UnsupportedAppUsage
void jobFinished(int jobId, boolean reschedule);
+
+ /*
+ * Inform JobScheduler to force finish this job because the client has lost
+ * the job handle. jobFinished can no longer be called from the client.
+ * @param jobId Unique integer used to identify this job
+ */
+ void forceJobFinished(int jobId);
+
/*
* Inform JobScheduler of a change in the estimated transfer payload.
*
diff --git a/apex/jobscheduler/framework/java/android/app/job/JobParameters.java b/apex/jobscheduler/framework/java/android/app/job/JobParameters.java
index e833bb9..52a761f 100644
--- a/apex/jobscheduler/framework/java/android/app/job/JobParameters.java
+++ b/apex/jobscheduler/framework/java/android/app/job/JobParameters.java
@@ -34,15 +34,21 @@
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.os.RemoteException;
+import android.system.SystemCleaner;
+import android.util.Log;
+
+import com.android.internal.annotations.VisibleForTesting;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.lang.ref.Cleaner;
/**
* Contains the parameters used to configure/identify your job. You do not create this object
* yourself, instead it is handed in to your application by the System.
*/
public class JobParameters implements Parcelable {
+ private static final String TAG = "JobParameters";
/** @hide */
public static final int INTERNAL_STOP_REASON_UNKNOWN = -1;
@@ -306,6 +312,10 @@
private int mStopReason = STOP_REASON_UNDEFINED;
private int mInternalStopReason = INTERNAL_STOP_REASON_UNKNOWN;
private String debugStopReason; // Human readable stop reason for debugging.
+ @Nullable
+ private JobCleanupCallback mJobCleanupCallback;
+ @Nullable
+ private Cleaner.Cleanable mCleanable;
/** @hide */
public JobParameters(IBinder callback, String namespace, int jobId, PersistableBundle extras,
@@ -326,6 +336,8 @@
this.mTriggeredContentAuthorities = triggeredContentAuthorities;
this.mNetwork = network;
this.mJobNamespace = namespace;
+ this.mJobCleanupCallback = null;
+ this.mCleanable = null;
}
/**
@@ -597,6 +609,8 @@
mStopReason = in.readInt();
mInternalStopReason = in.readInt();
debugStopReason = in.readString();
+ mJobCleanupCallback = null;
+ mCleanable = null;
}
/** @hide */
@@ -612,6 +626,54 @@
this.debugStopReason = debugStopReason;
}
+ /** @hide */
+ public void initCleaner(JobCleanupCallback jobCleanupCallback) {
+ mJobCleanupCallback = jobCleanupCallback;
+ mCleanable = SystemCleaner.cleaner().register(this, mJobCleanupCallback);
+ }
+
+ /**
+ * Lazy initialize the cleaner and enable it
+ *
+ * @hide
+ */
+ public void enableCleaner() {
+ if (mJobCleanupCallback == null) {
+ initCleaner(new JobCleanupCallback(IJobCallback.Stub.asInterface(callback), jobId));
+ }
+ mJobCleanupCallback.enableCleaner();
+ }
+
+ /**
+ * Disable the cleaner from running and unregister it
+ *
+ * @hide
+ */
+ public void disableCleaner() {
+ if (mJobCleanupCallback != null) {
+ mJobCleanupCallback.disableCleaner();
+ if (mCleanable != null) {
+ mCleanable.clean();
+ mCleanable = null;
+ }
+ mJobCleanupCallback = null;
+ }
+ }
+
+ /** @hide */
+ @VisibleForTesting
+ @Nullable
+ public Cleaner.Cleanable getCleanable() {
+ return mCleanable;
+ }
+
+ /** @hide */
+ @VisibleForTesting
+ @Nullable
+ public JobCleanupCallback getJobCleanupCallback() {
+ return mJobCleanupCallback;
+ }
+
@Override
public int describeContents() {
return 0;
@@ -647,6 +709,67 @@
dest.writeString(debugStopReason);
}
+ /**
+ * JobCleanupCallback is used track JobParameters leak. If the job is started
+ * and jobFinish is not called at the time of garbage collection of JobParameters
+ * instance, it is considered a job leak. Force finish the job.
+ *
+ * @hide
+ */
+ public static class JobCleanupCallback implements Runnable {
+ private final IJobCallback mCallback;
+ private final int mJobId;
+ private boolean mIsCleanerEnabled;
+
+ public JobCleanupCallback(
+ IJobCallback callback,
+ int jobId) {
+ mCallback = callback;
+ mJobId = jobId;
+ mIsCleanerEnabled = false;
+ }
+
+ /**
+ * Check if the cleaner is enabled
+ *
+ * @hide
+ */
+ public boolean isCleanerEnabled() {
+ return mIsCleanerEnabled;
+ }
+
+ /**
+ * Enable the cleaner to detect JobParameter leak
+ *
+ * @hide
+ */
+ public void enableCleaner() {
+ mIsCleanerEnabled = true;
+ }
+
+ /**
+ * Disable the cleaner from running.
+ *
+ * @hide
+ */
+ public void disableCleaner() {
+ mIsCleanerEnabled = false;
+ }
+
+ /** @hide */
+ @Override
+ public void run() {
+ if (!isCleanerEnabled()) {
+ return;
+ }
+ try {
+ mCallback.forceJobFinished(mJobId);
+ } catch (Exception e) {
+ Log.wtf(TAG, "Could not destroy running job", e);
+ }
+ }
+ }
+
public static final @android.annotation.NonNull Creator<JobParameters> CREATOR = new Creator<JobParameters>() {
@Override
public JobParameters createFromParcel(Parcel in) {
diff --git a/apex/jobscheduler/framework/java/android/app/job/JobServiceEngine.java b/apex/jobscheduler/framework/java/android/app/job/JobServiceEngine.java
index 79d87ed..5f80c52 100644
--- a/apex/jobscheduler/framework/java/android/app/job/JobServiceEngine.java
+++ b/apex/jobscheduler/framework/java/android/app/job/JobServiceEngine.java
@@ -165,7 +165,13 @@
case MSG_EXECUTE_JOB: {
final JobParameters params = (JobParameters) msg.obj;
try {
+ if (Flags.cleanupEmptyJobs()) {
+ params.enableCleaner();
+ }
boolean workOngoing = JobServiceEngine.this.onStartJob(params);
+ if (Flags.cleanupEmptyJobs() && !workOngoing) {
+ params.disableCleaner();
+ }
ackStartMessage(params, workOngoing);
} catch (Exception e) {
Log.e(TAG, "Error while executing job: " + params.getJobId());
@@ -190,6 +196,9 @@
IJobCallback callback = params.getCallback();
if (callback != null) {
try {
+ if (Flags.cleanupEmptyJobs()) {
+ params.disableCleaner();
+ }
callback.jobFinished(params.getJobId(), needsReschedule);
} catch (RemoteException e) {
Log.e(TAG, "Error reporting job finish to system: binder has gone" +
diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
index be8e304..ee246d8 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
@@ -129,6 +129,8 @@
private static final String[] VERB_STRINGS = {
"VERB_BINDING", "VERB_STARTING", "VERB_EXECUTING", "VERB_STOPPING", "VERB_FINISHED"
};
+ private static final String TRACE_JOB_FORCE_FINISHED_PREFIX = "forceJobFinished:";
+ private static final String TRACE_JOB_FORCE_FINISHED_DELIMITER = "#";
// States that a job occupies while interacting with the client.
static final int VERB_BINDING = 0;
@@ -292,6 +294,11 @@
}
@Override
+ public void forceJobFinished(int jobId) {
+ doForceJobFinished(this, jobId);
+ }
+
+ @Override
public void updateEstimatedNetworkBytes(int jobId, JobWorkItem item,
long downloadBytes, long uploadBytes) {
doUpdateEstimatedNetworkBytes(this, jobId, item, downloadBytes, uploadBytes);
@@ -762,6 +769,35 @@
}
}
+ /**
+ * This method just adds traces to evaluate jobs that leak jobparameters at the client.
+ * It does not stop the job.
+ */
+ void doForceJobFinished(JobCallback cb, int jobId) {
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ final JobStatus executing;
+ synchronized (mLock) {
+ // not the current job, presumably it has finished in some way already
+ if (!verifyCallerLocked(cb)) {
+ return;
+ }
+
+ executing = getRunningJobLocked();
+ }
+ if (executing != null && jobId == executing.getJobId()) {
+ final StringBuilder stateSuffix = new StringBuilder();
+ stateSuffix.append(TRACE_JOB_FORCE_FINISHED_PREFIX);
+ stateSuffix.append(executing.getBatteryName());
+ stateSuffix.append(TRACE_JOB_FORCE_FINISHED_DELIMITER);
+ stateSuffix.append(executing.getJobId());
+ Trace.instant(Trace.TRACE_TAG_POWER, stateSuffix.toString());
+ }
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ }
+
private void doAcknowledgeGetTransferredDownloadBytesMessage(JobCallback cb, int jobId,
int workId, @BytesLong long transferredBytes) {
// TODO(255393346): Make sure apps call this appropriately and monitor for abuse
diff --git a/apex/jobscheduler/service/java/com/android/server/job/TEST_MAPPING b/apex/jobscheduler/service/java/com/android/server/job/TEST_MAPPING
index 16c2fd4..a0bf78f 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/TEST_MAPPING
+++ b/apex/jobscheduler/service/java/com/android/server/job/TEST_MAPPING
@@ -25,10 +25,7 @@
]
},
{
- "name": "FrameworksServicesTests",
- "options": [
- {"include-filter": "com.android.server.job"}
- ]
+ "name": "FrameworksServicesTests_com_android_server_job"
},
{
"name": "CtsHostsideNetworkPolicyTests",
diff --git a/apex/jobscheduler/service/java/com/android/server/usage/TEST_MAPPING b/apex/jobscheduler/service/java/com/android/server/usage/TEST_MAPPING
index 52670a2..f56c14d 100644
--- a/apex/jobscheduler/service/java/com/android/server/usage/TEST_MAPPING
+++ b/apex/jobscheduler/service/java/com/android/server/usage/TEST_MAPPING
@@ -10,14 +10,10 @@
]
},
{
- "name": "CtsBRSTestCases",
- "options": [
- {"exclude-annotation": "androidx.test.filters.FlakyTest"},
- {"exclude-annotation": "org.junit.Ignore"}
- ]
+ "name": "CtsBRSTestCases"
},
{
- "name": "FrameworksServicesTests_com_android_server_usage_Presubmit"
+ "name": "FrameworksServicesTests_com_android_server_usage"
}
],
"postsubmit": [
@@ -25,10 +21,7 @@
"name": "CtsUsageStatsTestCases"
},
{
- "name": "FrameworksServicesTests",
- "options": [
- {"include-filter": "com.android.server.usage"}
- ]
+ "name": "FrameworksServicesTests_com_android_server_usage"
}
]
}
diff --git a/api/api.go b/api/api.go
index 5b7f534..e9f1fee 100644
--- a/api/api.go
+++ b/api/api.go
@@ -15,7 +15,7 @@
package api
import (
- "sort"
+ "slices"
"github.com/google/blueprint/proptools"
@@ -75,31 +75,25 @@
var PrepareForCombinedApisTest = android.FixtureRegisterWithContext(registerBuildComponents)
-func (a *CombinedApis) bootclasspath(ctx android.ConfigAndErrorContext) []string {
- return a.properties.Bootclasspath.GetOrDefault(a.ConfigurableEvaluator(ctx), nil)
-}
-
-func (a *CombinedApis) systemServerClasspath(ctx android.ConfigAndErrorContext) []string {
- return a.properties.System_server_classpath.GetOrDefault(a.ConfigurableEvaluator(ctx), nil)
-}
-
func (a *CombinedApis) apiFingerprintStubDeps(ctx android.BottomUpMutatorContext) []string {
- ret := []string{}
+ bootClasspath := a.properties.Bootclasspath.GetOrDefault(ctx, nil)
+ systemServerClasspath := a.properties.System_server_classpath.GetOrDefault(ctx, nil)
+ var ret []string
ret = append(
ret,
- transformArray(a.bootclasspath(ctx), "", ".stubs")...,
+ transformArray(bootClasspath, "", ".stubs")...,
)
ret = append(
ret,
- transformArray(a.bootclasspath(ctx), "", ".stubs.system")...,
+ transformArray(bootClasspath, "", ".stubs.system")...,
)
ret = append(
ret,
- transformArray(a.bootclasspath(ctx), "", ".stubs.module_lib")...,
+ transformArray(bootClasspath, "", ".stubs.module_lib")...,
)
ret = append(
ret,
- transformArray(a.systemServerClasspath(ctx), "", ".stubs.system_server")...,
+ transformArray(systemServerClasspath, "", ".stubs.system_server")...,
)
return ret
}
@@ -129,7 +123,7 @@
Cmd *string
Dists []android.Dist
Out []string
- Srcs []string
+ Srcs proptools.Configurable[[]string]
Tools []string
Visibility []string
}
@@ -137,7 +131,7 @@
type libraryProps struct {
Name *string
Sdk_version *string
- Static_libs []string
+ Static_libs proptools.Configurable[[]string]
Visibility []string
Defaults []string
Is_stubs_module *bool
@@ -145,7 +139,7 @@
type fgProps struct {
Name *string
- Srcs []string
+ Srcs proptools.Configurable[[]string]
Visibility []string
}
@@ -166,7 +160,7 @@
// The module for the non-updatable / non-module part of the api.
BaseTxt string
// The list of modules that are relevant for this merged txt.
- Modules []string
+ Modules proptools.Configurable[[]string]
// The output tag for each module to use.e.g. {.public.api.txt} for current.txt
ModuleTag string
// public, system, module-lib or system-server
@@ -190,7 +184,8 @@
props.Tools = []string{"metalava"}
props.Out = []string{filename}
props.Cmd = proptools.StringPtr(metalavaCmd + "$(in) --out $(out)")
- props.Srcs = append([]string{txt.BaseTxt}, createSrcs(txt.Modules, txt.ModuleTag)...)
+ props.Srcs = proptools.NewSimpleConfigurable([]string{txt.BaseTxt})
+ props.Srcs.Append(createSrcs(txt.Modules, txt.ModuleTag))
if doDist {
props.Dists = []android.Dist{
{
@@ -209,11 +204,11 @@
ctx.CreateModule(genrule.GenRuleFactory, &props)
}
-func createMergedAnnotationsFilegroups(ctx android.LoadHookContext, modules, system_server_modules []string) {
+func createMergedAnnotationsFilegroups(ctx android.LoadHookContext, modules, system_server_modules proptools.Configurable[[]string]) {
for _, i := range []struct {
name string
tag string
- modules []string
+ modules proptools.Configurable[[]string]
}{
{
name: "all-modules-public-annotations",
@@ -240,33 +235,39 @@
}
}
-func createMergedPublicStubs(ctx android.LoadHookContext, modules []string) {
+func createMergedPublicStubs(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
+ modules = modules.Clone()
+ transformConfigurableArray(modules, "", ".stubs")
props := libraryProps{}
props.Name = proptools.StringPtr("all-modules-public-stubs")
- props.Static_libs = transformArray(modules, "", ".stubs")
+ props.Static_libs = modules
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
ctx.CreateModule(java.LibraryFactory, &props)
}
-func createMergedPublicExportableStubs(ctx android.LoadHookContext, modules []string) {
+func createMergedPublicExportableStubs(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
+ modules = modules.Clone()
+ transformConfigurableArray(modules, "", ".stubs.exportable")
props := libraryProps{}
props.Name = proptools.StringPtr("all-modules-public-stubs-exportable")
- props.Static_libs = transformArray(modules, "", ".stubs.exportable")
+ props.Static_libs = modules
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
ctx.CreateModule(java.LibraryFactory, &props)
}
-func createMergedSystemStubs(ctx android.LoadHookContext, modules []string) {
+func createMergedSystemStubs(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
// First create the all-updatable-modules-system-stubs
{
- updatable_modules := removeAll(modules, non_updatable_modules)
+ updatable_modules := modules.Clone()
+ removeAll(updatable_modules, non_updatable_modules)
+ transformConfigurableArray(updatable_modules, "", ".stubs.system")
props := libraryProps{}
props.Name = proptools.StringPtr("all-updatable-modules-system-stubs")
- props.Static_libs = transformArray(updatable_modules, "", ".stubs.system")
+ props.Static_libs = updatable_modules
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
@@ -275,10 +276,11 @@
// Now merge all-updatable-modules-system-stubs and stubs from non-updatable modules
// into all-modules-system-stubs.
{
+ static_libs := transformArray(non_updatable_modules, "", ".stubs.system")
+ static_libs = append(static_libs, "all-updatable-modules-system-stubs")
props := libraryProps{}
props.Name = proptools.StringPtr("all-modules-system-stubs")
- props.Static_libs = transformArray(non_updatable_modules, "", ".stubs.system")
- props.Static_libs = append(props.Static_libs, "all-updatable-modules-system-stubs")
+ props.Static_libs = proptools.NewSimpleConfigurable(static_libs)
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
@@ -286,13 +288,15 @@
}
}
-func createMergedSystemExportableStubs(ctx android.LoadHookContext, modules []string) {
+func createMergedSystemExportableStubs(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
// First create the all-updatable-modules-system-stubs
{
- updatable_modules := removeAll(modules, non_updatable_modules)
+ updatable_modules := modules.Clone()
+ removeAll(updatable_modules, non_updatable_modules)
+ transformConfigurableArray(updatable_modules, "", ".stubs.exportable.system")
props := libraryProps{}
props.Name = proptools.StringPtr("all-updatable-modules-system-stubs-exportable")
- props.Static_libs = transformArray(updatable_modules, "", ".stubs.exportable.system")
+ props.Static_libs = updatable_modules
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
@@ -301,10 +305,11 @@
// Now merge all-updatable-modules-system-stubs and stubs from non-updatable modules
// into all-modules-system-stubs.
{
+ static_libs := transformArray(non_updatable_modules, "", ".stubs.exportable.system")
+ static_libs = append(static_libs, "all-updatable-modules-system-stubs-exportable")
props := libraryProps{}
props.Name = proptools.StringPtr("all-modules-system-stubs-exportable")
- props.Static_libs = transformArray(non_updatable_modules, "", ".stubs.exportable.system")
- props.Static_libs = append(props.Static_libs, "all-updatable-modules-system-stubs-exportable")
+ props.Static_libs = proptools.NewSimpleConfigurable(static_libs)
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
@@ -315,7 +320,7 @@
func createMergedTestStubsForNonUpdatableModules(ctx android.LoadHookContext) {
props := libraryProps{}
props.Name = proptools.StringPtr("all-non-updatable-modules-test-stubs")
- props.Static_libs = transformArray(non_updatable_modules, "", ".stubs.test")
+ props.Static_libs = proptools.NewSimpleConfigurable(transformArray(non_updatable_modules, "", ".stubs.test"))
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
@@ -325,25 +330,27 @@
func createMergedTestExportableStubsForNonUpdatableModules(ctx android.LoadHookContext) {
props := libraryProps{}
props.Name = proptools.StringPtr("all-non-updatable-modules-test-stubs-exportable")
- props.Static_libs = transformArray(non_updatable_modules, "", ".stubs.exportable.test")
+ props.Static_libs = proptools.NewSimpleConfigurable(transformArray(non_updatable_modules, "", ".stubs.exportable.test"))
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
ctx.CreateModule(java.LibraryFactory, &props)
}
-func createMergedFrameworkImpl(ctx android.LoadHookContext, modules []string) {
+func createMergedFrameworkImpl(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
+ modules = modules.Clone()
// This module is for the "framework-all" module, which should not include the core libraries.
- modules = removeAll(modules, core_libraries_modules)
+ removeAll(modules, core_libraries_modules)
// Remove the modules that belong to non-updatable APEXes since those are allowed to compile
// against unstable APIs.
- modules = removeAll(modules, non_updatable_modules)
+ removeAll(modules, non_updatable_modules)
// First create updatable-framework-module-impl, which contains all updatable modules.
// This module compiles against module_lib SDK.
{
+ transformConfigurableArray(modules, "", ".impl")
props := libraryProps{}
props.Name = proptools.StringPtr("updatable-framework-module-impl")
- props.Static_libs = transformArray(modules, "", ".impl")
+ props.Static_libs = modules
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
ctx.CreateModule(java.LibraryFactory, &props)
@@ -352,65 +359,74 @@
// Now create all-framework-module-impl, which contains updatable-framework-module-impl
// and all non-updatable modules. This module compiles against hidden APIs.
{
+ static_libs := transformArray(non_updatable_modules, "", ".impl")
+ static_libs = append(static_libs, "updatable-framework-module-impl")
props := libraryProps{}
props.Name = proptools.StringPtr("all-framework-module-impl")
- props.Static_libs = transformArray(non_updatable_modules, "", ".impl")
- props.Static_libs = append(props.Static_libs, "updatable-framework-module-impl")
+ props.Static_libs = proptools.NewSimpleConfigurable(static_libs)
props.Sdk_version = proptools.StringPtr("core_platform")
props.Visibility = []string{"//frameworks/base"}
ctx.CreateModule(java.LibraryFactory, &props)
}
}
-func createMergedFrameworkModuleLibExportableStubs(ctx android.LoadHookContext, modules []string) {
+func createMergedFrameworkModuleLibExportableStubs(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
+ modules = modules.Clone()
// The user of this module compiles against the "core" SDK and against non-updatable modules,
// so remove to avoid dupes.
- modules = removeAll(modules, core_libraries_modules)
- modules = removeAll(modules, non_updatable_modules)
+ removeAll(modules, core_libraries_modules)
+ removeAll(modules, non_updatable_modules)
+ transformConfigurableArray(modules, "", ".stubs.exportable.module_lib")
props := libraryProps{}
props.Name = proptools.StringPtr("framework-updatable-stubs-module_libs_api-exportable")
- props.Static_libs = transformArray(modules, "", ".stubs.exportable.module_lib")
+ props.Static_libs = modules
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
ctx.CreateModule(java.LibraryFactory, &props)
}
-func createMergedFrameworkModuleLibStubs(ctx android.LoadHookContext, modules []string) {
+func createMergedFrameworkModuleLibStubs(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
+ modules = modules.Clone()
// The user of this module compiles against the "core" SDK and against non-updatable modules,
// so remove to avoid dupes.
- modules = removeAll(modules, core_libraries_modules)
- modules = removeAll(modules, non_updatable_modules)
+ removeAll(modules, core_libraries_modules)
+ removeAll(modules, non_updatable_modules)
+ transformConfigurableArray(modules, "", ".stubs.module_lib")
props := libraryProps{}
props.Name = proptools.StringPtr("framework-updatable-stubs-module_libs_api")
- props.Static_libs = transformArray(modules, "", ".stubs.module_lib")
+ props.Static_libs = modules
props.Sdk_version = proptools.StringPtr("module_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
ctx.CreateModule(java.LibraryFactory, &props)
}
-func createMergedFrameworkSystemServerExportableStubs(ctx android.LoadHookContext, bootclasspath, system_server_classpath []string) {
+func createMergedFrameworkSystemServerExportableStubs(ctx android.LoadHookContext, bootclasspath, system_server_classpath proptools.Configurable[[]string]) {
// The user of this module compiles against the "core" SDK and against non-updatable bootclasspathModules,
// so remove to avoid dupes.
- bootclasspathModules := removeAll(bootclasspath, core_libraries_modules)
- bootclasspathModules = removeAll(bootclasspath, non_updatable_modules)
- modules := append(
- // Include all the module-lib APIs from the bootclasspath libraries.
- transformArray(bootclasspathModules, "", ".stubs.exportable.module_lib"),
- // Then add all the system-server APIs from the service-* libraries.
- transformArray(system_server_classpath, "", ".stubs.exportable.system_server")...,
- )
+ bootclasspathModules := bootclasspath.Clone()
+ removeAll(bootclasspathModules, core_libraries_modules)
+ removeAll(bootclasspathModules, non_updatable_modules)
+ transformConfigurableArray(bootclasspathModules, "", ".stubs.exportable.module_lib")
+
+ system_server_classpath = system_server_classpath.Clone()
+ transformConfigurableArray(system_server_classpath, "", ".stubs.exportable.system_server")
+
+ // Include all the module-lib APIs from the bootclasspath libraries.
+ // Then add all the system-server APIs from the service-* libraries.
+ bootclasspathModules.Append(system_server_classpath)
+
props := libraryProps{}
props.Name = proptools.StringPtr("framework-updatable-stubs-system_server_api-exportable")
- props.Static_libs = modules
+ props.Static_libs = bootclasspathModules
props.Sdk_version = proptools.StringPtr("system_server_current")
props.Visibility = []string{"//frameworks/base"}
props.Is_stubs_module = proptools.BoolPtr(true)
ctx.CreateModule(java.LibraryFactory, &props)
}
-func createPublicStubsSourceFilegroup(ctx android.LoadHookContext, modules []string) {
+func createPublicStubsSourceFilegroup(ctx android.LoadHookContext, modules proptools.Configurable[[]string]) {
props := fgProps{}
props.Name = proptools.StringPtr("all-modules-public-stubs-source")
props.Srcs = createSrcs(modules, "{.public.stubs.source}")
@@ -418,7 +434,14 @@
ctx.CreateModule(android.FileGroupFactory, &props)
}
-func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_classpath []string, baseTxtModulePrefix, stubsTypeSuffix string, doDist bool) {
+func createMergedTxts(
+ ctx android.LoadHookContext,
+ bootclasspath proptools.Configurable[[]string],
+ system_server_classpath proptools.Configurable[[]string],
+ baseTxtModulePrefix string,
+ stubsTypeSuffix string,
+ doDist bool,
+) {
var textFiles []MergedTxtDefinition
tagSuffix := []string{".api.txt}", ".removed-api.txt}"}
@@ -463,11 +486,10 @@
}
func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
- bootclasspath := a.bootclasspath(ctx)
- system_server_classpath := a.systemServerClasspath(ctx)
+ bootclasspath := a.properties.Bootclasspath.Clone()
+ system_server_classpath := a.properties.System_server_classpath.Clone()
if ctx.Config().VendorConfig("ANDROID").Bool("include_nonpublic_framework_api") {
- bootclasspath = append(bootclasspath, a.properties.Conditional_bootclasspath...)
- sort.Strings(bootclasspath)
+ bootclasspath.AppendSimpleValue(a.properties.Conditional_bootclasspath)
}
createMergedTxts(ctx, bootclasspath, system_server_classpath, "non-updatable-", "-", false)
createMergedTxts(ctx, bootclasspath, system_server_classpath, "non-updatable-exportable-", "-exportable-", true)
@@ -500,8 +522,10 @@
// Various utility methods below.
// Creates an array of ":<m><tag>" for each m in <modules>.
-func createSrcs(modules []string, tag string) []string {
- return transformArray(modules, ":", tag)
+func createSrcs(modules proptools.Configurable[[]string], tag string) proptools.Configurable[[]string] {
+ result := modules.Clone()
+ transformConfigurableArray(result, ":", tag)
+ return result
}
// Creates an array of "<prefix><m><suffix>", for each m in <modules>.
@@ -513,11 +537,23 @@
return a
}
-func removeAll(s []string, vs []string) []string {
- for _, v := range vs {
- s = remove(s, v)
- }
- return s
+// Creates an array of "<prefix><m><suffix>", for each m in <modules>.
+func transformConfigurableArray(modules proptools.Configurable[[]string], prefix, suffix string) {
+ modules.AddPostProcessor(func(s []string) []string {
+ return transformArray(s, prefix, suffix)
+ })
+}
+
+func removeAll(s proptools.Configurable[[]string], vs []string) {
+ s.AddPostProcessor(func(s []string) []string {
+ a := make([]string, 0, len(s))
+ for _, module := range s {
+ if !slices.Contains(vs, module) {
+ a = append(a, module)
+ }
+ }
+ return a
+ })
}
func remove(s []string, v string) []string {
diff --git a/boot/hiddenapi/hiddenapi-unsupported.txt b/boot/hiddenapi/hiddenapi-unsupported.txt
index adcc3df..70e5a68 100644
--- a/boot/hiddenapi/hiddenapi-unsupported.txt
+++ b/boot/hiddenapi/hiddenapi-unsupported.txt
@@ -183,7 +183,6 @@
Landroid/view/autofill/IAutoFillManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/autofill/IAutoFillManager;
Landroid/view/IAppTransitionAnimationSpecsFuture$Stub;-><init>()V
Landroid/view/IDockedStackListener$Stub;-><init>()V
-Landroid/view/IRecentsAnimationRunner$Stub;-><init>()V
Landroid/view/IRemoteAnimationRunner$Stub;-><init>()V
Landroid/view/IRotationWatcher$Stub;-><init>()V
Landroid/view/IWindow$Stub;-><init>()V
diff --git a/cmds/uiautomator/library/Android.bp b/cmds/uiautomator/library/Android.bp
index cd1fb9a..966bf13 100644
--- a/cmds/uiautomator/library/Android.bp
+++ b/cmds/uiautomator/library/Android.bp
@@ -71,7 +71,7 @@
":uiautomator-stubs",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
"junit",
],
java_version: "1.8",
@@ -84,8 +84,8 @@
"testrunner-src/**/*.java",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/core/api/current.txt b/core/api/current.txt
index 5685221..5cdc57a 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -145,12 +145,12 @@
field public static final String MANAGE_DEVICE_POLICY_AUDIO_OUTPUT = "android.permission.MANAGE_DEVICE_POLICY_AUDIO_OUTPUT";
field public static final String MANAGE_DEVICE_POLICY_AUTOFILL = "android.permission.MANAGE_DEVICE_POLICY_AUTOFILL";
field public static final String MANAGE_DEVICE_POLICY_BACKUP_SERVICE = "android.permission.MANAGE_DEVICE_POLICY_BACKUP_SERVICE";
- field @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled") public static final String MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL = "android.permission.MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL";
+ field public static final String MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL = "android.permission.MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL";
field public static final String MANAGE_DEVICE_POLICY_BLUETOOTH = "android.permission.MANAGE_DEVICE_POLICY_BLUETOOTH";
field public static final String MANAGE_DEVICE_POLICY_BUGREPORT = "android.permission.MANAGE_DEVICE_POLICY_BUGREPORT";
field public static final String MANAGE_DEVICE_POLICY_CALLS = "android.permission.MANAGE_DEVICE_POLICY_CALLS";
field public static final String MANAGE_DEVICE_POLICY_CAMERA = "android.permission.MANAGE_DEVICE_POLICY_CAMERA";
- field @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled") public static final String MANAGE_DEVICE_POLICY_CAMERA_TOGGLE = "android.permission.MANAGE_DEVICE_POLICY_CAMERA_TOGGLE";
+ field public static final String MANAGE_DEVICE_POLICY_CAMERA_TOGGLE = "android.permission.MANAGE_DEVICE_POLICY_CAMERA_TOGGLE";
field public static final String MANAGE_DEVICE_POLICY_CERTIFICATES = "android.permission.MANAGE_DEVICE_POLICY_CERTIFICATES";
field public static final String MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE = "android.permission.MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE";
field @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") public static final String MANAGE_DEVICE_POLICY_CONTENT_PROTECTION = "android.permission.MANAGE_DEVICE_POLICY_CONTENT_PROTECTION";
@@ -172,7 +172,7 @@
field public static final String MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS = "android.permission.MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS";
field public static final String MANAGE_DEVICE_POLICY_METERED_DATA = "android.permission.MANAGE_DEVICE_POLICY_METERED_DATA";
field public static final String MANAGE_DEVICE_POLICY_MICROPHONE = "android.permission.MANAGE_DEVICE_POLICY_MICROPHONE";
- field @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled") public static final String MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE = "android.permission.MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE";
+ field public static final String MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE = "android.permission.MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE";
field public static final String MANAGE_DEVICE_POLICY_MOBILE_NETWORK = "android.permission.MANAGE_DEVICE_POLICY_MOBILE_NETWORK";
field public static final String MANAGE_DEVICE_POLICY_MODIFY_USERS = "android.permission.MANAGE_DEVICE_POLICY_MODIFY_USERS";
field public static final String MANAGE_DEVICE_POLICY_MTE = "android.permission.MANAGE_DEVICE_POLICY_MTE";
@@ -8121,7 +8121,7 @@
method public boolean isLogoutEnabled();
method public boolean isManagedProfile(@NonNull android.content.ComponentName);
method public boolean isMasterVolumeMuted(@NonNull android.content.ComponentName);
- method @FlaggedApi("android.app.admin.flags.is_mte_policy_enforced") public static boolean isMtePolicyEnforced();
+ method public static boolean isMtePolicyEnforced();
method public boolean isNetworkLoggingEnabled(@Nullable android.content.ComponentName);
method public boolean isOrganizationOwnedDeviceWithManagedProfile();
method public boolean isOverrideApnEnabled(@NonNull android.content.ComponentName);
@@ -8597,7 +8597,7 @@
field public static final int TAG_ADB_SHELL_CMD = 210002; // 0x33452
field public static final int TAG_ADB_SHELL_INTERACTIVE = 210001; // 0x33451
field public static final int TAG_APP_PROCESS_START = 210005; // 0x33455
- field @FlaggedApi("android.app.admin.flags.backup_service_security_log_event_enabled") public static final int TAG_BACKUP_SERVICE_TOGGLED = 210044; // 0x3347c
+ field public static final int TAG_BACKUP_SERVICE_TOGGLED = 210044; // 0x3347c
field public static final int TAG_BLUETOOTH_CONNECTION = 210039; // 0x33477
field public static final int TAG_BLUETOOTH_DISCONNECTION = 210040; // 0x33478
field public static final int TAG_CAMERA_POLICY_SET = 210034; // 0x33472
@@ -32771,6 +32771,7 @@
field @NonNull public static final String RELEASE_OR_PREVIEW_DISPLAY;
field @Deprecated public static final String SDK;
field public static final int SDK_INT;
+ field @FlaggedApi("android.sdk.major_minor_versioning_scheme") public static final int SDK_MINOR_INT;
field public static final String SECURITY_PATCH;
}
@@ -34265,9 +34266,14 @@
method public final int areAllEffectsSupported(@NonNull int...);
method public final boolean areAllPrimitivesSupported(@NonNull int...);
method @NonNull public int[] areEffectsSupported(@NonNull int...);
+ method @FlaggedApi("android.os.vibrator.normalized_pwle_effects") public boolean areEnvelopeEffectsSupported();
method @NonNull public boolean[] arePrimitivesSupported(@NonNull int...);
method @RequiresPermission(android.Manifest.permission.VIBRATE) public abstract void cancel();
method public int getId();
+ method @FlaggedApi("android.os.vibrator.normalized_pwle_effects") public int getMaxEnvelopeEffectControlPointDurationMillis();
+ method @FlaggedApi("android.os.vibrator.normalized_pwle_effects") public int getMaxEnvelopeEffectDurationMillis();
+ method @FlaggedApi("android.os.vibrator.normalized_pwle_effects") public int getMaxEnvelopeEffectSize();
+ method @FlaggedApi("android.os.vibrator.normalized_pwle_effects") public int getMinEnvelopeEffectControlPointDurationMillis();
method @NonNull public int[] getPrimitiveDurations(@NonNull int...);
method public float getQFactor();
method public float getResonantFrequency();
@@ -36924,6 +36930,19 @@
field public static final String CONTENT_DIRECTORY = "data";
}
+ @FlaggedApi("android.provider.new_default_account_api_enabled") public static final class ContactsContract.RawContacts.DefaultAccountAndState {
+ ctor public ContactsContract.RawContacts.DefaultAccountAndState(int, @Nullable android.accounts.Account);
+ method @Nullable public android.accounts.Account getCloudAccount();
+ method public int getState();
+ method @NonNull public static android.provider.ContactsContract.RawContacts.DefaultAccountAndState ofCloud(@NonNull android.accounts.Account);
+ method @NonNull public static android.provider.ContactsContract.RawContacts.DefaultAccountAndState ofLocal();
+ method @NonNull public static android.provider.ContactsContract.RawContacts.DefaultAccountAndState ofNotSet();
+ field public static final int DEFAULT_ACCOUNT_STATE_CLOUD = 3; // 0x3
+ field public static final int DEFAULT_ACCOUNT_STATE_INVALID = 0; // 0x0
+ field public static final int DEFAULT_ACCOUNT_STATE_LOCAL = 2; // 0x2
+ field public static final int DEFAULT_ACCOUNT_STATE_NOT_SET = 1; // 0x1
+ }
+
public static final class ContactsContract.RawContacts.DisplayPhoto {
field public static final String CONTENT_DIRECTORY = "display_photo";
}
@@ -44066,6 +44085,7 @@
}
public static final class CarrierConfigManager.Gps {
+ field @FlaggedApi("android.location.flags.enable_ni_supl_message_injection_by_carrier_config") public static final String KEY_ENABLE_NI_SUPL_MESSAGE_INJECTION_BOOL = "gps.enable_ni_supl_message_injection_bool";
field public static final String KEY_PERSIST_LPP_MODE_BOOL = "gps.persist_lpp_mode_bool";
field public static final String KEY_PREFIX = "gps.";
}
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index ba16037..fb425a9 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -1322,7 +1322,7 @@
method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.UserHandle getDeviceOwnerUser();
method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public android.app.admin.DevicePolicyState getDevicePolicyState();
method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public String getFinancedDeviceKioskRoleHolder();
- method @FlaggedApi("android.app.admin.flags.device_policy_size_tracking_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public int getMaxPolicyStorageLimit();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public int getMaxPolicyStorageLimit();
method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.QUERY_ADMIN_POLICY}) public java.util.List<java.lang.String> getPermittedAccessibilityServices(int);
method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.QUERY_ADMIN_POLICY}) public java.util.List<java.lang.String> getPermittedInputMethodsForCurrentUser();
method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public java.util.List<android.os.UserHandle> getPolicyManagedProfiles(@NonNull android.os.UserHandle);
@@ -1349,7 +1349,7 @@
method @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_POLICY_AUDIT_LOGGING) public void setAuditLogEventCallback(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.util.List<android.app.admin.SecurityLog.SecurityEvent>>);
method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setDeviceProvisioningConfigApplied();
method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setDpcDownloaded(boolean);
- method @FlaggedApi("android.app.admin.flags.device_policy_size_tracking_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setMaxPolicyStorageLimit(int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setMaxPolicyStorageLimit(int);
method @Deprecated @RequiresPermission(value=android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS, conditional=true) public void setProfileOwnerCanAccessDeviceIds(@NonNull android.content.ComponentName);
method public void setSecondaryLockscreenEnabled(@NonNull android.content.ComponentName, boolean);
method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setUserProvisioningState(int, @NonNull android.os.UserHandle);
@@ -10561,6 +10561,7 @@
method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean shouldDefaultToObserveMode();
method @FlaggedApi("android.nfc.enable_nfc_mainline") public void writeToParcel(@NonNull android.os.Parcel, int);
field @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public static final android.os.Parcelable.Creator<android.nfc.cardemulation.ApduServiceInfo> CREATOR;
+ field @FlaggedApi("android.permission.flags.wallet_role_icon_property_enabled") public static final String PROPERTY_WALLET_PREFERRED_BANNER_AND_LABEL = "android.nfc.cardemulation.PROPERTY_WALLET_PREFERRED_BANNER_AND_LABEL";
}
@FlaggedApi("android.nfc.enable_nfc_mainline") public final class NfcFServiceInfo implements android.os.Parcelable {
@@ -18155,9 +18156,17 @@
field public static final int DISPLAY_IME_POLICY_LOCAL = 0; // 0x0
}
+ @FlaggedApi("android.companion.virtualdevice.flags.status_bar_and_insets") public static class WindowManager.InsetsParams {
+ ctor public WindowManager.InsetsParams(int);
+ method @Nullable public android.graphics.Insets getInsetsSize();
+ method public int getType();
+ method @NonNull public android.view.WindowManager.InsetsParams setInsetsSize(@Nullable android.graphics.Insets);
+ }
+
public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
method public final long getUserActivityTimeout();
method public boolean isSystemApplicationOverlay();
+ method @FlaggedApi("android.companion.virtualdevice.flags.status_bar_and_insets") public void setInsetsParams(@NonNull java.util.List<android.view.WindowManager.InsetsParams>);
method @RequiresPermission(android.Manifest.permission.SYSTEM_APPLICATION_OVERLAY) public void setSystemApplicationOverlay(boolean);
method public final void setUserActivityTimeout(long);
field @RequiresPermission(android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS) public static final int SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS = 524288; // 0x80000
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index 4fc7076..caf6992 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -2321,7 +2321,7 @@
}
public final class BugreportParams {
- field @FlaggedApi("android.os.bugreport_mode_max_value") public static final int BUGREPORT_MODE_MAX_VALUE = 7; // 0x7
+ field public static final int BUGREPORT_MODE_MAX_VALUE = 7; // 0x7
}
public class Build {
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index b83be6b..7273e64 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -88,6 +88,7 @@
import android.view.WindowInsetsController.Appearance;
import android.window.TaskSnapshot;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.LocalePicker;
import com.android.internal.app.procstats.ProcessStats;
import com.android.internal.os.RoSystemProperties;
@@ -238,6 +239,22 @@
private static final RateLimitingCache<List<ProcessErrorStateInfo>> mErrorProcessesCache =
new RateLimitingCache<>(10, 2);
+ /** Rate-Limiting cache that allows no more than 100 calls to the service per second. */
+ @GuardedBy("mMemoryInfoCache")
+ private static final RateLimitingCache<MemoryInfo> mMemoryInfoCache =
+ new RateLimitingCache<>(10);
+ /** Used to store cached results for rate-limited calls to getMemoryInfo(). */
+ @GuardedBy("mMemoryInfoCache")
+ private static final MemoryInfo mRateLimitedMemInfo = new MemoryInfo();
+
+ /** Rate-Limiting cache that allows no more than 200 calls to the service per second. */
+ @GuardedBy("mMyMemoryStateCache")
+ private static final RateLimitingCache<RunningAppProcessInfo> mMyMemoryStateCache =
+ new RateLimitingCache<>(10, 2);
+ /** Used to store cached results for rate-limited calls to getMyMemoryState(). */
+ @GuardedBy("mMyMemoryStateCache")
+ private static final RunningAppProcessInfo mRateLimitedMemState = new RunningAppProcessInfo();
+
/**
* Query handler for mGetCurrentUserIdCache - returns a cached value of the current foreground
* user id if the backstage_power/android.app.cache_get_current_user_id flag is enabled.
@@ -3510,6 +3527,19 @@
foregroundAppThreshold = source.readLong();
}
+ /** @hide */
+ public void copyTo(MemoryInfo other) {
+ other.advertisedMem = advertisedMem;
+ other.availMem = availMem;
+ other.totalMem = totalMem;
+ other.threshold = threshold;
+ other.lowMemory = lowMemory;
+ other.hiddenAppThreshold = hiddenAppThreshold;
+ other.secondaryServerThreshold = secondaryServerThreshold;
+ other.visibleAppThreshold = visibleAppThreshold;
+ other.foregroundAppThreshold = foregroundAppThreshold;
+ }
+
public static final @android.annotation.NonNull Creator<MemoryInfo> CREATOR
= new Creator<MemoryInfo>() {
public MemoryInfo createFromParcel(Parcel source) {
@@ -3536,6 +3566,20 @@
* manage its memory.
*/
public void getMemoryInfo(MemoryInfo outInfo) {
+ if (Flags.rateLimitGetMemoryInfo()) {
+ synchronized (mMemoryInfoCache) {
+ mMemoryInfoCache.get(() -> {
+ getMemoryInfoInternal(mRateLimitedMemInfo);
+ return mRateLimitedMemInfo;
+ });
+ mRateLimitedMemInfo.copyTo(outInfo);
+ }
+ } else {
+ getMemoryInfoInternal(outInfo);
+ }
+ }
+
+ private void getMemoryInfoInternal(MemoryInfo outInfo) {
try {
getService().getMemoryInfo(outInfo);
} catch (RemoteException e) {
@@ -4187,6 +4231,23 @@
lastActivityTime = source.readLong();
}
+ /**
+ * Note: only fields that are updated in ProcessList.fillInProcMemInfoLOSP() are copied.
+ * @hide
+ */
+ public void copyTo(RunningAppProcessInfo other) {
+ other.pid = pid;
+ other.uid = uid;
+ other.flags = flags;
+ other.lastTrimLevel = lastTrimLevel;
+ other.importance = importance;
+ other.lru = lru;
+ other.importanceReasonCode = importanceReasonCode;
+ other.processState = processState;
+ other.isFocused = isFocused;
+ other.lastActivityTime = lastActivityTime;
+ }
+
public static final @android.annotation.NonNull Creator<RunningAppProcessInfo> CREATOR =
new Creator<RunningAppProcessInfo>() {
public RunningAppProcessInfo createFromParcel(Parcel source) {
@@ -4818,7 +4879,21 @@
* {@link RunningAppProcessInfo#lru}, and
* {@link RunningAppProcessInfo#importanceReasonCode}.
*/
- static public void getMyMemoryState(RunningAppProcessInfo outState) {
+ public static void getMyMemoryState(RunningAppProcessInfo outState) {
+ if (Flags.rateLimitGetMyMemoryState()) {
+ synchronized (mMyMemoryStateCache) {
+ mMyMemoryStateCache.get(() -> {
+ getMyMemoryStateInternal(mRateLimitedMemState);
+ return mRateLimitedMemState;
+ });
+ mRateLimitedMemState.copyTo(outState);
+ }
+ } else {
+ getMyMemoryStateInternal(outState);
+ }
+ }
+
+ private static void getMyMemoryStateInternal(RunningAppProcessInfo outState) {
try {
getService().getMyMemoryState(outState);
} catch (RemoteException e) {
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java
index 1b29b7a..32e9542 100644
--- a/core/java/android/app/NotificationChannel.java
+++ b/core/java/android/app/NotificationChannel.java
@@ -761,14 +761,22 @@
this.mVibrationEnabled = effect != null;
this.mVibrationEffect = effect;
if (Flags.notifChannelCropVibrationEffects() && effect != null) {
- // Try converting to a vibration pattern and trimming that array. If not convertible
- // to a pattern directly, try trimming the vibration effect if possible and storing
- // that version instead.
long[] pattern = effect.computeCreateWaveformOffOnTimingsOrNull();
if (pattern != null) {
- setVibrationPattern(pattern);
+ // If this effect has an equivalent pattern, AND the pattern needs to be truncated
+ // due to being too long, we delegate to setVibrationPattern to re-generate the
+ // effect as well. Otherwise, we use the effect (already set above) and converted
+ // pattern directly.
+ if (pattern.length > MAX_VIBRATION_LENGTH) {
+ setVibrationPattern(pattern);
+ } else {
+ this.mVibrationPattern = pattern;
+ }
} else {
+ // If not convertible to a pattern directly, try trimming the vibration effect if
+ // possible and storing that version instead.
this.mVibrationEffect = getTrimmedVibrationEffect(mVibrationEffect);
+ this.mVibrationPattern = null;
}
} else {
this.mVibrationPattern =
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index e44e776..5147f12 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -104,6 +104,7 @@
import android.devicelock.DeviceLockFrameworkInitializer;
import android.graphics.fonts.FontManager;
import android.hardware.ConsumerIrManager;
+import android.hardware.ISensorPrivacyManager;
import android.hardware.ISerialManager;
import android.hardware.SensorManager;
import android.hardware.SensorPrivacyManager;
@@ -707,8 +708,12 @@
registerService(Context.SENSOR_PRIVACY_SERVICE, SensorPrivacyManager.class,
new CachedServiceFetcher<SensorPrivacyManager>() {
@Override
- public SensorPrivacyManager createService(ContextImpl ctx) {
- return SensorPrivacyManager.getInstance(ctx);
+ public SensorPrivacyManager createService(ContextImpl ctx)
+ throws ServiceNotFoundException {
+ IBinder b = ServiceManager.getServiceOrThrow(
+ Context.SENSOR_PRIVACY_SERVICE);
+ return SensorPrivacyManager.getInstance(
+ ctx, ISensorPrivacyManager.Stub.asInterface(b));
}});
registerService(Context.STATUS_BAR_SERVICE, StatusBarManager.class,
diff --git a/core/java/android/app/activity_manager.aconfig b/core/java/android/app/activity_manager.aconfig
index 4c97dbb..38bd576 100644
--- a/core/java/android/app/activity_manager.aconfig
+++ b/core/java/android/app/activity_manager.aconfig
@@ -106,6 +106,17 @@
flag {
namespace: "backstage_power"
+ name: "use_app_info_not_launched"
+ description: "Use the notLaunched state from ApplicationInfo instead of current value"
+ is_fixed_read_only: true
+ bug: "362516211"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ namespace: "backstage_power"
name: "cache_get_current_user_id"
description: "Add caching for getCurrentUserId"
is_fixed_read_only: true
@@ -114,3 +125,25 @@
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ namespace: "backstage_power"
+ name: "rate_limit_get_memory_info"
+ description: "Rate limit calls to getMemoryInfo using a cache"
+ is_fixed_read_only: true
+ bug: "364312431"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ namespace: "backstage_power"
+ name: "rate_limit_get_my_memory_state"
+ description: "Rate limit calls to getMyMemoryState using a cache"
+ is_fixed_read_only: true
+ bug: "365182205"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 0f54cb7..daa15f0 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -55,10 +55,8 @@
import static android.Manifest.permission.SET_TIME_ZONE;
import static android.app.admin.DeviceAdminInfo.HEADLESS_DEVICE_OWNER_MODE_UNSUPPORTED;
import static android.app.admin.flags.Flags.FLAG_DEVICE_THEFT_API_ENABLED;
-import static android.app.admin.flags.Flags.FLAG_DEVICE_POLICY_SIZE_TRACKING_ENABLED;
import static android.app.admin.flags.Flags.onboardingBugreportV2Enabled;
import static android.app.admin.flags.Flags.onboardingConsentlessBugreports;
-import static android.app.admin.flags.Flags.FLAG_IS_MTE_POLICY_ENFORCED;
import static android.content.Intent.LOCAL_FLAG_FROM_SYSTEM;
import static android.net.NetworkCapabilities.NET_ENTERPRISE_ID_1;
import static android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
@@ -4232,7 +4230,6 @@
*
* @return whether MTE is currently enabled on the device.
*/
- @FlaggedApi(FLAG_IS_MTE_POLICY_ENFORCED)
public static boolean isMtePolicyEnforced() {
return Zygote.nativeSupportsMemoryTagging();
}
@@ -8664,6 +8661,7 @@
* {@link DeviceAdminInfo#USES_POLICY_DISABLE_CAMERA}.
*/
@RequiresPermission(value = MANAGE_DEVICE_POLICY_CAMERA, conditional = true)
+ @SupportsCoexistence
public void setCameraDisabled(@Nullable ComponentName admin, boolean disabled) {
if (mService != null) {
try {
@@ -10249,6 +10247,7 @@
* permission {@link android.Manifest.permission#MANAGE_DEVICE_POLICY_LOCK_TASK}.
*/
@RequiresPermission(value = MANAGE_DEVICE_POLICY_LOCK_TASK, conditional = true)
+ @SupportsCoexistence
public void clearPackagePersistentPreferredActivities(@Nullable ComponentName admin,
String packageName) {
throwIfParentInstance("clearPackagePersistentPreferredActivities");
@@ -11940,6 +11939,7 @@
* @throws SecurityException if {@code admin} is not a device or profile owner and if the caller
* has not been granted the permission to set the given user restriction.
*/
+ @SupportsCoexistence
public void addUserRestriction(@NonNull ComponentName admin,
@UserManager.UserRestrictionKey String key) {
if (mService != null) {
@@ -12021,6 +12021,7 @@
* @throws IllegalStateException if caller is not targeting Android
* {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE} or above.
*/
+ @SupportsCoexistence
public void addUserRestrictionGlobally(@NonNull @UserManager.UserRestrictionKey String key) {
throwIfParentInstance("addUserRestrictionGlobally");
if (mService != null) {
@@ -12076,6 +12077,7 @@
* @throws SecurityException if {@code admin} is not a device or profile owner and if the
* caller has not been granted the permission to set the given user restriction.
*/
+ @SupportsCoexistence
public void clearUserRestriction(@NonNull ComponentName admin,
@UserManager.UserRestrictionKey String key) {
if (mService != null) {
@@ -12312,6 +12314,7 @@
* @see #DELEGATION_PACKAGE_ACCESS
*/
@RequiresPermission(value = MANAGE_DEVICE_POLICY_PACKAGE_STATE, conditional = true)
+ @SupportsCoexistence
public boolean setApplicationHidden(@Nullable ComponentName admin, String packageName,
boolean hidden) {
if (mService != null) {
@@ -12492,6 +12495,7 @@
* @throws SecurityException if {@code admin} is not a device or profile owner.
*/
@RequiresPermission(value = MANAGE_DEVICE_POLICY_ACCOUNT_MANAGEMENT, conditional = true)
+ @SupportsCoexistence
public void setAccountManagementDisabled(@Nullable ComponentName admin, String accountType,
boolean disabled) {
if (mService != null) {
@@ -12575,10 +12579,24 @@
**/
@SystemApi
public void setSecondaryLockscreenEnabled(@NonNull ComponentName admin, boolean enabled) {
+ setSecondaryLockscreenEnabled(admin, enabled, null);
+ }
+
+ /**
+ * Called by the system supervision app to set whether a secondary lockscreen needs to be shown.
+ *
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with. Null if the
+ * caller is not a device admin.
+ * @param enabled Whether or not the lockscreen needs to be shown.
+ * @param options A {@link PersistableBundle} to supply options to the lock screen.
+ * @hide
+ */
+ public void setSecondaryLockscreenEnabled(@Nullable ComponentName admin, boolean enabled,
+ @Nullable PersistableBundle options) {
throwIfParentInstance("setSecondaryLockscreenEnabled");
if (mService != null) {
try {
- mService.setSecondaryLockscreenEnabled(admin, enabled);
+ mService.setSecondaryLockscreenEnabled(admin, enabled, options);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -14276,6 +14294,7 @@
* @see #retrieveSecurityLogs
*/
@RequiresPermission(value = MANAGE_DEVICE_POLICY_SECURITY_LOGGING, conditional = true)
+ @SupportsCoexistence
public void setSecurityLoggingEnabled(@Nullable ComponentName admin, boolean enabled) {
throwIfParentInstance("setSecurityLoggingEnabled");
try {
@@ -17181,6 +17200,7 @@
* if USB data signaling fails to be enabled/disabled.
*/
@RequiresPermission(value = MANAGE_DEVICE_POLICY_USB_DATA_SIGNALLING, conditional = true)
+ @SupportsCoexistence
public void setUsbDataSignalingEnabled(boolean enabled) {
throwIfParentInstance("setUsbDataSignalingEnabled");
if (mService != null) {
@@ -17746,7 +17766,6 @@
*/
@SystemApi
@RequiresPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)
- @FlaggedApi(FLAG_DEVICE_POLICY_SIZE_TRACKING_ENABLED)
public void setMaxPolicyStorageLimit(int storageLimit) {
if (mService != null) {
try {
@@ -17766,7 +17785,6 @@
*/
@SystemApi
@RequiresPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)
- @FlaggedApi(FLAG_DEVICE_POLICY_SIZE_TRACKING_ENABLED)
public int getMaxPolicyStorageLimit() {
if (mService != null) {
try {
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index d4e5c99..a4e2b8f 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -303,7 +303,7 @@
String[] getAccountTypesWithManagementDisabled(String callerPackageName);
String[] getAccountTypesWithManagementDisabledAsUser(int userId, String callerPackageName, in boolean parent);
- void setSecondaryLockscreenEnabled(in ComponentName who, boolean enabled);
+ void setSecondaryLockscreenEnabled(in ComponentName who, boolean enabled, in PersistableBundle options);
boolean isSecondaryLockscreenEnabled(in UserHandle userHandle);
void setPreferentialNetworkServiceConfigs(
diff --git a/core/java/android/app/admin/SecurityLog.java b/core/java/android/app/admin/SecurityLog.java
index 477f2e0..beb93fd 100644
--- a/core/java/android/app/admin/SecurityLog.java
+++ b/core/java/android/app/admin/SecurityLog.java
@@ -16,10 +16,7 @@
package android.app.admin;
-import static android.app.admin.flags.Flags.FLAG_BACKUP_SERVICE_SECURITY_LOG_EVENT_ENABLED;
-
import android.Manifest;
-import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -611,7 +608,6 @@
* <li> [2] backup service state ({@code Integer}, 1 for enabled, 0 for disabled)
* @see DevicePolicyManager#setBackupServiceEnabled(ComponentName, boolean)
*/
- @FlaggedApi(FLAG_BACKUP_SERVICE_SECURITY_LOG_EVENT_ENABLED)
public static final int TAG_BACKUP_SERVICE_TOGGLED =
SecurityLogTags.SECURITY_BACKUP_SERVICE_TOGGLED;
/**
diff --git a/core/java/android/app/admin/flags/flags.aconfig b/core/java/android/app/admin/flags/flags.aconfig
index 9ed5aa6..081dfe6 100644
--- a/core/java/android/app/admin/flags/flags.aconfig
+++ b/core/java/android/app/admin/flags/flags.aconfig
@@ -13,6 +13,7 @@
bug: "289520697"
}
+# Fully rolled out and must not be used.
flag {
name: "device_policy_size_tracking_enabled"
is_exported: true
@@ -22,13 +23,6 @@
}
flag {
- name: "device_policy_size_tracking_internal_enabled"
- namespace: "enterprise"
- description: "Add feature to track the total policy size and have a max threshold - internal changes"
- bug: "281543351"
-}
-
-flag {
name: "onboarding_bugreport_v2_enabled"
is_exported: true
namespace: "enterprise"
@@ -44,13 +38,7 @@
is_fixed_read_only: true
}
-flag {
- name: "dedicated_device_control_enabled"
- namespace: "enterprise"
- description: "Allow the device management role holder to control which platform features are available on dedicated devices."
- bug: "281964214"
-}
-
+# Fully rolled out and must not be used.
flag {
name: "dedicated_device_control_api_enabled"
is_exported: true
@@ -164,12 +152,23 @@
}
flag {
+ name: "fix_race_condition_in_tie_profile_lock"
+ namespace: "enterprise"
+ description: "Fix race condition in tieProfileLockIfNecessary()"
+ bug: "355905501"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "quiet_mode_credential_bug_fix"
namespace: "enterprise"
description: "Guards a bugfix that ends the credential input flow if the managed user has not stopped."
bug: "293441361"
}
+# Fully rolled out and must not be used.
flag {
name: "assist_content_user_restriction_enabled"
is_exported: true
@@ -188,6 +187,7 @@
}
}
+# Fully rolled out and must not be used.
flag {
name: "backup_service_security_log_event_enabled"
is_exported: true
@@ -196,6 +196,7 @@
bug: "304999634"
}
+# Fully rolled out and must not be used.
flag {
name: "esim_management_enabled"
is_exported: true
@@ -213,6 +214,7 @@
bug: "289515470"
}
+# Fully rolled out and must not be used.
flag {
name: "is_mte_policy_enforced"
is_exported: true
diff --git a/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java b/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java
index c4e8b41..f5c5a11 100644
--- a/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java
+++ b/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java
@@ -61,6 +61,20 @@
return RUNTIME_SCHEMA_TYPE + RUNTIME_SCHEMA_TYPE_SEPARATOR + Objects.requireNonNull(pkg);
}
+ /** Returns the package name from the runtime metadata schema name. */
+ @NonNull
+ public static String getPackageNameFromSchema(String metadataSchemaType) {
+ String[] split = metadataSchemaType.split(RUNTIME_SCHEMA_TYPE_SEPARATOR);
+ if (split.length > 2) {
+ throw new IllegalArgumentException(
+ "Invalid schema type: " + metadataSchemaType + " for app function runtime");
+ }
+ if (split.length < 2) {
+ return APP_FUNCTION_INDEXER_PACKAGE;
+ }
+ return split[1];
+ }
+
/** Returns the document id for an app function's runtime metadata. */
public static String getDocumentIdForAppFunction(
@NonNull String pkg, @NonNull String functionId) {
@@ -72,14 +86,32 @@
* we need to have per-package app function schemas.
*
* <p>This schema should be set visible to callers from the package owner itself and for callers
- * with {@link android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED} or {@link
- * android.permission.EXECUTE_APP_FUNCTIONS} permissions.
+ * with {@link android.Manifest.permission#EXECUTE_APP_FUNCTIONS} or {@link
+ * android.Manifest.permission#EXECUTE_APP_FUNCTIONS_TRUSTED} permissions.
*
* @param packageName The package name to create a schema for.
*/
@NonNull
public static AppSearchSchema createAppFunctionRuntimeSchema(@NonNull String packageName) {
- return new AppSearchSchema.Builder(getRuntimeSchemaNameForPackage(packageName))
+ return getAppFunctionRuntimeSchemaBuilder(getRuntimeSchemaNameForPackage(packageName))
+ .addParentType(RUNTIME_SCHEMA_TYPE)
+ .build();
+ }
+
+ /**
+ * Creates a parent schema for all app function runtime schemas.
+ *
+ * <p>This schema should be set visible to the owner itself and for callers with {@link
+ * android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED} or {@link
+ * android.permission.EXECUTE_APP_FUNCTIONS} permissions.
+ */
+ public static AppSearchSchema createParentAppFunctionRuntimeSchema() {
+ return getAppFunctionRuntimeSchemaBuilder(RUNTIME_SCHEMA_TYPE).build();
+ }
+
+ private static AppSearchSchema.Builder getAppFunctionRuntimeSchemaBuilder(
+ @NonNull String schemaType) {
+ return new AppSearchSchema.Builder(schemaType)
.addProperty(
new AppSearchSchema.StringPropertyConfig.Builder(PROPERTY_FUNCTION_ID)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
@@ -111,9 +143,7 @@
.setJoinableValueType(
AppSearchSchema.StringPropertyConfig
.JOINABLE_VALUE_TYPE_QUALIFIED_ID)
- .build())
- .addParentType(RUNTIME_SCHEMA_TYPE)
- .build();
+ .build());
}
/** Returns the function id. This might look like "com.example.message#send_message". */
diff --git a/core/java/android/app/appfunctions/AppFunctionStaticMetadataHelper.java b/core/java/android/app/appfunctions/AppFunctionStaticMetadataHelper.java
index 926cc9a..a23f842 100644
--- a/core/java/android/app/appfunctions/AppFunctionStaticMetadataHelper.java
+++ b/core/java/android/app/appfunctions/AppFunctionStaticMetadataHelper.java
@@ -37,8 +37,12 @@
public class AppFunctionStaticMetadataHelper {
public static final String STATIC_SCHEMA_TYPE = "AppFunctionStaticMetadata";
public static final String STATIC_PROPERTY_ENABLED_BY_DEFAULT = "enabledByDefault";
+ public static final String STATIC_PROPERTY_RESTRICT_CALLERS_WITH_EXECUTE_APP_FUNCTIONS =
+ "restrictCallersWithExecuteAppFunctions";
public static final String APP_FUNCTION_STATIC_NAMESPACE = "app_functions";
+ public static final String PROPERTY_FUNCTION_ID = "functionId";
+ public static final String PROPERTY_PACKAGE_NAME = "packageName";
// These are constants that has to be kept the same with {@code
// com.android.server.appsearch.appsindexer.appsearchtypes.AppSearchHelper}.
diff --git a/core/java/android/app/jank/OWNERS b/core/java/android/app/jank/OWNERS
new file mode 100644
index 0000000..806de57
--- /dev/null
+++ b/core/java/android/app/jank/OWNERS
@@ -0,0 +1,4 @@
+steventerrell@google.com
+carmenjackson@google.com
+jjaggi@google.com
+pmuetschard@google.com
\ No newline at end of file
diff --git a/core/java/android/companion/virtual/flags/flags.aconfig b/core/java/android/companion/virtual/flags/flags.aconfig
index 297fe8a..e9fa3e1 100644
--- a/core/java/android/companion/virtual/flags/flags.aconfig
+++ b/core/java/android/companion/virtual/flags/flags.aconfig
@@ -43,6 +43,7 @@
name: "virtual_display_insets"
description: "APIs for specifying virtual display insets (via cutout)"
bug: "350007135"
+ is_exported: true
}
flag {
@@ -88,6 +89,7 @@
name: "virtual_display_rotation_api"
description: "API for on-demand rotation of virtual displays"
bug: "291748430"
+ is_exported: true
}
flag {
@@ -98,11 +100,11 @@
}
flag {
- name: "camera_multiple_input_streams"
- is_exported: true
- namespace: "virtual_devices"
- description: "Expose multiple surface for the virtual camera owner for different stream resolution"
- bug: "341083465"
+ name: "camera_multiple_input_streams"
+ is_exported: true
+ namespace: "virtual_devices"
+ description: "Expose multiple surface for the virtual camera owner for different stream resolution"
+ bug: "341083465"
}
flag {
@@ -110,11 +112,28 @@
name: "device_aware_display_power"
description: "Device awareness in power and display APIs"
bug: "285020111"
+ is_exported: true
}
flag {
- name: "status_bar_and_insets"
+ namespace: "virtual_devices"
+ name: "display_power_manager_apis"
+ description: "Make relevant PowerManager APIs display aware by default"
+ bug: "365042486"
+ is_fixed_read_only: true
+}
+
+flag {
+ name: "status_bar_and_insets"
+ namespace: "virtual_devices"
+ description: "Allow for status bar and insets on virtual devices"
+ bug: "350007866"
+ is_exported: true
+}
+
+flag {
namespace: "virtual_devices"
- description: "Allow for status bar and insets on virtual devices"
- bug: "350007866"
+ name: "camera_timestamp_from_surface"
+ description: "Pass the surface timestamp to the capture result"
+ bug: "351341245"
}
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index da3cc1b..031380d 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -86,6 +86,7 @@
import android.util.proto.ProtoOutputStream;
import com.android.internal.util.XmlUtils;
+import com.android.modules.expresslog.Counter;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -12805,6 +12806,8 @@
new ClipData.Item(text, htmlText, null, stream));
setClipData(clipData);
if (stream != null) {
+ logCounterIfFlagsMissing(FLAG_GRANT_READ_URI_PERMISSION,
+ "intents.value_explicit_uri_grant_for_send_action");
addFlags(FLAG_GRANT_READ_URI_PERMISSION);
}
return true;
@@ -12846,6 +12849,8 @@
setClipData(clipData);
if (streams != null) {
+ logCounterIfFlagsMissing(FLAG_GRANT_READ_URI_PERMISSION,
+ "intents.value_explicit_uri_grant_for_send_multiple_action");
addFlags(FLAG_GRANT_READ_URI_PERMISSION);
}
return true;
@@ -12865,6 +12870,10 @@
putExtra(MediaStore.EXTRA_OUTPUT, output);
setClipData(ClipData.newRawUri("", output));
+
+ logCounterIfFlagsMissing(
+ FLAG_GRANT_WRITE_URI_PERMISSION | FLAG_GRANT_READ_URI_PERMISSION,
+ "intents.value_explicit_uri_grant_for_image_capture_action");
addFlags(FLAG_GRANT_WRITE_URI_PERMISSION|FLAG_GRANT_READ_URI_PERMISSION);
return true;
}
@@ -12873,6 +12882,12 @@
return false;
}
+ private void logCounterIfFlagsMissing(int requiredFlags, String metricId) {
+ if ((getFlags() & requiredFlags) != requiredFlags) {
+ Counter.logIncrement(metricId);
+ }
+ }
+
@android.ravenwood.annotation.RavenwoodThrow
private Uri maybeConvertFileToContentUri(Context context, Uri uri) {
if (ContentResolver.SCHEME_FILE.equals(uri.getScheme())
diff --git a/core/java/android/content/UriRelativeFilterGroup.java b/core/java/android/content/UriRelativeFilterGroup.java
index 0e49b4f..07aeb26 100644
--- a/core/java/android/content/UriRelativeFilterGroup.java
+++ b/core/java/android/content/UriRelativeFilterGroup.java
@@ -63,6 +63,7 @@
*/
@FlaggedApi(Flags.FLAG_RELATIVE_REFERENCE_INTENT_FILTERS)
public final class UriRelativeFilterGroup {
+ private static final String TAG = "UriRelativeFilterGroup";
private static final String ALLOW_STR = "allow";
private static final String URI_RELATIVE_FILTER_GROUP_STR = "uriRelativeFilterGroup";
@@ -233,9 +234,16 @@
final int n = mUriRelativeFilters.size();
if (n > 0) {
dest.writeInt(n);
+ int i = 0;
Iterator<UriRelativeFilter> it = mUriRelativeFilters.iterator();
while (it.hasNext()) {
it.next().writeToParcel(dest, flags);
+ i++;
+ }
+ if (i != n) {
+ Log.e(TAG, "UriRelativeFilters was unexpectedly"
+ + " modified while writing to parcel. Expected "
+ + n + " but found " + i + " filters", new Exception());
}
} else {
dest.writeInt(0);
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 495ae60..34bea1a 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -849,6 +849,12 @@
*/
public static final int PRIVATE_FLAG_EXT_CPU_OVERRIDE = 1 << 5;
+ /**
+ * Whether the app has been previously not launched
+ * @hide
+ */
+ public static final int PRIVATE_FLAG_EXT_NOT_LAUNCHED = 1 << 6;
+
/** @hide */
@IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = {
PRIVATE_FLAG_EXT_PROFILEABLE,
@@ -857,6 +863,7 @@
PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK,
PRIVATE_FLAG_EXT_ALLOWLISTED_FOR_HIDDEN_APIS,
PRIVATE_FLAG_EXT_CPU_OVERRIDE,
+ PRIVATE_FLAG_EXT_NOT_LAUNCHED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ApplicationInfoPrivateFlagsExt {}
@@ -2664,6 +2671,22 @@
}
/**
+ * Returns whether the app in the STOPPED state.
+ * @hide
+ */
+ public boolean isStopped() {
+ return (flags & ApplicationInfo.FLAG_STOPPED) != 0;
+ }
+
+ /**
+ * Returns whether the app was never launched (any process started) before.
+ * @hide
+ */
+ public boolean isNotLaunched() {
+ return (privateFlagsExt & ApplicationInfo.PRIVATE_FLAG_EXT_NOT_LAUNCHED) != 0;
+ }
+
+ /**
* Checks if a changeId is enabled for the current user
* @param changeId The changeId to verify
* @return True of the changeId is enabled
diff --git a/core/java/android/content/pm/LauncherActivityInfo.java b/core/java/android/content/pm/LauncherActivityInfo.java
index cb3455b..bb91a37 100644
--- a/core/java/android/content/pm/LauncherActivityInfo.java
+++ b/core/java/android/content/pm/LauncherActivityInfo.java
@@ -43,9 +43,11 @@
private final PackageManager mPm;
private final LauncherActivityInfoInternal mInternal;
- private static final UnicodeSet TRIMMABLE_CHARACTERS =
+ private static final UnicodeSet INVISIBLE_CHARACTERS =
new UnicodeSet("[[:White_Space:][:Default_Ignorable_Code_Point:][:gc=Cc:]]",
/* ignoreWhitespace= */ false).freeze();
+ // Only allow 3 consecutive invisible characters in the prefix of the string.
+ private static final int PREFIX_CONSECUTIVE_INVISIBLE_CHARACTERS_MAXIMUM = 3;
/**
* Create a launchable activity object for a given ResolveInfo and user.
@@ -93,17 +95,21 @@
return getActivityInfo().loadLabel(mPm);
}
- CharSequence label = trim(getActivityInfo().loadLabel(mPm));
- // If the trimmed label is empty, use application's label instead
- if (TextUtils.isEmpty(label)) {
- label = trim(getApplicationInfo().loadLabel(mPm));
- // If the trimmed label is still empty, use package name instead
- if (TextUtils.isEmpty(label)) {
- label = getComponentName().getPackageName();
- }
+ CharSequence label = getActivityInfo().loadLabel(mPm).toString().trim();
+ // If the activity label is visible to the user, return the original activity label
+ if (isVisible(label)) {
+ return label;
}
- // TODO: Go through LauncherAppsService
- return label;
+
+ // Use application label instead
+ label = getApplicationInfo().loadLabel(mPm).toString().trim();
+ // If the application label is visible to the user, return the original application label
+ if (isVisible(label)) {
+ return label;
+ }
+
+ // Use package name instead
+ return getComponentName().getPackageName();
}
/**
@@ -207,147 +213,75 @@
}
/**
- * If the {@code ch} is trimmable, return {@code true}. Otherwise, return
- * {@code false}. If the count of the code points of {@code ch} doesn't
- * equal 1, return {@code false}.
+ * Check whether the {@code sequence} is visible to the user or not.
* <p>
- * There are two types of the trimmable characters.
- * 1. The character is one of the Default_Ignorable_Code_Point in
+ * Return {@code false} when one of these conditions are satisfied:
+ * 1. The {@code sequence} starts with at least consecutive three invisible characters.
+ * 2. The sequence is composed of the invisible characters and non-glyph characters.
+ * <p>
+ * Invisible character is one of the Default_Ignorable_Code_Point in
* <a href="
* https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt">
* DerivedCoreProperties.txt</a>, the White_Space in <a href=
* "https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt">PropList.txt
* </a> or category Cc.
* <p>
- * 2. The character is not supported in the current system font.
+ * Non-glyph character means the character is not supported in the current system font.
* {@link android.graphics.Paint#hasGlyph(String)}
* <p>
*
+ * @hide
*/
- private static boolean isTrimmable(@NonNull Paint paint, @NonNull CharSequence ch) {
- Objects.requireNonNull(paint);
- Objects.requireNonNull(ch);
-
- // if ch is empty or it is not a character (i,e, the count of code
- // point doesn't equal one), return false
- if (TextUtils.isEmpty(ch)
- || Character.codePointCount(ch, /* beginIndex= */ 0, ch.length()) != 1) {
+ @VisibleForTesting
+ public static boolean isVisible(@NonNull CharSequence sequence) {
+ Objects.requireNonNull(sequence);
+ if (TextUtils.isEmpty(sequence)) {
return false;
}
- // Return true for the cases as below:
- // 1. The character is in the TRIMMABLE_CHARACTERS set
- // 2. The character is not supported in the system font
- return TRIMMABLE_CHARACTERS.contains(ch) || !paint.hasGlyph(ch.toString());
- }
-
- /**
- * If the {@code sequence} has some leading trimmable characters, creates a new copy
- * and removes the trimmable characters from the copy. Otherwise the given
- * {@code sequence} is returned as it is. Use {@link #isTrimmable(Paint, CharSequence)}
- * to determine whether the character is trimmable or not.
- *
- * @return the trimmed string or the original string that has no
- * leading trimmable characters.
- * @see #isTrimmable(Paint, CharSequence)
- * @see #trim(CharSequence)
- * @see #trimEnd(CharSequence)
- *
- * @hide
- */
- @VisibleForTesting
- @NonNull
- public static CharSequence trimStart(@NonNull CharSequence sequence) {
- Objects.requireNonNull(sequence);
-
- if (TextUtils.isEmpty(sequence)) {
- return sequence;
- }
-
final Paint paint = new Paint();
- int trimCount = 0;
+ int invisibleCharCount = 0;
+ int notSupportedCharCount = 0;
final int[] codePoints = sequence.codePoints().toArray();
for (int i = 0, length = codePoints.length; i < length; i++) {
String ch = new String(new int[]{codePoints[i]}, /* offset= */ 0, /* count= */ 1);
- if (!isTrimmable(paint, ch)) {
- break;
+
+ // The check steps:
+ // 1. If the character is contained in INVISIBLE_CHARACTERS, invisibleCharCount++.
+ // 1.1 Check whether the invisibleCharCount is larger or equal to
+ // PREFIX_INVISIBLE_CHARACTERS_MAXIMUM when notSupportedCharCount is zero.
+ // It means that there are three consecutive invisible characters at the
+ // start of the string, return false.
+ // Otherwise, continue.
+ // 2. If the character is not supported on the system:
+ // notSupportedCharCount++, continue
+ // 3. If it does not continue or return on the above two cases, it means the
+ // character is visible and supported on the system, break.
+ // After going through the whole string, if the sum of invisibleCharCount
+ // and notSupportedCharCount is smaller than the length of the string, it
+ // means the string has the other visible characters, return true.
+ // Otherwise, return false.
+ if (INVISIBLE_CHARACTERS.contains(ch)) {
+ invisibleCharCount++;
+ // If there are three successive invisible characters at the start of the
+ // string, it is hard to visible to the user.
+ if (notSupportedCharCount == 0
+ && invisibleCharCount >= PREFIX_CONSECUTIVE_INVISIBLE_CHARACTERS_MAXIMUM) {
+ return false;
+ }
+ continue;
}
- trimCount += ch.length();
- }
- if (trimCount == 0) {
- return sequence;
- }
- return sequence.subSequence(trimCount, sequence.length());
- }
- /**
- * If the {@code sequence} has some trailing trimmable characters, creates a new copy
- * and removes the trimmable characters from the copy. Otherwise the given
- * {@code sequence} is returned as it is. Use {@link #isTrimmable(Paint, CharSequence)}
- * to determine whether the character is trimmable or not.
- *
- * @return the trimmed sequence or the original sequence that has no
- * trailing trimmable characters.
- * @see #isTrimmable(Paint, CharSequence)
- * @see #trimStart(CharSequence)
- * @see #trim(CharSequence)
- *
- * @hide
- */
- @VisibleForTesting
- @NonNull
- public static CharSequence trimEnd(@NonNull CharSequence sequence) {
- Objects.requireNonNull(sequence);
-
- if (TextUtils.isEmpty(sequence)) {
- return sequence;
- }
-
- final Paint paint = new Paint();
- int trimCount = 0;
- final int[] codePoints = sequence.codePoints().toArray();
- for (int i = codePoints.length - 1; i >= 0; i--) {
- String ch = new String(new int[]{codePoints[i]}, /* offset= */ 0, /* count= */ 1);
- if (!isTrimmable(paint, ch)) {
- break;
+ // The character is not supported on the system, but it may not be an invisible
+ // character. E.g. tofu (a rectangle).
+ if (!paint.hasGlyph(ch)) {
+ notSupportedCharCount++;
+ continue;
}
- trimCount += ch.length();
+ // The character is visible and supported on the system, break the for loop
+ break;
}
- if (trimCount == 0) {
- return sequence;
- }
- return sequence.subSequence(0, sequence.length() - trimCount);
- }
-
- /**
- * If the {@code sequence} has some leading or trailing trimmable characters, creates
- * a new copy and removes the trimmable characters from the copy. Otherwise the given
- * {@code sequence} is returned as it is. Use {@link #isTrimmable(Paint, CharSequence)}
- * to determine whether the character is trimmable or not.
- *
- * @return the trimmed sequence or the original sequence that has no leading or
- * trailing trimmable characters.
- * @see #isTrimmable(Paint, CharSequence)
- * @see #trimStart(CharSequence)
- * @see #trimEnd(CharSequence)
- *
- * @hide
- */
- @VisibleForTesting
- @NonNull
- public static CharSequence trim(@NonNull CharSequence sequence) {
- Objects.requireNonNull(sequence);
-
- if (TextUtils.isEmpty(sequence)) {
- return sequence;
- }
-
- CharSequence result = trimStart(sequence);
- if (TextUtils.isEmpty(result)) {
- return result;
- }
-
- return trimEnd(result);
+ return (invisibleCharCount + notSupportedCharCount < codePoints.length);
}
}
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 8c56a9d..26bb6e4 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -8847,6 +8847,8 @@
} catch (PackageParserException e) {
Log.w(TAG, "Failure to parse package archive apkFile= " +apkFile);
return null;
+ } finally {
+ parser2.close();
}
}
diff --git a/core/java/android/content/pm/multiuser.aconfig b/core/java/android/content/pm/multiuser.aconfig
index 28534ad..9eec7a4 100644
--- a/core/java/android/content/pm/multiuser.aconfig
+++ b/core/java/android/content/pm/multiuser.aconfig
@@ -426,4 +426,13 @@
metadata {
purpose: PURPOSE_BUGFIX
}
-}
\ No newline at end of file
+}
+
+
+flag {
+ name: "caching_development_improvements"
+ namespace: "multiuser"
+ description: "System API to simplify caching implamentations"
+ bug: "364947162"
+ is_fixed_read_only: true
+}
diff --git a/core/java/android/database/CursorWindow.java b/core/java/android/database/CursorWindow.java
index 6514872..ef59e0a 100644
--- a/core/java/android/database/CursorWindow.java
+++ b/core/java/android/database/CursorWindow.java
@@ -26,6 +26,10 @@
import android.database.sqlite.SQLiteException;
import android.os.Parcel;
import android.os.Parcelable;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
+import android.ravenwood.annotation.RavenwoodThrow;
import dalvik.annotation.optimization.FastNative;
import dalvik.system.CloseGuard;
@@ -40,9 +44,8 @@
* consumer for reading.
* </p>
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.CursorWindow_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("CursorWindow_host")
public class CursorWindow extends SQLiteClosable implements Parcelable {
private static final String STATS_TAG = "CursorWindowStats";
@@ -63,48 +66,69 @@
private final CloseGuard mCloseGuard;
// May throw CursorWindowAllocationException
+ @RavenwoodRedirect
private static native long nativeCreate(String name, int cursorWindowSize);
// May throw CursorWindowAllocationException
+ @RavenwoodRedirect
private static native long nativeCreateFromParcel(Parcel parcel);
+ @RavenwoodRedirect
private static native void nativeDispose(long windowPtr);
+ @RavenwoodRedirect
private static native void nativeWriteToParcel(long windowPtr, Parcel parcel);
+ @RavenwoodRedirect
private static native String nativeGetName(long windowPtr);
+ @RavenwoodRedirect
private static native byte[] nativeGetBlob(long windowPtr, int row, int column);
+ @RavenwoodRedirect
private static native String nativeGetString(long windowPtr, int row, int column);
+ @RavenwoodThrow
private static native void nativeCopyStringToBuffer(long windowPtr, int row, int column,
CharArrayBuffer buffer);
+ @RavenwoodRedirect
private static native boolean nativePutBlob(long windowPtr, byte[] value, int row, int column);
+ @RavenwoodRedirect
private static native boolean nativePutString(long windowPtr, String value,
int row, int column);
// Below native methods don't do unconstrained work, so are FastNative for performance
@FastNative
+ @RavenwoodThrow
private static native void nativeClear(long windowPtr);
@FastNative
+ @RavenwoodRedirect
private static native int nativeGetNumRows(long windowPtr);
@FastNative
+ @RavenwoodRedirect
private static native boolean nativeSetNumColumns(long windowPtr, int columnNum);
@FastNative
+ @RavenwoodRedirect
private static native boolean nativeAllocRow(long windowPtr);
@FastNative
+ @RavenwoodThrow
private static native void nativeFreeLastRow(long windowPtr);
@FastNative
+ @RavenwoodRedirect
private static native int nativeGetType(long windowPtr, int row, int column);
@FastNative
+ @RavenwoodRedirect
private static native long nativeGetLong(long windowPtr, int row, int column);
@FastNative
+ @RavenwoodRedirect
private static native double nativeGetDouble(long windowPtr, int row, int column);
@FastNative
+ @RavenwoodRedirect
private static native boolean nativePutLong(long windowPtr, long value, int row, int column);
@FastNative
+ @RavenwoodRedirect
private static native boolean nativePutDouble(long windowPtr, double value, int row, int column);
@FastNative
+ @RavenwoodThrow
private static native boolean nativePutNull(long windowPtr, int row, int column);
diff --git a/core/java/android/database/sqlite/SQLiteClosable.java b/core/java/android/database/sqlite/SQLiteClosable.java
index 8eb512a..806c386 100644
--- a/core/java/android/database/sqlite/SQLiteClosable.java
+++ b/core/java/android/database/sqlite/SQLiteClosable.java
@@ -31,6 +31,20 @@
private int mReferenceCount = 1;
/**
+ * True if the instance should record when it was closed. Tracking closure can be expensive,
+ * so it is best reserved for subclasses that have long lifetimes.
+ * @hide
+ */
+ protected boolean mTrackClosure = false;
+
+ /**
+ * The caller that finally released this instance. If this is not null, it is supplied as the
+ * cause to the IllegalStateException that is thrown when the object is reopened. Subclasses
+ * are responsible for populating this field, if they wish to use it.
+ */
+ private Throwable mClosedBy = null;
+
+ /**
* Called when the last reference to the object was released by
* a call to {@link #releaseReference()} or {@link #close()}.
*/
@@ -57,7 +71,7 @@
synchronized(this) {
if (mReferenceCount <= 0) {
throw new IllegalStateException(
- "attempt to re-open an already-closed object: " + this);
+ "attempt to re-open an already-closed object: " + this, mClosedBy);
}
mReferenceCount++;
}
@@ -108,5 +122,11 @@
*/
public void close() {
releaseReference();
+ synchronized (this) {
+ if (mTrackClosure && (mClosedBy == null)) {
+ String name = getClass().getName();
+ mClosedBy = new Exception("closed by " + name + ".close()").fillInStackTrace();
+ }
+ }
}
}
diff --git a/core/java/android/database/sqlite/SQLiteConnectionPool.java b/core/java/android/database/sqlite/SQLiteConnectionPool.java
index 15d7d66..505905f 100644
--- a/core/java/android/database/sqlite/SQLiteConnectionPool.java
+++ b/core/java/android/database/sqlite/SQLiteConnectionPool.java
@@ -96,6 +96,10 @@
private boolean mIsOpen;
private int mNextConnectionId;
+ // Record the caller that explicitly closed the database.
+ @GuardedBy("mLock")
+ private Throwable mClosedBy;
+
private ConnectionWaiter mConnectionWaiterPool;
private ConnectionWaiter mConnectionWaiterQueue;
@@ -265,6 +269,7 @@
throwIfClosedLocked();
mIsOpen = false;
+ mClosedBy = new Exception("SQLiteConnectionPool.close()").fillInStackTrace();
closeAvailableConnectionsAndLogExceptionsLocked();
@@ -1101,7 +1106,7 @@
private void throwIfClosedLocked() {
if (!mIsOpen) {
throw new IllegalStateException("Cannot perform this operation "
- + "because the connection pool has been closed.");
+ + "because the connection pool has been closed.", mClosedBy);
}
}
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index f54be00..8bff624 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -236,15 +236,21 @@
*
* {@more} Note that the value of this flag is 0, so it is the default.
*/
- public static final int OPEN_READWRITE = 0x00000000; // update native code if changing
+ // LINT.IfChange
+ public static final int OPEN_READWRITE = 0x00000000;
+ // LINT.ThenChange(/core/jni/android_database_SQLiteConnection.cpp)
/**
* Open flag: Flag for {@link #openDatabase} to open the database for reading only.
* This is the only reliable way to open a database if the disk may be full.
*/
- public static final int OPEN_READONLY = 0x00000001; // update native code if changing
+ // LINT.IfChange
+ public static final int OPEN_READONLY = 0x00000001;
+ // LINT.ThenChange(/core/jni/android_database_SQLiteConnection.cpp)
- private static final int OPEN_READ_MASK = 0x00000001; // update native code if changing
+ // LINT.IfChange
+ private static final int OPEN_READ_MASK = 0x00000001;
+ // LINT.ThenChange(/core/jni/android_database_SQLiteConnection.cpp)
/**
* Open flag: Flag for {@link #openDatabase} to open the database without support for
@@ -254,13 +260,31 @@
* You must be consistent when using this flag to use the setting the database was
* created with. If this is set, {@link #setLocale} will do nothing.
*/
- public static final int NO_LOCALIZED_COLLATORS = 0x00000010; // update native code if changing
+ // LINT.IfChange
+ public static final int NO_LOCALIZED_COLLATORS = 0x00000010;
+ // LINT.ThenChange(/core/jni/android_database_SQLiteConnection.cpp)
+
+ /**
+ * Open flag: Flag for {@link #openDatabase} to open a database, disallowing double-quoted
+ * strings.
+ *
+ * This causes sqlite to reject SQL statements with double-quoted string literals. String
+ * literals must be enclosed in single quotes; double-quotes are reserved for identifiers like
+ * column names.
+ * See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted
+ * @hide
+ */
+ // LINT.IfChange
+ public static final int NO_DOUBLE_QUOTED_STRS = 0x00000020;
+ // LINT.ThenChange(/core/jni/android_database_SQLiteConnection.cpp)
/**
* Open flag: Flag for {@link #openDatabase} to create the database file if it does not
* already exist.
*/
- public static final int CREATE_IF_NECESSARY = 0x10000000; // update native code if changing
+ // LINT.IfChange
+ public static final int CREATE_IF_NECESSARY = 0x10000000;
+ // LINT.ThenChange(/core/jni/android_database_SQLiteConnection.cpp)
/**
* Open flag: Flag for {@link #openDatabase} to open the database file with
@@ -464,6 +488,7 @@
@Nullable CursorFactory cursorFactory, @Nullable DatabaseErrorHandler errorHandler,
int lookasideSlotSize, int lookasideSlotCount, long idleConnectionTimeoutMs,
@Nullable String journalMode, @Nullable String syncMode) {
+ mTrackClosure = true;
mCursorFactory = cursorFactory;
mErrorHandler = errorHandler != null ? errorHandler : new DefaultDatabaseErrorHandler();
mConfigurationLocked = new SQLiteDatabaseConfiguration(path, openFlags);
@@ -490,6 +515,9 @@
if (SQLiteCompatibilityWalFlags.isLegacyCompatibilityWalEnabled()) {
mConfigurationLocked.openFlags |= ENABLE_LEGACY_COMPATIBILITY_WAL;
}
+ if (SQLiteDebug.NoPreloadHolder.NO_DOUBLE_QUOTED_STRS) {
+ mConfigurationLocked.openFlags |= NO_DOUBLE_QUOTED_STRS;
+ }
mConfigurationLocked.journalMode = journalMode;
mConfigurationLocked.syncMode = syncMode;
}
@@ -3275,6 +3303,7 @@
OPEN_READONLY,
CREATE_IF_NECESSARY,
NO_LOCALIZED_COLLATORS,
+ NO_DOUBLE_QUOTED_STRS,
ENABLE_WRITE_AHEAD_LOGGING
})
@Retention(RetentionPolicy.SOURCE)
diff --git a/core/java/android/database/sqlite/SQLiteDebug.java b/core/java/android/database/sqlite/SQLiteDebug.java
index 93d74b1..b648e05 100644
--- a/core/java/android/database/sqlite/SQLiteDebug.java
+++ b/core/java/android/database/sqlite/SQLiteDebug.java
@@ -66,7 +66,6 @@
public static final boolean DEBUG_SQL_TIME =
Log.isLoggable("SQLiteTime", Log.VERBOSE);
-
/**
* True to enable database performance testing instrumentation.
*/
@@ -83,6 +82,15 @@
*/
public static final boolean DEBUG_LOG_DETAILED = Build.IS_DEBUGGABLE
&& SystemProperties.getBoolean("db.log.detailed", false);
+
+ /**
+ * Whether to accept double-quoted strings in SQL statements. Double-quoted strings are a
+ * syntax error but are accepted by sqlite in compatibility mode (the default). If the
+ * property is set to true, double-quoted strings will be treated by sqlite as a syntax
+ * error.
+ */
+ public static final boolean NO_DOUBLE_QUOTED_STRS =
+ SystemProperties.getBoolean("debug.sqlite.no_double_quoted_strs", false);
}
private SQLiteDebug() {
diff --git a/core/java/android/hardware/SensorPrivacyManager.java b/core/java/android/hardware/SensorPrivacyManager.java
index 4cdaaddd..a4c0e87 100644
--- a/core/java/android/hardware/SensorPrivacyManager.java
+++ b/core/java/android/hardware/SensorPrivacyManager.java
@@ -797,7 +797,7 @@
public void setSensorPrivacy(@Sensors.Sensor int sensor,
boolean enable) {
setSensorPrivacy(resolveSourceFromCurrentContext(), sensor, enable,
- UserHandle.USER_CURRENT);
+ mContext.getUserId());
}
private @Sources.Source int resolveSourceFromCurrentContext() {
@@ -837,6 +837,8 @@
@RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY)
public void setSensorPrivacy(@Sources.Source int source, @Sensors.Sensor int sensor,
boolean enable) {
+ // TODO(b/348510106): Replace USER_CURRENT with Context user and fix any tests that may be
+ // affected.
setSensorPrivacy(source, sensor, enable, UserHandle.USER_CURRENT);
}
@@ -894,7 +896,7 @@
@RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY)
public void setSensorPrivacyForProfileGroup(@Sources.Source int source,
@Sensors.Sensor int sensor, boolean enable) {
- setSensorPrivacyForProfileGroup(source , sensor, enable, UserHandle.USER_CURRENT);
+ setSensorPrivacyForProfileGroup(source , sensor, enable, mContext.getUserId());
}
/**
@@ -950,7 +952,7 @@
@RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY)
public void suppressSensorPrivacyReminders(int sensor,
boolean suppress) {
- suppressSensorPrivacyReminders(sensor, suppress, UserHandle.USER_CURRENT);
+ suppressSensorPrivacyReminders(sensor, suppress, mContext.getUserId());
}
/**
diff --git a/core/java/android/hardware/biometrics/BiometricConstants.java b/core/java/android/hardware/biometrics/BiometricConstants.java
index 8975191..9355937 100644
--- a/core/java/android/hardware/biometrics/BiometricConstants.java
+++ b/core/java/android/hardware/biometrics/BiometricConstants.java
@@ -170,6 +170,12 @@
int BIOMETRIC_ERROR_MANDATORY_NOT_ACTIVE = 20;
/**
+ * Biometrics is not allowed to verify in apps.
+ * @hide
+ */
+ int BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS = 21;
+
+ /**
* This constant is only used by SystemUI. It notifies SystemUI that authentication was paused
* because the authentication attempt was unsuccessful.
* @hide
diff --git a/core/java/android/hardware/biometrics/BiometricManager.java b/core/java/android/hardware/biometrics/BiometricManager.java
index 9bc46b9..a4f7485f 100644
--- a/core/java/android/hardware/biometrics/BiometricManager.java
+++ b/core/java/android/hardware/biometrics/BiometricManager.java
@@ -94,6 +94,13 @@
BiometricConstants.BIOMETRIC_ERROR_MANDATORY_NOT_ACTIVE;
/**
+ * Biometrics is not allowed to verify in apps.
+ * @hide
+ */
+ public static final int BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS =
+ BiometricConstants.BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS;
+
+ /**
* A security vulnerability has been discovered and the sensor is unavailable until a
* security update has addressed this issue. This error can be received if for example,
* authentication was requested with {@link Authenticators#BIOMETRIC_STRONG}, but the
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
index c7dba6c..8407258 100644
--- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
@@ -364,16 +364,11 @@
throw new IllegalArgumentException("Null argument given");
}
mCameraId = cameraId;
- if (Flags.singleThreadExecutor()) {
- mDeviceCallback = new ClientStateCallback(executor, callback);
- if (Flags.singleThreadExecutorNaming()) {
- mDeviceExecutor = Executors.newSingleThreadExecutor(sThreadFactory);
- } else {
- mDeviceExecutor = Executors.newSingleThreadExecutor();
- }
+ mDeviceCallback = new ClientStateCallback(executor, callback);
+ if (Flags.singleThreadExecutorNaming()) {
+ mDeviceExecutor = Executors.newSingleThreadExecutor(sThreadFactory);
} else {
- mDeviceCallback = callback;
- mDeviceExecutor = executor;
+ mDeviceExecutor = Executors.newSingleThreadExecutor();
}
mCharacteristics = characteristics;
mCameraManager = manager;
diff --git a/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java b/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java
index 43c0da9..48c5887 100644
--- a/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java
+++ b/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java
@@ -23,12 +23,14 @@
import android.content.Context;
import android.hardware.biometrics.fingerprint.IFingerprint;
import android.hardware.biometrics.fingerprint.SensorProps;
+import android.hardware.biometrics.fingerprint.virtualhal.IVirtualHal;
import android.os.Binder;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Log;
+import android.util.Slog;
import java.util.ArrayList;
import java.util.HashMap;
@@ -162,6 +164,43 @@
dest.writeMap(mSensorPropsMap);
}
+
+ /**
+ * Remap fqName of VHAL because the `virtual` instance is registered
+ * with IVirtulalHal now (IFingerprint previously)
+ * @param fqName fqName to be translated
+ * @return real fqName
+ */
+ public static String remapFqName(String fqName) {
+ if (!fqName.contains(IFingerprint.DESCRIPTOR + "/virtual")) {
+ return fqName; //no remap needed for real hardware HAL
+ } else {
+ //new Vhal instance name
+ return fqName.replace("IFingerprint", "virtualhal.IVirtualHal");
+ }
+ }
+
+ /**
+ * @param fqName aidl interface instance name
+ * @return aidl interface
+ */
+ public static IFingerprint getIFingerprint(String fqName) {
+ if (fqName.contains("virtual")) {
+ String fqNameMapped = remapFqName(fqName);
+ Slog.i(TAG, "getIFingerprint fqName is mapped: " + fqName + "->" + fqNameMapped);
+ try {
+ IVirtualHal vhal = IVirtualHal.Stub.asInterface(
+ Binder.allowBlocking(ServiceManager.waitForService(fqNameMapped)));
+ return vhal.getFingerprintHal();
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Remote exception in vhal.getFingerprintHal() call" + fqNameMapped);
+ }
+ }
+
+ return IFingerprint.Stub.asInterface(
+ Binder.allowBlocking(ServiceManager.waitForDeclaredService(fqName)));
+ }
+
/**
* Returns fingerprint sensor props for the HAL {@param instance}.
*/
@@ -176,8 +215,7 @@
try {
final String fqName = IFingerprint.DESCRIPTOR + "/" + instance;
- final IFingerprint fp = IFingerprint.Stub.asInterface(Binder.allowBlocking(
- ServiceManager.waitForDeclaredService(fqName)));
+ final IFingerprint fp = getIFingerprint(fqName);
if (fp != null) {
props = fp.getSensorProps();
} else {
diff --git a/core/java/android/hardware/input/input_framework.aconfig b/core/java/android/hardware/input/input_framework.aconfig
index fcd6c31..4478592 100644
--- a/core/java/android/hardware/input/input_framework.aconfig
+++ b/core/java/android/hardware/input/input_framework.aconfig
@@ -117,3 +117,10 @@
description: "Allow configurable timeout before key repeat and repeat delay rate for key repeats"
bug: "336585002"
}
+
+flag {
+ name: "mouse_reverse_vertical_scrolling"
+ namespace: "input"
+ description: "Controls whether external mouse vertical scrolling can be reversed"
+ bug: "352598211"
+}
diff --git a/core/java/android/net/vcn/flags.aconfig b/core/java/android/net/vcn/flags.aconfig
index d4d1ed2..dcb363c 100644
--- a/core/java/android/net/vcn/flags.aconfig
+++ b/core/java/android/net/vcn/flags.aconfig
@@ -55,14 +55,4 @@
metadata {
purpose: PURPOSE_BUGFIX
}
-}
-
-flag{
- name: "allow_disable_ipsec_loss_detector"
- namespace: "vcn"
- description: "Allow disabling IPsec packet loss detector"
- bug: "336638836"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
}
\ No newline at end of file
diff --git a/core/java/android/os/AppZygote.java b/core/java/android/os/AppZygote.java
index 07fbe4a..0541a96 100644
--- a/core/java/android/os/AppZygote.java
+++ b/core/java/android/os/AppZygote.java
@@ -111,12 +111,15 @@
try {
int runtimeFlags = Zygote.getMemorySafetyRuntimeFlagsForSecondaryZygote(
mAppInfo, mProcessInfo);
+
+ final int[] sharedAppGid = {
+ UserHandle.getSharedAppGid(UserHandle.getAppId(mAppInfo.uid)) };
mZygote = Process.ZYGOTE_PROCESS.startChildZygote(
"com.android.internal.os.AppZygoteInit",
mAppInfo.processName + "_zygote",
mZygoteUid,
mZygoteUid,
- null, // gids
+ sharedAppGid, // Zygote gets access to shared app GID for profiles
runtimeFlags,
"app_zygote", // seInfo
abi, // abi
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java
index 4bc3dbe..97e9f34 100644
--- a/core/java/android/os/Binder.java
+++ b/core/java/android/os/Binder.java
@@ -21,6 +21,8 @@
import android.annotation.SystemApi;
import android.app.AppOpsManager;
import android.compat.annotation.UnsupportedAppUsage;
+import android.ravenwood.annotation.RavenwoodClassLoadHook;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
import android.util.ExceptionUtils;
import android.util.Log;
import android.util.Slog;
@@ -30,11 +32,9 @@
import com.android.internal.os.BinderCallHeavyHitterWatcher.BinderCallHeavyHitterListener;
import com.android.internal.os.BinderInternal;
import com.android.internal.os.BinderInternal.CallSession;
-import com.android.internal.os.SomeArgs;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.FunctionalUtils.ThrowingRunnable;
import com.android.internal.util.FunctionalUtils.ThrowingSupplier;
-import com.android.internal.util.Preconditions;
import dalvik.annotation.optimization.CriticalNative;
@@ -48,7 +48,6 @@
import java.io.PrintWriter;
import java.lang.reflect.Modifier;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import java.util.function.Supplier;
/**
* Base class for a remotable object, the core part of a lightweight
@@ -82,6 +81,8 @@
*
* @see IBinder
*/
+@RavenwoodKeepWholeClass
+@RavenwoodClassLoadHook(RavenwoodClassLoadHook.LIBANDROID_LOADING_HOOK)
public class Binder implements IBinder {
/*
* Set this flag to true to detect anonymous, local or member classes
@@ -292,33 +293,6 @@
sWarnOnBlockingOnCurrentThread.set(sWarnOnBlocking);
}
- private static volatile ThreadLocal<SomeArgs> sIdentity$ravenwood;
-
- @android.ravenwood.annotation.RavenwoodKeepWholeClass
- private static class IdentitySupplier implements Supplier<SomeArgs> {
- @Override
- public SomeArgs get() {
- final SomeArgs args = SomeArgs.obtain();
- // Match IPCThreadState behavior
- args.arg1 = Boolean.FALSE;
- args.argi1 = android.os.Process.myUid();
- args.argi2 = android.os.Process.myPid();
- return args;
- }
- }
-
- /** @hide */
- @android.ravenwood.annotation.RavenwoodKeep
- public static void init$ravenwood() {
- sIdentity$ravenwood = ThreadLocal.withInitial(new IdentitySupplier());
- }
-
- /** @hide */
- @android.ravenwood.annotation.RavenwoodKeep
- public static void reset$ravenwood() {
- sIdentity$ravenwood = null;
- }
-
/**
* Raw native pointer to JavaBBinderHolder object. Owned by this Java object. Not null.
*/
@@ -346,14 +320,8 @@
* 0 for a synchronous call.
*/
@CriticalNative
- @android.ravenwood.annotation.RavenwoodReplace
public static final native int getCallingPid();
- /** @hide */
- public static final int getCallingPid$ravenwood() {
- return Preconditions.requireNonNullViaRavenwoodRule(sIdentity$ravenwood).get().argi2;
- }
-
/**
* Return the Linux UID assigned to the process that sent you the
* current transaction that is being processed. This UID can be used with
@@ -362,14 +330,8 @@
* incoming transaction, then its own UID is returned.
*/
@CriticalNative
- @android.ravenwood.annotation.RavenwoodReplace
public static final native int getCallingUid();
- /** @hide */
- public static final int getCallingUid$ravenwood() {
- return Preconditions.requireNonNullViaRavenwoodRule(sIdentity$ravenwood).get().argi1;
- }
-
/**
* Returns {@code true} if the current thread is currently executing an
* incoming transaction.
@@ -377,21 +339,13 @@
* @hide
*/
@CriticalNative
- @android.ravenwood.annotation.RavenwoodReplace
public static final native boolean isDirectlyHandlingTransactionNative();
- /** @hide */
- public static final boolean isDirectlyHandlingTransactionNative$ravenwood() {
- // Ravenwood doesn't support IPC
- return false;
- }
-
private static boolean sIsHandlingBinderTransaction = false;
/**
* @hide
*/
- @android.ravenwood.annotation.RavenwoodKeep
public static final boolean isDirectlyHandlingTransaction() {
return sIsHandlingBinderTransaction || isDirectlyHandlingTransactionNative();
}
@@ -400,7 +354,6 @@
* This is Test API which will be used to override output of isDirectlyHandlingTransactionNative
* @hide
*/
- @android.ravenwood.annotation.RavenwoodKeep
public static void setIsDirectlyHandlingTransactionOverride(boolean isInTransaction) {
sIsHandlingBinderTransaction = isInTransaction;
}
@@ -412,15 +365,8 @@
* @hide
*/
@CriticalNative
- @android.ravenwood.annotation.RavenwoodReplace
private static native boolean hasExplicitIdentity();
- /** @hide */
- private static boolean hasExplicitIdentity$ravenwood() {
- return Preconditions.requireNonNullViaRavenwoodRule(sIdentity$ravenwood).get().arg1
- == Boolean.TRUE;
- }
-
/**
* Return the Linux UID assigned to the process that sent the transaction
* currently being processed.
@@ -429,7 +375,6 @@
* executing an incoming transaction and the calling identity has not been
* explicitly set with {@link #clearCallingIdentity()}
*/
- @android.ravenwood.annotation.RavenwoodKeep
public static final int getCallingUidOrThrow() {
if (!isDirectlyHandlingTransaction() && !hasExplicitIdentity()) {
throw new IllegalStateException(
@@ -491,26 +436,8 @@
* @see #restoreCallingIdentity(long)
*/
@CriticalNative
- @android.ravenwood.annotation.RavenwoodReplace
public static final native long clearCallingIdentity();
- /** @hide */
- public static final long clearCallingIdentity$ravenwood() {
- final SomeArgs args = Preconditions.requireNonNullViaRavenwoodRule(
- sIdentity$ravenwood).get();
- long res = ((long) args.argi1 << 32) | args.argi2;
- if (args.arg1 == Boolean.TRUE) {
- res |= (0x1 << 30);
- } else {
- res &= ~(0x1 << 30);
- }
- // Match IPCThreadState behavior
- args.arg1 = Boolean.TRUE;
- args.argi1 = android.os.Process.myUid();
- args.argi2 = android.os.Process.myPid();
- return res;
- }
-
/**
* Restore the identity of the incoming IPC on the current thread
* back to a previously identity that was returned by {@link
@@ -522,18 +449,8 @@
* @see #clearCallingIdentity
*/
@CriticalNative
- @android.ravenwood.annotation.RavenwoodReplace
public static final native void restoreCallingIdentity(long token);
- /** @hide */
- public static final void restoreCallingIdentity$ravenwood(long token) {
- final SomeArgs args = Preconditions.requireNonNullViaRavenwoodRule(
- sIdentity$ravenwood).get();
- args.arg1 = ((token & (0x1 << 30)) != 0) ? Boolean.TRUE : Boolean.FALSE;
- args.argi1 = (int) (token >> 32);
- args.argi2 = (int) (token & ~(0x1 << 30));
- }
-
/**
* Convenience method for running the provided action enclosed in
* {@link #clearCallingIdentity}/{@link #restoreCallingIdentity}.
@@ -708,16 +625,9 @@
*
* @hide
*/
- @android.ravenwood.annotation.RavenwoodReplace
@SystemApi(client = SystemApi.Client.PRIVILEGED_APPS)
public final native void markVintfStability();
- /** @hide */
- private void markVintfStability$ravenwood() {
- // This is not useful for Ravenwood which uses local binder.
- // TODO(b/361785059): Use real native libbinder.
- }
-
/**
* Use a VINTF-stability binder w/o VINTF requirements. Should be called
* on a binder before it is sent out of process.
@@ -736,14 +646,8 @@
* in order to prevent the process from holding on to objects longer than
* it needs to.
*/
- @android.ravenwood.annotation.RavenwoodReplace
public static final native void flushPendingCommands();
- /** @hide */
- public static final void flushPendingCommands$ravenwood() {
- // Ravenwood doesn't support IPC; ignored
- }
-
/**
* Add the calling thread to the IPC thread pool. This function does
* not return until the current process is exiting.
@@ -801,7 +705,6 @@
* <p>If you're creating a Binder token (a Binder object without an attached interface),
* you should use {@link #Binder(String)} instead.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public Binder() {
this(null);
}
@@ -818,12 +721,9 @@
* Instead of creating multiple tokens with the same descriptor, consider adding a suffix to
* help identify them.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public Binder(@Nullable String descriptor) {
mObject = getNativeBBinderHolder();
- if (mObject != 0L) {
- NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mObject);
- }
+ NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mObject);
if (FIND_POTENTIAL_LEAKS) {
final Class<? extends Binder> klass = getClass();
@@ -842,7 +742,6 @@
* will be implemented for you to return the given owner IInterface when
* the corresponding descriptor is requested.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public void attachInterface(@Nullable IInterface owner, @Nullable String descriptor) {
mOwner = owner;
mDescriptor = descriptor;
@@ -851,7 +750,6 @@
/**
* Default implementation returns an empty interface name.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public @Nullable String getInterfaceDescriptor() {
return mDescriptor;
}
@@ -860,7 +758,6 @@
* Default implementation always returns true -- if you got here,
* the object is alive.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public boolean pingBinder() {
return true;
}
@@ -871,7 +768,6 @@
* Note that if you're calling on a local binder, this always returns true
* because your process is alive if you're calling it.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public boolean isBinderAlive() {
return true;
}
@@ -881,7 +777,6 @@
* to return the associated {@link IInterface} if it matches the requested
* descriptor.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public @Nullable IInterface queryLocalInterface(@NonNull String descriptor) {
if (mDescriptor != null && mDescriptor.equals(descriptor)) {
return mOwner;
@@ -1080,7 +975,6 @@
*
* @hide
*/
- @android.ravenwood.annotation.RavenwoodKeep
public @Nullable String getTransactionName(int transactionCode) {
return null;
}
@@ -1089,7 +983,6 @@
* @hide
*/
@VisibleForTesting
- @android.ravenwood.annotation.RavenwoodKeep
public final @Nullable String getTransactionTraceName(int transactionCode) {
final boolean isInterfaceUserDefined = getMaxTransactionId() == 0;
if (mTransactionTraceNames == null) {
@@ -1127,7 +1020,6 @@
return transactionTraceName;
}
- @android.ravenwood.annotation.RavenwoodKeep
private @NonNull String getSimpleDescriptor() {
String descriptor = mDescriptor;
if (descriptor == null) {
@@ -1147,7 +1039,6 @@
* @return The highest user-defined transaction id of all transactions.
* @hide
*/
- @android.ravenwood.annotation.RavenwoodKeep
public int getMaxTransactionId() {
return 0;
}
@@ -1359,14 +1250,12 @@
/**
* Local implementation is a no-op.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public void linkToDeath(@NonNull DeathRecipient recipient, int flags) {
}
/**
* Local implementation is a no-op.
*/
- @android.ravenwood.annotation.RavenwoodKeep
public boolean unlinkToDeath(@NonNull DeathRecipient recipient, int flags) {
return true;
}
@@ -1394,13 +1283,8 @@
}
}
- @android.ravenwood.annotation.RavenwoodReplace
private static native long getNativeBBinderHolder();
- private static long getNativeBBinderHolder$ravenwood() {
- return 0L;
- }
-
/**
* By default, we use the calling UID since we can always trust it.
*/
diff --git a/core/java/android/os/BugreportParams.java b/core/java/android/os/BugreportParams.java
index f7b4173..93a8ed9 100644
--- a/core/java/android/os/BugreportParams.java
+++ b/core/java/android/os/BugreportParams.java
@@ -134,7 +134,6 @@
* The maximum value of supported bugreport mode.
* @hide
*/
- @FlaggedApi(android.os.Flags.FLAG_BUGREPORT_MODE_MAX_VALUE)
@TestApi
public static final int BUGREPORT_MODE_MAX_VALUE = BUGREPORT_MODE_ONBOARDING;
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 30d2dec..a8267d1 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -17,6 +17,7 @@
package android.os;
import android.Manifest;
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
@@ -28,6 +29,7 @@
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.sdk.Flags;
import android.sysprop.DeviceProperties;
import android.sysprop.SocProperties;
import android.sysprop.TelephonyProperties;
@@ -399,12 +401,35 @@
* device. This value never changes while a device is booted, but it may
* increase when the hardware manufacturer provides an OTA update.
* <p>
+ * Together with {@link SDK_MINOR_INT}, this constant defines the
+ * <pre>major.minor</pre> version of Android. <pre>SDK_INT</pre> is
+ * increased and <pre>SDK_MINOR_INT</pre> is set to 0 on new Android
+ * dessert releases. Between these, Android may also release so called
+ * minor releases where <pre>SDK_INT</pre> remains unchanged and
+ * <pre>SDK_MINOR_INT</pre> is increased. Minor releases can add new
+ * APIs, and have stricter guarantees around backwards compatibility
+ * (e.g. no changes gated by <pre>targetSdkVersion</pre>) compared to
+ * major releases.
+ * <p>
* Possible values are defined in {@link Build.VERSION_CODES}.
*/
public static final int SDK_INT = SystemProperties.getInt(
"ro.build.version.sdk", 0);
/**
+ * The minor SDK version of the software currently running on this hardware
+ * device. This value never changes while a device is booted, but it may
+ * increase when the hardware manufacturer provides an OTA update.
+ * <p>
+ * Together with {@link SDK_INT}, this constant defines the
+ * <pre>major.minor</pre> version of Android. See {@link SDK_INT} for
+ * more information.
+ */
+ @FlaggedApi(Flags.FLAG_MAJOR_MINOR_VERSIONING_SCHEME)
+ public static final int SDK_MINOR_INT = SystemProperties.getInt(
+ "ro.build.version.sdk_minor", 0);
+
+ /**
* The SDK version of the software that <em>initially</em> shipped on
* this hardware device. It <em>never</em> changes during the lifetime
* of the device, even when {@link #SDK_INT} increases due to an OTA
diff --git a/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java b/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
index da2eec9..b2d9260 100644
--- a/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
+++ b/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
@@ -19,9 +19,9 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.TestApi;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Trace;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
import android.util.Log;
import android.util.Printer;
import android.util.SparseArray;
@@ -51,9 +51,8 @@
* <p>You can retrieve the MessageQueue for the current thread with
* {@link Looper#myQueue() Looper.myQueue()}.
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.MessageQueue_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("MessageQueue_host")
public final class MessageQueue {
private static final String TAG = "ConcurrentMessageQueue";
private static final boolean DEBUG = false;
@@ -345,11 +344,17 @@
// Barriers are indicated by messages with a null target whose arg1 field carries the token.
private final AtomicInteger mNextBarrierToken = new AtomicInteger(1);
+ @RavenwoodRedirect
private static native long nativeInit();
+ @RavenwoodRedirect
private static native void nativeDestroy(long ptr);
+ @RavenwoodRedirect
private native void nativePollOnce(long ptr, int timeoutMillis); /*non-static for callbacks*/
+ @RavenwoodRedirect
private static native void nativeWake(long ptr);
+ @RavenwoodRedirect
private static native boolean nativeIsPolling(long ptr);
+ @RavenwoodRedirect
private static native void nativeSetFileDescriptorEvents(long ptr, int fd, int events);
MessageQueue(boolean quitAllowed) {
diff --git a/core/java/android/os/IHintManager.aidl b/core/java/android/os/IHintManager.aidl
index 360b2ac..73cdd56 100644
--- a/core/java/android/os/IHintManager.aidl
+++ b/core/java/android/os/IHintManager.aidl
@@ -33,7 +33,7 @@
* if creation is supported but fails.
*/
IHintSession createHintSessionWithConfig(in IBinder token, in int[] threadIds,
- in long durationNanos, in SessionTag tag, out @nullable SessionConfig config);
+ in long durationNanos, in SessionTag tag, out SessionConfig config);
/**
* Get preferred rate limit in nanoseconds.
@@ -48,6 +48,6 @@
*
* Throws IllegalStateException if FMQ channel creation fails.
*/
- ChannelConfig getSessionChannel(in IBinder token);
+ @nullable ChannelConfig getSessionChannel(in IBinder token);
oneway void closeSessionChannel();
}
diff --git a/core/java/android/os/LegacyMessageQueue/MessageQueue.java b/core/java/android/os/LegacyMessageQueue/MessageQueue.java
index 6b9b349..4474e7e 100644
--- a/core/java/android/os/LegacyMessageQueue/MessageQueue.java
+++ b/core/java/android/os/LegacyMessageQueue/MessageQueue.java
@@ -20,9 +20,9 @@
import android.annotation.NonNull;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Handler;
-import android.os.Process;
-import android.os.Trace;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
import android.util.Log;
import android.util.Printer;
import android.util.SparseArray;
@@ -42,9 +42,8 @@
* <p>You can retrieve the MessageQueue for the current thread with
* {@link Looper#myQueue() Looper.myQueue()}.
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.MessageQueue_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("MessageQueue_host")
public final class MessageQueue {
private static final String TAG = "MessageQueue";
private static final boolean DEBUG = false;
@@ -79,12 +78,18 @@
@UnsupportedAppUsage
private int mNextBarrierToken;
+ @RavenwoodRedirect
private native static long nativeInit();
+ @RavenwoodRedirect
private native static void nativeDestroy(long ptr);
@UnsupportedAppUsage
+ @RavenwoodRedirect
private native void nativePollOnce(long ptr, int timeoutMillis); /*non-static for callbacks*/
+ @RavenwoodRedirect
private native static void nativeWake(long ptr);
+ @RavenwoodRedirect
private native static boolean nativeIsPolling(long ptr);
+ @RavenwoodRedirect
private native static void nativeSetFileDescriptorEvents(long ptr, int fd, int events);
MessageQueue(boolean quitAllowed) {
diff --git a/core/java/android/os/LockedMessageQueue/MessageQueue.java b/core/java/android/os/LockedMessageQueue/MessageQueue.java
index b24e14b..f1affce 100644
--- a/core/java/android/os/LockedMessageQueue/MessageQueue.java
+++ b/core/java/android/os/LockedMessageQueue/MessageQueue.java
@@ -20,8 +20,9 @@
import android.annotation.NonNull;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
-import android.os.Handler;
-import android.os.Trace;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
import android.util.Log;
import android.util.Printer;
import android.util.SparseArray;
@@ -44,9 +45,8 @@
* <p>You can retrieve the MessageQueue for the current thread with
* {@link Looper#myQueue() Looper.myQueue()}.
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.MessageQueue_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("MessageQueue_host")
public final class MessageQueue {
private static final String TAG = "LockedMessageQueue";
private static final boolean DEBUG = false;
@@ -389,12 +389,18 @@
@UnsupportedAppUsage
private int mNextBarrierToken;
+ @RavenwoodRedirect
private native static long nativeInit();
+ @RavenwoodRedirect
private native static void nativeDestroy(long ptr);
@UnsupportedAppUsage
+ @RavenwoodRedirect
private native void nativePollOnce(long ptr, int timeoutMillis); /*non-static for callbacks*/
+ @RavenwoodRedirect
private native static void nativeWake(long ptr);
+ @RavenwoodRedirect
private native static boolean nativeIsPolling(long ptr);
+ @RavenwoodRedirect
private native static void nativeSetFileDescriptorEvents(long ptr, int fd, int events);
MessageQueue(boolean quitAllowed) {
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 47096db..f728552 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -27,8 +27,8 @@
import android.annotation.TestApi;
import android.app.AppOpsManager;
import android.compat.annotation.UnsupportedAppUsage;
+import android.ravenwood.annotation.RavenwoodClassLoadHook;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
-import android.ravenwood.annotation.RavenwoodNativeSubstitutionClass;
import android.ravenwood.annotation.RavenwoodReplace;
import android.ravenwood.annotation.RavenwoodThrow;
import android.text.TextUtils;
@@ -233,8 +233,7 @@
* {@link #readSparseArray(ClassLoader, Class)}.
*/
@RavenwoodKeepWholeClass
-@RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.Parcel_host")
+@RavenwoodClassLoadHook(RavenwoodClassLoadHook.LIBANDROID_LOADING_HOOK)
public final class Parcel {
private static final boolean DEBUG_RECYCLE = false;
@@ -389,10 +388,8 @@
@CriticalNative
private static native void nativeMarkSensitive(long nativePtr);
@FastNative
- @RavenwoodThrow
private static native void nativeMarkForBinder(long nativePtr, IBinder binder);
@CriticalNative
- @RavenwoodThrow
private static native boolean nativeIsForRpc(long nativePtr);
@CriticalNative
private static native int nativeDataSize(long nativePtr);
@@ -424,14 +421,12 @@
private static native int nativeWriteFloat(long nativePtr, float val);
@CriticalNative
private static native int nativeWriteDouble(long nativePtr, double val);
- @RavenwoodThrow
private static native void nativeSignalExceptionForError(int error);
@FastNative
private static native void nativeWriteString8(long nativePtr, String val);
@FastNative
private static native void nativeWriteString16(long nativePtr, String val);
@FastNative
- @RavenwoodThrow
private static native void nativeWriteStrongBinder(long nativePtr, IBinder val);
@FastNative
private static native void nativeWriteFileDescriptor(long nativePtr, FileDescriptor val);
@@ -452,7 +447,6 @@
@FastNative
private static native String nativeReadString16(long nativePtr);
@FastNative
- @RavenwoodThrow
private static native IBinder nativeReadStrongBinder(long nativePtr);
@FastNative
private static native FileDescriptor nativeReadFileDescriptor(long nativePtr);
@@ -477,17 +471,13 @@
private static native boolean nativeHasBinders(long nativePtr);
private static native boolean nativeHasBindersInRange(
long nativePtr, int offset, int length);
- @RavenwoodThrow
private static native void nativeWriteInterfaceToken(long nativePtr, String interfaceName);
- @RavenwoodThrow
private static native void nativeEnforceInterface(long nativePtr, String interfaceName);
@CriticalNative
- @RavenwoodThrow
private static native boolean nativeReplaceCallingWorkSourceUid(
long nativePtr, int workSourceUid);
@CriticalNative
- @RavenwoodThrow
private static native int nativeReadCallingWorkSourceUid(long nativePtr);
/** Last time exception with a stack trace was written */
@@ -496,7 +486,6 @@
private static final int WRITE_EXCEPTION_STACK_TRACE_THRESHOLD_MS = 1000;
@CriticalNative
- @RavenwoodThrow
private static native long nativeGetOpenAshmemSize(long nativePtr);
public final static Parcelable.Creator<String> STRING_CREATOR
@@ -660,12 +649,10 @@
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @RavenwoodThrow
public static native long getGlobalAllocSize();
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @RavenwoodThrow
public static native long getGlobalAllocCount();
/**
@@ -1257,6 +1244,7 @@
* @hide
*/
@UnsupportedAppUsage
+ @RavenwoodThrow(blockedBy = android.text.Spanned.class)
public final void writeCharSequence(@Nullable CharSequence val) {
TextUtils.writeToParcel(val, this, 0);
}
@@ -2996,7 +2984,7 @@
* @see #writeNoException
* @see #readException
*/
- @RavenwoodReplace
+ @RavenwoodReplace(blockedBy = AppOpsManager.class)
public final void writeException(@NonNull Exception e) {
AppOpsManager.prefixParcelWithAppOpsIfNeeded(this);
@@ -3035,10 +3023,15 @@
}
}
- /** @hide */
- public final void writeException$ravenwood(@NonNull Exception e) {
- // Ravenwood doesn't support IPC, no transaction headers needed
- writeInt(getExceptionCode(e));
+ private void writeException$ravenwood(@NonNull Exception e) {
+ int code = getExceptionCode(e);
+ writeInt(code);
+ if (code == 0) {
+ if (e instanceof RuntimeException) {
+ throw (RuntimeException) e;
+ }
+ throw new RuntimeException(e);
+ }
writeString(e.getMessage());
writeInt(0);
}
@@ -3096,7 +3089,7 @@
* @see #writeException
* @see #readException
*/
- @RavenwoodReplace
+ @RavenwoodReplace(blockedBy = AppOpsManager.class)
public final void writeNoException() {
AppOpsManager.prefixParcelWithAppOpsIfNeeded(this);
@@ -3127,9 +3120,7 @@
}
}
- /** @hide */
- public final void writeNoException$ravenwood() {
- // Ravenwood doesn't support IPC, no transaction headers needed
+ private void writeNoException$ravenwood() {
writeInt(0);
}
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 3b2041b..346ee7c 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -589,6 +589,12 @@
**/
public static final int THREAD_GROUP_RESTRICTED = 7;
+ /**
+ * Thread group for foreground apps in multi-window mode
+ * @hide
+ **/
+ public static final int THREAD_GROUP_FOREGROUND_WINDOW = 8;
+
/** @hide */
public static final int SIGNAL_DEFAULT = 0;
public static final int SIGNAL_QUIT = 3;
diff --git a/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java b/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java
index 79f229a..80c24a9 100644
--- a/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java
+++ b/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java
@@ -19,8 +19,9 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.TestApi;
-import android.os.Handler;
-import android.os.Trace;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
import android.util.Log;
import android.util.Printer;
import android.util.SparseArray;
@@ -37,8 +38,6 @@
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
-import java.util.PriorityQueue;
-import java.util.PriorityQueue;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@@ -50,9 +49,8 @@
* <p>You can retrieve the MessageQueue for the current thread with
* {@link Looper#myQueue() Looper.myQueue()}.
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.MessageQueue_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("MessageQueue_host")
public final class MessageQueue {
private static final String TAG = "SemiConcurrentMessageQueue";
private static final boolean DEBUG = false;
@@ -338,11 +336,17 @@
// Barriers are indicated by messages with a null target whose arg1 field carries the token.
private final AtomicInteger mNextBarrierToken = new AtomicInteger(1);
+ @RavenwoodRedirect
private static native long nativeInit();
+ @RavenwoodRedirect
private static native void nativeDestroy(long ptr);
+ @RavenwoodRedirect
private native void nativePollOnce(long ptr, int timeoutMillis); /*non-static for callbacks*/
+ @RavenwoodRedirect
private static native void nativeWake(long ptr);
+ @RavenwoodRedirect
private static native boolean nativeIsPolling(long ptr);
+ @RavenwoodRedirect
private static native void nativeSetFileDescriptorEvents(long ptr, int fd, int events);
MessageQueue(boolean quitAllowed) {
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java
index 50b73a9..81dc46e 100644
--- a/core/java/android/os/StrictMode.java
+++ b/core/java/android/os/StrictMode.java
@@ -2605,10 +2605,15 @@
* (Java) thread-local policy value.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
+ @android.ravenwood.annotation.RavenwoodReplace
private static void onBinderStrictModePolicyChange(@ThreadPolicyMask int newPolicy) {
setBlockGuardPolicy(newPolicy);
}
+ private static void onBinderStrictModePolicyChange$ravenwood(@ThreadPolicyMask int newPolicy) {
+ /* no-op */
+ }
+
/**
* A tracked, critical time span. (e.g. during an animation.)
*
diff --git a/core/java/android/os/SystemClock.java b/core/java/android/os/SystemClock.java
index 0ed1ab6..4c9a02c 100644
--- a/core/java/android/os/SystemClock.java
+++ b/core/java/android/os/SystemClock.java
@@ -109,6 +109,7 @@
private static final String TAG = "SystemClock";
private static volatile IAlarmManager sIAlarmManager;
+ private static volatile ITimeDetectorService sITimeDetectorService;
/**
* Since {@code nanoTime()} is arbitrary, anchor our Ravenwood clocks against it.
@@ -188,6 +189,14 @@
return sIAlarmManager;
}
+ private static ITimeDetectorService getITimeDetectorService() {
+ if (sITimeDetectorService == null) {
+ sITimeDetectorService = ITimeDetectorService.Stub
+ .asInterface(ServiceManager.getService(Context.TIME_DETECTOR_SERVICE));
+ }
+ return sITimeDetectorService;
+ }
+
/**
* Returns milliseconds since boot, not counting time spent in deep sleep.
*
@@ -314,15 +323,6 @@
}
/**
- * @see #currentNetworkTimeMillis(ITimeDetectorService)
- * @hide
- */
- public static long currentNetworkTimeMillis() {
- return currentNetworkTimeMillis(ITimeDetectorService.Stub
- .asInterface(ServiceManager.getService(Context.TIME_DETECTOR_SERVICE)));
- }
-
- /**
* Returns milliseconds since January 1, 1970 00:00:00.0 UTC, synchronized
* using a remote network source outside the device.
* <p>
@@ -346,29 +346,29 @@
* @throws DateTimeException when no network time can be provided.
* @hide
*/
- public static long currentNetworkTimeMillis(
- ITimeDetectorService timeDetectorService) {
- if (timeDetectorService != null) {
- UnixEpochTime time;
- try {
- time = timeDetectorService.latestNetworkTime();
- } catch (ParcelableException e) {
- e.maybeRethrow(DateTimeException.class);
- throw new RuntimeException(e);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
-
- if (time == null) {
- // This is not expected.
- throw new DateTimeException("Network based time is not available.");
- }
- long currentMillis = elapsedRealtime();
- long deltaMs = currentMillis - time.getElapsedRealtimeMillis();
- return time.getUnixEpochTimeMillis() + deltaMs;
- } else {
+ public static long currentNetworkTimeMillis() {
+ ITimeDetectorService timeDetectorService = getITimeDetectorService();
+ if (timeDetectorService == null) {
throw new RuntimeException(new DeadSystemException());
}
+
+ UnixEpochTime time;
+ try {
+ time = timeDetectorService.latestNetworkTime();
+ } catch (ParcelableException e) {
+ e.maybeRethrow(DateTimeException.class);
+ throw new RuntimeException(e);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ if (time == null) {
+ // This is not expected.
+ throw new DateTimeException("Network based time is not available.");
+ }
+
+ long currentMillis = elapsedRealtime();
+ long deltaMs = currentMillis - time.getElapsedRealtimeMillis();
+ return time.getUnixEpochTimeMillis() + deltaMs;
}
/**
@@ -396,14 +396,9 @@
*/
public static @NonNull Clock currentNetworkTimeClock() {
return new SimpleClock(ZoneOffset.UTC) {
- private ITimeDetectorService mSvc;
@Override
public long millis() {
- if (mSvc == null) {
- mSvc = ITimeDetectorService.Stub
- .asInterface(ServiceManager.getService(Context.TIME_DETECTOR_SERVICE));
- }
- return SystemClock.currentNetworkTimeMillis(mSvc);
+ return SystemClock.currentNetworkTimeMillis();
}
};
}
diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java
index 0a38691..e53873b 100644
--- a/core/java/android/os/SystemProperties.java
+++ b/core/java/android/os/SystemProperties.java
@@ -21,11 +21,13 @@
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
-import android.ravenwood.annotation.RavenwoodNativeSubstitutionClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
import android.util.Log;
import android.util.MutableInt;
import com.android.internal.annotations.GuardedBy;
+import com.android.internal.ravenwood.RavenwoodEnvironment;
import dalvik.annotation.optimization.CriticalNative;
import dalvik.annotation.optimization.FastNative;
@@ -56,8 +58,7 @@
*/
@SystemApi
@RavenwoodKeepWholeClass
-@RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.SystemProperties_host")
+@RavenwoodRedirectionClass("SystemProperties_host")
public class SystemProperties {
private static final String TAG = "SystemProperties";
private static final boolean TRACK_KEY_ACCESS = false;
@@ -75,7 +76,7 @@
@UnsupportedAppUsage
@GuardedBy("sChangeCallbacks")
- private static final ArrayList<Runnable> sChangeCallbacks = new ArrayList<Runnable>();
+ static final ArrayList<Runnable> sChangeCallbacks = new ArrayList<Runnable>();
@GuardedBy("sRoReads")
private static final HashMap<String, MutableInt> sRoReads =
@@ -102,30 +103,18 @@
}
/** @hide */
+ @RavenwoodRedirect
public static void init$ravenwood(Map<String, String> values,
Predicate<String> keyReadablePredicate, Predicate<String> keyWritablePredicate) {
- native_init$ravenwood(values, keyReadablePredicate, keyWritablePredicate,
- SystemProperties::callChangeCallbacks);
- synchronized (sChangeCallbacks) {
- sChangeCallbacks.clear();
- }
+ throw RavenwoodEnvironment.notSupportedOnDevice();
}
/** @hide */
+ @RavenwoodRedirect
public static void reset$ravenwood() {
- native_reset$ravenwood();
- synchronized (sChangeCallbacks) {
- sChangeCallbacks.clear();
- }
+ throw RavenwoodEnvironment.notSupportedOnDevice();
}
- // These native methods are currently only implemented by Ravenwood, as it's the only
- // mechanism we have to jump to our RavenwoodNativeSubstitutionClass
- private static native void native_init$ravenwood(Map<String, String> values,
- Predicate<String> keyReadablePredicate, Predicate<String> keyWritablePredicate,
- Runnable changeCallback);
- private static native void native_reset$ravenwood();
-
// The one-argument version of native_get used to be a regular native function. Nowadays,
// we use the two-argument form of native_get all the time, but we can't just delete the
// one-argument overload: apps use it via reflection, as the UnsupportedAppUsage annotation
@@ -137,34 +126,46 @@
@FastNative
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
+ @RavenwoodRedirect
private static native String native_get(String key, String def);
@FastNative
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
+ @RavenwoodRedirect
private static native int native_get_int(String key, int def);
@FastNative
@UnsupportedAppUsage
+ @RavenwoodRedirect
private static native long native_get_long(String key, long def);
@FastNative
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
+ @RavenwoodRedirect
private static native boolean native_get_boolean(String key, boolean def);
@FastNative
+ @RavenwoodRedirect
private static native long native_find(String name);
@FastNative
+ @RavenwoodRedirect
private static native String native_get(long handle);
@CriticalNative
+ @RavenwoodRedirect
private static native int native_get_int(long handle, int def);
@CriticalNative
+ @RavenwoodRedirect
private static native long native_get_long(long handle, long def);
@CriticalNative
+ @RavenwoodRedirect
private static native boolean native_get_boolean(long handle, boolean def);
// _NOT_ FastNative: native_set performs IPC and can block
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
+ @RavenwoodRedirect
private static native void native_set(String key, String def);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
+ @RavenwoodRedirect
private static native void native_add_change_callback();
+ @RavenwoodRedirect
private static native void native_report_sysprop_change();
/**
@@ -300,7 +301,7 @@
}
@SuppressWarnings("unused") // Called from native code.
- private static void callChangeCallbacks() {
+ static void callChangeCallbacks() {
ArrayList<Runnable> callbacks = null;
synchronized (sChangeCallbacks) {
//Log.i("foo", "Calling " + sChangeCallbacks.size() + " change callbacks!");
diff --git a/core/java/android/os/Vibrator.java b/core/java/android/os/Vibrator.java
index 36233b7..84325b7 100644
--- a/core/java/android/os/Vibrator.java
+++ b/core/java/android/os/Vibrator.java
@@ -17,6 +17,7 @@
package android.os;
import android.annotation.CallbackExecutor;
+import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -30,6 +31,7 @@
import android.content.res.Resources;
import android.hardware.vibrator.IVibrator;
import android.media.AudioAttributes;
+import android.os.vibrator.Flags;
import android.os.vibrator.VibrationConfig;
import android.os.vibrator.VibratorFrequencyProfile;
import android.util.Log;
@@ -313,6 +315,86 @@
}
/**
+ * Checks whether the vibrator supports the creation of envelope effects.
+ *
+ * Envelope effects are defined by a series of frequency-amplitude pairs with specified
+ * transition times, allowing the creation of more complex vibration patterns.
+ *
+ * @return True if the hardware supports creating envelope effects, false otherwise.
+ */
+ @FlaggedApi(Flags.FLAG_NORMALIZED_PWLE_EFFECTS)
+ public boolean areEnvelopeEffectsSupported() {
+ return getInfo().areEnvelopeEffectsSupported();
+ }
+
+ /**
+ * Retrieves the maximum duration supported for an envelope effect, in milliseconds.
+ *
+ * <p>If the device supports envelope effects (check {@link #areEnvelopeEffectsSupported}),
+ * this value will be positive. Devices with envelope effects capabilities guarantees a
+ * maximum duration equivalent to the product of {@link #getMaxEnvelopeEffectSize()} and
+ * {@link #getMaxEnvelopeEffectControlPointDurationMillis()}. If the device does not support
+ * envelope effects, this method will return 0.
+ *
+ * @return The maximum duration (in milliseconds) allowed for an envelope effect, or 0 if
+ * envelope effects are not supported.
+ */
+ @FlaggedApi(Flags.FLAG_NORMALIZED_PWLE_EFFECTS)
+ public int getMaxEnvelopeEffectDurationMillis() {
+ return getInfo().getMaxEnvelopeEffectDurationMillis();
+ }
+
+ /**
+ * Retrieves the maximum number of control points supported for an envelope effect.
+ *
+ * <p>If the device supports envelope effects (check {@link #areEnvelopeEffectsSupported}),
+ * this value will be positive. Devices with envelope effects capabilities guarantee support
+ * for a minimum of 16 control points. If the device does not support envelope effects,
+ * this method will return 0.
+ *
+ * @return the maximum number of control points allowed for an envelope effect, or 0 if
+ * envelope effects are not supported.
+ */
+ @FlaggedApi(Flags.FLAG_NORMALIZED_PWLE_EFFECTS)
+ public int getMaxEnvelopeEffectSize() {
+ return getInfo().getMaxEnvelopeEffectSize();
+ }
+
+ /**
+ * Retrieves the minimum duration supported between two control points within an envelope
+ * effect, in milliseconds.
+ *
+ * <p>If the device supports envelope effects (check {@link #areEnvelopeEffectsSupported}),
+ * this value will be positive. Devices with envelope effects capabilities guarantee
+ * support for durations down to at least 20 milliseconds. If the device does
+ * not support envelope effects, this method will return 0.
+ *
+ * @return the minimum allowed duration between two control points in an envelope effect,
+ * or 0 if envelope effects are not supported.
+ */
+ @FlaggedApi(Flags.FLAG_NORMALIZED_PWLE_EFFECTS)
+ public int getMinEnvelopeEffectControlPointDurationMillis() {
+ return getInfo().getMinEnvelopeEffectControlPointDurationMillis();
+ }
+
+ /**
+ * Retrieves the maximum duration supported between two control points within an envelope
+ * effect, in milliseconds.
+ *
+ * <p>If the device supports envelope effects (check {@link #areEnvelopeEffectsSupported}),
+ * this value will be positive. Devices with envelope effects capabilities guarantee support
+ * for durations up to at least 1 second. If the device does not support envelope effects,
+ * this method will return 0.
+ *
+ * @return the maximum allowed duration between two control points in an envelope effect,
+ * or 0 if envelope effects are not supported.
+ */
+ @FlaggedApi(Flags.FLAG_NORMALIZED_PWLE_EFFECTS)
+ public int getMaxEnvelopeEffectControlPointDurationMillis() {
+ return getInfo().getMaxEnvelopeEffectControlPointDurationMillis();
+ }
+
+ /**
* Configure an always-on haptics effect.
*
* @param alwaysOnId The board-specific always-on ID to configure.
diff --git a/core/java/android/os/VibratorInfo.java b/core/java/android/os/VibratorInfo.java
index 4f8c24d..5378295e 100644
--- a/core/java/android/os/VibratorInfo.java
+++ b/core/java/android/os/VibratorInfo.java
@@ -60,6 +60,9 @@
private final int mPwleSizeMax;
private final float mQFactor;
private final FrequencyProfile mFrequencyProfile;
+ private final int mMaxEnvelopeEffectSize;
+ private final int mMinEnvelopeEffectControlPointDurationMillis;
+ private final int mMaxEnvelopeEffectControlPointDurationMillis;
VibratorInfo(Parcel in) {
mId = in.readInt();
@@ -73,6 +76,9 @@
mPwleSizeMax = in.readInt();
mQFactor = in.readFloat();
mFrequencyProfile = FrequencyProfile.CREATOR.createFromParcel(in);
+ mMaxEnvelopeEffectSize = in.readInt();
+ mMinEnvelopeEffectControlPointDurationMillis = in.readInt();
+ mMaxEnvelopeEffectControlPointDurationMillis = in.readInt();
}
public VibratorInfo(int id, @NonNull VibratorInfo baseVibratorInfo) {
@@ -80,7 +86,10 @@
baseVibratorInfo.mSupportedBraking, baseVibratorInfo.mSupportedPrimitives,
baseVibratorInfo.mPrimitiveDelayMax, baseVibratorInfo.mCompositionSizeMax,
baseVibratorInfo.mPwlePrimitiveDurationMax, baseVibratorInfo.mPwleSizeMax,
- baseVibratorInfo.mQFactor, baseVibratorInfo.mFrequencyProfile);
+ baseVibratorInfo.mQFactor, baseVibratorInfo.mFrequencyProfile,
+ baseVibratorInfo.mMaxEnvelopeEffectSize,
+ baseVibratorInfo.mMinEnvelopeEffectControlPointDurationMillis,
+ baseVibratorInfo.mMaxEnvelopeEffectControlPointDurationMillis);
}
/**
@@ -111,7 +120,9 @@
@Nullable SparseBooleanArray supportedBraking,
@NonNull SparseIntArray supportedPrimitives, int primitiveDelayMax,
int compositionSizeMax, int pwlePrimitiveDurationMax, int pwleSizeMax,
- float qFactor, @NonNull FrequencyProfile frequencyProfile) {
+ float qFactor, @NonNull FrequencyProfile frequencyProfile,
+ int maxEnvelopeEffectSize, int minEnvelopeEffectControlPointDurationMillis,
+ int maxEnvelopeEffectControlPointDurationMillis) {
Preconditions.checkNotNull(supportedPrimitives);
Preconditions.checkNotNull(frequencyProfile);
mId = id;
@@ -125,6 +136,11 @@
mPwleSizeMax = pwleSizeMax;
mQFactor = qFactor;
mFrequencyProfile = frequencyProfile;
+ mMaxEnvelopeEffectSize = maxEnvelopeEffectSize;
+ mMinEnvelopeEffectControlPointDurationMillis =
+ minEnvelopeEffectControlPointDurationMillis;
+ mMaxEnvelopeEffectControlPointDurationMillis =
+ maxEnvelopeEffectControlPointDurationMillis;
}
@Override
@@ -140,6 +156,9 @@
dest.writeInt(mPwleSizeMax);
dest.writeFloat(mQFactor);
mFrequencyProfile.writeToParcel(dest, flags);
+ dest.writeInt(mMaxEnvelopeEffectSize);
+ dest.writeInt(mMinEnvelopeEffectControlPointDurationMillis);
+ dest.writeInt(mMaxEnvelopeEffectControlPointDurationMillis);
}
@Override
@@ -186,7 +205,12 @@
&& Objects.equals(mSupportedEffects, that.mSupportedEffects)
&& Objects.equals(mSupportedBraking, that.mSupportedBraking)
&& Objects.equals(mQFactor, that.mQFactor)
- && Objects.equals(mFrequencyProfile, that.mFrequencyProfile);
+ && Objects.equals(mFrequencyProfile, that.mFrequencyProfile)
+ && mMaxEnvelopeEffectSize == that.mMaxEnvelopeEffectSize
+ && mMinEnvelopeEffectControlPointDurationMillis
+ == that.mMinEnvelopeEffectControlPointDurationMillis
+ && mMaxEnvelopeEffectControlPointDurationMillis
+ == that.mMaxEnvelopeEffectControlPointDurationMillis;
}
@Override
@@ -215,6 +239,11 @@
+ ", mPwleSizeMax=" + mPwleSizeMax
+ ", mQFactor=" + mQFactor
+ ", mFrequencyProfile=" + mFrequencyProfile
+ + ", mMaxEnvelopeEffectSize=" + mMaxEnvelopeEffectSize
+ + ", mMinEnvelopeEffectControlPointDurationMillis="
+ + mMinEnvelopeEffectControlPointDurationMillis
+ + ", mMaxEnvelopeEffectControlPointDurationMillis="
+ + mMaxEnvelopeEffectControlPointDurationMillis
+ '}';
}
@@ -234,6 +263,11 @@
pw.println("pwleSizeMax = " + mPwleSizeMax);
pw.println("q-factor = " + mQFactor);
pw.println("frequencyProfile = " + mFrequencyProfile);
+ pw.println("mMaxEnvelopeEffectSize = " + mMaxEnvelopeEffectSize);
+ pw.println("mMinEnvelopeEffectControlPointDurationMillis = "
+ + mMinEnvelopeEffectControlPointDurationMillis);
+ pw.println("mMaxEnvelopeEffectControlPointDurationMillis = "
+ + mMaxEnvelopeEffectControlPointDurationMillis);
pw.decreaseIndent();
}
@@ -414,6 +448,58 @@
}
/**
+ * Check whether the vibrator supports the creation of envelope effects.
+ *
+ * <p>See {@link Vibrator#areEnvelopeEffectsSupported()} for more information on envelope
+ * effects.
+ *
+ * @return True if the hardware supports creating envelope effects, false otherwise.
+ */
+ public boolean areEnvelopeEffectsSupported() {
+ return hasCapability(IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2);
+ }
+
+ /**
+ * Calculates the maximum allowed duration for an envelope effect, measured in milliseconds.
+ *
+ * @return The maximum duration (in milliseconds) that an envelope effect can have.
+ */
+ public int getMaxEnvelopeEffectDurationMillis() {
+ return mMaxEnvelopeEffectSize * mMaxEnvelopeEffectControlPointDurationMillis;
+ }
+
+ /**
+ * Gets the maximum number of control points supported for envelope effects on this device.
+ *
+ * @return The maximum number of control points that can be used to define an envelope effect.
+ */
+ public int getMaxEnvelopeEffectSize() {
+ return mMaxEnvelopeEffectSize;
+ }
+
+ /**
+ * Gets the minimum allowed duration for any individual segment within an envelope effect,
+ * measured in milliseconds.
+ *
+ * @return The minimum duration (in milliseconds) that a segment within an envelope effect
+ * can have.
+ */
+ public int getMinEnvelopeEffectControlPointDurationMillis() {
+ return mMinEnvelopeEffectControlPointDurationMillis;
+ }
+
+ /**
+ * Gets the maximum allowed duration for any individual segment within an envelope effect,
+ * measured in milliseconds.
+ *
+ * @return The maximum duration (in milliseconds) that a segment within an envelope effect
+ * can have.
+ */
+ public int getMaxEnvelopeEffectControlPointDurationMillis() {
+ return mMaxEnvelopeEffectControlPointDurationMillis;
+ }
+
+ /**
* Check against this vibrator capabilities.
*
* @param capability one of IVibrator.CAP_*
@@ -489,6 +575,9 @@
if (hasCapability(IVibrator.CAP_EXTERNAL_AMPLITUDE_CONTROL)) {
names.add("EXTERNAL_AMPLITUDE_CONTROL");
}
+ if (hasCapability(IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2)) {
+ names.add("CAP_COMPOSE_PWLE_EFFECTS_V2");
+ }
return names.toArray(new String[names.size()]);
}
@@ -745,6 +834,9 @@
private float mQFactor = Float.NaN;
private FrequencyProfile mFrequencyProfile =
new FrequencyProfile(Float.NaN, Float.NaN, Float.NaN, null);
+ private int mMaxEnvelopeEffectSize;
+ private int mMinEnvelopeEffectControlPointDurationMillis;
+ private int mMaxEnvelopeEffectControlPointDurationMillis;
/** A builder class for a {@link VibratorInfo}. */
public Builder(int id) {
@@ -821,12 +913,46 @@
return this;
}
+ /**
+ * Configure the maximum number of control points supported for envelope effects on this
+ * device.
+ */
+ @NonNull
+ public Builder setMaxEnvelopeEffectSize(int maxEnvelopeEffectSize) {
+ mMaxEnvelopeEffectSize = maxEnvelopeEffectSize;
+ return this;
+ }
+
+ /**
+ * Configure the minimum supported duration for any individual segment within an
+ * envelope effect in milliseconds.
+ */
+ @NonNull
+ public Builder setMinEnvelopeEffectControlPointDurationMillis(
+ int minEnvelopeEffectControlPointDuration) {
+ mMinEnvelopeEffectControlPointDurationMillis = minEnvelopeEffectControlPointDuration;
+ return this;
+ }
+
+ /**
+ * Configure the maximum supported duration for any individual segment within an
+ * envelope effect in milliseconds.
+ */
+ @NonNull
+ public Builder setMaxEnvelopeEffectControlPointDurationMillis(
+ int maxEnvelopeEffectControlPointDuration) {
+ mMaxEnvelopeEffectControlPointDurationMillis = maxEnvelopeEffectControlPointDuration;
+ return this;
+ }
+
/** Build the configured {@link VibratorInfo}. */
@NonNull
public VibratorInfo build() {
return new VibratorInfo(mId, mCapabilities, mSupportedEffects, mSupportedBraking,
mSupportedPrimitives, mPrimitiveDelayMax, mCompositionSizeMax,
- mPwlePrimitiveDurationMax, mPwleSizeMax, mQFactor, mFrequencyProfile);
+ mPwlePrimitiveDurationMax, mPwleSizeMax, mQFactor, mFrequencyProfile,
+ mMaxEnvelopeEffectSize, mMinEnvelopeEffectControlPointDurationMillis,
+ mMaxEnvelopeEffectControlPointDurationMillis);
}
/**
diff --git a/core/java/android/os/flags.aconfig b/core/java/android/os/flags.aconfig
index f026997..39bd15c 100644
--- a/core/java/android/os/flags.aconfig
+++ b/core/java/android/os/flags.aconfig
@@ -52,14 +52,6 @@
}
flag {
- name: "bugreport_mode_max_value"
- is_exported: true
- namespace: "telephony"
- description: "Introduce a constant as maximum value of bugreport mode."
- bug: "305067125"
-}
-
-flag {
name: "adpf_prefer_power_efficiency"
is_exported: true
namespace: "game"
@@ -115,14 +107,6 @@
}
flag {
- name: "adpf_fmq_eager_send"
- namespace: "game"
- description: "Guards the use of an eager-sending optimization in FMQ for low-latency messages"
- is_fixed_read_only: true
- bug: "315894228"
-}
-
-flag {
name: "adpf_hwui_gpu"
namespace: "game"
description: "Guards use of the FMQ channel for ADPF"
diff --git a/core/java/android/os/vibrator/MultiVibratorInfo.java b/core/java/android/os/vibrator/MultiVibratorInfo.java
index 5f32731..9c2b978 100644
--- a/core/java/android/os/vibrator/MultiVibratorInfo.java
+++ b/core/java/android/os/vibrator/MultiVibratorInfo.java
@@ -59,7 +59,13 @@
integerLimitIntersection(vibrators, VibratorInfo::getPwlePrimitiveDurationMax),
integerLimitIntersection(vibrators, VibratorInfo::getPwleSizeMax),
floatPropertyIntersection(vibrators, VibratorInfo::getQFactor),
- mergedProfile);
+ mergedProfile,
+ integerLimitIntersection(vibrators,
+ VibratorInfo::getMaxEnvelopeEffectSize),
+ integerLimitIntersection(vibrators,
+ VibratorInfo::getMinEnvelopeEffectControlPointDurationMillis),
+ integerLimitIntersection(vibrators,
+ VibratorInfo::getMaxEnvelopeEffectControlPointDurationMillis));
}
private static int capabilitiesIntersection(VibratorInfo[] infos,
diff --git a/core/java/android/permission/flags.aconfig b/core/java/android/permission/flags.aconfig
index 5174005..991611a 100644
--- a/core/java/android/permission/flags.aconfig
+++ b/core/java/android/permission/flags.aconfig
@@ -241,3 +241,19 @@
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "wallet_role_icon_property_enabled"
+ is_exported: true
+ namespace: "wallet_integration"
+ description: "This flag is used to enabled the Wallet Role s icon fetching from manifest property"
+ bug: "349942654"
+}
+
+flag {
+ name: "replace_body_sensors_permission_enabled"
+ is_exported: true
+ namespace: "android_health_services"
+ description: "This flag is used to enable replacing permission BODY_SENSORS(and BODY_SENSORS_BACKGROUND) with granular health permission READ_HEART_RATE(and READ_HEALTH_DATA_IN_BACKGROUND)"
+ bug: "364638912"
+}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 7d00b80..f6eb4b5 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -17,6 +17,8 @@
package android.provider;
import android.accounts.Account;
+import android.annotation.FlaggedApi;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
@@ -65,6 +67,8 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -3015,6 +3019,173 @@
}
/**
+ * Represents the state of the default account, and the actual {@link Account} if it's
+ * a cloud account.
+ * If the default account is set to {@link #DEFAULT_ACCOUNT_STATE_LOCAL} or
+ * {@link #DEFAULT_ACCOUNT_STATE_CLOUD}, new raw contacts requested for insertion
+ * without a
+ * specified {@link Account} will be saved in the default account.
+ * The default account can have one of the following four states:
+ * <ul>
+ * <li> {@link #DEFAULT_ACCOUNT_STATE_INVALID}: An invalid state that should not
+ * occur on the device. </li>
+ * <li> {@link #DEFAULT_ACCOUNT_STATE_NOT_SET}: The default account has not
+ * been set by the user. </li>
+ * <li> {@link #DEFAULT_ACCOUNT_STATE_LOCAL}: The default account is set to
+ * the local device storage. New raw contacts requested for insertion without a
+ * specified
+ * {@link Account} will be saved in a null or custom local account. </li>
+ * <li> {@link #DEFAULT_ACCOUNT_STATE_CLOUD}: The default account is set to a
+ * cloud-synced account. New raw contacts requested for insertion without a specified
+ * {@link Account} will be saved in {@link mCloudAccount}. </li>
+ * </ul>
+ */
+ @FlaggedApi(Flags.FLAG_NEW_DEFAULT_ACCOUNT_API_ENABLED)
+ public static final class DefaultAccountAndState {
+ // The state of the default account.
+ /** A state that is invalid. */
+ public static final int DEFAULT_ACCOUNT_STATE_INVALID = 0;
+
+ /** A state indicating that default account is not set. */
+ public static final int DEFAULT_ACCOUNT_STATE_NOT_SET = 1;
+
+ /** A state indicating that default account is set to local device storage. */
+ public static final int DEFAULT_ACCOUNT_STATE_LOCAL = 2;
+
+ /**
+ * A state indicating that the default account is set as an account that is synced
+ * to the cloud.
+ */
+ public static final int DEFAULT_ACCOUNT_STATE_CLOUD = 3;
+
+ /**
+ * The state of the default account. One of
+ * {@link #DEFAULT_ACCOUNT_STATE_NOT_SET},
+ * {@link #DEFAULT_ACCOUNT_STATE_LOCAL} or
+ * {@link #DEFAULT_ACCOUNT_STATE_CLOUD}.
+ */
+ @DefaultAccountState
+ private final int mState;
+
+ /**
+ * The account of the default account, when {@link mState} is {
+ *
+ * @link #STATE_SET_TO_CLOUD}, or null otherwise.
+ */
+ private final Account mCloudAccount;
+
+ /**
+ * Constructs a new `DefaultAccountAndState` instance with the specified state and
+ * cloud
+ * account.
+ *
+ * @param state The state of the default account.
+ * @param cloudAccount The cloud account associated with the default account,
+ * or null if the state is not
+ * {@link #DEFAULT_ACCOUNT_STATE_CLOUD}.
+ */
+ public DefaultAccountAndState(@DefaultAccountState int state,
+ @Nullable Account cloudAccount) {
+ if (state == DEFAULT_ACCOUNT_STATE_INVALID) {
+ throw new IllegalArgumentException("Invalid default account state.");
+ }
+ if ((state == DEFAULT_ACCOUNT_STATE_CLOUD) != (cloudAccount != null)) {
+ throw new IllegalArgumentException(
+ "Default account can be set to cloud if and only if the cloud "
+ + "account is provided.");
+ }
+ this.mState = state;
+ this.mCloudAccount =
+ (mState == DEFAULT_ACCOUNT_STATE_CLOUD) ? cloudAccount : null;
+ }
+
+ /**
+ * Creates a `DefaultAccountAndState` instance representing a default account
+ * that is set to the cloud and associated with the specified cloud account.
+ *
+ * @param cloudAccount The non-null cloud account associated with the default
+ * contacts
+ * account.
+ * @return A new `DefaultAccountAndState` instance with state
+ * {@link #DEFAULT_ACCOUNT_STATE_CLOUD}.
+ */
+ public static @NonNull DefaultAccountAndState ofCloud(
+ @NonNull Account cloudAccount) {
+ return new DefaultAccountAndState(DEFAULT_ACCOUNT_STATE_CLOUD, cloudAccount);
+ }
+
+ /**
+ * Creates a `DefaultAccountAndState` instance representing a default account
+ * that is set to the local device storage.
+ *
+ * @return A new `DefaultAccountAndState` instance with state
+ * {@link #DEFAULT_ACCOUNT_STATE_LOCAL}.
+ */
+ public static @NonNull DefaultAccountAndState ofLocal() {
+ return new DefaultAccountAndState(DEFAULT_ACCOUNT_STATE_LOCAL, null);
+ }
+
+ /**
+ * Creates a `DefaultAccountAndState` instance representing a default account
+ * that is not set.
+ *
+ * @return A new `DefaultAccountAndState` instance with state
+ * {@link #DEFAULT_ACCOUNT_STATE_NOT_SET}.
+ */
+ public static @NonNull DefaultAccountAndState ofNotSet() {
+ return new DefaultAccountAndState(DEFAULT_ACCOUNT_STATE_NOT_SET, null);
+ }
+
+ /**
+ * @return the state of the default account.
+ */
+ @DefaultAccountState
+ public int getState() {
+ return mState;
+ }
+
+ /**
+ * @return the cloud account associated with the default account, or null if the
+ * state is not {@link #DEFAULT_ACCOUNT_STATE_CLOUD}.
+ */
+ public @Nullable Account getCloudAccount() {
+ return mCloudAccount;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mState, mCloudAccount);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof DefaultAccountAndState that)) {
+ return false;
+ }
+
+ return mState == that.mState && Objects.equals(mCloudAccount,
+ that.mCloudAccount);
+ }
+
+ /**
+ * Annotation for all default account states.
+ *
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(
+ prefix = {"DEFAULT_ACCOUNT_STATE_"},
+ value = {DEFAULT_ACCOUNT_STATE_INVALID,
+ DEFAULT_ACCOUNT_STATE_NOT_SET,
+ DEFAULT_ACCOUNT_STATE_LOCAL, DEFAULT_ACCOUNT_STATE_CLOUD})
+ public @interface DefaultAccountState {
+ }
+ }
+
+ /**
* A sub-directory of a single raw contact that contains all of its
* {@link ContactsContract.Data} rows. To access this directory
* append {@link Data#CONTENT_DIRECTORY} to the raw contact URI.
@@ -8326,7 +8497,6 @@
public static final String RAW_CONTACT_ID2 = "raw_contact_id2";
}
-
/**
* Class containing utility methods around determine what accounts in the ContactsProvider are
* related to the SIM cards in the device.
@@ -8840,6 +9010,30 @@
public static final String KEY_DEFAULT_ACCOUNT = "key_default_account";
/**
+ * Key in the Bundle for the default account state.
+ *
+ * @hide
+ */
+ public static final String KEY_DEFAULT_ACCOUNT_STATE =
+ "key_default_contacts_account_state";
+
+ /**
+ * The method to invoke in order to set the default account.
+ *
+ * @hide
+ */
+ public static final String SET_DEFAULT_ACCOUNT_FOR_NEW_CONTACTS_METHOD =
+ "setDefaultAccountForNewContacts";
+
+ /**
+ * The method to invoke in order to query the default account.
+ *
+ * @hide
+ */
+ public static final String QUERY_DEFAULT_ACCOUNT_FOR_NEW_CONTACTS_METHOD =
+ "queryDefaultAccountForNewContacts";
+
+ /**
* Get the account that is set as the default account for new contacts, which should be
* initially selected when creating a new contact on contact management apps.
* If the setting has not been set by any app, it will return null. Once the setting
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 98904fe..0a05f70 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5150,13 +5150,19 @@
public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
/**
- * The screen backlight brightness between 0 and 255.
+ * The screen backlight brightness between 1 (minimum) and 255 (maximum).
+ *
+ * Use {@link android.view.WindowManager.LayoutParams#screenBrightness} to set the screen
+ * brightness instead.
*/
@Readable
public static final String SCREEN_BRIGHTNESS = "screen_brightness";
/**
- * Control whether to enable automatic brightness mode.
+ * Controls whether to enable automatic brightness mode. Value can be set to
+ * {@link #SCREEN_BRIGHTNESS_MODE_MANUAL} or {@link #SCREEN_BRIGHTNESS_MODE_AUTOMATIC}.
+ * If {@link #SCREEN_BRIGHTNESS_MODE_AUTOMATIC} is set, the system may change
+ * {@link #SCREEN_BRIGHTNESS} automatically.
*/
@Readable
public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
diff --git a/core/java/android/provider/flags.aconfig b/core/java/android/provider/flags.aconfig
index 53d0c62..5c0f873 100644
--- a/core/java/android/provider/flags.aconfig
+++ b/core/java/android/provider/flags.aconfig
@@ -43,3 +43,12 @@
purpose: PURPOSE_FEATURE
}
}
+
+# OWNER = liefuliu
+flag {
+ name: "new_default_account_api_enabled"
+ is_exported: true
+ namespace: "contacts"
+ description: "Enable the new ContactsContract Default Account APIs."
+ bug: "359957527"
+}
diff --git a/core/java/android/text/ClientFlags.java b/core/java/android/text/ClientFlags.java
index 5d84d17..c2ad508 100644
--- a/core/java/android/text/ClientFlags.java
+++ b/core/java/android/text/ClientFlags.java
@@ -28,41 +28,6 @@
*/
public class ClientFlags {
/**
- * @see Flags#noBreakNoHyphenationSpan()
- */
- public static boolean noBreakNoHyphenationSpan() {
- return TextFlags.isFeatureEnabled(Flags.FLAG_NO_BREAK_NO_HYPHENATION_SPAN);
- }
-
- /**
- * @see Flags#phraseStrictFallback()
- */
- public static boolean phraseStrictFallback() {
- return TextFlags.isFeatureEnabled(Flags.FLAG_PHRASE_STRICT_FALLBACK);
- }
-
- /**
- * @see Flags#useBoundsForWidth()
- */
- public static boolean useBoundsForWidth() {
- return TextFlags.isFeatureEnabled(Flags.FLAG_USE_BOUNDS_FOR_WIDTH);
- }
-
- /**
- * @see Flags#fixLineHeightForLocale()
- */
- public static boolean fixLineHeightForLocale() {
- return TextFlags.isFeatureEnabled(Flags.FLAG_FIX_LINE_HEIGHT_FOR_LOCALE);
- }
-
- /**
- * @see Flags#icuBidiMigration()
- */
- public static boolean icuBidiMigration() {
- return TextFlags.isFeatureEnabled(Flags.FLAG_ICU_BIDI_MIGRATION);
- }
-
- /**
* @see Flags#fixMisalignedContextMenu()
*/
public static boolean fixMisalignedContextMenu() {
diff --git a/core/java/android/text/MeasuredParagraph.java b/core/java/android/text/MeasuredParagraph.java
index 896e087..31a2263 100644
--- a/core/java/android/text/MeasuredParagraph.java
+++ b/core/java/android/text/MeasuredParagraph.java
@@ -42,8 +42,6 @@
import android.text.style.ReplacementSpan;
import android.util.Pools.SynchronizedPool;
-import com.android.text.flags.Flags;
-
import java.util.Arrays;
/**
@@ -201,14 +199,11 @@
* @hide
*/
public @Layout.Direction int getParagraphDir() {
- if (Flags.icuBidiMigration()) {
- if (mBidi == null) {
- return Layout.DIR_LEFT_TO_RIGHT;
- }
- return (mBidi.getParaLevel() & 0x01) == 0
- ? Layout.DIR_LEFT_TO_RIGHT : Layout.DIR_RIGHT_TO_LEFT;
+ if (mBidi == null) {
+ return Layout.DIR_LEFT_TO_RIGHT;
}
- return mParaDir;
+ return (mBidi.getParaLevel() & 0x01) == 0
+ ? Layout.DIR_LEFT_TO_RIGHT : Layout.DIR_RIGHT_TO_LEFT;
}
/**
@@ -219,71 +214,62 @@
*/
public Directions getDirections(@IntRange(from = 0) int start, // inclusive
@IntRange(from = 0) int end) { // exclusive
- if (Flags.icuBidiMigration()) {
- // Easy case: mBidi == null means the text is all LTR and no bidi suppot is needed.
- if (mBidi == null) {
- return Layout.DIRS_ALL_LEFT_TO_RIGHT;
- }
-
- // Easy case: If the original text only contains single directionality run, the
- // substring is only single run.
- if (start == end) {
- if ((mBidi.getParaLevel() & 0x01) == 0) {
- return Layout.DIRS_ALL_LEFT_TO_RIGHT;
- } else {
- return Layout.DIRS_ALL_RIGHT_TO_LEFT;
- }
- }
-
- // Okay, now we need to generate the line instance.
- Bidi bidi = mBidi.createLineBidi(start, end);
-
- // Easy case: If the line instance only contains single directionality run, no need
- // to reorder visually.
- if (bidi.getRunCount() == 1) {
- if (bidi.getRunLevel(0) == 1) {
- return Layout.DIRS_ALL_RIGHT_TO_LEFT;
- } else if (bidi.getRunLevel(0) == 0) {
- return Layout.DIRS_ALL_LEFT_TO_RIGHT;
- } else {
- return new Directions(new int[] {
- 0, bidi.getRunLevel(0) << Layout.RUN_LEVEL_SHIFT | (end - start)});
- }
- }
-
- // Reorder directionality run visually.
- byte[] levels = new byte[bidi.getRunCount()];
- for (int i = 0; i < bidi.getRunCount(); ++i) {
- levels[i] = (byte) bidi.getRunLevel(i);
- }
- int[] visualOrders = Bidi.reorderVisual(levels);
-
- int[] dirs = new int[bidi.getRunCount() * 2];
- for (int i = 0; i < bidi.getRunCount(); ++i) {
- int vIndex;
- if ((mBidi.getBaseLevel() & 0x01) == 1) {
- // For the historical reasons, if the base directionality is RTL, the Android
- // draws from the right, i.e. the visually reordered run needs to be reversed.
- vIndex = visualOrders[bidi.getRunCount() - i - 1];
- } else {
- vIndex = visualOrders[i];
- }
-
- // Special packing of dire
- dirs[i * 2] = bidi.getRunStart(vIndex);
- dirs[i * 2 + 1] = bidi.getRunLevel(vIndex) << Layout.RUN_LEVEL_SHIFT
- | (bidi.getRunLimit(vIndex) - dirs[i * 2]);
- }
-
- return new Directions(dirs);
- }
- if (mLtrWithoutBidi) {
+ // Easy case: mBidi == null means the text is all LTR and no bidi suppot is needed.
+ if (mBidi == null) {
return Layout.DIRS_ALL_LEFT_TO_RIGHT;
}
- final int length = end - start;
- return AndroidBidi.directions(mParaDir, mLevels.getRawArray(), start, mCopiedBuffer, start,
- length);
+ // Easy case: If the original text only contains single directionality run, the
+ // substring is only single run.
+ if (start == end) {
+ if ((mBidi.getParaLevel() & 0x01) == 0) {
+ return Layout.DIRS_ALL_LEFT_TO_RIGHT;
+ } else {
+ return Layout.DIRS_ALL_RIGHT_TO_LEFT;
+ }
+ }
+
+ // Okay, now we need to generate the line instance.
+ Bidi bidi = mBidi.createLineBidi(start, end);
+
+ // Easy case: If the line instance only contains single directionality run, no need
+ // to reorder visually.
+ if (bidi.getRunCount() == 1) {
+ if (bidi.getRunLevel(0) == 1) {
+ return Layout.DIRS_ALL_RIGHT_TO_LEFT;
+ } else if (bidi.getRunLevel(0) == 0) {
+ return Layout.DIRS_ALL_LEFT_TO_RIGHT;
+ } else {
+ return new Directions(new int[] {
+ 0, bidi.getRunLevel(0) << Layout.RUN_LEVEL_SHIFT | (end - start)});
+ }
+ }
+
+ // Reorder directionality run visually.
+ byte[] levels = new byte[bidi.getRunCount()];
+ for (int i = 0; i < bidi.getRunCount(); ++i) {
+ levels[i] = (byte) bidi.getRunLevel(i);
+ }
+ int[] visualOrders = Bidi.reorderVisual(levels);
+
+ int[] dirs = new int[bidi.getRunCount() * 2];
+ for (int i = 0; i < bidi.getRunCount(); ++i) {
+ int vIndex;
+ if ((mBidi.getBaseLevel() & 0x01) == 1) {
+ // For the historical reasons, if the base directionality is RTL, the Android
+ // draws from the right, i.e. the visually reordered run needs to be reversed.
+ vIndex = visualOrders[bidi.getRunCount() - i - 1];
+ } else {
+ vIndex = visualOrders[i];
+ }
+
+ // Special packing of dire
+ dirs[i * 2] = bidi.getRunStart(vIndex);
+ dirs[i * 2 + 1] = bidi.getRunLevel(vIndex) << Layout.RUN_LEVEL_SHIFT
+ | (bidi.getRunLimit(vIndex) - dirs[i * 2]);
+ }
+
+ return new Directions(dirs);
}
/**
@@ -681,84 +667,56 @@
}
}
- if (Flags.icuBidiMigration()) {
- if ((textDir == TextDirectionHeuristics.LTR
- || textDir == TextDirectionHeuristics.FIRSTSTRONG_LTR
- || textDir == TextDirectionHeuristics.ANYRTL_LTR)
- && TextUtils.doesNotNeedBidi(mCopiedBuffer, 0, mTextLength)) {
- mLevels.clear();
- mLtrWithoutBidi = true;
- return;
- }
- final int bidiRequest;
- if (textDir == TextDirectionHeuristics.LTR) {
- bidiRequest = Bidi.LTR;
- } else if (textDir == TextDirectionHeuristics.RTL) {
- bidiRequest = Bidi.RTL;
- } else if (textDir == TextDirectionHeuristics.FIRSTSTRONG_LTR) {
- bidiRequest = Bidi.LEVEL_DEFAULT_LTR;
- } else if (textDir == TextDirectionHeuristics.FIRSTSTRONG_RTL) {
- bidiRequest = Bidi.LEVEL_DEFAULT_RTL;
- } else {
- final boolean isRtl = textDir.isRtl(mCopiedBuffer, 0, mTextLength);
- bidiRequest = isRtl ? Bidi.RTL : Bidi.LTR;
- }
- mBidi = new Bidi(mCopiedBuffer, 0, null, 0, mCopiedBuffer.length, bidiRequest);
-
- if (mCopiedBuffer.length > 0
- && mBidi.getParagraphIndex(mCopiedBuffer.length - 1) != 0) {
- // Historically, the MeasuredParagraph does not treat the CR letters as paragraph
- // breaker but ICU BiDi treats it as paragraph breaker. In the MeasureParagraph,
- // the given range always represents a single paragraph, so if the BiDi object has
- // multiple paragraph, it should contains a CR letters in the text. Using CR is not
- // common in Android and also it should not penalize the easy case, e.g. all LTR,
- // check the paragraph count here and replace the CR letters and re-calculate
- // BiDi again.
- for (int i = 0; i < mTextLength; ++i) {
- if (Character.isSurrogate(mCopiedBuffer[i])) {
- // All block separators are in BMP.
- continue;
- }
- if (UCharacter.getDirection(mCopiedBuffer[i])
- == UCharacterDirection.BLOCK_SEPARATOR) {
- mCopiedBuffer[i] = OBJECT_REPLACEMENT_CHARACTER;
- }
- }
- mBidi = new Bidi(mCopiedBuffer, 0, null, 0, mCopiedBuffer.length, bidiRequest);
- }
- mLevels.resize(mTextLength);
- byte[] rawArray = mLevels.getRawArray();
- for (int i = 0; i < mTextLength; ++i) {
- rawArray[i] = mBidi.getLevelAt(i);
- }
- mLtrWithoutBidi = false;
- return;
- }
if ((textDir == TextDirectionHeuristics.LTR
|| textDir == TextDirectionHeuristics.FIRSTSTRONG_LTR
|| textDir == TextDirectionHeuristics.ANYRTL_LTR)
&& TextUtils.doesNotNeedBidi(mCopiedBuffer, 0, mTextLength)) {
mLevels.clear();
- mParaDir = Layout.DIR_LEFT_TO_RIGHT;
mLtrWithoutBidi = true;
- } else {
- final int bidiRequest;
- if (textDir == TextDirectionHeuristics.LTR) {
- bidiRequest = Layout.DIR_REQUEST_LTR;
- } else if (textDir == TextDirectionHeuristics.RTL) {
- bidiRequest = Layout.DIR_REQUEST_RTL;
- } else if (textDir == TextDirectionHeuristics.FIRSTSTRONG_LTR) {
- bidiRequest = Layout.DIR_REQUEST_DEFAULT_LTR;
- } else if (textDir == TextDirectionHeuristics.FIRSTSTRONG_RTL) {
- bidiRequest = Layout.DIR_REQUEST_DEFAULT_RTL;
- } else {
- final boolean isRtl = textDir.isRtl(mCopiedBuffer, 0, mTextLength);
- bidiRequest = isRtl ? Layout.DIR_REQUEST_RTL : Layout.DIR_REQUEST_LTR;
- }
- mLevels.resize(mTextLength);
- mParaDir = AndroidBidi.bidi(bidiRequest, mCopiedBuffer, mLevels.getRawArray());
- mLtrWithoutBidi = false;
+ return;
}
+ final int bidiRequest;
+ if (textDir == TextDirectionHeuristics.LTR) {
+ bidiRequest = Bidi.LTR;
+ } else if (textDir == TextDirectionHeuristics.RTL) {
+ bidiRequest = Bidi.RTL;
+ } else if (textDir == TextDirectionHeuristics.FIRSTSTRONG_LTR) {
+ bidiRequest = Bidi.LEVEL_DEFAULT_LTR;
+ } else if (textDir == TextDirectionHeuristics.FIRSTSTRONG_RTL) {
+ bidiRequest = Bidi.LEVEL_DEFAULT_RTL;
+ } else {
+ final boolean isRtl = textDir.isRtl(mCopiedBuffer, 0, mTextLength);
+ bidiRequest = isRtl ? Bidi.RTL : Bidi.LTR;
+ }
+ mBidi = new Bidi(mCopiedBuffer, 0, null, 0, mCopiedBuffer.length, bidiRequest);
+
+ if (mCopiedBuffer.length > 0
+ && mBidi.getParagraphIndex(mCopiedBuffer.length - 1) != 0) {
+ // Historically, the MeasuredParagraph does not treat the CR letters as paragraph
+ // breaker but ICU BiDi treats it as paragraph breaker. In the MeasureParagraph,
+ // the given range always represents a single paragraph, so if the BiDi object has
+ // multiple paragraph, it should contains a CR letters in the text. Using CR is not
+ // common in Android and also it should not penalize the easy case, e.g. all LTR,
+ // check the paragraph count here and replace the CR letters and re-calculate
+ // BiDi again.
+ for (int i = 0; i < mTextLength; ++i) {
+ if (Character.isSurrogate(mCopiedBuffer[i])) {
+ // All block separators are in BMP.
+ continue;
+ }
+ if (UCharacter.getDirection(mCopiedBuffer[i])
+ == UCharacterDirection.BLOCK_SEPARATOR) {
+ mCopiedBuffer[i] = OBJECT_REPLACEMENT_CHARACTER;
+ }
+ }
+ mBidi = new Bidi(mCopiedBuffer, 0, null, 0, mCopiedBuffer.length, bidiRequest);
+ }
+ mLevels.resize(mTextLength);
+ byte[] rawArray = mLevels.getRawArray();
+ for (int i = 0; i < mTextLength; ++i) {
+ rawArray[i] = mBidi.getLevelAt(i);
+ }
+ mLtrWithoutBidi = false;
}
private void applyReplacementRun(@NonNull ReplacementSpan replacement,
diff --git a/core/java/android/text/TextFlags.java b/core/java/android/text/TextFlags.java
index 9e02460..076721f 100644
--- a/core/java/android/text/TextFlags.java
+++ b/core/java/android/text/TextFlags.java
@@ -55,11 +55,6 @@
* List of text flags to be transferred to the application process.
*/
public static final String[] TEXT_ACONFIGS_FLAGS = {
- Flags.FLAG_NO_BREAK_NO_HYPHENATION_SPAN,
- Flags.FLAG_PHRASE_STRICT_FALLBACK,
- Flags.FLAG_USE_BOUNDS_FOR_WIDTH,
- Flags.FLAG_FIX_LINE_HEIGHT_FOR_LOCALE,
- Flags.FLAG_ICU_BIDI_MIGRATION,
Flags.FLAG_FIX_MISALIGNED_CONTEXT_MENU,
};
@@ -69,11 +64,6 @@
* The order must be the same to the TEXT_ACONFIG_FLAGS.
*/
public static final boolean[] TEXT_ACONFIG_DEFAULT_VALUE = {
- Flags.noBreakNoHyphenationSpan(),
- Flags.phraseStrictFallback(),
- Flags.useBoundsForWidth(),
- Flags.fixLineHeightForLocale(),
- Flags.icuBidiMigration(),
Flags.fixMisalignedContextMenu(),
};
diff --git a/core/java/android/text/flags/24Q3.aconfig b/core/java/android/text/flags/24Q3.aconfig
new file mode 100644
index 0000000..7035fc8
--- /dev/null
+++ b/core/java/android/text/flags/24Q3.aconfig
@@ -0,0 +1,54 @@
+package: "com.android.text.flags"
+container: "system"
+
+# This aconfig file contains released flags in 24Q3 those cannot be removed.
+
+flag {
+ name: "use_bounds_for_width"
+ is_exported: true
+ namespace: "text"
+ description: "Feature flag for preventing horizontal clipping."
+ bug: "63938206"
+}
+
+flag {
+ name: "word_style_auto"
+ is_exported: true
+ namespace: "text"
+ description: "A feature flag that implements line break word style auto."
+ bug: "280005585"
+}
+
+flag {
+ name: "letter_spacing_justification"
+ is_exported: true
+ namespace: "text"
+ description: "A feature flag that implement inter character justification."
+ bug: "283193133"
+}
+
+flag {
+ name: "fix_line_height_for_locale"
+ is_exported: true
+ namespace: "text"
+ description: "Feature flag that preserve the line height of the TextView and EditText even if the the locale is different from Latin"
+ bug: "303326708"
+}
+
+flag {
+ name: "new_fonts_fallback_xml"
+ is_exported: true
+ namespace: "text"
+ description: "Feature flag for deprecating fonts.xml. By setting true for this feature flag, the new font configuration XML, /system/etc/font_fallback.xml is used. The new XML has a new syntax and flexibility of variable font declarations, but it is not compatible with the apps that reads fonts.xml. So, fonts.xml is maintained as a subset of the font_fallback.xml"
+ # Make read only, as it could be used before the Settings provider is initialized.
+ is_fixed_read_only: true
+ bug: "281769620"
+}
+
+flag {
+ name: "no_break_no_hyphenation_span"
+ is_exported: true
+ namespace: "text"
+ description: "A feature flag that adding new spans that prevents line breaking and hyphenation."
+ bug: "283193586"
+}
diff --git a/core/java/android/text/flags/flags.aconfig b/core/java/android/text/flags/flags.aconfig
index d33c95e..3c61f4f 100644
--- a/core/java/android/text/flags/flags.aconfig
+++ b/core/java/android/text/flags/flags.aconfig
@@ -2,47 +2,6 @@
container: "system"
flag {
- name: "vendor_custom_locale_fallback"
- namespace: "text"
- description: "A feature flag that adds custom locale fallback to the vendor customization XML. This enables vendors to add their locale specific fonts, e.g. Japanese font."
- is_fixed_read_only: true
- bug: "278768958"
-}
-
-flag {
- name: "new_fonts_fallback_xml"
- is_exported: true
- namespace: "text"
- description: "Feature flag for deprecating fonts.xml. By setting true for this feature flag, the new font configuration XML, /system/etc/font_fallback.xml is used. The new XML has a new syntax and flexibility of variable font declarations, but it is not compatible with the apps that reads fonts.xml. So, fonts.xml is maintained as a subset of the font_fallback.xml"
- # Make read only, as it could be used before the Settings provider is initialized.
- is_fixed_read_only: true
- bug: "281769620"
-}
-
-flag {
- name: "fix_double_underline"
- namespace: "text"
- description: "Feature flag for fixing double underline because of the multiple font used in the single line."
- bug: "297336724"
-}
-
-flag {
- name: "fix_line_height_for_locale"
- is_exported: true
- namespace: "text"
- description: "Feature flag that preserve the line height of the TextView and EditText even if the the locale is different from Latin"
- bug: "303326708"
-}
-
-flag {
- name: "no_break_no_hyphenation_span"
- is_exported: true
- namespace: "text"
- description: "A feature flag that adding new spans that prevents line breaking and hyphenation."
- bug: "283193586"
-}
-
-flag {
name: "use_optimized_boottime_font_loading"
namespace: "text"
description: "Feature flag ensuring that font is loaded once and asynchronously."
@@ -66,44 +25,6 @@
}
flag {
- name: "phrase_strict_fallback"
- namespace: "text"
- description: "Feature flag for automatic fallback from phrase based line break to strict line break."
- bug: "281970875"
-}
-
-flag {
- name: "use_bounds_for_width"
- is_exported: true
- namespace: "text"
- description: "Feature flag for preventing horizontal clipping."
- bug: "63938206"
-}
-
-flag {
- name: "deprecate_ui_fonts"
- namespace: "text"
- description: "Feature flag for deprecating UI fonts. By setting true for this feature flag, the elegant text height of will be turned on by default unless explicitly setting it to false by attribute or Java API call."
- bug: "279646685"
-}
-
-flag {
- name: "word_style_auto"
- is_exported: true
- namespace: "text"
- description: "A feature flag that implements line break word style auto."
- bug: "280005585"
-}
-
-flag {
- name: "letter_spacing_justification"
- is_exported: true
- namespace: "text"
- description: "A feature flag that implement inter character justification."
- bug: "283193133"
-}
-
-flag {
name: "escape_clears_focus"
namespace: "text"
description: "Feature flag for clearing focus when the escape key is pressed."
@@ -142,22 +63,6 @@
}
flag {
- name: "icu_bidi_migration"
- namespace: "text"
- description: "A flag for replacing AndroidBidi with android.icu.text.Bidi."
- bug: "317144801"
-}
-
-flag {
- name: "lazy_variation_instance"
- namespace: "text"
- description: "A flag for enabling lazy variation instance creation."
- # Make read only, as it could be used before the Settings provider is initialized.
- is_fixed_read_only: true
- bug: "324676775"
-}
-
-flag {
name: "handwriting_end_of_line_tap"
namespace: "text"
description: "Initiate handwriting when stylus taps at the end of a line in a focused non-empty TextView with the cursor at the end of that line"
diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java
index 0a73fd1..00545da 100644
--- a/core/java/android/util/EventLog.java
+++ b/core/java/android/util/EventLog.java
@@ -21,6 +21,10 @@
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
+import android.ravenwood.annotation.RavenwoodThrow;
import java.io.BufferedReader;
import java.io.FileReader;
@@ -48,9 +52,8 @@
* They carry a payload of one or more int, long, or String values. The
* event-log-tags file defines the payload contents for each type code.
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.EventLog_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("EventLog_host")
public class EventLog {
/** @hide */ public EventLog() {}
@@ -339,6 +342,7 @@
* @param value A value to log
* @return The number of bytes written
*/
+ @RavenwoodRedirect
public static native int writeEvent(int tag, int value);
/**
@@ -347,6 +351,7 @@
* @param value A value to log
* @return The number of bytes written
*/
+ @RavenwoodRedirect
public static native int writeEvent(int tag, long value);
/**
@@ -355,6 +360,7 @@
* @param value A value to log
* @return The number of bytes written
*/
+ @RavenwoodRedirect
public static native int writeEvent(int tag, float value);
/**
@@ -363,6 +369,7 @@
* @param str A value to log
* @return The number of bytes written
*/
+ @RavenwoodRedirect
public static native int writeEvent(int tag, String str);
/**
@@ -371,6 +378,7 @@
* @param list A list of values to log
* @return The number of bytes written
*/
+ @RavenwoodRedirect
public static native int writeEvent(int tag, Object... list);
/**
@@ -379,6 +387,7 @@
* @param output container to add events into
* @throws IOException if something goes wrong reading events
*/
+ @RavenwoodThrow
public static native void readEvents(int[] tags, Collection<Event> output)
throws IOException;
@@ -391,6 +400,7 @@
* @hide
*/
@SystemApi
+ @RavenwoodThrow
public static native void readEventsOnWrapping(int[] tags, long timestamp,
Collection<Event> output)
throws IOException;
diff --git a/core/java/android/util/Slog.java b/core/java/android/util/Slog.java
index 9ecb4cb..b2017a5 100644
--- a/core/java/android/util/Slog.java
+++ b/core/java/android/util/Slog.java
@@ -224,7 +224,6 @@
/**
* Similar to {@link #wtf(String, String)}, but does not output anything to the log.
*/
- @android.ravenwood.annotation.RavenwoodThrow
public static void wtfQuiet(@Nullable String tag, @NonNull String msg) {
Log.wtfQuiet(Log.LOG_ID_SYSTEM, tag, msg, true);
}
@@ -243,7 +242,6 @@
* @see Log#wtfStack(String, String)
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- @android.ravenwood.annotation.RavenwoodThrow
public static int wtfStack(@Nullable String tag, @NonNull String msg) {
return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null, true, true);
}
diff --git a/core/java/android/view/IRecentsAnimationController.aidl b/core/java/android/view/IRecentsAnimationController.aidl
deleted file mode 100644
index 55ad4ae..0000000
--- a/core/java/android/view/IRecentsAnimationController.aidl
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.view;
-
-import android.app.ActivityManager;
-import android.graphics.GraphicBuffer;
-import android.view.IRemoteAnimationFinishedCallback;
-import android.view.RemoteAnimationTarget;
-import android.view.SurfaceControl;
-import android.window.PictureInPictureSurfaceTransaction;
-import android.window.TaskSnapshot;
-import android.window.WindowAnimationState;
-
-import com.android.internal.os.IResultReceiver;
-
-/**
- * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the
- * runner control certain aspects of the recents animation, and to notify window manager when the
- * animation has completed.
- *
- * {@hide}
- */
-interface IRecentsAnimationController {
-
- /**
- * Takes a screenshot of the task associated with the given {@param taskId}. Only valid for the
- * current set of task ids provided to the handler.
- */
- TaskSnapshot screenshotTask(int taskId);
-
- /**
- * Sets the final surface transaction on a Task. This is used by Launcher to notify the system
- * that animating Activity to PiP has completed and the associated task surface should be
- * updated accordingly. This should be called before `finish`
- * @param taskId for which the leash should be updated
- * @param finishTransaction leash operations for the final transform.
- * @param overlay the surface control for an overlay being shown above the pip (can be null)
- */
- void setFinishTaskTransaction(int taskId,
- in PictureInPictureSurfaceTransaction finishTransaction, in SurfaceControl overlay);
-
- /**
- * Notifies to the system that the animation into Recents should end, and all leashes associated
- * with remote animation targets should be relinquished. If {@param moveHomeToTop} is true, then
- * the home activity should be moved to the top. Otherwise, the home activity is hidden and the
- * user is returned to the app.
- * @param sendUserLeaveHint If set to true, {@link Activity#onUserLeaving} will be sent to the
- * top resumed app, false otherwise.
- */
- @UnsupportedAppUsage
- void finish(boolean moveHomeToTop, boolean sendUserLeaveHint, in IResultReceiver finishCb);
-
- /**
- * Called by the handler to indicate that the recents animation input consumer should be
- * enabled. This is currently used to work around an issue where registering an input consumer
- * mid-animation causes the existing motion event chain to be canceled. Instead, the caller
- * may register the recents animation input consumer prior to starting the recents animation
- * and then enable it mid-animation to start receiving touch events.
- */
- @UnsupportedAppUsage
- void setInputConsumerEnabled(boolean enabled);
-
- /**
- * Informs the system whether the animation targets passed into
- * IRecentsAnimationRunner.onAnimationStart are currently behind the system bars. If they are,
- * they can control the SystemUI flags, otherwise the SystemUI flags from home activity will be
- * taken.
- */
- @UnsupportedAppUsage
- void setAnimationTargetsBehindSystemBars(boolean behindSystemBars);
-
- /**
- * Clean up the screenshot of previous task which was created during recents animation that
- * was cancelled by a stack order change.
- *
- * @see {@link IRecentsAnimationRunner#onAnimationCanceled}
- */
- void cleanupScreenshot();
-
- /**
- * Set a state for controller whether would like to cancel recents animations with deferred
- * task screenshot presentation.
- *
- * When we cancel the recents animation due to a stack order change, we can't just cancel it
- * immediately as it would lead to a flicker in Launcher if we just remove the task from the
- * leash. Instead we screenshot the previous task and replace the child of the leash with the
- * screenshot, so that Launcher can still control the leash lifecycle & make the next app
- * transition animate smoothly without flickering.
- *
- * @param defer When set {@code true}, means that the recents animation will defer canceling the
- * animation when a stack order change is triggered until the subsequent app
- * transition start and skip previous task's animation.
- * When set to {@code false}, means that the recents animation will be canceled
- * immediately when the stack order changes.
- * @param screenshot When set {@code true}, means that the system will take previous task's
- * screenshot and replace the contents of the leash with it when the next app
- * transition starting. The runner must call #cleanupScreenshot() to end the
- * recents animation.
- * When set to {@code false}, means that the system will simply wait for the
- * next app transition start to immediately cancel the recents animation. This
- * can be useful when you want an immediate transition into a state where the
- * task is shown in the home/recents activity (without waiting for a
- * screenshot).
- *
- * @see #cleanupScreenshot()
- * @see IRecentsAnimationRunner#onCancelled
- */
- void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot);
-
- /**
- * Sets a state for controller to decide which surface is the destination when the recents
- * animation is cancelled through fail safe mechanism.
- */
- void setWillFinishToHome(boolean willFinishToHome);
-
- /**
- * Stops controlling a task that is currently controlled by this recents animation.
- *
- * This method should be called when a task that has been received via {@link #onAnimationStart}
- * or {@link #onTaskAppeared} is no longer needed. After calling this method, the task will
- * either disappear from the screen, or jump to its final position in case it was the top task.
- *
- * @param taskId Id of the Task target to remove
- * @return {@code true} when target removed successfully, {@code false} otherwise.
- */
- boolean removeTask(int taskId);
-
- /**
- * Detach navigation bar from app.
- *
- * The system reparents the leash of navigation bar to the app when the recents animation starts
- * and Launcher should call this method to let system restore the navigation bar to its
- * original position when the quick switch gesture is finished and will run the fade-in
- * animation If {@param moveHomeToTop} is {@code true}. Otherwise, restore the navigtation bar
- * without animation.
- *
- * @param moveHomeToTop if {@code true}, the home activity should be moved to the top.
- * Otherwise, the home activity is hidden and the user is returned to the
- * app.
- */
- void detachNavigationBarFromApp(boolean moveHomeToTop);
-
- /**
- * Used for animating the navigation bar during app launch from recents in live tile mode.
- *
- * First fade out the navigation bar at the bottom of the display and then fade in to the app.
- *
- * @param duration the duration of the app launch animation
- */
- void animateNavigationBarToApp(long duration);
-
- /**
- * Hand off the ongoing animation of a set of remote targets, to be run by another handler using
- * the given starting parameters.
- *
- * Once the handoff is complete, operations on the old leashes for the given targets as well as
- * callbacks will become no-ops.
- *
- * The number of targets MUST match the number of states, and each state MUST match the target
- * at the same index.
- */
- oneway void handOffAnimation(in RemoteAnimationTarget[] targets,
- in WindowAnimationState[] states);
-}
diff --git a/core/java/android/view/PointerIcon.java b/core/java/android/view/PointerIcon.java
index 815fd1c..dd950e8 100644
--- a/core/java/android/view/PointerIcon.java
+++ b/core/java/android/view/PointerIcon.java
@@ -540,8 +540,6 @@
// Assumes they have the exact duration.
mDurationPerFrame = animationDrawable.getDuration(0);
mBitmapFrames = new Bitmap[frames - 1];
- final int width = drawable.getIntrinsicWidth();
- final int height = drawable.getIntrinsicHeight();
final boolean isVectorAnimation = drawable instanceof VectorDrawable;
mDrawNativeDropShadow = isVectorAnimation;
for (int i = 1; i < frames; ++i) {
@@ -556,9 +554,6 @@
+ "is a different type from the others. All frames should be the "
+ "same type.");
}
- // TODO(b/361232935): Check when bitmap size of the ith frame is different
- // drawableFrame.getIntrinsicWidth() != width ||
- // drawableFrame.getIntrinsicHeight() != height
if (isVectorAnimation) {
drawableFrame = getBitmapDrawableFromVectorDrawable(resources,
(VectorDrawable) drawableFrame, pointerScale);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 7b4ea41..0ed0e60 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -371,7 +371,7 @@
* </tr>
* <tr>
* <td><code>{@link #onTouchEvent(MotionEvent)}</code></td>
- * <td>Called when a touch screen motion event occurs.
+ * <td>Called when a motion event occurs with pointers down on the view.
* </td>
* </tr>
* <tr>
@@ -17873,7 +17873,13 @@
}
/**
- * Implement this method to handle touch screen motion events.
+ * Implement this method to handle pointer events.
+ * <p>
+ * This method is called to handle motion events where pointers are down on
+ * the view. For example, this could include touchscreen touches, stylus
+ * touches, or click-and-drag events from a mouse. However, it is not called
+ * for motion events that do not involve pointers being down, such as hover
+ * events or mouse scroll wheel movements.
* <p>
* If this method is used to detect click actions, it is recommended that
* the actions be performed by implementing and calling
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 3b5286a..2237417 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -4504,6 +4504,11 @@
final View[] children = mChildren;
for (int i = 0; i < count; i++) {
final View child = children[i];
+ if (child == null) {
+ throw new IllegalStateException(getClass().getSimpleName() + " contains null " +
+ "child at index " + i + " when traversal in dispatchGetDisplayList," +
+ " the view may have been removed.");
+ }
if (((child.mViewFlags & VISIBILITY_MASK) == VISIBLE || child.getAnimation() != null)) {
recreateChildDisplayList(child);
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index f021bdf..e10cc28 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -4345,6 +4345,7 @@
handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
mPendingTransaction, "view not visible");
+ mHasPendingTransactions = false;
} else if (cancelAndRedraw) {
if (!mWasLastDrawCanceled) {
logAndTrace("Canceling draw."
@@ -4372,6 +4373,7 @@
if (!performDraw(mActiveSurfaceSyncGroup)) {
handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
mPendingTransaction, mLastPerformDrawSkippedReason);
+ mHasPendingTransactions = false;
}
}
mWasLastDrawCanceled = cancelAndRedraw;
@@ -4388,7 +4390,14 @@
mReportNextDraw = false;
mLastReportNextDrawReason = null;
mActiveSurfaceSyncGroup = null;
- mHasPendingTransactions = false;
+ if (mHasPendingTransactions) {
+ // TODO: We shouldn't ever actually hit this, it means mPendingTransaction wasn't
+ // merged with a sync group or BLASTBufferQueue before making it to this point
+ // But better a one or two frame flicker than steady-state broken from dropping
+ // whatever is in this transaction
+ mPendingTransaction.apply();
+ mHasPendingTransactions = false;
+ }
mSyncBuffer = false;
if (isInWMSRequestedSync()) {
mWmsRequestSyncGroup.markSyncReady();
@@ -5305,6 +5314,7 @@
private void registerCallbackForPendingTransactions() {
Transaction t = new Transaction();
t.merge(mPendingTransaction);
+ mHasPendingTransactions = false;
registerRtFrameCallback(new FrameDrawingCallback() {
@Override
@@ -5384,6 +5394,7 @@
if (!usingAsyncReport && mHasPendingTransactions) {
pendingTransaction = new Transaction();
pendingTransaction.merge(mPendingTransaction);
+ mHasPendingTransactions = false;
} else {
pendingTransaction = null;
}
@@ -9942,6 +9953,7 @@
}
handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
mPendingTransaction, "shutting down VRI");
+ mHasPendingTransactions = false;
WindowManagerGlobal.getInstance().doRemoveView(this);
}
@@ -12601,6 +12613,7 @@
if (mHasPendingTransactions) {
t = new Transaction();
t.merge(mPendingTransaction);
+ mHasPendingTransactions = false;
} else {
t = null;
}
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 67a207e..5b39f62 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -107,6 +107,7 @@
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
+import android.graphics.Insets;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.Rect;
@@ -2371,7 +2372,7 @@
public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
/**
- * Window type: the drag-and-drop pseudowindow. There is only one
+ * Window type: the drag-and-drop pseudowindow. There is only one
* drag layer (at most), and it is placed on top of all other windows.
* In multiuser systems shows only on the owning user's window.
* @hide
@@ -2381,7 +2382,7 @@
/**
* Window type: panel that slides out from over the status bar
* In multiuser systems shows on all users' windows. These windows
- * are displayed on top of the stauts bar and any {@link #TYPE_STATUS_BAR_PANEL}
+ * are displayed on top of the status bar and any {@link #TYPE_STATUS_BAR_PANEL}
* windows.
* @hide
*/
@@ -4649,6 +4650,30 @@
public InsetsFrameProvider[] providedInsets;
/**
+ * Sets the insets to be provided by the window.
+ *
+ * @param insetsParams The parameters for the insets to be provided by the window.
+ *
+ * @hide
+ */
+ @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_STATUS_BAR_AND_INSETS)
+ @SystemApi
+ public void setInsetsParams(@NonNull List<InsetsParams> insetsParams) {
+ if (insetsParams.isEmpty()) {
+ providedInsets = null;
+ } else {
+ providedInsets = new InsetsFrameProvider[insetsParams.size()];
+ for (int i = 0; i < insetsParams.size(); ++i) {
+ final InsetsParams params = insetsParams.get(i);
+ providedInsets[i] =
+ new InsetsFrameProvider(/* owner= */ this, /* index= */ i,
+ params.getType())
+ .setInsetsSize(params.getInsetsSize());
+ }
+ }
+ }
+
+ /**
* Specifies which {@link InsetsType}s should be forcibly shown. The types shown by this
* method won't affect the app's layout. This field only takes effects if the caller has
* {@link android.Manifest.permission#STATUS_BAR_SERVICE} or the caller has the same uid as
@@ -6117,6 +6142,56 @@
}
/**
+ * Specifies the parameters of the insets provided by a window.
+ *
+ * @see WindowManager.LayoutParams#setInsetsParams(List)
+ * @see android.graphics.Insets
+ *
+ * @hide
+ */
+ @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_STATUS_BAR_AND_INSETS)
+ @SystemApi
+ public static class InsetsParams {
+
+ private final @InsetsType int mType;
+ private @Nullable Insets mInsets;
+
+ /**
+ * Creates an instance of InsetsParams.
+ *
+ * @param type the type of insets to provide, e.g. {@link WindowInsets.Type#statusBars()}.
+ * @see WindowInsets.Type
+ */
+ public InsetsParams(@InsetsType int type) {
+ mType = type;
+ }
+
+ /**
+ * Sets the size of the provided insets. If {@code null}, then the provided insets will
+ * have the same size as the window frame.
+ */
+ public @NonNull InsetsParams setInsetsSize(@Nullable Insets insets) {
+ mInsets = insets;
+ return this;
+ }
+
+ /**
+ * Returns the type of provided insets.
+ */
+ public @InsetsType int getType() {
+ return mType;
+ }
+
+ /**
+ * Returns the size of the provided insets. May be {@code null} if the provided insets have
+ * the same size as the window frame.
+ */
+ public @Nullable Insets getInsetsSize() {
+ return mInsets;
+ }
+ }
+
+ /**
* Holds the WM lock for the specified amount of milliseconds.
* Intended for use by the tests that need to imitate lock contention.
* The token should be obtained by
diff --git a/core/java/android/view/accessibility/AccessibilityManager.java b/core/java/android/view/accessibility/AccessibilityManager.java
index a87e5c8..2b7cf42 100644
--- a/core/java/android/view/accessibility/AccessibilityManager.java
+++ b/core/java/android/view/accessibility/AccessibilityManager.java
@@ -1774,7 +1774,8 @@
}
/**
- * Notifies that the accessibility button in the system's navigation area has been clicked
+ * Notifies that the accessibility button in the system's navigation area has been clicked,
+ * or a gesture shortcut input has been performed.
*
* @param displayId The logical display id.
* @hide
@@ -1785,7 +1786,8 @@
}
/**
- * Perform the accessibility button for the given target which is assigned to the button.
+ * Perform the accessibility button or gesture
+ * for the given target which is assigned to the button.
*
* @param displayId displayId The logical display id.
* @param targetName The flattened {@link ComponentName} string or the class name of a system
@@ -1810,6 +1812,31 @@
}
/**
+ * Notifies that a shortcut was long-clicked.
+ * This displays the dialog used to select which target the given shortcut will use,
+ * from its list of targets.
+ * The current shortcut type is determined by the current navigation mode.
+ *
+ * @param displayId The id of the display to show the dialog on.
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.STATUS_BAR_SERVICE)
+ public void notifyAccessibilityButtonLongClicked(int displayId) {
+ final IAccessibilityManager service;
+ synchronized (mLock) {
+ service = getServiceLocked();
+ if (service == null) {
+ return;
+ }
+ }
+ try {
+ service.notifyAccessibilityButtonLongClicked(displayId);
+ } catch (RemoteException re) {
+ Log.e(LOG_TAG, "Error while dispatching accessibility button long click. ", re);
+ }
+ }
+
+ /**
* Notifies that the visibility of the accessibility button in the system's navigation area
* has changed.
*
diff --git a/core/java/android/view/accessibility/IAccessibilityManager.aidl b/core/java/android/view/accessibility/IAccessibilityManager.aidl
index 2de3ce8..e04fa15 100644
--- a/core/java/android/view/accessibility/IAccessibilityManager.aidl
+++ b/core/java/android/view/accessibility/IAccessibilityManager.aidl
@@ -88,6 +88,8 @@
@EnforcePermission("STATUS_BAR_SERVICE")
void notifyAccessibilityButtonClicked(int displayId, String targetName);
+ @EnforcePermission("STATUS_BAR_SERVICE")
+ void notifyAccessibilityButtonLongClicked(int displayId);
@EnforcePermission("STATUS_BAR_SERVICE")
void notifyAccessibilityButtonVisibilityChanged(boolean available);
diff --git a/core/java/android/webkit/UserPackage.java b/core/java/android/webkit/UserPackage.java
index 1da2af4..b18dbbc 100644
--- a/core/java/android/webkit/UserPackage.java
+++ b/core/java/android/webkit/UserPackage.java
@@ -15,12 +15,14 @@
*/
package android.webkit;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.UserInfo;
+import android.content.pm.PackageManager;
import android.os.Build;
+import android.os.UserHandle;
import android.os.UserManager;
import java.util.ArrayList;
@@ -31,30 +33,31 @@
* @hide
*/
public class UserPackage {
- private final UserInfo mUserInfo;
+ private final UserHandle mUser;
private final PackageInfo mPackageInfo;
public static final int MINIMUM_SUPPORTED_SDK = Build.VERSION_CODES.TIRAMISU;
- public UserPackage(UserInfo user, PackageInfo packageInfo) {
- this.mUserInfo = user;
- this.mPackageInfo = packageInfo;
+ public UserPackage(@NonNull UserHandle user, @Nullable PackageInfo packageInfo) {
+ mUser = user;
+ mPackageInfo = packageInfo;
}
/**
* Returns a list of (User,PackageInfo) pairs corresponding to the PackageInfos for all
* device users for the package named {@param packageName}.
*/
- public static List<UserPackage> getPackageInfosAllUsers(Context context,
- String packageName, int packageFlags) {
- List<UserInfo> users = getAllUsers(context);
+ public static @NonNull List<UserPackage> getPackageInfosAllUsers(@NonNull Context context,
+ @NonNull String packageName, int packageFlags) {
+ UserManager userManager = context.getSystemService(UserManager.class);
+ List<UserHandle> users = userManager.getUserHandles(false);
List<UserPackage> userPackages = new ArrayList<UserPackage>(users.size());
- for (UserInfo user : users) {
+ for (UserHandle user : users) {
+ PackageManager pm = context.createContextAsUser(user, 0).getPackageManager();
PackageInfo packageInfo = null;
try {
- packageInfo = context.getPackageManager().getPackageInfoAsUser(
- packageName, packageFlags, user.id);
- } catch (NameNotFoundException e) {
+ packageInfo = pm.getPackageInfo(packageName, packageFlags);
+ } catch (PackageManager.NameNotFoundException e) {
}
userPackages.add(new UserPackage(user, packageInfo));
}
@@ -88,18 +91,11 @@
return packageInfo.applicationInfo.targetSdkVersion >= MINIMUM_SUPPORTED_SDK;
}
- public UserInfo getUserInfo() {
- return mUserInfo;
+ public UserHandle getUser() {
+ return mUser;
}
public PackageInfo getPackageInfo() {
return mPackageInfo;
}
-
-
- private static List<UserInfo> getAllUsers(Context context) {
- UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
- return userManager.getUsers();
- }
-
}
diff --git a/core/java/android/webkit/WebViewDelegate.java b/core/java/android/webkit/WebViewDelegate.java
index 8501474..4c5802c 100644
--- a/core/java/android/webkit/WebViewDelegate.java
+++ b/core/java/android/webkit/WebViewDelegate.java
@@ -137,9 +137,13 @@
*/
@Deprecated
public void detachDrawGlFunctor(View containerView, long nativeDrawGLFunctor) {
- ViewRootImpl viewRootImpl = containerView.getViewRootImpl();
- if (nativeDrawGLFunctor != 0 && viewRootImpl != null) {
- viewRootImpl.detachFunctor(nativeDrawGLFunctor);
+ if (Flags.mainlineApis()) {
+ throw new UnsupportedOperationException();
+ } else {
+ ViewRootImpl viewRootImpl = containerView.getViewRootImpl();
+ if (nativeDrawGLFunctor != 0 && viewRootImpl != null) {
+ viewRootImpl.detachFunctor(nativeDrawGLFunctor);
+ }
}
}
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index eb35817..89ea852 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -153,6 +153,7 @@
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
+import java.util.function.Function;
import java.util.function.Predicate;
/**
@@ -712,6 +713,24 @@
}
public abstract void writeToParcel(Parcel dest, int flags);
+
+ /**
+ * Override to return true if this Action can be serialized to Protobuf, and implement
+ * writeToProto / createFromProto.
+ *
+ * If this returns false, then the action will be omitted from RemoteViews previews created
+ * with createPreviewFromProto / writePreviewToProto.
+ *
+ * Because Parcelables should not be serialized to disk, any action that contains an Intent,
+ * PendingIntent, or Bundle should return false here.
+ */
+ public boolean canWriteToProto() {
+ return false;
+ }
+
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ throw new UnsupportedOperationException();
+ }
}
/**
@@ -1447,6 +1466,11 @@
}
@Override
+ public void onNullBinding(ComponentName name) {
+ context.unbindService(this);
+ }
+
+ @Override
public void onServiceDisconnected(ComponentName componentName) { }
});
@@ -1501,6 +1525,7 @@
switch (in.getFieldNumber()) {
case (int) RemoteViewsProto.RemoteCollectionCache.ENTRIES:
final LongSparseArray<Object> entry = new LongSparseArray<>();
+
final long entryToken = in.start(
RemoteViewsProto.RemoteCollectionCache.ENTRIES);
while (in.nextField() != NO_MORE_FIELDS) {
@@ -1528,10 +1553,12 @@
}
}
in.end(entryToken);
+
checkContainsKeys(entry,
new long[]{RemoteViewsProto.RemoteCollectionCache.Entry.ID,
RemoteViewsProto.RemoteCollectionCache.Entry.URI,
RemoteViewsProto.RemoteCollectionCache.Entry.ITEMS});
+
entries.add(entry);
break;
default:
@@ -2242,6 +2269,62 @@
public int getActionTag() {
return BITMAP_REFLECTION_ACTION_TAG;
}
+
+ @Override
+ public boolean canWriteToProto() {
+ return true;
+ }
+
+ @Override
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ final long token = out.start(RemoteViewsProto.Action.BITMAP_REFLECTION_ACTION);
+ out.write(RemoteViewsProto.BitmapReflectionAction.VIEW_ID,
+ appResources.getResourceName(mViewId));
+ out.write(RemoteViewsProto.BitmapReflectionAction.METHOD_NAME, mMethodName);
+ out.write(RemoteViewsProto.BitmapReflectionAction.BITMAP_ID, mBitmapId);
+ out.end(token);
+ }
+ }
+
+ private PendingResources<Action> createFromBitmapReflectionActionFromProto(ProtoInputStream in)
+ throws Exception {
+ final LongSparseArray<Object> values = new LongSparseArray<>();
+
+ final long token = in.start(RemoteViewsProto.Action.BITMAP_REFLECTION_ACTION);
+ while (in.nextField() != NO_MORE_FIELDS) {
+ switch (in.getFieldNumber()) {
+ case (int) RemoteViewsProto.BitmapReflectionAction.VIEW_ID:
+ values.put(RemoteViewsProto.BitmapReflectionAction.VIEW_ID,
+ in.readString(RemoteViewsProto.BitmapReflectionAction.VIEW_ID));
+ break;
+ case (int) RemoteViewsProto.BitmapReflectionAction.METHOD_NAME:
+ values.put(RemoteViewsProto.BitmapReflectionAction.METHOD_NAME,
+ in.readString(RemoteViewsProto.BitmapReflectionAction.METHOD_NAME));
+ break;
+ case (int) RemoteViewsProto.BitmapReflectionAction.BITMAP_ID:
+ values.put(RemoteViewsProto.BitmapReflectionAction.BITMAP_ID,
+ in.readInt(RemoteViewsProto.BitmapReflectionAction.BITMAP_ID));
+ break;
+ default:
+ Log.w(LOG_TAG, "Unhandled field while reading RemoteViews proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+ in.end(token);
+
+ checkContainsKeys(values, new long[]{RemoteViewsProto.BitmapReflectionAction.VIEW_ID,
+ RemoteViewsProto.BitmapReflectionAction.METHOD_NAME});
+
+ return (context, resources, rootData, depth) -> {
+ int viewId = getAsIdentifier(resources, values,
+ RemoteViewsProto.BitmapReflectionAction.VIEW_ID);
+ return new BitmapReflectionAction(viewId,
+ (String) values.get(RemoteViewsProto.BitmapReflectionAction.METHOD_NAME),
+ rootData.mBitmapCache.getBitmapForId(
+ (int) values.get(RemoteViewsProto.BitmapReflectionAction.BITMAP_ID,
+ 0)));
+ };
+
}
/**
@@ -2555,6 +2638,268 @@
public int getActionTag() {
return REFLECTION_ACTION_TAG;
}
+
+ @Override
+ public boolean canWriteToProto() {
+ return true;
+ }
+
+ @Override
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ final long token = out.start(RemoteViewsProto.Action.REFLECTION_ACTION);
+ out.write(RemoteViewsProto.ReflectionAction.VIEW_ID,
+ appResources.getResourceName(mViewId));
+ out.write(RemoteViewsProto.ReflectionAction.METHOD_NAME, mMethodName);
+ out.write(RemoteViewsProto.ReflectionAction.PARAMETER_TYPE, mType);
+ if (this.mValue != null) {
+ switch (this.mType) {
+ case BOOLEAN:
+ // ProtoOutputStream will omit this write if the value is false
+ out.write(RemoteViewsProto.ReflectionAction.BOOLEAN_VALUE,
+ (boolean) this.mValue);
+ break;
+ case BYTE:
+ out.write(RemoteViewsProto.ReflectionAction.BYTE_VALUE,
+ new byte[]{(byte) this.mValue});
+ break;
+ case SHORT:
+ out.write(RemoteViewsProto.ReflectionAction.SHORT_VALUE,
+ (short) this.mValue);
+ break;
+ case INT:
+ out.write(RemoteViewsProto.ReflectionAction.INT_VALUE, (int) this.mValue);
+ break;
+ case LONG:
+ out.write(RemoteViewsProto.ReflectionAction.LONG_VALUE, (long) this.mValue);
+ break;
+ case FLOAT:
+ out.write(RemoteViewsProto.ReflectionAction.FLOAT_VALUE,
+ (float) this.mValue);
+ break;
+ case DOUBLE:
+ out.write(RemoteViewsProto.ReflectionAction.DOUBLE_VALUE,
+ (double) this.mValue);
+ break;
+ case CHAR:
+ out.write(RemoteViewsProto.ReflectionAction.CHAR_VALUE,
+ (Character) this.mValue);
+ break;
+ case STRING:
+ out.write(RemoteViewsProto.ReflectionAction.STRING_VALUE,
+ (String) this.mValue);
+ break;
+ case CHAR_SEQUENCE:
+ long csToken = out.start(
+ RemoteViewsProto.ReflectionAction.CHAR_SEQUENCE_VALUE);
+ RemoteViewsSerializers.writeCharSequenceToProto(out,
+ (CharSequence) this.mValue);
+ out.end(csToken);
+ break;
+ case URI:
+ out.write(RemoteViewsProto.ReflectionAction.URI_VALUE,
+ ((Uri) this.mValue).toString());
+ break;
+ case BITMAP:
+ final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ((Bitmap) this.mValue).compress(Bitmap.CompressFormat.WEBP_LOSSLESS, 100,
+ bytes);
+ out.write(RemoteViewsProto.ReflectionAction.BITMAP_VALUE,
+ bytes.toByteArray());
+ break;
+ case BLEND_MODE:
+ out.write(RemoteViewsProto.ReflectionAction.BLEND_MODE_VALUE,
+ BlendMode.toValue((BlendMode) this.mValue));
+ break;
+ case COLOR_STATE_LIST:
+ writeColorStateListToProto(out, (ColorStateList) this.mValue,
+ RemoteViewsProto.ReflectionAction.COLOR_STATE_LIST_VALUE);
+ break;
+ case ICON:
+ writeIconToProto(out, appResources, (Icon) this.mValue,
+ RemoteViewsProto.ReflectionAction.ICON_VALUE);
+ break;
+ case BUNDLE:
+ case INTENT:
+ default:
+ break;
+ }
+ }
+ out.end(token);
+ }
+
+ public static PendingResources<Action> createFromProto(ProtoInputStream in)
+ throws Exception {
+ final LongSparseArray<Object> values = new LongSparseArray<>();
+
+ final long token = in.start(RemoteViewsProto.Action.REFLECTION_ACTION);
+ while (in.nextField() != NO_MORE_FIELDS) {
+ switch (in.getFieldNumber()) {
+ case (int) RemoteViewsProto.ReflectionAction.VIEW_ID:
+ values.put(RemoteViewsProto.ReflectionAction.VIEW_ID,
+ in.readString(RemoteViewsProto.ReflectionAction.VIEW_ID));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.METHOD_NAME:
+ values.put(RemoteViewsProto.ReflectionAction.METHOD_NAME,
+ in.readString(RemoteViewsProto.ReflectionAction.METHOD_NAME));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.PARAMETER_TYPE:
+ values.put(RemoteViewsProto.ReflectionAction.PARAMETER_TYPE,
+ in.readInt(RemoteViewsProto.ReflectionAction.PARAMETER_TYPE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.BOOLEAN_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.BOOLEAN_VALUE,
+ in.readBoolean(RemoteViewsProto.ReflectionAction.BOOLEAN_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.BYTE_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.BYTE_VALUE,
+ in.readBytes(RemoteViewsProto.ReflectionAction.BYTE_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.SHORT_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.SHORT_VALUE,
+ (short) in.readInt(RemoteViewsProto.ReflectionAction.SHORT_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.INT_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.INT_VALUE,
+ in.readInt(RemoteViewsProto.ReflectionAction.INT_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.LONG_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.LONG_VALUE,
+ in.readLong(RemoteViewsProto.ReflectionAction.LONG_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.FLOAT_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.FLOAT_VALUE,
+ in.readFloat(RemoteViewsProto.ReflectionAction.FLOAT_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.DOUBLE_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.DOUBLE_VALUE,
+ in.readDouble(RemoteViewsProto.ReflectionAction.DOUBLE_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.CHAR_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.CHAR_VALUE,
+ (char) in.readInt(RemoteViewsProto.ReflectionAction.CHAR_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.STRING_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.STRING_VALUE,
+ in.readString(RemoteViewsProto.ReflectionAction.STRING_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.CHAR_SEQUENCE_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.CHAR_SEQUENCE_VALUE,
+ createCharSequenceFromProto(in,
+ RemoteViewsProto.ReflectionAction.CHAR_SEQUENCE_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.URI_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.URI_VALUE,
+ in.readString(RemoteViewsProto.ReflectionAction.URI_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.BITMAP_VALUE:
+ byte[] bitmapData = in.readBytes(
+ RemoteViewsProto.ReflectionAction.BITMAP_VALUE);
+ values.put(RemoteViewsProto.ReflectionAction.BITMAP_VALUE,
+ BitmapFactory.decodeByteArray(bitmapData, 0, bitmapData.length));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.COLOR_STATE_LIST_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.COLOR_STATE_LIST_VALUE,
+ createColorStateListFromProto(in,
+ RemoteViewsProto.ReflectionAction.COLOR_STATE_LIST_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.ICON_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.ICON_VALUE,
+ createIconFromProto(in,
+ RemoteViewsProto.ReflectionAction.ICON_VALUE));
+ break;
+ case (int) RemoteViewsProto.ReflectionAction.BLEND_MODE_VALUE:
+ values.put(RemoteViewsProto.ReflectionAction.BLEND_MODE_VALUE,
+ BlendMode.fromValue(in.readInt(
+ RemoteViewsProto.ReflectionAction.BLEND_MODE_VALUE)));
+ break;
+ default:
+ Log.w(LOG_TAG, "Unhandled field while reading RemoteViews proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+ in.end(token);
+
+ checkContainsKeys(values, new long[]{RemoteViewsProto.ReflectionAction.VIEW_ID,
+ RemoteViewsProto.ReflectionAction.METHOD_NAME,
+ RemoteViewsProto.ReflectionAction.PARAMETER_TYPE});
+
+ return (context, resources, rootData, depth) -> {
+ int viewId = getAsIdentifier(resources, values,
+ RemoteViewsProto.ReflectionAction.VIEW_ID);
+ Object value = null;
+ int parameterType = (int) values.get(
+ RemoteViewsProto.ReflectionAction.PARAMETER_TYPE);
+ switch (parameterType) {
+ case BOOLEAN:
+ value = (boolean) values.get(
+ RemoteViewsProto.ReflectionAction.BOOLEAN_VALUE, false);
+ break;
+ case BYTE:
+ byte[] bytes = (byte[]) values.get(
+ RemoteViewsProto.ReflectionAction.BYTE_VALUE);
+ if (bytes != null && bytes.length > 0) {
+ value = bytes[0];
+ }
+ break;
+ case SHORT:
+ value = (short) values.get(RemoteViewsProto.ReflectionAction.SHORT_VALUE,
+ 0);
+ break;
+ case INT:
+ value = (int) values.get(RemoteViewsProto.ReflectionAction.INT_VALUE, 0);
+ break;
+ case LONG:
+ value = (long) values.get(RemoteViewsProto.ReflectionAction.LONG_VALUE, 0);
+ break;
+ case FLOAT:
+ value = (float) values.get(RemoteViewsProto.ReflectionAction.FLOAT_VALUE,
+ 0);
+ break;
+ case DOUBLE:
+ value = (double) values.get(RemoteViewsProto.ReflectionAction.DOUBLE_VALUE,
+ 0);
+ break;
+ case CHAR:
+ value = (char) values.get(RemoteViewsProto.ReflectionAction.CHAR_VALUE, 0);
+ break;
+ case STRING:
+ value = (String) values.get(RemoteViewsProto.ReflectionAction.STRING_VALUE);
+ break;
+ case CHAR_SEQUENCE:
+ value = (CharSequence) values.get(
+ RemoteViewsProto.ReflectionAction.CHAR_SEQUENCE_VALUE);
+ break;
+ case URI:
+ value = Uri.parse(
+ (String) values.get(RemoteViewsProto.ReflectionAction.URI_VALUE));
+ break;
+ case BITMAP:
+ value = (Bitmap) values.get(RemoteViewsProto.ReflectionAction.BITMAP_VALUE);
+ break;
+ case BLEND_MODE:
+ value = (BlendMode) values.get(
+ RemoteViewsProto.ReflectionAction.BLEND_MODE_VALUE);
+ break;
+ case COLOR_STATE_LIST:
+ value = (ColorStateList) values.get(
+ RemoteViewsProto.ReflectionAction.COLOR_STATE_LIST_VALUE);
+ break;
+ case ICON:
+ value = ((PendingResources<Icon>) values.get(
+ RemoteViewsProto.ReflectionAction.ICON_VALUE)).create(context,
+ resources, rootData, depth);
+ break;
+ case BUNDLE:
+ case INTENT:
+ default:
+ // omit the action for unsupported parameter types
+ return null;
+ }
+ return new ReflectionAction(viewId,
+ (String) values.get(RemoteViewsProto.ReflectionAction.METHOD_NAME),
+ parameterType, value);
+ };
+ }
}
private static final class ResourceReflectionAction extends BaseReflectionAction {
@@ -2735,7 +3080,87 @@
public int getActionTag() {
return ATTRIBUTE_REFLECTION_ACTION_TAG;
}
+
+ @Override
+ public boolean canWriteToProto() {
+ return true;
+ }
+
+ @Override
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ final long token = out.start(RemoteViewsProto.Action.ATTRIBUTE_REFLECTION_ACTION);
+ out.write(RemoteViewsProto.AttributeReflectionAction.VIEW_ID,
+ appResources.getResourceName(mViewId));
+ out.write(RemoteViewsProto.AttributeReflectionAction.METHOD_NAME, mMethodName);
+ out.write(RemoteViewsProto.AttributeReflectionAction.PARAMETER_TYPE, mType);
+ out.write(RemoteViewsProto.AttributeReflectionAction.RESOURCE_TYPE, mResourceType);
+ if (mAttrId != 0) {
+ out.write(RemoteViewsProto.AttributeReflectionAction.ATTRIBUTE_ID,
+ appResources.getResourceName(mAttrId));
+ }
+ out.end(token);
+ }
+
+ public static PendingResources<Action> createFromProto(ProtoInputStream in)
+ throws Exception {
+ final LongSparseArray<Object> values = new LongSparseArray<>();
+
+ final long token = in.start(RemoteViewsProto.Action.ATTRIBUTE_REFLECTION_ACTION);
+ while (in.nextField() != NO_MORE_FIELDS) {
+ switch (in.getFieldNumber()) {
+ case (int) RemoteViewsProto.AttributeReflectionAction.VIEW_ID: {
+ values.put(RemoteViewsProto.AttributeReflectionAction.VIEW_ID,
+ in.readString(RemoteViewsProto.AttributeReflectionAction.VIEW_ID));
+ break;
+ }
+ case (int) RemoteViewsProto.AttributeReflectionAction.METHOD_NAME:
+ values.put(RemoteViewsProto.AttributeReflectionAction.METHOD_NAME,
+ in.readString(
+ RemoteViewsProto.AttributeReflectionAction.METHOD_NAME));
+ break;
+ case (int) RemoteViewsProto.AttributeReflectionAction.ATTRIBUTE_ID:
+ values.put(RemoteViewsProto.AttributeReflectionAction.ATTRIBUTE_ID,
+ in.readString(
+ RemoteViewsProto.AttributeReflectionAction.ATTRIBUTE_ID));
+ break;
+ case (int) RemoteViewsProto.AttributeReflectionAction.PARAMETER_TYPE:
+ values.put(RemoteViewsProto.AttributeReflectionAction.PARAMETER_TYPE,
+ in.readInt(
+ RemoteViewsProto.AttributeReflectionAction.PARAMETER_TYPE));
+ break;
+ case (int) RemoteViewsProto.AttributeReflectionAction.RESOURCE_TYPE:
+ values.put(RemoteViewsProto.AttributeReflectionAction.RESOURCE_TYPE,
+ in.readInt(
+ RemoteViewsProto.AttributeReflectionAction.RESOURCE_TYPE));
+ break;
+ default:
+ Log.w(LOG_TAG, "Unhandled field while reading RemoteViews proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+ in.end(token);
+
+ checkContainsKeys(values, new long[]{RemoteViewsProto.AttributeReflectionAction.VIEW_ID,
+ RemoteViewsProto.AttributeReflectionAction.METHOD_NAME,
+ RemoteViewsProto.AttributeReflectionAction.PARAMETER_TYPE,
+ RemoteViewsProto.AttributeReflectionAction.RESOURCE_TYPE});
+
+ return (context, resources, rootData, depth) -> {
+ int viewId = getAsIdentifier(resources, values,
+ RemoteViewsProto.AttributeReflectionAction.VIEW_ID);
+ int attributeId = (values.indexOfKey(
+ RemoteViewsProto.AttributeReflectionAction.ATTRIBUTE_ID) >= 0)
+ ? getAsIdentifier(resources, values,
+ RemoteViewsProto.AttributeReflectionAction.ATTRIBUTE_ID) : 0;
+ return new AttributeReflectionAction(viewId,
+ (String) values.get(RemoteViewsProto.AttributeReflectionAction.METHOD_NAME),
+ (int) values.get(RemoteViewsProto.AttributeReflectionAction.PARAMETER_TYPE),
+ (int) values.get(RemoteViewsProto.AttributeReflectionAction.RESOURCE_TYPE),
+ attributeId);
+ };
+ }
}
+
private static final class ComplexUnitDimensionReflectionAction extends BaseReflectionAction {
private final float mValue;
@ComplexDimensionUnit
@@ -2789,6 +3214,101 @@
public int getActionTag() {
return COMPLEX_UNIT_DIMENSION_REFLECTION_ACTION_TAG;
}
+
+ @Override
+ public boolean canWriteToProto() {
+ return true;
+ }
+
+ @Override
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ final long token = out.start(
+ RemoteViewsProto.Action.COMPLEX_UNIT_DIMENSION_REFLECTION_ACTION);
+ out.write(RemoteViewsProto.ComplexUnitDimensionReflectionAction.VIEW_ID,
+ appResources.getResourceName(mViewId));
+ out.write(RemoteViewsProto.ComplexUnitDimensionReflectionAction.METHOD_NAME,
+ mMethodName);
+ out.write(RemoteViewsProto.ComplexUnitDimensionReflectionAction.PARAMETER_TYPE, mType);
+ out.write(RemoteViewsProto.ComplexUnitDimensionReflectionAction.DIMENSION_VALUE,
+ mValue);
+ out.write(RemoteViewsProto.ComplexUnitDimensionReflectionAction.UNIT, mUnit);
+ out.end(token);
+ }
+
+ public static PendingResources<Action> createFromProto(ProtoInputStream in)
+ throws Exception {
+ final LongSparseArray<Object> values = new LongSparseArray<>();
+
+ final long token = in.start(
+ RemoteViewsProto.Action.COMPLEX_UNIT_DIMENSION_REFLECTION_ACTION);
+ while (in.nextField() != NO_MORE_FIELDS) {
+ switch (in.getFieldNumber()) {
+ case (int) RemoteViewsProto.ComplexUnitDimensionReflectionAction.VIEW_ID:
+ values.put(RemoteViewsProto.ComplexUnitDimensionReflectionAction.VIEW_ID,
+ in.readString(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.VIEW_ID));
+ break;
+ case (int) RemoteViewsProto.ComplexUnitDimensionReflectionAction.METHOD_NAME:
+ values.put(
+ RemoteViewsProto.ComplexUnitDimensionReflectionAction.METHOD_NAME,
+ in.readString(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.METHOD_NAME));
+ break;
+ case (int) RemoteViewsProto.ComplexUnitDimensionReflectionAction.PARAMETER_TYPE:
+ values.put(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.PARAMETER_TYPE,
+ in.readInt(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction
+ .PARAMETER_TYPE));
+ break;
+ case (int) RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.DIMENSION_VALUE:
+ values.put(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.DIMENSION_VALUE,
+ in.readFloat(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction
+ .DIMENSION_VALUE));
+ break;
+ case (int) RemoteViewsProto.ComplexUnitDimensionReflectionAction.UNIT:
+ values.put(RemoteViewsProto.ComplexUnitDimensionReflectionAction.UNIT,
+ in.readInt(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.UNIT));
+ break;
+ default:
+ Log.w(LOG_TAG, "Unhandled field while reading RemoteViews proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+ in.end(token);
+
+ checkContainsKeys(values,
+ new long[]{RemoteViewsProto.ComplexUnitDimensionReflectionAction.VIEW_ID,
+ RemoteViewsProto.ComplexUnitDimensionReflectionAction.METHOD_NAME,
+ RemoteViewsProto.ComplexUnitDimensionReflectionAction.PARAMETER_TYPE});
+
+ return (context, resources, rootData, depth) -> {
+ int viewId = getAsIdentifier(resources, values,
+ RemoteViewsProto.ComplexUnitDimensionReflectionAction.VIEW_ID);
+ return new ComplexUnitDimensionReflectionAction(viewId, (String) values.get(
+ RemoteViewsProto.ComplexUnitDimensionReflectionAction.METHOD_NAME),
+ (int) values.get(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.PARAMETER_TYPE),
+ (float) values.get(
+ RemoteViewsProto
+ .ComplexUnitDimensionReflectionAction.DIMENSION_VALUE,
+ 0),
+ (int) values.get(RemoteViewsProto.ComplexUnitDimensionReflectionAction.UNIT,
+ 0));
+ };
+ }
}
private static final class NightModeReflectionAction extends BaseReflectionAction {
@@ -2863,6 +3383,145 @@
visitIconUri((Icon) mLightValue, visitor);
}
}
+
+ @Override
+ public boolean canWriteToProto() {
+ return true;
+ }
+
+ @Override
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ final long token = out.start(RemoteViewsProto.Action.NIGHT_MODE_REFLECTION_ACTION);
+ out.write(RemoteViewsProto.NightModeReflectionAction.VIEW_ID,
+ appResources.getResourceName(mViewId));
+ out.write(RemoteViewsProto.NightModeReflectionAction.METHOD_NAME, mMethodName);
+ out.write(RemoteViewsProto.NightModeReflectionAction.PARAMETER_TYPE, mType);
+ switch (this.mType) {
+ case ICON:
+ writeIconToProto(out, appResources, (Icon) mLightValue,
+ RemoteViewsProto.NightModeReflectionAction.LIGHT_ICON);
+ writeIconToProto(out, appResources, (Icon) mDarkValue,
+ RemoteViewsProto.NightModeReflectionAction.DARK_ICON);
+ break;
+ case COLOR_STATE_LIST:
+ writeColorStateListToProto(out, (ColorStateList) mLightValue,
+ RemoteViewsProto.NightModeReflectionAction.LIGHT_COLOR_STATE_LIST);
+ writeColorStateListToProto(out, (ColorStateList) mDarkValue,
+ RemoteViewsProto.NightModeReflectionAction.DARK_COLOR_STATE_LIST);
+ break;
+ case INT:
+ out.write(RemoteViewsProto.NightModeReflectionAction.LIGHT_INT,
+ (int) mLightValue);
+ out.write(RemoteViewsProto.NightModeReflectionAction.DARK_INT,
+ (int) mDarkValue);
+ break;
+ }
+ out.end(token);
+ }
+
+ public static PendingResources<Action> createFromProto(ProtoInputStream in)
+ throws Exception {
+ final LongSparseArray<Object> values = new LongSparseArray<>();
+
+ final long token = in.start(RemoteViewsProto.Action.NIGHT_MODE_REFLECTION_ACTION);
+ while (in.nextField() != NO_MORE_FIELDS) {
+ switch (in.getFieldNumber()) {
+ case (int) RemoteViewsProto.NightModeReflectionAction.VIEW_ID:
+ values.put(RemoteViewsProto.NightModeReflectionAction.VIEW_ID,
+ in.readString(RemoteViewsProto.NightModeReflectionAction.VIEW_ID));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.METHOD_NAME:
+ values.put(RemoteViewsProto.NightModeReflectionAction.METHOD_NAME,
+ in.readString(
+ RemoteViewsProto.NightModeReflectionAction.METHOD_NAME));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.PARAMETER_TYPE:
+ values.put(RemoteViewsProto.NightModeReflectionAction.PARAMETER_TYPE,
+ in.readInt(
+ RemoteViewsProto.NightModeReflectionAction.PARAMETER_TYPE));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.LIGHT_ICON:
+ values.put(RemoteViewsProto.NightModeReflectionAction.LIGHT_ICON,
+ createIconFromProto(in,
+ RemoteViewsProto.NightModeReflectionAction.LIGHT_ICON));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.LIGHT_COLOR_STATE_LIST:
+ values.put(
+ RemoteViewsProto.NightModeReflectionAction.LIGHT_COLOR_STATE_LIST,
+ createColorStateListFromProto(in,
+ RemoteViewsProto
+ .NightModeReflectionAction.LIGHT_COLOR_STATE_LIST));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.LIGHT_INT:
+ values.put(RemoteViewsProto.NightModeReflectionAction.LIGHT_INT,
+ in.readInt(RemoteViewsProto.NightModeReflectionAction.LIGHT_INT));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.DARK_ICON:
+ values.put(RemoteViewsProto.NightModeReflectionAction.DARK_ICON,
+ createIconFromProto(in,
+ RemoteViewsProto.NightModeReflectionAction.DARK_ICON));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.DARK_COLOR_STATE_LIST:
+ values.put(RemoteViewsProto.NightModeReflectionAction.DARK_COLOR_STATE_LIST,
+ createColorStateListFromProto(in,
+ RemoteViewsProto
+ .NightModeReflectionAction.DARK_COLOR_STATE_LIST));
+ break;
+ case (int) RemoteViewsProto.NightModeReflectionAction.DARK_INT:
+ values.put(RemoteViewsProto.NightModeReflectionAction.DARK_INT,
+ in.readInt(RemoteViewsProto.NightModeReflectionAction.DARK_INT));
+ break;
+ default:
+ Log.w(LOG_TAG, "Unhandled field while reading RemoteViews proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+ in.end(token);
+
+ checkContainsKeys(values, new long[]{RemoteViewsProto.NightModeReflectionAction.VIEW_ID,
+ RemoteViewsProto.NightModeReflectionAction.METHOD_NAME,
+ RemoteViewsProto.NightModeReflectionAction.PARAMETER_TYPE});
+
+ return (context, resources, rootData, depth) -> {
+ int viewId = getAsIdentifier(resources, values,
+ RemoteViewsProto.NightModeReflectionAction.VIEW_ID);
+ String methodName = (String) values.get(
+ RemoteViewsProto.NightModeReflectionAction.METHOD_NAME);
+ int parameterType = (int) values.get(
+ RemoteViewsProto.NightModeReflectionAction.PARAMETER_TYPE);
+ switch (parameterType) {
+ case ICON:
+ PendingResources<Icon> pendingLightIcon =
+ (PendingResources<Icon>) values.get(
+ RemoteViewsProto.NightModeReflectionAction.LIGHT_ICON);
+ PendingResources<Icon> pendingDarkIcon =
+ (PendingResources<Icon>) values.get(
+ RemoteViewsProto.NightModeReflectionAction.DARK_ICON);
+ Icon lightIcon = pendingLightIcon != null ? pendingLightIcon.create(context,
+ resources, rootData, depth) : null;
+ Icon darkIcon = pendingDarkIcon != null ? pendingDarkIcon.create(context,
+ resources, rootData, depth) : null;
+ return new NightModeReflectionAction(viewId, methodName, parameterType,
+ lightIcon, darkIcon);
+ case COLOR_STATE_LIST:
+ return new NightModeReflectionAction(viewId, methodName, parameterType,
+ (ColorStateList) values.get(
+ RemoteViewsProto
+ .NightModeReflectionAction.LIGHT_COLOR_STATE_LIST),
+ (ColorStateList) values.get(
+ RemoteViewsProto
+ .NightModeReflectionAction.DARK_COLOR_STATE_LIST));
+ case INT:
+ return new NightModeReflectionAction(viewId, methodName, parameterType,
+ (int) values.get(
+ RemoteViewsProto.NightModeReflectionAction.LIGHT_INT, 0),
+ (int) values.get(
+ RemoteViewsProto.NightModeReflectionAction.DARK_INT, 0));
+ default:
+ throw new RuntimeException("Unknown parameterType: " + parameterType);
+ }
+ };
+ }
}
/**
@@ -3348,6 +4007,46 @@
public int mergeBehavior() {
return MERGE_APPEND;
}
+
+ @Override
+ public boolean canWriteToProto() {
+ return true;
+ }
+
+ @Override
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ final long token = out.start(RemoteViewsProto.Action.REMOVE_FROM_PARENT_ACTION);
+ out.write(RemoteViewsProto.RemoveFromParentAction.VIEW_ID,
+ appResources.getResourceName(mViewId));
+ out.end(token);
+ }
+
+ public static PendingResources<Action> createFromProto(ProtoInputStream in)
+ throws Exception {
+ final LongSparseArray<Object> values = new LongSparseArray<>();
+
+ final long token = in.start(RemoteViewsProto.Action.REMOVE_FROM_PARENT_ACTION);
+ while (in.nextField() != NO_MORE_FIELDS) {
+ switch (in.getFieldNumber()) {
+ case (int) RemoteViewsProto.RemoveFromParentAction.VIEW_ID:
+ values.put(RemoteViewsProto.RemoveFromParentAction.VIEW_ID,
+ in.readString(RemoteViewsProto.RemoveFromParentAction.VIEW_ID));
+ break;
+ default:
+ Log.w(LOG_TAG, "Unhandled field while reading RemoteViews proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+ in.end(token);
+
+ checkContainsKeys(values, new long[]{RemoteViewsProto.RemoveFromParentAction.VIEW_ID});
+
+ return (context, resources, rootData, depth) -> {
+ int viewId = getAsIdentifier(resources, values,
+ RemoteViewsProto.RemoveFromParentAction.VIEW_ID);
+ return new RemoveFromParentAction(viewId);
+ };
+ }
}
/**
@@ -3763,6 +4462,64 @@
public String getUniqueKey() {
return super.getUniqueKey() + mProperty;
}
+
+ @Override
+ public boolean canWriteToProto() {
+ return true;
+ }
+
+ @Override
+ public void writeToProto(ProtoOutputStream out, Context context, Resources appResources) {
+ final long token = out.start(RemoteViewsProto.Action.LAYOUT_PARAM_ACTION);
+ out.write(RemoteViewsProto.LayoutParamAction.VIEW_ID,
+ appResources.getResourceName(mViewId));
+ out.write(RemoteViewsProto.LayoutParamAction.PROPERTY, mProperty);
+ out.write(RemoteViewsProto.LayoutParamAction.LAYOUT_VALUE, mValue);
+ out.write(RemoteViewsProto.LayoutParamAction.VALUE_TYPE, mValueType);
+ out.end(token);
+ }
+
+ public static PendingResources<Action> createFromProto(ProtoInputStream in)
+ throws Exception {
+ final LongSparseArray<Object> values = new LongSparseArray<>();
+
+ final long token = in.start(RemoteViewsProto.Action.LAYOUT_PARAM_ACTION);
+ while (in.nextField() != NO_MORE_FIELDS) {
+ switch (in.getFieldNumber()) {
+ case (int) RemoteViewsProto.LayoutParamAction.VIEW_ID:
+ values.put(RemoteViewsProto.LayoutParamAction.VIEW_ID,
+ in.readString(RemoteViewsProto.LayoutParamAction.VIEW_ID));
+ break;
+ case (int) RemoteViewsProto.LayoutParamAction.PROPERTY:
+ values.put(RemoteViewsProto.LayoutParamAction.PROPERTY,
+ in.readInt(RemoteViewsProto.LayoutParamAction.PROPERTY));
+ break;
+ case (int) RemoteViewsProto.LayoutParamAction.LAYOUT_VALUE:
+ values.put(RemoteViewsProto.LayoutParamAction.LAYOUT_VALUE,
+ in.readInt(RemoteViewsProto.LayoutParamAction.LAYOUT_VALUE));
+ break;
+ case (int) RemoteViewsProto.LayoutParamAction.VALUE_TYPE:
+ values.put(RemoteViewsProto.LayoutParamAction.VALUE_TYPE,
+ in.readInt(RemoteViewsProto.LayoutParamAction.VALUE_TYPE));
+ break;
+ default:
+ Log.w(LOG_TAG, "Unhandled field while reading RemoteViews proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+ in.end(token);
+
+ checkContainsKeys(values, new long[]{RemoteViewsProto.LayoutParamAction.VIEW_ID});
+
+ return (context, resources, rootData, depth) -> {
+ int viewId = getAsIdentifier(resources, values,
+ RemoteViewsProto.LayoutParamAction.VIEW_ID);
+ return new LayoutParamAction(viewId,
+ (int) values.get(RemoteViewsProto.LayoutParamAction.PROPERTY, 0),
+ (int) values.get(RemoteViewsProto.LayoutParamAction.LAYOUT_VALUE, 0),
+ (int) values.get(RemoteViewsProto.LayoutParamAction.VALUE_TYPE, 0));
+ };
+ }
}
/**
@@ -7663,6 +8420,7 @@
values.put(RemoteViewsProto.RemoteCollectionItems.IDS, new ArrayList<Long>());
values.put(RemoteViewsProto.RemoteCollectionItems.VIEWS,
new ArrayList<PendingResources<RemoteViews>>());
+
while (in.nextField() != NO_MORE_FIELDS) {
switch (in.getFieldNumber()) {
case (int) RemoteViewsProto.RemoteCollectionItems.IDS:
@@ -7699,6 +8457,7 @@
checkContainsKeys(values,
new long[]{RemoteViewsProto.RemoteCollectionItems.VIEW_TYPE_COUNT});
+
return (context, resources, rootData, depth) -> {
List<Long> idList = (List<Long>) values.get(
RemoteViewsProto.RemoteCollectionItems.IDS);
@@ -8144,6 +8903,16 @@
out.write(SizeFProto.HEIGHT, mIdealSize.getHeight());
out.end(token);
}
+
+ if (mActions != null) {
+ for (Action action : mActions) {
+ if (action.canWriteToProto()) {
+ final long token = out.start(RemoteViewsProto.ACTIONS);
+ action.writeToProto(out, context, appResources);
+ out.end(token);
+ }
+ }
+ }
} else if (hasSizedRemoteViews()) {
out.write(RemoteViewsProto.MODE, MODE_HAS_SIZED_REMOTEVIEWS);
for (RemoteViews view : mSizedRemoteViews) {
@@ -8187,6 +8956,7 @@
String mLayoutResName = null;
String mLightBackgroundResName = null;
String mViewResName = null;
+ final List<PendingResources<Action>> mActions = new ArrayList<>();
final List<PendingResources<RemoteViews>> mSizedRemoteViews = new ArrayList<>();
PendingResources<RemoteViews> mLandscapeViews = null;
PendingResources<RemoteViews> mPortraitViews = null;
@@ -8225,6 +8995,14 @@
case (int) RemoteViewsProto.PROVIDER_INSTANCE_ID:
ref.mProviderInstanceId = in.readInt(RemoteViewsProto.PROVIDER_INSTANCE_ID);
break;
+ case (int) RemoteViewsProto.ACTIONS:
+ final long actionsToken = in.start(RemoteViewsProto.ACTIONS);
+ final PendingResources<Action> action = createActionFromProto(ref.mRv, in);
+ if (action != null) {
+ ref.mActions.add(action);
+ }
+ in.end(actionsToken);
+ break;
case (int) RemoteViewsProto.SIZED_REMOTEVIEWS:
final long sizedToken = in.start(RemoteViewsProto.SIZED_REMOTEVIEWS);
ref.mSizedRemoteViews.add(createFromProto(in));
@@ -8323,19 +9101,27 @@
}
}
if (ref.mPopulateRemoteCollectionCache != null) {
- ref.mPopulateRemoteCollectionCache.create(context, resources, rootData, depth);
+ ref.mPopulateRemoteCollectionCache.create(appContext, appResources, rootData,
+ depth);
}
if (ref.mProviderInstanceId != -1) {
rv.mProviderInstanceId = ref.mProviderInstanceId;
}
if (ref.mMode == MODE_NORMAL) {
rv.setIdealSize(ref.mIdealSize);
+ for (PendingResources<Action> pendingAction : ref.mActions) {
+ Action action = pendingAction.create(appContext, appResources, rootData, depth);
+ if (action != null) {
+ rv.addAction(action);
+ }
+ }
return rv;
} else if (ref.mMode == MODE_HAS_SIZED_REMOTEVIEWS) {
List<RemoteViews> sizedViews = new ArrayList<>();
for (RemoteViews.PendingResources<RemoteViews> pendingViews :
ref.mSizedRemoteViews) {
- RemoteViews views = pendingViews.create(context, resources, rootData, depth);
+ RemoteViews views = pendingViews.create(appContext, appResources, rootData,
+ depth);
sizedViews.add(views);
}
rv.initializeSizedRemoteViews(sizedViews.iterator());
@@ -8344,8 +9130,8 @@
checkProtoResultNotNull(ref.mLandscapeViews, "Missing landscape views");
checkProtoResultNotNull(ref.mPortraitViews, "Missing portrait views");
RemoteViews parentRv = new RemoteViews(
- ref.mLandscapeViews.create(context, resources, rootData, depth),
- ref.mPortraitViews.create(context, resources, rootData, depth));
+ ref.mLandscapeViews.create(appContext, appResources, rootData, depth),
+ ref.mPortraitViews.create(appContext, appResources, rootData, depth));
parentRv.initializeFrom(/* src= */ rv, /* hierarchyRoot= */ rv);
return parentRv;
} else {
@@ -8365,6 +9151,35 @@
throws Exception;
}
+ @Nullable
+ private static PendingResources<Action> createActionFromProto(RemoteViews rv,
+ ProtoInputStream in) throws Exception {
+ int actionFieldId = in.nextField();
+ if (actionFieldId == NO_MORE_FIELDS) {
+ // action was omitted
+ return null;
+ }
+ switch (actionFieldId) {
+ case (int) RemoteViewsProto.Action.ATTRIBUTE_REFLECTION_ACTION:
+ return AttributeReflectionAction.createFromProto(in);
+ case (int) RemoteViewsProto.Action.BITMAP_REFLECTION_ACTION:
+ return rv.createFromBitmapReflectionActionFromProto(in);
+ case (int) RemoteViewsProto.Action.COMPLEX_UNIT_DIMENSION_REFLECTION_ACTION:
+ return ComplexUnitDimensionReflectionAction.createFromProto(in);
+ case (int) RemoteViewsProto.Action.LAYOUT_PARAM_ACTION:
+ return LayoutParamAction.createFromProto(in);
+ case (int) RemoteViewsProto.Action.NIGHT_MODE_REFLECTION_ACTION:
+ return NightModeReflectionAction.createFromProto(in);
+ case (int) RemoteViewsProto.Action.REFLECTION_ACTION:
+ return ReflectionAction.createFromProto(in);
+ case (int) RemoteViewsProto.Action.REMOVE_FROM_PARENT_ACTION:
+ return RemoveFromParentAction.createFromProto(in);
+ default:
+ throw new RuntimeException("Unhandled field while reading Action proto!\n"
+ + ProtoUtils.currentFieldToString(in));
+ }
+ }
+
private static void checkValidResource(int id, String message, String resName)
throws Exception {
if (id == 0) throw new Exception(message + ": " + resName);
@@ -8387,6 +9202,22 @@
}
}
+ private static int getAsIdentifier(Resources resources, LongSparseArray<?> array, long fieldId)
+ throws Exception {
+ String resName = (String) array.get(fieldId);
+ int id = resources.getIdentifier(resName, /* defType= */ null, /* defPackage= */ null);
+ checkValidResource(id, "Invalid id", resName);
+ return id;
+ }
+
+ private static int getAsIdentifier(Resources resources, SparseArray<?> array, int key)
+ throws Exception {
+ String resName = (String) array.get(key);
+ int id = resources.getIdentifier(resName, /* defType= */ null, /* defPackage= */ null);
+ checkValidResource(id, "Invalid id", resName);
+ return id;
+ }
+
private static SizeF createSizeFFromProto(ProtoInputStream in) throws Exception {
float width = 0;
float height = 0;
@@ -8406,4 +9237,43 @@
return new SizeF(width, height);
}
+
+ private static void writeIconToProto(ProtoOutputStream out, Resources appResources, Icon icon,
+ long fieldId) {
+ long token = out.start(fieldId);
+ RemoteViewsSerializers.writeIconToProto(out, appResources, icon);
+ out.end(token);
+ }
+
+ private static PendingResources<Icon> createIconFromProto(ProtoInputStream in, long fieldId)
+ throws Exception {
+ long token = in.start(fieldId);
+ Function<Resources, Icon> icon = RemoteViewsSerializers.createIconFromProto(in);
+ in.end(token);
+ return (context, resources, rootData, depth) -> icon.apply(resources);
+ }
+
+ private static void writeColorStateListToProto(ProtoOutputStream out,
+ ColorStateList colorStateList, long fieldId) {
+ long token = out.start(fieldId);
+ colorStateList.writeToProto(out);
+ out.end(token);
+ }
+
+ private static ColorStateList createColorStateListFromProto(ProtoInputStream in, long fieldId)
+ throws Exception {
+ long token = in.start(fieldId);
+ ColorStateList colorStateList = ColorStateList.createFromProto(in);
+ in.end(token);
+ return colorStateList;
+ }
+
+ private static CharSequence createCharSequenceFromProto(ProtoInputStream in, long fieldId)
+ throws Exception {
+ long token = in.start(fieldId);
+ CharSequence cs = RemoteViewsSerializers.createCharSequenceFromProto(in);
+ in.end(token);
+ return cs;
+ }
+
}
diff --git a/core/java/android/widget/RemoteViewsAdapter.java b/core/java/android/widget/RemoteViewsAdapter.java
index 2f28a87..118edc2 100644
--- a/core/java/android/widget/RemoteViewsAdapter.java
+++ b/core/java/android/widget/RemoteViewsAdapter.java
@@ -241,6 +241,11 @@
}
@Override
+ public void onNullBinding(ComponentName name) {
+ enqueueDeferredUnbindServiceMessage();
+ }
+
+ @Override
public void handleMessage(Message msg) {
RemoteViewsAdapter adapter = mAdapter.get();
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index b5bf529..511c832 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -16,6 +16,7 @@
package android.widget;
+import static android.view.flags.Flags.enableTouchScrollFeedback;
import static android.view.flags.Flags.viewVelocityApi;
import android.annotation.ColorInt;
@@ -846,6 +847,8 @@
deltaY += mTouchSlop;
}
}
+ boolean hitTopLimit = false;
+ boolean hitBottomLimit = false;
if (mIsBeingDragged) {
// Scroll to follow the motion event
mLastMotionY = y - mScrollOffset[1];
@@ -889,12 +892,14 @@
if (!mEdgeGlowBottom.isFinished()) {
mEdgeGlowBottom.onRelease();
}
+ hitTopLimit = true;
} else if (pulledToY > range) {
mEdgeGlowBottom.onPullDistance((float) deltaY / getHeight(),
1.f - displacement);
if (!mEdgeGlowTop.isFinished()) {
mEdgeGlowTop.onRelease();
}
+ hitBottomLimit = true;
}
if (shouldDisplayEdgeEffects()
&& (!mEdgeGlowTop.isFinished() || !mEdgeGlowBottom.isFinished())) {
@@ -902,6 +907,20 @@
}
}
}
+
+ // TODO: b/360198915 - Add unit tests.
+ if (enableTouchScrollFeedback()) {
+ if (hitTopLimit || hitBottomLimit) {
+ initHapticScrollFeedbackProviderIfNotExists();
+ mHapticScrollFeedbackProvider.onScrollLimit(vtev.getDeviceId(),
+ vtev.getSource(), MotionEvent.AXIS_Y,
+ /* isStart= */ hitTopLimit);
+ } else if (Math.abs(deltaY) != 0) {
+ initHapticScrollFeedbackProviderIfNotExists();
+ mHapticScrollFeedbackProvider.onScrollProgress(vtev.getDeviceId(),
+ vtev.getSource(), MotionEvent.AXIS_Y, deltaY);
+ }
+ }
break;
case MotionEvent.ACTION_UP:
if (mIsBeingDragged) {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index a4b28ad..ef941da 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -1659,11 +1659,7 @@
}
if (!hasUseBoundForWidthValue) {
- if (CompatChanges.isChangeEnabled(USE_BOUNDS_FOR_WIDTH)) {
- mUseBoundsForWidth = Flags.useBoundsForWidth();
- } else {
- mUseBoundsForWidth = false;
- }
+ mUseBoundsForWidth = CompatChanges.isChangeEnabled(USE_BOUNDS_FOR_WIDTH);
}
// TODO(b/179693024): Use a ChangeId instead.
diff --git a/core/java/android/widget/flags/flags.aconfig b/core/java/android/widget/flags/flags.aconfig
new file mode 100644
index 0000000..f0ed83b
--- /dev/null
+++ b/core/java/android/widget/flags/flags.aconfig
@@ -0,0 +1,11 @@
+package: "android.widget.flags"
+container: "system"
+flag {
+ name: "enable_fading_view_group"
+ namespace: "system_performance"
+ description: "FRP screen during OOBE must have fading and scaling animation in Wear Watches"
+ bug: "348515581"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
\ No newline at end of file
diff --git a/core/java/android/window/BackProgressAnimator.java b/core/java/android/window/BackProgressAnimator.java
index 12d4ab8..465e11a 100644
--- a/core/java/android/window/BackProgressAnimator.java
+++ b/core/java/android/window/BackProgressAnimator.java
@@ -212,6 +212,17 @@
mBackCancelledFinishRunnable = null;
}
+ /**
+ * Removes the finishCallback passed into {@link #onBackCancelled}
+ */
+ public void removeOnBackInvokedFinishCallback() {
+ if (mBackInvokedFlingAnim != null) {
+ mBackInvokedFlingAnim.removeUpdateListener(mOnBackInvokedFlingUpdateListener);
+ mBackInvokedFlingAnim.removeEndListener(mOnAnimationEndListener);
+ }
+ mBackInvokedFinishRunnable = null;
+ }
+
/** Returns true if the back animation is in progress. */
@VisibleForTesting(visibility = PACKAGE)
public boolean isBackAnimationInProgress() {
diff --git a/core/java/android/window/TaskFragmentOrganizer.java b/core/java/android/window/TaskFragmentOrganizer.java
index 4cc0d8a..c3168001 100644
--- a/core/java/android/window/TaskFragmentOrganizer.java
+++ b/core/java/android/window/TaskFragmentOrganizer.java
@@ -69,6 +69,23 @@
public static final String KEY_ERROR_CALLBACK_OP_TYPE = "operation_type";
/**
+ * Key to bundle {@link TaskFragmentInfo}s from the system in
+ * {@link #registerOrganizer(boolean, Bundle)}
+ *
+ * @hide
+ */
+ public static final String KEY_RESTORE_TASK_FRAGMENTS_INFO = "key_restore_task_fragments_info";
+
+ /**
+ * Key to bundle {@link TaskFragmentParentInfo} from the system in
+ * {@link #registerOrganizer(boolean, Bundle)}
+ *
+ * @hide
+ */
+ public static final String KEY_RESTORE_TASK_FRAGMENT_PARENT_INFO =
+ "key_restore_task_fragment_parent_info";
+
+ /**
* No change set.
*/
@WindowManager.TransitionType
diff --git a/core/java/android/window/TransitionInfo.java b/core/java/android/window/TransitionInfo.java
index 1083f64..ec79f94 100644
--- a/core/java/android/window/TransitionInfo.java
+++ b/core/java/android/window/TransitionInfo.java
@@ -1141,6 +1141,7 @@
// Customize activity transition animation
private CustomActivityTransition mCustomActivityOpenTransition;
private CustomActivityTransition mCustomActivityCloseTransition;
+ private int mUserId;
private AnimationOptions(int type) {
mType = type;
@@ -1159,6 +1160,7 @@
mAnimations = in.readInt();
mCustomActivityOpenTransition = in.readTypedObject(CustomActivityTransition.CREATOR);
mCustomActivityCloseTransition = in.readTypedObject(CustomActivityTransition.CREATOR);
+ mUserId = in.readInt();
}
/** Make basic customized animation for a package */
@@ -1283,6 +1285,14 @@
return options;
}
+ public void setUserId(int userId) {
+ mUserId = userId;
+ }
+
+ public int getUserId() {
+ return mUserId;
+ }
+
public int getType() {
return mType;
}
@@ -1349,6 +1359,7 @@
dest.writeInt(mAnimations);
dest.writeTypedObject(mCustomActivityOpenTransition, flags);
dest.writeTypedObject(mCustomActivityCloseTransition, flags);
+ dest.writeInt(mUserId);
}
@NonNull
@@ -1406,6 +1417,7 @@
if (mExitResId != DEFAULT_ANIMATION_RESOURCES_ID) {
sb.append(" exitResId=").append(mExitResId);
}
+ sb.append(" mUserId=").append(mUserId);
sb.append('}');
return sb.toString();
}
diff --git a/core/java/android/window/WindowOnBackInvokedDispatcher.java b/core/java/android/window/WindowOnBackInvokedDispatcher.java
index b6c0d7c..bb89a24 100644
--- a/core/java/android/window/WindowOnBackInvokedDispatcher.java
+++ b/core/java/android/window/WindowOnBackInvokedDispatcher.java
@@ -243,6 +243,8 @@
if (previousTopCallback == callback) {
// We should call onBackCancelled() when an active callback is removed from
// dispatcher.
+ mProgressAnimator.removeOnBackCancelledFinishCallback();
+ mProgressAnimator.removeOnBackInvokedFinishCallback();
sendCancelledIfInProgress(callback);
mHandler.post(mProgressAnimator::reset);
setTopOnBackInvokedCallback(getTopCallback());
diff --git a/core/java/android/window/flags/lse_desktop_experience.aconfig b/core/java/android/window/flags/lse_desktop_experience.aconfig
index 3998ac6..8e81951 100644
--- a/core/java/android/window/flags/lse_desktop_experience.aconfig
+++ b/core/java/android/window/flags/lse_desktop_experience.aconfig
@@ -251,3 +251,10 @@
description: "Persists the desktop windowing session across reboots."
bug: "350456942"
}
+
+flag {
+ name: "enable_display_focus_in_shell_transitions"
+ namespace: "lse_desktop_experience"
+ description: "Creates a shell transition when display focus switches."
+ bug: "356109871"
+}
diff --git a/core/java/com/android/internal/accessibility/dialog/AccessibilityButtonChooserActivity.java b/core/java/com/android/internal/accessibility/dialog/AccessibilityButtonChooserActivity.java
index 01cbb55..81d8adf 100644
--- a/core/java/com/android/internal/accessibility/dialog/AccessibilityButtonChooserActivity.java
+++ b/core/java/com/android/internal/accessibility/dialog/AccessibilityButtonChooserActivity.java
@@ -20,7 +20,6 @@
import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_COMPONENT_NAME;
import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_CONTROLLER_NAME;
-import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.GESTURE;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.SOFTWARE;
import static com.android.internal.accessibility.dialog.AccessibilityTargetHelper.getTargets;
import static com.android.internal.accessibility.util.AccessibilityStatsLogUtils.logAccessibilityButtonLongPressStatus;
@@ -44,6 +43,8 @@
* Activity used to display and persist a service or feature target for the Accessibility button.
*/
public class AccessibilityButtonChooserActivity extends Activity {
+ public static final String EXTRA_TYPE_TO_CHOOSE = "TYPE";
+
private final List<AccessibilityTarget> mTargets = new ArrayList<>();
@Override
@@ -67,8 +68,8 @@
NAV_BAR_MODE_GESTURAL == getResources().getInteger(
com.android.internal.R.integer.config_navBarInteractionMode);
- final int targetType = (isGestureNavigateEnabled
- && android.provider.Flags.a11yStandaloneGestureEnabled()) ? GESTURE : SOFTWARE;
+ final int targetType = android.provider.Flags.a11yStandaloneGestureEnabled()
+ ? getIntent().getIntExtra(EXTRA_TYPE_TO_CHOOSE, SOFTWARE) : SOFTWARE;
if (isGestureNavigateEnabled) {
final TextView promptPrologue = findViewById(R.id.accessibility_button_prompt_prologue);
diff --git a/core/java/com/android/internal/app/SetScreenLockDialogActivity.java b/core/java/com/android/internal/app/SetScreenLockDialogActivity.java
index 360fcaf..4c3af4d 100644
--- a/core/java/com/android/internal/app/SetScreenLockDialogActivity.java
+++ b/core/java/com/android/internal/app/SetScreenLockDialogActivity.java
@@ -60,6 +60,7 @@
LAUNCH_REASON_PRIVATE_SPACE_SETTINGS_ACCESS,
LAUNCH_REASON_DISABLE_QUIET_MODE,
LAUNCH_REASON_UNKNOWN,
+ LAUNCH_REASON_RESET_PRIVATE_SPACE_SETTINGS_ACCESS,
})
@Retention(RetentionPolicy.SOURCE)
public @interface LaunchReason {
@@ -67,6 +68,7 @@
public static final int LAUNCH_REASON_UNKNOWN = -1;
public static final int LAUNCH_REASON_DISABLE_QUIET_MODE = 1;
public static final int LAUNCH_REASON_PRIVATE_SPACE_SETTINGS_ACCESS = 2;
+ public static final int LAUNCH_REASON_RESET_PRIVATE_SPACE_SETTINGS_ACCESS = 3;
private @LaunchReason int mReason;
private int mOriginUserId;
@@ -139,7 +141,11 @@
// Always set private space message if launch reason is specific to private space
builder.setMessage(R.string.private_space_set_up_screen_lock_message);
return;
+ } else if (mReason == LAUNCH_REASON_RESET_PRIVATE_SPACE_SETTINGS_ACCESS) {
+ builder.setMessage(R.string.private_space_set_up_screen_lock_for_reset);
+ return;
}
+
final UserManager userManager = getApplicationContext().getSystemService(UserManager.class);
if (userManager != null) {
UserInfo userInfo = userManager.getUserInfo(mOriginUserId);
diff --git a/core/java/com/android/internal/jank/flags.aconfig b/core/java/com/android/internal/jank/flags.aconfig
index b6b8bc5..82f50ae 100644
--- a/core/java/com/android/internal/jank/flags.aconfig
+++ b/core/java/com/android/internal/jank/flags.aconfig
@@ -3,7 +3,7 @@
flag {
name: "use_sf_frame_duration"
- namespace: "android_platform_window_surfaces"
+ namespace: "window_surfaces"
description: "Whether to get the frame duration from SurfaceFlinger, or HWUI"
bug: "354763298"
is_fixed_read_only: true
diff --git a/core/java/com/android/internal/os/LongArrayMultiStateCounter.java b/core/java/com/android/internal/os/LongArrayMultiStateCounter.java
index 07fa679..dfb2884 100644
--- a/core/java/com/android/internal/os/LongArrayMultiStateCounter.java
+++ b/core/java/com/android/internal/os/LongArrayMultiStateCounter.java
@@ -18,6 +18,10 @@
import android.os.Parcel;
import android.os.Parcelable;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
+import android.ravenwood.annotation.RavenwoodReplace;
import com.android.internal.util.Preconditions;
@@ -55,18 +59,15 @@
*
* @hide
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.LongArrayMultiStateCounter_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("LongArrayMultiStateCounter_host")
public final class LongArrayMultiStateCounter implements Parcelable {
/**
* Container for a native equivalent of a long[].
*/
- @android.ravenwood.annotation.RavenwoodKeepWholeClass
- @android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution"
- + ".LongArrayMultiStateCounter_host$LongArrayContainer_host")
+ @RavenwoodKeepWholeClass
+ @RavenwoodRedirectionClass("LongArrayContainer_host")
public static class LongArrayContainer {
private static NativeAllocationRegistry sRegistry;
@@ -81,7 +82,7 @@
registerNativeAllocation();
}
- @android.ravenwood.annotation.RavenwoodReplace
+ @RavenwoodReplace
private void registerNativeAllocation() {
if (sRegistry == null) {
synchronized (LongArrayMultiStateCounter.class) {
@@ -140,18 +141,23 @@
}
@CriticalNative
+ @RavenwoodRedirect
private static native long native_init(int length);
@CriticalNative
+ @RavenwoodRedirect
private static native long native_getReleaseFunc();
@FastNative
+ @RavenwoodRedirect
private static native void native_setValues(long nativeObject, long[] array);
@FastNative
+ @RavenwoodRedirect
private static native void native_getValues(long nativeObject, long[] array);
@FastNative
+ @RavenwoodRedirect
private static native boolean native_combineValues(long nativeObject, long[] array,
int[] indexMap);
}
@@ -175,7 +181,7 @@
registerNativeAllocation();
}
- @android.ravenwood.annotation.RavenwoodReplace
+ @RavenwoodReplace
private void registerNativeAllocation() {
if (sRegistry == null) {
synchronized (LongArrayMultiStateCounter.class) {
@@ -374,57 +380,73 @@
@CriticalNative
+ @RavenwoodRedirect
private static native long native_init(int stateCount, int arrayLength);
@CriticalNative
+ @RavenwoodRedirect
private static native long native_getReleaseFunc();
@CriticalNative
+ @RavenwoodRedirect
private static native void native_setEnabled(long nativeObject, boolean enabled,
long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_setState(long nativeObject, int state, long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_copyStatesFrom(long nativeObjectTarget,
long nativeObjectSource);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_setValues(long nativeObject, int state,
long longArrayContainerNativeObject);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_updateValues(long nativeObject,
long longArrayContainerNativeObject, long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_incrementValues(long nativeObject,
long longArrayContainerNativeObject, long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_addCounts(long nativeObject,
long longArrayContainerNativeObject);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_reset(long nativeObject);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_getCounts(long nativeObject,
long longArrayContainerNativeObject, int state);
@FastNative
+ @RavenwoodRedirect
private static native String native_toString(long nativeObject);
@FastNative
+ @RavenwoodRedirect
private static native void native_writeToParcel(long nativeObject, Parcel dest, int flags);
@FastNative
+ @RavenwoodRedirect
private static native long native_initFromParcel(Parcel parcel);
@CriticalNative
+ @RavenwoodRedirect
private static native int native_getStateCount(long nativeObject);
@CriticalNative
+ @RavenwoodRedirect
private static native int native_getArrayLength(long nativeObject);
}
diff --git a/core/java/com/android/internal/os/LongMultiStateCounter.java b/core/java/com/android/internal/os/LongMultiStateCounter.java
index e5662c7..c386a86 100644
--- a/core/java/com/android/internal/os/LongMultiStateCounter.java
+++ b/core/java/com/android/internal/os/LongMultiStateCounter.java
@@ -18,6 +18,10 @@
import android.os.Parcel;
import android.os.Parcelable;
+import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
+import android.ravenwood.annotation.RavenwoodReplace;
import com.android.internal.util.Preconditions;
@@ -55,9 +59,8 @@
*
* @hide
*/
-@android.ravenwood.annotation.RavenwoodKeepWholeClass
-@android.ravenwood.annotation.RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.LongMultiStateCounter_host")
+@RavenwoodKeepWholeClass
+@RavenwoodRedirectionClass("LongMultiStateCounter_host")
public final class LongMultiStateCounter implements Parcelable {
private static NativeAllocationRegistry sRegistry;
@@ -82,7 +85,7 @@
mStateCount = native_getStateCount(mNativeObject);
}
- @android.ravenwood.annotation.RavenwoodReplace
+ @RavenwoodReplace
private void registerNativeAllocation() {
if (sRegistry == null) {
synchronized (LongMultiStateCounter.class) {
@@ -210,43 +213,56 @@
@CriticalNative
+ @RavenwoodRedirect
private static native long native_init(int stateCount);
@CriticalNative
+ @RavenwoodRedirect
private static native long native_getReleaseFunc();
@CriticalNative
+ @RavenwoodRedirect
private static native void native_setEnabled(long nativeObject, boolean enabled,
long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_setState(long nativeObject, int state, long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native long native_updateValue(long nativeObject, long value, long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_incrementValue(long nativeObject, long increment,
long timestampMs);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_addCount(long nativeObject, long count);
@CriticalNative
+ @RavenwoodRedirect
private static native void native_reset(long nativeObject);
@CriticalNative
+ @RavenwoodRedirect
private static native long native_getCount(long nativeObject, int state);
@FastNative
+ @RavenwoodRedirect
private static native String native_toString(long nativeObject);
@FastNative
+ @RavenwoodRedirect
private static native void native_writeToParcel(long nativeObject, Parcel dest, int flags);
@FastNative
+ @RavenwoodRedirect
private static native long native_initFromParcel(Parcel parcel);
@CriticalNative
+ @RavenwoodRedirect
private static native int native_getStateCount(long nativeObject);
}
diff --git a/core/java/com/android/internal/os/RuntimeInit.java b/core/java/com/android/internal/os/RuntimeInit.java
index cdac097..1709ca7 100644
--- a/core/java/com/android/internal/os/RuntimeInit.java
+++ b/core/java/com/android/internal/os/RuntimeInit.java
@@ -404,6 +404,17 @@
}
public static void redirectLogStreams$ravenwood() {
+ if (sOut$ravenwood != null && sErr$ravenwood != null) {
+ return; // Already initialized.
+ }
+
+ // Make sure the Log class is loaded and the JNI methods are hooked up,
+ // before redirecting System.out/err.
+ // Otherwise, because ClassLoadHook tries to write to System.out, this would cause
+ // a circular initialization problem and would cause a UnsatisfiedLinkError
+ // on the JNI methods.
+ Log.isLoggable("X", Log.VERBOSE);
+
if (sOut$ravenwood == null) {
sOut$ravenwood = System.out;
System.setOut(new AndroidPrintStream(Log.INFO, "System.out"));
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index 58818f3..4708be8 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -1144,7 +1144,8 @@
mDrawLegacyNavigationBarBackground =
((requestedVisibleTypes | mLastForceConsumingTypes)
& WindowInsets.Type.navigationBars()) != 0
- && (mWindow.getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0;
+ && (mWindow.getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0
+ && navBarSize > 0;
if (oldDrawLegacy != mDrawLegacyNavigationBarBackground) {
mDrawLegacyNavigationBarBackgroundHandled =
mWindow.onDrawLegacyNavigationBarBackgroundChanged(
diff --git a/core/java/com/android/internal/policy/TransitionAnimation.java b/core/java/com/android/internal/policy/TransitionAnimation.java
index 238e6f5..201f267 100644
--- a/core/java/com/android/internal/policy/TransitionAnimation.java
+++ b/core/java/com/android/internal/policy/TransitionAnimation.java
@@ -49,7 +49,7 @@
import android.media.Image;
import android.media.ImageReader;
import android.os.Handler;
-import android.os.SystemProperties;
+import android.os.UserHandle;
import android.util.Slog;
import android.view.InflateException;
import android.view.SurfaceControl;
@@ -187,23 +187,44 @@
return createHiddenByKeyguardExit(mContext, mInterpolator, onWallpaper, toShade, subtle);
}
+ /** Load keyguard unocclude animation for user. */
+ @Nullable
+ public Animation loadKeyguardUnoccludeAnimation(int userId) {
+ return loadDefaultAnimationRes(com.android.internal.R.anim.wallpaper_open_exit, userId);
+ }
+
+ /** Same as {@code loadKeyguardUnoccludeAnimation} for current user. */
@Nullable
public Animation loadKeyguardUnoccludeAnimation() {
- return loadDefaultAnimationRes(com.android.internal.R.anim.wallpaper_open_exit);
+ return loadKeyguardUnoccludeAnimation(UserHandle.USER_CURRENT);
}
+ /** Load voice activity open animation for user. */
@Nullable
- public Animation loadVoiceActivityOpenAnimation(boolean enter) {
+ public Animation loadVoiceActivityOpenAnimation(boolean enter, int userId) {
return loadDefaultAnimationRes(enter
? com.android.internal.R.anim.voice_activity_open_enter
- : com.android.internal.R.anim.voice_activity_open_exit);
+ : com.android.internal.R.anim.voice_activity_open_exit, userId);
}
+ /** Same as {@code loadVoiceActivityOpenAnimation} for current user. */
@Nullable
- public Animation loadVoiceActivityExitAnimation(boolean enter) {
+ public Animation loadVoiceActivityOpenAnimation(boolean enter) {
+ return loadVoiceActivityOpenAnimation(enter, UserHandle.USER_CURRENT);
+ }
+
+ /** Load voice activity exit animation for user. */
+ @Nullable
+ public Animation loadVoiceActivityExitAnimation(boolean enter, int userId) {
return loadDefaultAnimationRes(enter
? com.android.internal.R.anim.voice_activity_close_enter
- : com.android.internal.R.anim.voice_activity_close_exit);
+ : com.android.internal.R.anim.voice_activity_close_exit, userId);
+ }
+
+ /** Same as {@code loadVoiceActivityExitAnimation} for current user. */
+ @Nullable
+ public Animation loadVoiceActivityExitAnimation(boolean enter) {
+ return loadVoiceActivityExitAnimation(enter, UserHandle.USER_CURRENT);
}
@Nullable
@@ -211,10 +232,17 @@
return loadAnimationRes(packageName, resId);
}
+ /** Load cross profile app enter animation for user. */
+ @Nullable
+ public Animation loadCrossProfileAppEnterAnimation(int userId) {
+ return loadAnimationRes(DEFAULT_PACKAGE,
+ com.android.internal.R.anim.task_open_enter_cross_profile_apps, userId);
+ }
+
+ /** Same as {@code loadCrossProfileAppEnterAnimation} for current user. */
@Nullable
public Animation loadCrossProfileAppEnterAnimation() {
- return loadAnimationRes(DEFAULT_PACKAGE,
- com.android.internal.R.anim.task_open_enter_cross_profile_apps);
+ return loadCrossProfileAppEnterAnimation(UserHandle.USER_CURRENT);
}
@Nullable
@@ -230,11 +258,11 @@
appRect.height(), 0, null);
}
- /** Load animation by resource Id from specific package. */
+ /** Load animation by resource Id from specific package for user. */
@Nullable
- public Animation loadAnimationRes(String packageName, int resId) {
+ public Animation loadAnimationRes(String packageName, int resId, int userId) {
if (ResourceId.isValid(resId)) {
- AttributeCache.Entry ent = getCachedAnimations(packageName, resId);
+ AttributeCache.Entry ent = getCachedAnimations(packageName, resId, userId);
if (ent != null) {
return loadAnimationSafely(ent.context, resId, mTag);
}
@@ -242,10 +270,22 @@
return null;
}
- /** Load animation by resource Id from android package. */
+ /** Same as {@code loadAnimationRes} for current user. */
+ @Nullable
+ public Animation loadAnimationRes(String packageName, int resId) {
+ return loadAnimationRes(packageName, resId, UserHandle.USER_CURRENT);
+ }
+
+ /** Load animation by resource Id from android package for user. */
+ @Nullable
+ public Animation loadDefaultAnimationRes(int resId, int userId) {
+ return loadAnimationRes(DEFAULT_PACKAGE, resId, userId);
+ }
+
+ /** Same as {@code loadDefaultAnimationRes} for current user. */
@Nullable
public Animation loadDefaultAnimationRes(int resId) {
- return loadAnimationRes(DEFAULT_PACKAGE, resId);
+ return loadAnimationRes(DEFAULT_PACKAGE, resId, UserHandle.USER_CURRENT);
}
/** Load animation by attribute Id from specific LayoutParams */
@@ -378,10 +418,10 @@
}
@Nullable
- private AttributeCache.Entry getCachedAnimations(String packageName, int resId) {
+ private AttributeCache.Entry getCachedAnimations(String packageName, int resId, int userId) {
if (mDebug) {
- Slog.v(mTag, "Loading animations: package="
- + packageName + " resId=0x" + Integer.toHexString(resId));
+ Slog.v(mTag, "Loading animations: package=" + packageName + " resId=0x"
+ + Integer.toHexString(resId) + " for user=" + userId);
}
if (packageName != null) {
if ((resId & 0xFF000000) == 0x01000000) {
@@ -392,11 +432,16 @@
+ packageName);
}
return AttributeCache.instance().get(packageName, resId,
- com.android.internal.R.styleable.WindowAnimation);
+ com.android.internal.R.styleable.WindowAnimation, userId);
}
return null;
}
+ @Nullable
+ private AttributeCache.Entry getCachedAnimations(String packageName, int resId) {
+ return getCachedAnimations(packageName, resId, UserHandle.USER_CURRENT);
+ }
+
/** Returns window animation style ID from {@link LayoutParams} or from system in some cases */
public int getAnimationStyleResId(@NonNull LayoutParams lp) {
int resId = lp.windowAnimations;
diff --git a/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java b/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java
index 1fd933f..e440dc9 100644
--- a/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java
+++ b/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java
@@ -34,7 +34,6 @@
import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MESSAGES;
import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.GROUP_ID;
import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.LEVEL;
-import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.LOCATION;
import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.MESSAGE;
import static android.internal.perfetto.protos.TracePacketOuterClass.TracePacket.INTERNED_DATA;
import static android.internal.perfetto.protos.TracePacketOuterClass.TracePacket.PROTOLOG_MESSAGE;
@@ -72,7 +71,6 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
-import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
@@ -103,6 +101,7 @@
private final ProtoLogDataSource mDataSource;
@Nullable
private final ProtoLogViewerConfigReader mViewerConfigReader;
+ @Deprecated
@Nullable
private final ViewerConfigInputStreamProvider mViewerConfigInputStreamProvider;
@NonNull
@@ -148,6 +147,7 @@
cacheUpdater, groups);
}
+ @Deprecated
@VisibleForTesting
public PerfettoProtoLogImpl(
@Nullable ViewerConfigInputStreamProvider viewerConfigInputStreamProvider,
@@ -160,6 +160,18 @@
groups, dataSourceBuilder, configurationService);
}
+ @VisibleForTesting
+ public PerfettoProtoLogImpl(
+ @Nullable String viewerConfigFilePath,
+ @Nullable ProtoLogViewerConfigReader viewerConfigReader,
+ @NonNull Runnable cacheUpdater,
+ @NonNull IProtoLogGroup[] groups,
+ @NonNull ProtoLogDataSourceBuilder dataSourceBuilder,
+ @NonNull ProtoLogConfigurationService configurationService) {
+ this(viewerConfigFilePath, null, viewerConfigReader, cacheUpdater,
+ groups, dataSourceBuilder, configurationService);
+ }
+
private PerfettoProtoLogImpl(
@Nullable String viewerConfigFilePath,
@Nullable ViewerConfigInputStreamProvider viewerConfigInputStreamProvider,
@@ -449,6 +461,7 @@
Log.d(LOG_TAG, "Finished onTracingFlush");
}
+ @Deprecated
private void dumpViewerConfig() {
if (mViewerConfigInputStreamProvider == null) {
// No viewer config available
@@ -457,103 +470,29 @@
Log.d(LOG_TAG, "Dumping viewer config to trace");
- mDataSource.trace(ctx -> {
- try {
- ProtoInputStream pis = mViewerConfigInputStreamProvider.getInputStream();
-
- final ProtoOutputStream os = ctx.newTracePacket();
-
- os.write(TIMESTAMP, SystemClock.elapsedRealtimeNanos());
-
- final long outProtologViewerConfigToken = os.start(PROTOLOG_VIEWER_CONFIG);
- while (pis.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
- if (pis.getFieldNumber() == (int) MESSAGES) {
- writeViewerConfigMessage(pis, os);
- }
-
- if (pis.getFieldNumber() == (int) GROUPS) {
- writeViewerConfigGroup(pis, os);
- }
- }
-
- os.end(outProtologViewerConfigToken);
- } catch (IOException e) {
- Log.e(LOG_TAG, "Failed to read ProtoLog viewer config to dump on tracing end", e);
- }
- });
+ Utils.dumpViewerConfig(mDataSource, mViewerConfigInputStreamProvider);
Log.d(LOG_TAG, "Dumped viewer config to trace");
}
- private static void writeViewerConfigGroup(
- ProtoInputStream pis, ProtoOutputStream os) throws IOException {
- final long inGroupToken = pis.start(GROUPS);
- final long outGroupToken = os.start(GROUPS);
-
- while (pis.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
- switch (pis.getFieldNumber()) {
- case (int) ID:
- int id = pis.readInt(ID);
- os.write(ID, id);
- break;
- case (int) NAME:
- String name = pis.readString(NAME);
- os.write(NAME, name);
- break;
- case (int) TAG:
- String tag = pis.readString(TAG);
- os.write(TAG, tag);
- break;
- default:
- throw new RuntimeException(
- "Unexpected field id " + pis.getFieldNumber());
- }
- }
-
- pis.end(inGroupToken);
- os.end(outGroupToken);
- }
-
- private static void writeViewerConfigMessage(
- ProtoInputStream pis, ProtoOutputStream os) throws IOException {
- final long inMessageToken = pis.start(MESSAGES);
- final long outMessagesToken = os.start(MESSAGES);
-
- while (pis.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
- switch (pis.getFieldNumber()) {
- case (int) MessageData.MESSAGE_ID:
- os.write(MessageData.MESSAGE_ID,
- pis.readLong(MessageData.MESSAGE_ID));
- break;
- case (int) MESSAGE:
- os.write(MESSAGE, pis.readString(MESSAGE));
- break;
- case (int) LEVEL:
- os.write(LEVEL, pis.readInt(LEVEL));
- break;
- case (int) GROUP_ID:
- os.write(GROUP_ID, pis.readInt(GROUP_ID));
- break;
- case (int) LOCATION:
- os.write(LOCATION, pis.readString(LOCATION));
- break;
- default:
- throw new RuntimeException(
- "Unexpected field id " + pis.getFieldNumber());
- }
- }
-
- pis.end(inMessageToken);
- os.end(outMessagesToken);
- }
-
private void logToLogcat(String tag, LogLevel level, Message message,
@Nullable Object[] args) {
String messageString;
if (mViewerConfigReader == null) {
messageString = message.getMessage();
+
+ if (messageString == null) {
+ Log.e(LOG_TAG, "Failed to decode message for logcat. "
+ + "Message not available without ViewerConfig to decode the hash.");
+ }
} else {
messageString = message.getMessage(mViewerConfigReader);
+
+ if (messageString == null) {
+ Log.e(LOG_TAG, "Failed to decode message for logcat. "
+ + "Message hash either not available in viewerConfig file or "
+ + "not loaded into memory from file before decoding.");
+ }
}
if (messageString == null) {
@@ -760,7 +699,7 @@
os.write(MessageData.MESSAGE_ID, messageHash);
os.write(MESSAGE, message);
- os.write(LEVEL, level.ordinal());
+ os.write(LEVEL, level.id);
os.write(GROUP_ID, logGroup.getId());
os.end(messageConfigToken);
@@ -954,8 +893,7 @@
private static class Message {
@Nullable
private final Long mMessageHash;
- @Nullable
- private final Integer mMessageMask;
+ private final int mMessageMask;
@Nullable
private final String mMessageString;
@@ -972,8 +910,7 @@
this.mMessageString = messageString;
}
- @Nullable
- private Integer getMessageMask() {
+ private int getMessageMask() {
return mMessageMask;
}
diff --git a/core/java/com/android/internal/protolog/ProtoLogConfigurationService.java b/core/java/com/android/internal/protolog/ProtoLogConfigurationService.java
index d54a80b..7031d69 100644
--- a/core/java/com/android/internal/protolog/ProtoLogConfigurationService.java
+++ b/core/java/com/android/internal/protolog/ProtoLogConfigurationService.java
@@ -26,8 +26,6 @@
import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.LOCATION;
import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.MESSAGE;
import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.MESSAGE_ID;
-import static android.internal.perfetto.protos.TracePacketOuterClass.TracePacket.PROTOLOG_VIEWER_CONFIG;
-import static android.internal.perfetto.protos.TracePacketOuterClass.TracePacket.TIMESTAMP;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -36,7 +34,6 @@
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ShellCallback;
-import android.os.SystemClock;
import android.tracing.perfetto.DataSourceParams;
import android.tracing.perfetto.InitArguments;
import android.tracing.perfetto.Producer;
@@ -125,7 +122,8 @@
this(ProtoLogDataSource::new, tracer);
}
- private ProtoLogConfigurationService(
+ @VisibleForTesting
+ public ProtoLogConfigurationService(
@NonNull ProtoLogDataSourceBuilder dataSourceBuilder,
@NonNull ViewerConfigFileTracer tracer) {
mDataSource = dataSourceBuilder.build(
@@ -374,32 +372,13 @@
private static void dumpTransitionTraceConfig(@NonNull ProtoLogDataSource dataSource,
@NonNull String viewerConfigFilePath) {
- dataSource.trace(ctx -> {
- final ProtoInputStream pis;
+ Utils.dumpViewerConfig(dataSource, () -> {
try {
- pis = new ProtoInputStream(new FileInputStream(viewerConfigFilePath));
+ return new ProtoInputStream(new FileInputStream(viewerConfigFilePath));
} catch (FileNotFoundException e) {
throw new RuntimeException(
"Failed to load viewer config file " + viewerConfigFilePath, e);
}
-
- try {
- final ProtoOutputStream os = ctx.newTracePacket();
-
- os.write(TIMESTAMP, SystemClock.elapsedRealtimeNanos());
-
- final long outProtologViewerConfigToken = os.start(PROTOLOG_VIEWER_CONFIG);
- while (pis.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
- switch (pis.getFieldNumber()) {
- case (int) MESSAGES -> writeViewerConfigMessage(pis, os);
- case (int) GROUPS -> writeViewerConfigGroup(pis, os);
- }
- }
-
- os.end(outProtologViewerConfigToken);
- } catch (IOException e) {
- Log.e(LOG_TAG, "Failed to read ProtoLog viewer config to dump on tracing end", e);
- }
});
}
diff --git a/core/java/com/android/internal/protolog/ProtoLogDataSource.java b/core/java/com/android/internal/protolog/ProtoLogDataSource.java
index 1b2f5f7..0afb135 100644
--- a/core/java/com/android/internal/protolog/ProtoLogDataSource.java
+++ b/core/java/com/android/internal/protolog/ProtoLogDataSource.java
@@ -283,10 +283,24 @@
public static class Instance extends DataSourceInstance {
public interface TracingInstanceStartCallback {
+ /**
+ * Execute the tracing instance's onStart callback.
+ * @param instanceIdx The index of the tracing instance we are executing the callback
+ * for.
+ * @param config The protolog configuration for the tracing instance we are executing
+ * the callback for.
+ */
void run(int instanceIdx, @NonNull ProtoLogConfig config);
}
public interface TracingInstanceStopCallback {
+ /**
+ * Execute the tracing instance's onStop callback.
+ * @param instanceIdx The index of the tracing instance we are executing the callback
+ * for.
+ * @param config The protolog configuration for the tracing instance we are executing
+ * the callback for.
+ */
void run(int instanceIdx, @NonNull ProtoLogConfig config);
}
diff --git a/core/java/com/android/internal/protolog/ProtoLogImpl.java b/core/java/com/android/internal/protolog/ProtoLogImpl.java
index da6d8cf..7bdcf2d 100644
--- a/core/java/com/android/internal/protolog/ProtoLogImpl.java
+++ b/core/java/com/android/internal/protolog/ProtoLogImpl.java
@@ -23,6 +23,7 @@
import static com.android.internal.protolog.common.ProtoLogToolInjected.Value.VIEWER_CONFIG_PATH;
import android.annotation.Nullable;
+import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.IProtoLog;
@@ -37,6 +38,8 @@
* A service for the ProtoLog logging system.
*/
public class ProtoLogImpl {
+ private static final String LOG_TAG = "ProtoLogImpl";
+
private static IProtoLog sServiceInstance = null;
@ProtoLogToolInjected(VIEWER_CONFIG_PATH)
@@ -97,6 +100,9 @@
*/
public static synchronized IProtoLog getSingleInstance() {
if (sServiceInstance == null) {
+ Log.i(LOG_TAG, "Setting up " + ProtoLogImpl.class.getSimpleName() + " with "
+ + "viewerConfigPath = " + sViewerConfigPath);
+
final var groups = sLogGroups.values().toArray(new IProtoLogGroup[0]);
if (android.tracing.Flags.perfettoProtologTracing()) {
@@ -105,6 +111,9 @@
// TODO(b/353530422): Remove - temporary fix to unblock b/352290057
// In some tests the viewer config file might not exist in which we don't
// want to provide config path to the user
+ Log.w(LOG_TAG, "Failed to find viewerConfigFile when setting up "
+ + ProtoLogImpl.class.getSimpleName() + ". "
+ + "Setting up without a viewer config instead...");
sServiceInstance = new PerfettoProtoLogImpl(sCacheUpdater, groups);
} else {
sServiceInstance =
diff --git a/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java b/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java
index 6c8996e..0a80e00 100644
--- a/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java
+++ b/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java
@@ -43,6 +43,13 @@
return mLogMessageMap.get(messageHash);
}
+ /**
+ * Load the viewer configs for the target groups into memory.
+ * Only viewer configs loaded into memory can be required. So this must be called for all groups
+ * we want to query before we query their viewer config.
+ *
+ * @param groups Groups to load the viewer configs from file into memory.
+ */
public synchronized void loadViewerConfig(@NonNull String[] groups) {
loadViewerConfig(groups, (message) -> {});
}
diff --git a/core/java/com/android/internal/protolog/Utils.java b/core/java/com/android/internal/protolog/Utils.java
new file mode 100644
index 0000000..1e6ba30
--- /dev/null
+++ b/core/java/com/android/internal/protolog/Utils.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.protolog;
+
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.GROUPS;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.Group.ID;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.Group.NAME;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.Group.TAG;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MESSAGES;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.GROUP_ID;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.LEVEL;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.LOCATION;
+import static android.internal.perfetto.protos.Protolog.ProtoLogViewerConfig.MessageData.MESSAGE;
+import static android.internal.perfetto.protos.TracePacketOuterClass.TracePacket.PROTOLOG_VIEWER_CONFIG;
+import static android.internal.perfetto.protos.TracePacketOuterClass.TracePacket.TIMESTAMP;
+
+import android.annotation.NonNull;
+import android.internal.perfetto.protos.Protolog;
+import android.os.SystemClock;
+import android.util.Log;
+import android.util.proto.ProtoInputStream;
+import android.util.proto.ProtoOutputStream;
+
+import java.io.IOException;
+
+public class Utils {
+ private static final String LOG_TAG = "ProtoLogUtils";
+
+ /**
+ * Dump the viewer config provided by the input stream to the target datasource.
+ * @param dataSource The datasource to dump the ProtoLog viewer config to.
+ * @param viewerConfigInputStreamProvider The InputStream that provided the proto viewer config.
+ */
+ public static void dumpViewerConfig(@NonNull ProtoLogDataSource dataSource,
+ @NonNull ViewerConfigInputStreamProvider viewerConfigInputStreamProvider) {
+ dataSource.trace(ctx -> {
+ try {
+ ProtoInputStream pis = viewerConfigInputStreamProvider.getInputStream();
+
+ final ProtoOutputStream os = ctx.newTracePacket();
+
+ os.write(TIMESTAMP, SystemClock.elapsedRealtimeNanos());
+
+ final long outProtologViewerConfigToken = os.start(PROTOLOG_VIEWER_CONFIG);
+ while (pis.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
+ if (pis.getFieldNumber() == (int) MESSAGES) {
+ writeViewerConfigMessage(pis, os);
+ }
+
+ if (pis.getFieldNumber() == (int) GROUPS) {
+ writeViewerConfigGroup(pis, os);
+ }
+ }
+
+ os.end(outProtologViewerConfigToken);
+ } catch (IOException e) {
+ Log.e(LOG_TAG, "Failed to read ProtoLog viewer config to dump to datasource", e);
+ }
+ });
+ }
+
+ private static void writeViewerConfigGroup(
+ @NonNull ProtoInputStream pis, @NonNull ProtoOutputStream os) throws IOException {
+ final long inGroupToken = pis.start(GROUPS);
+ final long outGroupToken = os.start(GROUPS);
+
+ while (pis.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
+ switch (pis.getFieldNumber()) {
+ case (int) ID:
+ int id = pis.readInt(ID);
+ os.write(ID, id);
+ break;
+ case (int) NAME:
+ String name = pis.readString(NAME);
+ os.write(NAME, name);
+ break;
+ case (int) TAG:
+ String tag = pis.readString(TAG);
+ os.write(TAG, tag);
+ break;
+ default:
+ throw new RuntimeException(
+ "Unexpected field id " + pis.getFieldNumber());
+ }
+ }
+
+ pis.end(inGroupToken);
+ os.end(outGroupToken);
+ }
+
+ private static void writeViewerConfigMessage(
+ ProtoInputStream pis, ProtoOutputStream os) throws IOException {
+ final long inMessageToken = pis.start(MESSAGES);
+ final long outMessagesToken = os.start(MESSAGES);
+
+ while (pis.nextField() != ProtoInputStream.NO_MORE_FIELDS) {
+ switch (pis.getFieldNumber()) {
+ case (int) Protolog.ProtoLogViewerConfig.MessageData.MESSAGE_ID:
+ os.write(Protolog.ProtoLogViewerConfig.MessageData.MESSAGE_ID,
+ pis.readLong(Protolog.ProtoLogViewerConfig.MessageData.MESSAGE_ID));
+ break;
+ case (int) MESSAGE:
+ os.write(MESSAGE, pis.readString(MESSAGE));
+ break;
+ case (int) LEVEL:
+ os.write(LEVEL, pis.readInt(LEVEL));
+ break;
+ case (int) GROUP_ID:
+ os.write(GROUP_ID, pis.readInt(GROUP_ID));
+ break;
+ case (int) LOCATION:
+ os.write(LOCATION, pis.readString(LOCATION));
+ break;
+ default:
+ throw new RuntimeException(
+ "Unexpected field id " + pis.getFieldNumber());
+ }
+ }
+
+ pis.end(inMessageToken);
+ os.end(outMessagesToken);
+ }
+
+}
diff --git a/core/java/com/android/internal/protolog/common/LogLevel.java b/core/java/com/android/internal/protolog/common/LogLevel.java
index 16c34e1..b5541ae 100644
--- a/core/java/com/android/internal/protolog/common/LogLevel.java
+++ b/core/java/com/android/internal/protolog/common/LogLevel.java
@@ -17,10 +17,18 @@
package com.android.internal.protolog.common;
public enum LogLevel {
- DEBUG("d"), VERBOSE("v"), INFO("i"), WARN("w"), ERROR("e"), WTF("wtf");
+ DEBUG("d", 1),
+ VERBOSE("v", 2),
+ INFO("i", 3),
+ WARN("w", 4),
+ ERROR("e", 5),
+ WTF("wtf", 6);
public final String shortCode;
- LogLevel(String shortCode) {
+ public final int id;
+
+ LogLevel(String shortCode, int id) {
this.shortCode = shortCode;
+ this.id = id;
}
}
diff --git a/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java b/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java
index 319efe0..30b160a 100644
--- a/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java
+++ b/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java
@@ -16,15 +16,15 @@
package com.android.internal.ravenwood;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
-import android.ravenwood.annotation.RavenwoodNativeSubstitutionClass;
+import android.ravenwood.annotation.RavenwoodRedirect;
+import android.ravenwood.annotation.RavenwoodRedirectionClass;
import android.ravenwood.annotation.RavenwoodReplace;
/**
* Class to interact with the Ravenwood environment.
*/
@RavenwoodKeepWholeClass
-@RavenwoodNativeSubstitutionClass(
- "com.android.platform.test.ravenwood.nativesubstitution.RavenwoodEnvironment_host")
+@RavenwoodRedirectionClass("RavenwoodEnvironment_host")
public final class RavenwoodEnvironment {
public static final String TAG = "RavenwoodEnvironment";
@@ -40,7 +40,7 @@
ensureRavenwoodInitialized();
}
- private static RuntimeException notSupportedOnDevice() {
+ public static RuntimeException notSupportedOnDevice() {
return new UnsupportedOperationException("This method can only be used on Ravenwood");
}
@@ -56,14 +56,10 @@
*
* No-op if called on the device side.
*/
- @RavenwoodReplace
+ @RavenwoodRedirect
public static void ensureRavenwoodInitialized() {
}
- private static void ensureRavenwoodInitialized$ravenwood() {
- nativeEnsureRavenwoodInitialized();
- }
-
/**
* USE IT SPARINGLY! Returns true if it's running on Ravenwood, hostside test environment.
*
@@ -89,15 +85,11 @@
* Get the object back from the address obtained from
* {@link dalvik.system.VMRuntime#addressOf(Object)}.
*/
- @RavenwoodReplace
+ @RavenwoodRedirect
public <T> T fromAddress(long address) {
throw notSupportedOnDevice();
}
- private <T> T fromAddress$ravenwood(long address) {
- return nativeFromAddress(address);
- }
-
/**
* See {@link Workaround}. It's only usable on Ravenwood.
*/
@@ -113,20 +105,11 @@
/**
* @return the "ravenwood-runtime" directory.
*/
- @RavenwoodReplace
+ @RavenwoodRedirect
public String getRavenwoodRuntimePath() {
throw notSupportedOnDevice();
}
- private String getRavenwoodRuntimePath$ravenwood() {
- return nativeGetRavenwoodRuntimePath();
- }
-
- // Private native methods that are actually substituted on Ravenwood
- private native <T> T nativeFromAddress(long address);
- private native String nativeGetRavenwoodRuntimePath();
- private static native void nativeEnsureRavenwoodInitialized();
-
/**
* A set of APIs used to work around missing features on Ravenwood. Ideally, this class should
* be empty, and all its APIs should be able to be implemented properly.
diff --git a/core/java/com/android/internal/widget/LockPatternView.java b/core/java/com/android/internal/widget/LockPatternView.java
index 11c220b..0ec55f9 100644
--- a/core/java/com/android/internal/widget/LockPatternView.java
+++ b/core/java/com/android/internal/widget/LockPatternView.java
@@ -120,6 +120,7 @@
private static final String TAG = "LockPatternView";
private OnPatternListener mOnPatternListener;
+ private ExternalHapticsPlayer mExternalHapticsPlayer;
@UnsupportedAppUsage
private final ArrayList<Cell> mPattern = new ArrayList<Cell>(9);
@@ -317,6 +318,13 @@
void onPatternDetected(List<Cell> pattern);
}
+ /** An external haptics player for pattern updates. */
+ public interface ExternalHapticsPlayer{
+
+ /** Perform haptic feedback when a cell is added to the pattern. */
+ void performCellAddedFeedback();
+ }
+
public LockPatternView(Context context) {
this(context, null);
}
@@ -461,6 +469,15 @@
}
/**
+ * Set the external haptics player for feedback on pattern detection.
+ * @param player The external player.
+ */
+ @UnsupportedAppUsage
+ public void setExternalHapticsPlayer(ExternalHapticsPlayer player) {
+ mExternalHapticsPlayer = player;
+ }
+
+ /**
* Set the pattern explicitely (rather than waiting for the user to input
* a pattern).
* @param displayMode How to display the pattern.
@@ -847,6 +864,16 @@
return null;
}
+ @Override
+ public boolean performHapticFeedback(int feedbackConstant, int flags) {
+ if (mExternalHapticsPlayer != null) {
+ mExternalHapticsPlayer.performCellAddedFeedback();
+ return true;
+ } else {
+ return super.performHapticFeedback(feedbackConstant, flags);
+ }
+ }
+
private void addCellToPattern(Cell newCell) {
mPatternDrawLookup[newCell.getRow()][newCell.getColumn()] = true;
mPattern.add(newCell);
diff --git a/core/java/com/android/internal/widget/ViewGroupFader.java b/core/java/com/android/internal/widget/ViewGroupFader.java
index b54023a..21206c2 100644
--- a/core/java/com/android/internal/widget/ViewGroupFader.java
+++ b/core/java/com/android/internal/widget/ViewGroupFader.java
@@ -16,12 +16,14 @@
package com.android.internal.widget;
+import android.content.res.Resources;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.MarginLayoutParams;
import android.view.animation.BaseInterpolator;
import android.view.animation.PathInterpolator;
+import android.widget.flags.Flags;
/**
* This class is ported from
@@ -36,7 +38,7 @@
* height of the child. When not in the top or bottom regions, children have their default alpha and
* scale.
*/
-class ViewGroupFader {
+public class ViewGroupFader {
private static final float SCALE_LOWER_BOUND = 0.7f;
private float mScaleLowerBound = SCALE_LOWER_BOUND;
@@ -68,7 +70,7 @@
private BaseInterpolator mBottomInterpolator = new PathInterpolator(0.3f, 0f, 0.7f, 1f);
/** Callback which is called when attempting to fade a view. */
- interface AnimationCallback {
+ public interface AnimationCallback {
boolean shouldFadeFromTop(View view);
boolean shouldFadeFromBottom(View view);
@@ -82,7 +84,7 @@
* of the current position.
*/
// TODO(b/182846214): Clean up the interface design to avoid exposing too much details to users.
- interface ChildViewBoundsProvider {
+ public interface ChildViewBoundsProvider {
/**
* Provide the bounds of the child view.
*
@@ -168,7 +170,7 @@
}
}
- ViewGroupFader(
+ public ViewGroupFader(
ViewGroup parent,
AnimationCallback callback,
ChildViewBoundsProvider childViewBoundsProvider) {
@@ -212,7 +214,7 @@
this.mContainerBoundsProvider = boundsProvider;
}
- void updateFade() {
+ public void updateFade() {
mContainerBoundsProvider.provideBounds(mParent, mContainerBounds);
mTopBoundPixels = mContainerBounds.height() * mChainedBoundsTop;
mBottomBoundPixels = mContainerBounds.height() * mChainedBoundsBottom;
@@ -221,13 +223,20 @@
}
/** For each list element, calculate and adjust the scale and alpha based on its position */
- private void updateListElementFades(ViewGroup parent, boolean shouldFade) {
+ public void updateListElementFades(ViewGroup parent, boolean shouldFade) {
for (int i = 0; i < parent.getChildCount(); i++) {
View child = parent.getChildAt(i);
if (child.getVisibility() != View.VISIBLE) {
continue;
}
+ if (Flags.enableFadingViewGroup() && Resources.getSystem().getBoolean(
+ com.android.internal.R.bool.config_enableViewGroupScalingFading)) {
+ if (child instanceof ViewGroup) {
+ updateListElementFades((ViewGroup) child, true);
+ }
+ }
+
if (shouldFade) {
fadeElement(parent, child);
}
@@ -312,4 +321,4 @@
private static float lerp(float min, float max, float fraction) {
return min + (max - min) * fraction;
}
-}
+}
\ No newline at end of file
diff --git a/core/jni/android_database_SQLiteConnection.cpp b/core/jni/android_database_SQLiteConnection.cpp
index 7410468..3370f38 100644
--- a/core/jni/android_database_SQLiteConnection.cpp
+++ b/core/jni/android_database_SQLiteConnection.cpp
@@ -70,11 +70,14 @@
// Open flags.
// Must be kept in sync with the constants defined in SQLiteDatabase.java.
enum {
+ // LINT.IfChange
OPEN_READWRITE = 0x00000000,
OPEN_READONLY = 0x00000001,
OPEN_READ_MASK = 0x00000001,
NO_LOCALIZED_COLLATORS = 0x00000010,
+ NO_DOUBLE_QUOTED_STRS = 0x00000020,
CREATE_IF_NECESSARY = 0x10000000,
+ // LINT.ThenChange(/core/java/android/database/sqlite/SQLiteDatabase.java)
};
sqlite3* const db;
@@ -156,6 +159,18 @@
}
}
+ // Disallow double-quoted string literals if the proper flag is set.
+ if ((openFlags & SQLiteConnection::NO_DOUBLE_QUOTED_STRS) != 0) {
+ void *setting = 0;
+ int err = 0;
+ if ((err = sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DDL, 0, setting)) != SQLITE_OK) {
+ ALOGE("failed to configure SQLITE_DBCONFIG_DQS_DDL: %d", err);
+ }
+ if ((err = sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DML, 0, setting)) != SQLITE_OK) {
+ ALOGE("failed to configure SQLITE_DBCONFIG_DQS_DML: %d", err);
+ }
+ }
+
// Check that the database is really read/write when that is what we asked for.
if ((sqliteFlags & SQLITE_OPEN_READWRITE) && sqlite3_db_readonly(db, NULL)) {
throw_sqlite3_exception(env, db, "Could not open the database in read/write mode.");
diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp
index 584ebaa..dec724b 100644
--- a/core/jni/android_os_Parcel.cpp
+++ b/core/jni/android_os_Parcel.cpp
@@ -90,7 +90,7 @@
env->CallVoidMethod(parcelObj, gParcelOffsets.recycle);
}
-static void android_os_Parcel_markSensitive(jlong nativePtr)
+static void android_os_Parcel_markSensitive(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel) {
@@ -116,30 +116,30 @@
}
}
-static jboolean android_os_Parcel_isForRpc(jlong nativePtr) {
+static jboolean android_os_Parcel_isForRpc(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr) {
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->isForRpc() : false;
}
-static jint android_os_Parcel_dataSize(jlong nativePtr)
+static jint android_os_Parcel_dataSize(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataSize() : 0;
}
-static jint android_os_Parcel_dataAvail(jlong nativePtr)
+static jint android_os_Parcel_dataAvail(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataAvail() : 0;
}
-static jint android_os_Parcel_dataPosition(jlong nativePtr)
+static jint android_os_Parcel_dataPosition(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataPosition() : 0;
}
-static jint android_os_Parcel_dataCapacity(jlong nativePtr)
+static jint android_os_Parcel_dataCapacity(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataCapacity() : 0;
@@ -156,7 +156,7 @@
}
}
-static void android_os_Parcel_setDataPosition(jlong nativePtr, jint pos)
+static void android_os_Parcel_setDataPosition(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr, jint pos)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -175,7 +175,8 @@
}
}
-static jboolean android_os_Parcel_pushAllowFds(jlong nativePtr, jboolean allowFds)
+static jboolean android_os_Parcel_pushAllowFds(CRITICAL_JNI_PARAMS_COMMA
+ jlong nativePtr, jboolean allowFds)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
jboolean ret = JNI_TRUE;
@@ -185,7 +186,8 @@
return ret;
}
-static void android_os_Parcel_restoreAllowFds(jlong nativePtr, jboolean lastValue)
+static void android_os_Parcel_restoreAllowFds(CRITICAL_JNI_PARAMS_COMMA
+ jlong nativePtr, jboolean lastValue)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -259,22 +261,22 @@
blob.release();
}
-static int android_os_Parcel_writeInt(jlong nativePtr, jint val) {
+static int android_os_Parcel_writeInt(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr, jint val) {
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return (parcel != NULL) ? parcel->writeInt32(val) : OK;
}
-static int android_os_Parcel_writeLong(jlong nativePtr, jlong val) {
+static int android_os_Parcel_writeLong(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr, jlong val) {
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return (parcel != NULL) ? parcel->writeInt64(val) : OK;
}
-static int android_os_Parcel_writeFloat(jlong nativePtr, jfloat val) {
+static int android_os_Parcel_writeFloat(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr, jfloat val) {
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return (parcel != NULL) ? parcel->writeFloat(val) : OK;
}
-static int android_os_Parcel_writeDouble(jlong nativePtr, jdouble val) {
+static int android_os_Parcel_writeDouble(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr, jdouble val) {
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return (parcel != NULL) ? parcel->writeDouble(val) : OK;
}
@@ -446,7 +448,7 @@
return ret;
}
-static jint android_os_Parcel_readInt(jlong nativePtr)
+static jint android_os_Parcel_readInt(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -455,7 +457,7 @@
return 0;
}
-static jlong android_os_Parcel_readLong(jlong nativePtr)
+static jlong android_os_Parcel_readLong(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -464,7 +466,7 @@
return 0;
}
-static jfloat android_os_Parcel_readFloat(jlong nativePtr)
+static jfloat android_os_Parcel_readFloat(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -473,7 +475,7 @@
return 0;
}
-static jdouble android_os_Parcel_readDouble(jlong nativePtr)
+static jdouble android_os_Parcel_readDouble(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -690,7 +692,7 @@
return JNI_FALSE;
}
-static jboolean android_os_Parcel_hasFileDescriptors(jlong nativePtr)
+static jboolean android_os_Parcel_hasFileDescriptors(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
jboolean ret = JNI_FALSE;
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
@@ -807,7 +809,7 @@
return Parcel::getGlobalAllocCount();
}
-static jlong android_os_Parcel_getOpenAshmemSize(jlong nativePtr)
+static jlong android_os_Parcel_getOpenAshmemSize(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -816,7 +818,7 @@
return 0;
}
-static jint android_os_Parcel_readCallingWorkSourceUid(jlong nativePtr)
+static jint android_os_Parcel_readCallingWorkSourceUid(CRITICAL_JNI_PARAMS_COMMA jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
@@ -825,7 +827,8 @@
return IPCThreadState::kUnsetWorkSource;
}
-static jboolean android_os_Parcel_replaceCallingWorkSourceUid(jlong nativePtr, jint uid)
+static jboolean android_os_Parcel_replaceCallingWorkSourceUid(CRITICAL_JNI_PARAMS_COMMA
+ jlong nativePtr, jint uid)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 921b77d..f2c70b5 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -1152,60 +1152,60 @@
// ----------------------------------------------------------------------------
-static jint android_os_Binder_getCallingPid()
+static jint android_os_Binder_getCallingPid(CRITICAL_JNI_PARAMS)
{
return IPCThreadState::self()->getCallingPid();
}
-static jint android_os_Binder_getCallingUid()
+static jint android_os_Binder_getCallingUid(CRITICAL_JNI_PARAMS)
{
return IPCThreadState::self()->getCallingUid();
}
-static jboolean android_os_Binder_isDirectlyHandlingTransactionNative() {
+static jboolean android_os_Binder_isDirectlyHandlingTransactionNative(CRITICAL_JNI_PARAMS) {
return getCurrentServingCall() == BinderCallType::BINDER;
}
-static jlong android_os_Binder_clearCallingIdentity()
+static jlong android_os_Binder_clearCallingIdentity(CRITICAL_JNI_PARAMS)
{
return IPCThreadState::self()->clearCallingIdentity();
}
-static void android_os_Binder_restoreCallingIdentity(jlong token)
+static void android_os_Binder_restoreCallingIdentity(CRITICAL_JNI_PARAMS_COMMA jlong token)
{
IPCThreadState::self()->restoreCallingIdentity(token);
}
-static jboolean android_os_Binder_hasExplicitIdentity() {
+static jboolean android_os_Binder_hasExplicitIdentity(CRITICAL_JNI_PARAMS) {
return IPCThreadState::self()->hasExplicitIdentity();
}
-static void android_os_Binder_setThreadStrictModePolicy(jint policyMask)
+static void android_os_Binder_setThreadStrictModePolicy(CRITICAL_JNI_PARAMS_COMMA jint policyMask)
{
IPCThreadState::self()->setStrictModePolicy(policyMask);
}
-static jint android_os_Binder_getThreadStrictModePolicy()
+static jint android_os_Binder_getThreadStrictModePolicy(CRITICAL_JNI_PARAMS)
{
return IPCThreadState::self()->getStrictModePolicy();
}
-static jlong android_os_Binder_setCallingWorkSourceUid(jint workSource)
+static jlong android_os_Binder_setCallingWorkSourceUid(CRITICAL_JNI_PARAMS_COMMA jint workSource)
{
return IPCThreadState::self()->setCallingWorkSourceUid(workSource);
}
-static jlong android_os_Binder_getCallingWorkSourceUid()
+static jlong android_os_Binder_getCallingWorkSourceUid(CRITICAL_JNI_PARAMS)
{
return IPCThreadState::self()->getCallingWorkSourceUid();
}
-static jlong android_os_Binder_clearCallingWorkSource()
+static jlong android_os_Binder_clearCallingWorkSource(CRITICAL_JNI_PARAMS)
{
return IPCThreadState::self()->clearCallingWorkSource();
}
-static void android_os_Binder_restoreCallingWorkSource(jlong token)
+static void android_os_Binder_restoreCallingWorkSource(CRITICAL_JNI_PARAMS_COMMA jlong token)
{
IPCThreadState::self()->restoreCallingWorkSource(token);
}
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index e5ac0e1..49191ee 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -404,6 +404,11 @@
return;
}
break;
+ case SP_FOREGROUND_WINDOW:
+ if (!CgroupGetAttributePath("HighCapacityWICPUs", &filename)) {
+ return;
+ }
+ break;
case SP_TOP_APP:
if (!CgroupGetAttributePath("MaxCapacityCPUs", &filename)) {
return;
diff --git a/core/jni/android_view_TunnelModeEnabledListener.cpp b/core/jni/android_view_TunnelModeEnabledListener.cpp
index af7bae8..d9ab957 100644
--- a/core/jni/android_view_TunnelModeEnabledListener.cpp
+++ b/core/jni/android_view_TunnelModeEnabledListener.cpp
@@ -88,20 +88,19 @@
void nativeRegister(JNIEnv* env, jclass clazz, jlong ptr) {
sp<TunnelModeEnabledListener> listener = reinterpret_cast<TunnelModeEnabledListener*>(ptr);
- if (SurfaceComposerClient::addTunnelModeEnabledListener(listener) != OK) {
- constexpr auto error_msg = "Couldn't addTunnelModeEnabledListener";
- ALOGE(error_msg);
- jniThrowRuntimeException(env, error_msg);
+ status_t status = SurfaceComposerClient::addTunnelModeEnabledListener(listener);
+ if (status != OK) {
+ ALOGE("Couldn't addTunnelModeEnabledListener (%d)", status);
+ jniThrowRuntimeException(env, "Couldn't addTunnelModeEnabledListener");
}
}
void nativeUnregister(JNIEnv* env, jclass clazz, jlong ptr) {
sp<TunnelModeEnabledListener> listener = reinterpret_cast<TunnelModeEnabledListener*>(ptr);
-
- if (SurfaceComposerClient::removeTunnelModeEnabledListener(listener) != OK) {
- constexpr auto error_msg = "Couldn't removeTunnelModeEnabledListener";
- ALOGE(error_msg);
- jniThrowRuntimeException(env, error_msg);
+ status_t status = SurfaceComposerClient::removeTunnelModeEnabledListener(listener);
+ if (status != OK) {
+ ALOGE("Couldn't removeTunnelModeEnabledListener (%d)", status);
+ jniThrowRuntimeException(env, "Couldn't removeTunnelModeEnabledListener");
}
}
diff --git a/core/proto/android/widget/remoteviews.proto b/core/proto/android/widget/remoteviews.proto
index 5892396..47c97b0 100644
--- a/core/proto/android/widget/remoteviews.proto
+++ b/core/proto/android/widget/remoteviews.proto
@@ -54,6 +54,7 @@
optional bool has_draw_instructions = 13;
repeated bytes bitmap_cache = 14;
optional RemoteCollectionCache remote_collection_cache = 15;
+ repeated Action actions = 16;
message RemoteCollectionCache {
message Entry {
@@ -288,6 +289,91 @@
}
}
}
+
+ message Action {
+ oneof action {
+ AttributeReflectionAction attribute_reflection_action = 1;
+ BitmapReflectionAction bitmap_reflection_action = 2;
+ ComplexUnitDimensionReflectionAction complex_unit_dimension_reflection_action = 3;
+ LayoutParamAction layout_param_action = 4;
+ NightModeReflectionAction night_mode_reflection_action = 5;
+ ReflectionAction reflection_action = 6;
+ RemoveFromParentAction remove_from_parent_action = 7;
+ }
+ }
+
+ message AttributeReflectionAction {
+ optional string view_id = 1;
+ optional string method_name = 2;
+ optional int32 parameter_type = 3;
+ optional int32 resource_type = 4;
+ optional string attribute_id = 5;
+ }
+
+ message BitmapReflectionAction {
+ optional string view_id = 1;
+ optional string method_name = 2;
+ optional int32 bitmap_id = 3;
+ }
+
+ message ComplexUnitDimensionReflectionAction {
+ optional string view_id = 1;
+ optional string method_name = 2;
+ optional int32 parameter_type = 3;
+ optional float dimension_value = 4;
+ optional int32 unit = 5;
+ }
+
+ message LayoutParamAction {
+ optional string view_id = 1;
+ optional int32 property = 2;
+ optional int32 layout_value = 3;
+ optional int32 value_type = 4;
+ }
+
+ message NightModeReflectionAction {
+ optional string view_id = 1;
+ optional string method_name = 2;
+ optional int32 parameter_type = 3;
+ oneof light {
+ Icon light_icon = 4;
+ android.content.res.ColorStateListProto light_color_state_list = 5;
+ int32 light_int = 6;
+ }
+ oneof dark {
+ Icon dark_icon = 7;
+ android.content.res.ColorStateListProto dark_color_state_list = 8;
+ int32 dark_int = 9;
+ }
+ }
+
+ message ReflectionAction {
+ optional string view_id = 1;
+ optional string method_name = 2;
+ optional int32 parameter_type = 3;
+ oneof reflection_value {
+ bool boolean_value = 4;
+ bytes byte_value = 5;
+ int32 short_value = 6;
+ int32 int_value = 7;
+ int64 long_value = 8;
+ float float_value = 9;
+ double double_value = 10;
+ int32 char_value = 11;
+ string string_value = 12;
+ CharSequence char_sequence_value = 13;
+ string uri_value = 14;
+ bytes bitmap_value = 15;
+ android.content.res.ColorStateListProto color_state_list_value = 16;
+ Icon icon_value = 17;
+ int32 blend_mode_value = 18;
+ // Intent and Bundle values are excluded.
+ }
+ }
+
+ message RemoveFromParentAction {
+ optional string view_id = 1;
+ }
}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index a19b71c..d35c66e 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -4033,7 +4033,6 @@
<!-- Allows an application to manage policy related to block package uninstallation.
<p>Protection level: internal|role
<p>Intended for use by the DEVICE_POLICY_MANAGEMENT role only.
- @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled")
-->
<permission android:name="android.permission.MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL"
android:protectionLevel="internal|role" />
@@ -4041,7 +4040,6 @@
<!-- Allows an application to manage policy related to camera toggle.
<p>Protection level: internal|role
<p>Intended for use by the DEVICE_POLICY_MANAGEMENT role only.
- @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled")
-->
<permission android:name="android.permission.MANAGE_DEVICE_POLICY_CAMERA_TOGGLE"
android:protectionLevel="internal|role" />
@@ -4049,7 +4047,6 @@
<!-- Allows an application to manage policy related to microphone toggle.
<p>Protection level: internal|role
<p>Intended for use by the DEVICE_POLICY_MANAGEMENT role only.
- @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled")
-->
<permission android:name="android.permission.MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE"
android:protectionLevel="internal|role" />
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 2873785..a7b6661 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"አንድ መተግበሪያ የፍቃድ ጥያቄውን እያደበዘዘ ነው ስለዚህ የእርስዎ ምላሽ ሊረጋገጥ አይችልም።"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"አንድ ባህሪን መጠቀም ለመጀመር መታ ያድርጉት፦"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"በተደራሽነት አዝራር የሚጠቀሙባቸው ባሕሪያት ይምረጡ"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"በድምፅ ቁልፍ አቋራጭ የሚጠቀሙባቸው ባህሪያት ይምረጡ"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> ጠፍቷል"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"አቋራጮችን አርትዕ ያድርጉ"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"ተከናውኗል"</string>
diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml
index bc1dba27..c5ad8ba 100644
--- a/core/res/res/values-as/strings.xml
+++ b/core/res/res/values-as/strings.xml
@@ -1356,7 +1356,7 @@
<item msgid="9177085807664964627">"ভিপিএন"</item>
</string-array>
<string name="network_switch_type_name_unknown" msgid="3665696841646851068">"অজ্ঞাত প্ৰকাৰৰ নেটৱৰ্ক"</string>
- <string name="accept" msgid="5447154347815825107">"স্বীকাৰ কৰক"</string>
+ <string name="accept" msgid="5447154347815825107">"গ্ৰহণ কৰক"</string>
<string name="decline" msgid="6490507610282145874">"প্ৰত্যাখ্যান কৰক"</string>
<string name="select_character" msgid="3352797107930786979">"বর্ণ লিখক"</string>
<string name="sms_control_title" msgid="4748684259903148341">"এছএমএছ বার্তাবোৰ পঠিয়াই থকা হৈছে"</string>
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"এটা এপে অনুমতিৰ অনুৰোধটো অস্পষ্ট কৰি আছে আৰু সেয়েহে আপোনাৰ সঁহাৰিটো সত্যাপন কৰিব নোৱাৰি।"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"কোনো এটা সুবিধা ব্যৱহাৰ কৰিবলৈ সেইটোত টিপক:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"সাধ্য-সুবিধা বুটামটোৰ জৰিয়তে ব্যৱহাৰ কৰিবলৈ সুবিধাসমূহ বাছনি কৰক"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"ভলিউম কীৰ শ্বৰ্টকাটটোৰ জৰিয়তে ব্যৱহাৰ কৰিবলৈ সুবিধাসমূহ বাছনি কৰক"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> বন্ধ কৰা হৈছে"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"শ্বৰ্টকাটসমূহ সম্পাদনা কৰক"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"কৰা হ’ল"</string>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index b83eca5..8f0f4b2 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -1747,8 +1747,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Aplikacija krije zahtev za dozvolu, pa odgovor ne može da se verifikuje."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Dodirnite neku funkciju da biste počeli da je koristite:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Odaberite funkcije koje ćete koristiti sa dugmetom Pristupačnost"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Odaberite funkcije koje će se koristiti sa prečicom za tastere za jačinu zvuka"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Usluga <xliff:g id="SERVICE_NAME">%s</xliff:g> je isključena"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Izmenite prečice"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Gotovo"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 59645706..7a49bf3 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -1748,8 +1748,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Праграма хавае запыт дазволу, таму ваш адказ немагчыма спраўдзіць."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Каб пачаць выкарыстоўваць функцыю, націсніце на яе:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Выберыце функцыі, якія будзеце выкарыстоўваць з кнопкай спецыяльных магчымасцей"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Выберыце функцыі для выкарыстання з клавішамі гучнасці"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Сэрвіс \"<xliff:g id="SERVICE_NAME">%s</xliff:g>\" выключаны"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Змяніць ярлыкі"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Гатова"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index b9ceede..69e6483 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -1748,8 +1748,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Žádost o oprávnění skrývá nějaká aplikace, proto vaši odpověď nelze ověřit."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Chcete-li některou funkci začít používat, klepněte na ni:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Vyberte funkce, které budete používat s tlačítkem přístupnosti"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Vyberte funkce, které budete používat se zkratkou tlačítek hlasitosti"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Služba <xliff:g id="SERVICE_NAME">%s</xliff:g> byla vypnuta"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Upravit zkratky"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Hotovo"</string>
diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index 19547f8..dad6333 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"An app is obscuring the permission request so your response cannot be verified."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Tap a feature to start using it:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Choose features to use with the accessibility button"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Choose features to use with the volume keys shortcut"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> has been turned off"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Edit shortcuts"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Done"</string>
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index c1eade1..0bcbed7 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"An app is obscuring the permission request so your response cannot be verified."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Tap a feature to start using it:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Choose features to use with the accessibility button"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Choose features to use with the volume keys shortcut"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> has been turned off"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Edit shortcuts"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Done"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index ff7d912..e50d5fa 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -1747,8 +1747,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Una aplicación está ocultando la solicitud de permiso, por lo que no se puede verificar tu respuesta."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Toca una función para empezar a usarla:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Selecciona qué funciones usar con el botón de accesibilidad"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Selecciona qué funciones usar con el acceso directo de teclas de volumen"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Se ha desactivado <xliff:g id="SERVICE_NAME">%s</xliff:g>"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Editar accesos directos"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Hecho"</string>
@@ -1758,7 +1757,7 @@
<string name="color_correction_feature_name" msgid="7975133554160979214">"Corrección de color"</string>
<string name="one_handed_mode_feature_name" msgid="2334330034828094891">"Modo Una mano"</string>
<string name="reduce_bright_colors_feature_name" msgid="3222994553174604132">"Atenuación extra"</string>
- <string name="hearing_aids_feature_name" msgid="1125892105105852542">"Dispositivos auditivos"</string>
+ <string name="hearing_aids_feature_name" msgid="1125892105105852542">"Audífonos"</string>
<string name="accessibility_shortcut_enabling_service" msgid="5473495203759847687">"Al mantener pulsadas las teclas de volumen, se ha activado <xliff:g id="SERVICE_NAME">%1$s</xliff:g>."</string>
<string name="accessibility_shortcut_disabling_service" msgid="8675244165062700619">"Se han mantenido pulsadas las teclas de volumen. Se ha desactivado <xliff:g id="SERVICE_NAME">%1$s</xliff:g>."</string>
<string name="accessibility_shortcut_spoken_feedback" msgid="3760999147597564314">"Suelta las teclas de volumen. Para activar <xliff:g id="SERVICE_NAME">%1$s</xliff:g>, mantén pulsadas las dos teclas de volumen de nuevo durante 3 segundos."</string>
diff --git a/core/res/res/values-et-rEE/config.xml b/core/res/res/values-et-rEE/config.xml
new file mode 100644
index 0000000..cf4d07f2
--- /dev/null
+++ b/core/res/res/values-et-rEE/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2024, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources>
+ <bool name="config_use_sim_language_file">false</bool>
+</resources>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 5e474cd..0c46ed9 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"پاسخ شما تأیید نشد زیرا یک برنامه درخواست اجازه را مسدود کرده است."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"برای استفاده از ویژگی، روی آن تکضرب بزنید:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"انتخاب ویژگیهای موردنظر برای استفاده با دکمه دسترسپذیری"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"انتخاب کنید کدام ویژگیها با میانبر کلیدهای میزان صدا استفاده شود"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> خاموش شده است"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"ویرایش میانبرها"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"تمام"</string>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index 2810b5e..2ac70ab 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"કોઈ ઍપ પરવાનગીની વિનંતીને ઢાંકી રહી છે, તેથી તમારા પ્રતિસાદની ચકાસણી કરી શકાતી નથી."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"સુવિધાનો ઉપયોગ શરૂ કરવા તેના પર ટૅપ કરો:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"ઍક્સેસિબિલિટી બટન વડે તમે ઉપયોગમાં લેવા માગો છો તે સુવિધાઓ પસંદ કરો"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"વૉલ્યૂમ કી શૉર્ટકટ વડે તમે ઉપયોગમાં લેવા માગો છો તે સુવિધાઓ પસંદ કરો"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> બંધ કરવામાં આવ્યું છે"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"શૉર્ટકટમાં ફેરફાર કરો"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"થઈ ગયું"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 700e91a..5f1bb9a 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"ऐप्लिकेशन की वजह से, अनुमति का अनुरोध समझने में परेशानी हो रही है. इसलिए, आपके जवाब की पुष्टि नहीं की जा सकी."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"किसी सुविधा का इस्तेमाल करने के लिए, उस पर टैप करें:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"सुलभता बटन पर टैप करके, इस्तेमाल करने के लिए सुविधाएं चुनें"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"वे सुविधाएं चुनें जिन्हें आवाज़ बटनों के शॉर्टकट के ज़रिए इस्तेमाल करना है"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> को बंद कर दिया गया है"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"शॉर्टकट में बदलाव करें"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"हो गया"</string>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index 3eb2e4b..057b830 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Forrit er að fela heimildarbeiðnina svo ekki er hægt að staðfesta svarið þitt."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Ýttu á eiginleika til að byrja að nota hann:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Veldu eiginleika sem á að nota með aðgengishnappinum"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Veldu eiginleika sem á að nota með flýtileið hljóðstyrkstakka"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Slökkt hefur verið á <xliff:g id="SERVICE_NAME">%s</xliff:g>"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Breyta flýtileiðum"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Lokið"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index bcff813..0705b36 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -1400,10 +1400,10 @@
<string name="usb_tether_notification_title" msgid="8828527870612663771">"USB テザリング ON"</string>
<string name="usb_midi_notification_title" msgid="7404506788950595557">"USB MIDI モード ON"</string>
<string name="usb_uvc_notification_title" msgid="2030032862673400008">"ウェブカメラとしてデバイスを接続しました"</string>
- <string name="usb_accessory_notification_title" msgid="1385394660861956980">"USB アクセサリが接続されました"</string>
+ <string name="usb_accessory_notification_title" msgid="1385394660861956980">"USB アクセサリーが接続されました"</string>
<string name="usb_notification_message" msgid="4715163067192110676">"タップしてその他のオプションを表示します。"</string>
<string name="usb_power_notification_message" msgid="7284765627437897702">"接続されているデバイスを充電しています。タップすると、他の項目が表示されます。"</string>
- <string name="usb_unsupported_audio_accessory_title" msgid="2335775548086533065">"アナログのオーディオ アクセサリを検出"</string>
+ <string name="usb_unsupported_audio_accessory_title" msgid="2335775548086533065">"アナログのオーディオ アクセサリーを検出"</string>
<string name="usb_unsupported_audio_accessory_message" msgid="1300168007129796621">"接続したデバイスはこのスマートフォンと互換性がありません。タップすると、詳細を確認できます。"</string>
<string name="adb_active_notification_title" msgid="408390247354560331">"USB デバッグが接続されました"</string>
<string name="adb_active_notification_message" msgid="5617264033476778211">"無効にするにはここをタップしてください"</string>
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"権限のリクエストを遮っているアプリがあるため、同意の回答を確認できません。"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"使用を開始する機能をタップ:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"ユーザー補助機能ボタンで使用する機能の選択"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"音量ボタンのショートカットで使用する機能の選択"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> はオフになっています"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"ショートカットの編集"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"完了"</string>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index 0adebb0..bac2333 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"აპი მალავს ნებართვის მოთხოვნას, ასე რომ, თქვენი პასუხი ვერ დადასტურდება."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"შეეხეთ ფუნქციას მისი გამოყენების დასაწყებად:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"აირჩიეთ ფუნქციები, რომელთა გამოყენებაც გსურთ მარტივი წვდომის ღილაკით"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"ხმის კლავიშების მალსახმობების მეშვეობით გამოსაყენებელი ფუნქციების არჩევა"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> გამორთულია"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"მალსახმობების რედაქტირება"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"მზადაა"</string>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index f3dd775..1f931c6 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"កម្មវិធីមួយកំពុងបិទបាំងសំណើសុំការអនុញ្ញាត ដូច្នេះមិនអាចផ្ទៀងផ្ទាត់ការឆ្លើយតបរបស់អ្នកបានទេ។"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ចុចមុខងារណាមួយ ដើម្បចាប់ផ្ដើមប្រើ៖"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"ជ្រើសរើសមុខងារ ដើម្បីប្រើជាមួយប៊ូតុងភាពងាយស្រួល"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"ជ្រើសរើសមុខងារ ដើម្បីប្រើជាមួយផ្លូវកាត់គ្រាប់ចុចកម្រិតសំឡេង"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"បានបិទ <xliff:g id="SERVICE_NAME">%s</xliff:g>"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"កែផ្លូវកាត់"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"រួចរាល់"</string>
diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml
index a772e32..941a1b2 100644
--- a/core/res/res/values-kn/strings.xml
+++ b/core/res/res/values-kn/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"ಆ್ಯಪ್ವೊಂದು ಅನುಮತಿ ವಿನಂತಿಯನ್ನು ಮರೆಮಾಚುತ್ತಿರುವ ಕಾರಣ ನಿಮ್ಮ ಪ್ರತಿಕ್ರಿಯೆಯನ್ನು ಪರಿಶೀಲಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ವೈಶಿಷ್ಟ್ದ ಬಳಸುವುದನ್ನು ಪ್ರಾರಂಭಿಸಲು ಅದನ್ನು ಟ್ಯಾಪ್ ಮಾಡಿ:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"ಆ್ಯಕ್ಸೆಸಿಬಿಲಿಟಿ ಬಟನ್ ಜೊತೆಗೆ ಬಳಸಲು ವೈಶಿಷ್ಟ್ಯಗಳನ್ನು ಆಯ್ಕೆಮಾಡಿ"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"ವಾಲ್ಯೂಮ್ ಕೀ ಶಾರ್ಟ್ಕಟ್ ಜೊತೆಗೆ ಬಳಸಲು ಫೀಚರ್ಗಳನ್ನು ಆಯ್ಕೆಮಾಡಿ"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> ಅನ್ನು ಆಫ್ ಮಾಡಲಾಗಿದೆ"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"ಶಾರ್ಟ್ಕಟ್ಗಳನ್ನು ಎಡಿಟ್ ಮಾಡಿ"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"ಪೂರ್ಣಗೊಂಡಿದೆ"</string>
diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml
index 4c2ee5f..43fd6a7 100644
--- a/core/res/res/values-ky/strings.xml
+++ b/core/res/res/values-ky/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Колдонмо уруксат суроону жашырып койгондуктан, жообуңузду ырастоо мүмкүн эмес."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Функцияны колдонуп баштоо үчүн аны таптап коюңуз:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Атайын мүмкүнчүлүктөр баскычы менен колдонгуңуз келген функцияларды тандаңыз"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Үн баскычтары менен кайсы функцияларды иштеткиңиз келет?"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> өчүрүлдү"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Кыска жолдорду түзөтүү"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Бүттү"</string>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index b627503..dc15e9a 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"ແອັບໜຶ່ງກຳລັງປິດບັງຄຳຮ້ອງຂໍການອະນຸຍາດ ດັ່ງນັ້ນຈຶ່ງບໍ່ສາມາດຢັ້ງຢືນຄຳຕອບຂອງທ່ານໄດ້."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ແຕະໃສ່ຄຸນສົມບັດໃດໜຶ່ງເພື່ອເລີ່ມການນຳໃຊ້ມັນ:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"ເລືອກຄຸນສົມບັດເພື່ອໃຊ້ກັບປຸ່ມການຊ່ວຍເຂົ້າເຖິງ"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"ເລືອກຄຸນສົມບັດທີ່ຈະໃຊ້ກັບທາງລັດຂອງປຸ່ມລະດັບສຽງ"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"ປິດ <xliff:g id="SERVICE_NAME">%s</xliff:g> ໄວ້ແລ້ວ"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"ແກ້ໄຂທາງລັດ"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"ແລ້ວໆ"</string>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index 2b1c52f..6d60696 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"ഒരു ആപ്പ്, അനുമതി അഭ്യർത്ഥന മറയ്ക്കുന്നതിനാൽ നിങ്ങളുടെ പ്രതികരണം പരിശോധിച്ചുറപ്പിക്കാനാകില്ല."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ഉപയോഗിച്ച് തുടങ്ങാൻ ഫീച്ചർ ടാപ്പ് ചെയ്യുക:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"ഉപയോഗസഹായി ബട്ടണിന്റെ സഹായത്തോടെ, ഉപയോഗിക്കാൻ ഫീച്ചറുകൾ തിരഞ്ഞെടുക്കുക"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"വോളിയം കീകളുടെ കുറുക്കുവഴികൾക്കൊപ്പം ഉപയോഗിക്കേണ്ട ഫീച്ചറുകൾ തിരഞ്ഞെടുക്കുക"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> ഓഫാക്കിയിരിക്കുന്നു"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"കുറുക്കുവഴികൾ തിരുത്തുക"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"പൂർത്തിയാക്കി"</string>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index 67c3b98..30403cf 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"परवानगी मागणारी विनंती अॅपमुळे अस्पष्ट होत असल्याने, तुमच्या प्रतिसादाची पडताळणी केली जाऊ शकत नाही."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"वैशिष्ट्य वापरणे सुरू करण्यासाठी त्यावर टॅप करा:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"अॅक्सेसिबिलिटी बटणासोबत वापरायची असलेली ॲप्स निवडा"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"व्हॉल्यूम की शॉर्टकटसोबत वापरायची असलेली ॲप्स निवडा"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> बंद केले आहे"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"शॉर्टकट संपादित करा"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"पूर्ण झाले"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 5eac793..e17c62b 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Apl menghalang permintaan kebenaran, maka jawapan anda tidak dapat disahkan."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Ketik ciri untuk mula menggunakan ciri itu:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Pilih ciri untuk digunakan dengan butang kebolehaksesan"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Pilih ciri untuk digunakan dengan pintasan kekunci kelantangan"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> telah dimatikan"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Edit pintasan"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Selesai"</string>
diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml
index b09539c..85fb0e9 100644
--- a/core/res/res/values-my/strings.xml
+++ b/core/res/res/values-my/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"အက်ပ်တစ်ခုသည် ခွင့်ပြုချက်တောင်းဆိုမှုကို ပိတ်နေသဖြင့် သင့်တုံ့ပြန်မှုကို စိစစ်၍မရပါ။"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ဝန်ဆောင်မှုကို စတင်အသုံးပြုရန် တို့ပါ−"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"အများသုံးနိုင်မှု ခလုတ်ဖြင့် အသုံးပြုရန် ဝန်ဆောင်မှုများကို ရွေးပါ"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"အသံထိန်းခလုတ်ဖြတ်လမ်းဖြင့် အသုံးပြုရန်အတွက် တူးလ်များကိုရွေးပါ"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> ကို ပိတ်ထားသည်"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"ဖြတ်လမ်းများကို တည်းဖြတ်ရန်"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"ပြီးပြီ"</string>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index 9f3530a..36e3254 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"कुनै एपका कारण अनुमतिसम्बन्धी अनुरोध बुझ्न कठिनाइ भइरहेकाले तपाईंको जवाफको पुष्टि गर्न सकिएन।"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"कुनै सुविधा प्रयोग गर्न थाल्न उक्त सुविधामा ट्याप गर्नुहोस्:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"पहुँचको बटनमार्फत प्रयोग गर्न चाहेका सुविधाहरू छनौट गर्नुहोस्"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"भोल्युम बटनको सर्टकटमार्फत प्रयोग गर्न चाहेका सुविधाहरू छनौट गर्नुहोस्"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> निष्क्रिय पारिएको छ"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"सर्टकटहरू सम्पादन गर्नुहोस्"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"सम्पन्न भयो"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 8209504..18773f6 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -642,7 +642,7 @@
<string name="permdesc_mediaLocation" msgid="597912899423578138">"Hiermee sta je de app toe locaties van je mediacollectie te bekijken."</string>
<string name="biometric_app_setting_name" msgid="3339209978734534457">"Biometrische gegevens gebruiken"</string>
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biometrische gegevens of schermvergrendeling gebruiken"</string>
- <string name="biometric_dialog_default_title" msgid="55026799173208210">"Je identiteit verifiëren"</string>
+ <string name="biometric_dialog_default_title" msgid="55026799173208210">"Je identiteit bevestigen"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Gebruik je biometrische gegevens om door te gaan"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Gebruik je biometrische gegevens of schermvergrendeling om door te gaan"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrische hardware niet beschikbaar"</string>
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Een app dekt het verzoek om rechten af, waardoor je reactie niet kan worden geverifieerd."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Tik op een functie om deze te gebruiken:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Functies kiezen voor gebruik met de knop Toegankelijkheid"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Functies kiezen voor gebruik met de snelkoppeling met volumeknoppen"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> is uitgezet"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Snelkoppelingen bewerken"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Klaar"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 71940ef..28c130c 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -1747,8 +1747,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Uma app está a ocultar o pedido de autorização e, por isso, não é possível validar a sua resposta."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Toque numa funcionalidade para começar a utilizá-la:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Escolha funcionalidades para utilizar com o botão Acessibilidade"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Escolha funcionalidades para usar com o atalho de teclas de volume"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"O serviço <xliff:g id="SERVICE_NAME">%s</xliff:g> foi desativado."</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Editar atalhos"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Concluído"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 22501f2..3c374ef 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -1748,8 +1748,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Невозможно принять ваш ответ, поскольку запрос разрешения скрыт другим приложением."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Выберите, какую функцию использовать:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Выберите функции, которые будут запускаться с помощью кнопки специальных возможностей"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Выберите функции, которые вы хотите запускать кнопками регулировки громкости"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Сервис \"<xliff:g id="SERVICE_NAME">%s</xliff:g>\" отключен."</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Изменить ярлыки"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Готово"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 3289bbc..7185bcd 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -1748,8 +1748,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Aplikácia zakrýva žiadosť o povolenie, takže vaša odpoveď sa nedá overiť."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Klepnutím na funkciu ju začnite používať:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Výber funkcií, ktoré chcete používať tlačidlom dostupnosti"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Vyberte funkcie, ktoré chcete používať so skratkou tlačidiel hlasitosti"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Služba <xliff:g id="SERVICE_NAME">%s</xliff:g> bola vypnutá"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Upraviť skratky"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Hotovo"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 99ce046..e67bf9c 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -1748,8 +1748,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Aplikacija zakriva zahtevo za dovoljenje, zato ni mogoče potrditi vašega odgovora."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Če želite začeti uporabljati funkcijo, se je dotaknite:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Izberite funkcije, ki jih želite uporabljati z gumbom za dostopnost"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Izberite funkcije, ki jih želite uporabljati z bližnjico gumbov za glasnost"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Storitev <xliff:g id="SERVICE_NAME">%s</xliff:g> je izklopljena"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Uredi bližnjice"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Končano"</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 0451b56..f5988c2 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -1747,8 +1747,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"Апликација крије захтев за дозволу, па одговор не може да се верификује."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"Додирните неку функцију да бисте почели да је користите:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Одаберите функције које ћете користити са дугметом Приступачност"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Одаберите функције које ће се користити са пречицом за тастере за јачину звука"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Услуга <xliff:g id="SERVICE_NAME">%s</xliff:g> је искључена"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"Измените пречице"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Готово"</string>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index b1ce514..626205e 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"அணுகல் கோரிக்கையை ஓர் ஆப்ஸ் மறைப்பதால் உங்கள் பதிலைச் சரிபார்க்க முடியாது."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ஒரு அம்சத்தைப் பயன்படுத்த அதைத் தட்டவும்:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"அணுகல்தன்மை பட்டன் மூலம் பயன்படுத்த விரும்பும் அம்சங்களைத் தேர்வுசெய்யுங்கள்"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"ஒலியளவு விசைகளுக்கான ஷார்ட்கட்டுடன் பயன்படுத்துவதற்கான அம்சங்களைத் தேர்வுசெய்யுங்கள்"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> ஆஃப் செய்யப்பட்டுள்ளது"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"ஷார்ட்கட்களை மாற்று"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"முடிந்தது"</string>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index 4b655d1..db19868 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"ఒక యాప్ అనుమతి రిక్వెస్ట్కు అడ్డు తగులుతోంది కాబట్టి మీ సమాధానం వెరిఫై చేయడం సాధ్యం కాదు."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ఫీచర్ని ఉపయోగించడం ప్రారంభించడానికి, దాన్ని ట్యాప్ చేయండి:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"యాక్సెసిబిలిటీ బటన్తో ఉపయోగించడానికి ఫీచర్లను ఎంచుకోండి"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"వాల్యూమ్ కీల షార్ట్కట్తో ఉపయోగించడానికి ఫీచర్లను ఎంచుకోండి"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> ఆఫ్ చేయబడింది"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"షార్ట్కట్లను ఎడిట్ చేయండి"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"పూర్తయింది"</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index d979c34..b34cf59 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"มีแอปหนึ่งบดบังคำขอสิทธิ์ เราจึงยืนยันการตอบกลับของคุณไม่ได้"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"แตะฟีเจอร์เพื่อเริ่มใช้"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"เลือกฟีเจอร์ที่จะใช้กับปุ่มการช่วยเหลือพิเศษ"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"เลือกฟีเจอร์ที่จะใช้กับทางลัดปุ่มปรับระดับเสียง"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"ปิด <xliff:g id="SERVICE_NAME">%s</xliff:g> แล้ว"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"แก้ไขทางลัด"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"เสร็จ"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index fbbb32c..b976f20 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"May app na pumipigil sa kahilingan sa pahintulot kaya hindi ma-verify ang iyong sagot."</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"I-tap ang isang feature para simulan itong gamitin:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"Pumili ng mga feature na gagana sa pamamagitan ng button ng accessibility"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"Pumili ng mga feature na gagana sa pamamagitan ng shortcut ng mga volume key"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"Na-off ang <xliff:g id="SERVICE_NAME">%s</xliff:g>"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"I-edit ang mga shortcut"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"Tapos na"</string>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index d2f0898..fcfff0f 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -1746,8 +1746,7 @@
<string name="accessibility_dialog_touch_filtered_warning" msgid="3741940116597822451">"ایپ اجازت کی درخواست کو مبہم کر رہی ہے لہذا آپ کے جواب کی تصدیق نہیں کی جا سکتی۔"</string>
<string name="accessibility_select_shortcut_menu_title" msgid="6002726538854613272">"ایک خصوصیت کا استعمال شروع کرنے کیلئے اسے تھپتھپائیں:"</string>
<string name="accessibility_edit_shortcut_menu_button_title" msgid="239446795930436325">"ایکسیسبیلٹی بٹن کے ساتھ استعمال کرنے کیلئے خصوصیات منتخب کریں"</string>
- <!-- no translation found for accessibility_edit_shortcut_menu_volume_title (2245540598834891500) -->
- <skip />
+ <string name="accessibility_edit_shortcut_menu_volume_title" msgid="2245540598834891500">"والیوم کلیدوں کے شارٹ کٹ کے ساتھ استعمال کرنے کیلئے خصوصیات منتخب کریں"</string>
<string name="accessibility_uncheck_legacy_item_warning" msgid="8047830891064817447">"<xliff:g id="SERVICE_NAME">%s</xliff:g> کو آف کر دیا گیا ہے"</string>
<string name="edit_accessibility_shortcut_menu_button" msgid="8885752738733772935">"شارٹ کٹس میں ترمیم کریں"</string>
<string name="done_accessibility_shortcut_menu_button" msgid="3668407723770815708">"ہو گیا"</string>
diff --git a/core/res/res/values-watch/config.xml b/core/res/res/values-watch/config.xml
index 5266214..e28b646 100644
--- a/core/res/res/values-watch/config.xml
+++ b/core/res/res/values-watch/config.xml
@@ -96,4 +96,8 @@
<!-- True if the device supports system decorations on secondary displays. -->
<bool name="config_supportsSystemDecorsOnSecondaryDisplays">false</bool>
+
+ <!-- Whether to enable scaling and fading animation to scrollviews while scrolling.
+ P.S this is a change only intended for wear devices. -->
+ <bool name="config_enableViewGroupScalingFading">true</bool>
</resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 38aff75..f6267f6 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -7121,4 +7121,8 @@
<!-- The maximum number of call log entries for each sim card that can be stored in the call log
provider on the device. -->
<integer name="config_maximumCallLogEntriesPerSim">500</integer>
+
+ <!-- Whether to enable scaling and fading animation to scrollviews while scrolling.
+ P.S this is a change only intended for wear devices. -->
+ <bool name="config_enableViewGroupScalingFading">false</bool>
</resources>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 606c7fd..d634210 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -5509,6 +5509,9 @@
<!-- Message shown in the dialog prompting the user to set up a screen lock to access private space [CHAR LIMIT=120] -->
<string name="private_space_set_up_screen_lock_message">To use your private space, set a screen lock on this device</string>
+ <!-- Message shown in the dialog prompting the user to set up a screen lock to delete private space from Reset Options [CHAR LIMIT=120] -->
+ <string name="private_space_set_up_screen_lock_for_reset">To delete private space, set a screen lock on this device</string>
+
<!-- Title of the dialog that is shown when the user tries to launch a blocked application [CHAR LIMIT=50] -->
<string name="app_blocked_title">App is not available</string>
<!-- Default message shown in the dialog that is shown when the user tries to launch a blocked application [CHAR LIMIT=NONE] -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 4693894..bd8077e 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3299,6 +3299,8 @@
<java-symbol type="string" name="set_up_screen_lock_action_label" />
<!-- Message for the alert dialog prompting the user to set up a screen lock to access private space -->
<java-symbol type="string" name="private_space_set_up_screen_lock_message" />
+ <!-- Message shown in the dialog prompting the user to set up a screen lock to delete private space from Reset Options [CHAR LIMIT=120] -->
+ <java-symbol type="string" name="private_space_set_up_screen_lock_for_reset" />
<java-symbol type="string" name="deprecated_target_sdk_message" />
<java-symbol type="string" name="deprecated_target_sdk_app_store" />
@@ -5601,4 +5603,6 @@
<!-- Fingerprint loe notification string -->
<java-symbol type="string" name="fingerprint_loe_notification_msg" />
+
+ <java-symbol type="bool" name="config_enableViewGroupScalingFading"/>
</resources>
diff --git a/core/tests/BroadcastRadioTests/Android.bp b/core/tests/BroadcastRadioTests/Android.bp
index beffb9a..7d4ae00 100644
--- a/core/tests/BroadcastRadioTests/Android.bp
+++ b/core/tests/BroadcastRadioTests/Android.bp
@@ -45,7 +45,7 @@
"flag-junit",
"mockito-target-extended",
],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
test_suites: [
"general-tests",
"automotive-general-tests",
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/RadioServiceUserControllerTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/RadioServiceUserControllerTest.java
index 516253b..44beb55 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/RadioServiceUserControllerTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/RadioServiceUserControllerTest.java
@@ -19,18 +19,18 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doThrow;
-import static com.google.common.truth.Truth.assertWithMessage;
-
import static org.mockito.Mockito.when;
import android.app.ActivityManager;
-import android.app.compat.CompatChanges;
import android.os.Binder;
import android.os.UserHandle;
import com.android.dx.mockito.inline.extended.StaticMockitoSessionBuilder;
+import com.google.common.truth.Expect;
+
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mock;
@@ -41,36 +41,40 @@
private static final int USER_ID_1 = 11;
private static final int USER_ID_2 = 12;
+ private RadioServiceUserController mUserController;
@Mock
private UserHandle mUserHandleMock;
+ @Rule
+ public final Expect expect = Expect.create();
+
@Override
protected void initializeSession(StaticMockitoSessionBuilder builder) {
- builder.spyStatic(ActivityManager.class).spyStatic(Binder.class)
- .spyStatic(CompatChanges.class);
+ builder.spyStatic(ActivityManager.class).spyStatic(Binder.class);
}
@Before
public void setUp() {
doReturn(mUserHandleMock).when(() -> Binder.getCallingUserHandle());
doReturn(USER_ID_1).when(() -> ActivityManager.getCurrentUser());
+ mUserController = new RadioServiceUserControllerImpl();
}
@Test
public void isCurrentOrSystemUser_forCurrentUser_returnsFalse() {
when(mUserHandleMock.getIdentifier()).thenReturn(USER_ID_1);
- assertWithMessage("Current user")
- .that(RadioServiceUserController.isCurrentOrSystemUser()).isTrue();
+ expect.withMessage("Current user")
+ .that(mUserController.isCurrentOrSystemUser()).isTrue();
}
@Test
public void isCurrentOrSystemUser_forNonCurrentUser_returnsFalse() {
when(mUserHandleMock.getIdentifier()).thenReturn(USER_ID_2);
- assertWithMessage("Non-current user")
- .that(RadioServiceUserController.isCurrentOrSystemUser()).isFalse();
+ expect.withMessage("Non-current user")
+ .that(mUserController.isCurrentOrSystemUser()).isFalse();
}
@Test
@@ -78,8 +82,8 @@
when(mUserHandleMock.getIdentifier()).thenReturn(USER_ID_1);
when(mUserHandleMock.getIdentifier()).thenReturn(UserHandle.USER_SYSTEM);
- assertWithMessage("System user")
- .that(RadioServiceUserController.isCurrentOrSystemUser()).isTrue();
+ expect.withMessage("System user")
+ .that(mUserController.isCurrentOrSystemUser()).isTrue();
}
@Test
@@ -87,14 +91,14 @@
when(mUserHandleMock.getIdentifier()).thenReturn(USER_ID_1);
doThrow(new RuntimeException()).when(ActivityManager::getCurrentUser);
- assertWithMessage("User when activity manager fails")
- .that(RadioServiceUserController.isCurrentOrSystemUser()).isFalse();
+ expect.withMessage("User when activity manager fails")
+ .that(mUserController.isCurrentOrSystemUser()).isFalse();
}
@Test
public void getCurrentUser() {
- assertWithMessage("Current user")
- .that(RadioServiceUserController.getCurrentUser()).isEqualTo(USER_ID_1);
+ expect.withMessage("Current user")
+ .that(mUserController.getCurrentUser()).isEqualTo(USER_ID_1);
}
@Test
@@ -102,7 +106,15 @@
when(mUserHandleMock.getIdentifier()).thenReturn(USER_ID_1);
doThrow(new RuntimeException()).when(ActivityManager::getCurrentUser);
- assertWithMessage("Current user when activity manager fails")
- .that(RadioServiceUserController.getCurrentUser()).isEqualTo(UserHandle.USER_NULL);
+ expect.withMessage("Current user when activity manager fails")
+ .that(mUserController.getCurrentUser()).isEqualTo(UserHandle.USER_NULL);
+ }
+
+ @Test
+ public void getCallingUserId() {
+ when(mUserHandleMock.getIdentifier()).thenReturn(USER_ID_1);
+
+ expect.withMessage("Calling user id")
+ .that(mUserController.getCallingUserId()).isEqualTo(USER_ID_1);
}
}
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImplTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImplTest.java
index 22f3bd4..63f12d8 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImplTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImplTest.java
@@ -91,12 +91,13 @@
private IAnnouncementListener mAnnouncementListenerMock;
@Mock
private IBinder mListenerBinderMock;
+ @Mock
+ private RadioServiceUserController mUserControllerMock;
@Override
protected void initializeSession(StaticMockitoSessionBuilder builder) {
builder.spyStatic(ServiceManager.class)
- .spyStatic(RadioModule.class)
- .spyStatic(RadioServiceUserController.class);
+ .spyStatic(RadioModule.class);
}
@Test
@@ -156,7 +157,7 @@
@Test
public void openSession_forNonCurrentUser_throwsException() throws Exception {
createBroadcastRadioService();
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
IllegalStateException thrown = assertThrows(IllegalStateException.class,
() -> mBroadcastRadioService.openSession(FM_RADIO_MODULE_ID,
@@ -206,9 +207,9 @@
}
private void createBroadcastRadioService() throws RemoteException {
- doReturn(true).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(true).when(mUserControllerMock).isCurrentOrSystemUser();
mockServiceManager();
- mBroadcastRadioService = new BroadcastRadioServiceImpl(SERVICE_LIST);
+ mBroadcastRadioService = new BroadcastRadioServiceImpl(SERVICE_LIST, mUserControllerMock);
}
private void mockServiceManager() throws RemoteException {
@@ -222,9 +223,9 @@
any(IServiceCallback.class)));
doReturn(mFmRadioModuleMock).when(() -> RadioModule.tryLoadingModule(
- eq(FM_RADIO_MODULE_ID), anyString(), any(IBinder.class)));
+ eq(FM_RADIO_MODULE_ID), anyString(), any(IBinder.class), any()));
doReturn(mDabRadioModuleMock).when(() -> RadioModule.tryLoadingModule(
- eq(DAB_RADIO_MODULE_ID), anyString(), any(IBinder.class)));
+ eq(DAB_RADIO_MODULE_ID), anyString(), any(IBinder.class), any()));
when(mFmRadioModuleMock.getProperties()).thenReturn(mFmModuleMock);
when(mDabRadioModuleMock.getProperties()).thenReturn(mDabModuleMock);
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/RadioModuleTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/RadioModuleTest.java
index a952bde..368df09 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/RadioModuleTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/RadioModuleTest.java
@@ -34,6 +34,8 @@
import android.os.ParcelableException;
import android.os.RemoteException;
+import com.android.server.broadcastradio.RadioServiceUserController;
+
import com.google.common.truth.Expect;
import org.junit.Before;
@@ -63,6 +65,8 @@
private IAnnouncementListener mListenerMock;
@Mock
private android.hardware.broadcastradio.ICloseHandle mHalCloseHandleMock;
+ @Mock
+ private RadioServiceUserController mUserControllerMock;
// RadioModule under test
private RadioModule mRadioModule;
@@ -70,7 +74,8 @@
@Before
public void setup() throws RemoteException {
- mRadioModule = new RadioModule(mBroadcastRadioMock, TEST_MODULE_PROPERTIES);
+ mRadioModule = new RadioModule(mBroadcastRadioMock, TEST_MODULE_PROPERTIES,
+ mUserControllerMock);
// TODO(b/241118988): test non-null image for getImage method
when(mBroadcastRadioMock.getImage(anyInt())).thenReturn(null);
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/TunerSessionTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/TunerSessionTest.java
index 92dfe38..24d18e0 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/TunerSessionTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/TunerSessionTest.java
@@ -49,12 +49,10 @@
import android.hardware.radio.RadioManager;
import android.hardware.radio.RadioTuner;
import android.hardware.radio.UniqueProgramIdentifier;
-import android.os.Binder;
import android.os.DeadObjectException;
import android.os.ParcelableException;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
-import android.os.UserHandle;
import android.platform.test.flag.junit.SetFlagsRule;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -148,10 +146,10 @@
// Mocks
@Mock
- private UserHandle mUserHandleMock;
- @Mock
private IBroadcastRadio mBroadcastRadioMock;
private android.hardware.radio.ITunerCallback[] mAidlTunerCallbackMocks;
+ @Mock
+ private RadioServiceUserController mUserControllerMock;
// RadioModule under test
private RadioModule mRadioModule;
@@ -170,8 +168,7 @@
@Override
protected void initializeSession(StaticMockitoSessionBuilder builder) {
- builder.spyStatic(RadioServiceUserController.class).spyStatic(CompatChanges.class)
- .spyStatic(Binder.class);
+ builder.spyStatic(CompatChanges.class);
}
@Before
@@ -182,13 +179,12 @@
doReturn(true).when(() -> CompatChanges.isChangeEnabled(
eq(ConversionUtils.RADIO_U_VERSION_REQUIRED), anyInt()));
- doReturn(USER_ID_1).when(mUserHandleMock).getIdentifier();
- doReturn(mUserHandleMock).when(() -> Binder.getCallingUserHandle());
- doReturn(true).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
- doReturn(USER_ID_1).when(() -> RadioServiceUserController.getCurrentUser());
+ doReturn(USER_ID_1).when(mUserControllerMock).getCallingUserId();
+ doReturn(true).when(mUserControllerMock).isCurrentOrSystemUser();
+ doReturn(USER_ID_1).when(mUserControllerMock).getCurrentUser();
mRadioModule = new RadioModule(mBroadcastRadioMock,
- AidlTestUtils.makeDefaultModuleProperties());
+ AidlTestUtils.makeDefaultModuleProperties(), mUserControllerMock);
doAnswer(invocation -> {
mHalTunerCallback = (ITunerCallback) invocation.getArguments()[0];
@@ -237,7 +233,7 @@
@Test
public void setConfiguration_forNonCurrentUser_doesNotInvokesCallback() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].setConfiguration(FM_BAND_CONFIG);
@@ -434,7 +430,7 @@
@Test
public void tune_forNonCurrentUser_doesNotTune() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
ProgramSelector initialSel = AidlTestUtils.makeFmSelector(AM_FM_FREQUENCY_LIST[1]);
RadioManager.ProgramInfo tuneInfo =
AidlTestUtils.makeProgramInfo(initialSel, SIGNAL_QUALITY);
@@ -514,7 +510,7 @@
openAidlClients(/* numClients= */ 1);
mHalCurrentInfo = AidlTestUtils.makeHalProgramInfo(
ConversionUtils.programSelectorToHalProgramSelector(initialSel), SIGNAL_QUALITY);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].step(/* directionDown= */ true, /* skipSubChannel= */ false);
@@ -593,7 +589,7 @@
openAidlClients(/* numClients= */ 1);
mHalCurrentInfo = AidlTestUtils.makeHalProgramInfo(
ConversionUtils.programSelectorToHalProgramSelector(initialSel), SIGNAL_QUALITY);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].seek(/* directionDown= */ true, /* skipSubChannel= */ false);
@@ -627,7 +623,7 @@
@Test
public void cancel_forNonCurrentUser_doesNotCancel() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].cancel();
@@ -698,7 +694,7 @@
@Test
public void startBackgroundScan_forNonCurrentUser_doesNotInvokesCallback() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].startBackgroundScan();
@@ -968,7 +964,7 @@
openAidlClients(/* numClients= */ 1);
ProgramList.Filter filter = new ProgramList.Filter(new ArraySet<>(), new ArraySet<>(),
/* includeCategories= */ true, /* excludeModifications= */ false);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].startProgramListUpdates(filter);
@@ -1007,7 +1003,7 @@
ProgramList.Filter filter = new ProgramList.Filter(new ArraySet<>(), new ArraySet<>(),
/* includeCategories= */ true, /* excludeModifications= */ false);
mTunerSessions[0].startProgramListUpdates(filter);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].stopProgramListUpdates();
@@ -1073,7 +1069,7 @@
public void setConfigFlag_forNonCurrentUser_doesNotSetConfigFlag() throws Exception {
openAidlClients(/* numClients= */ 1);
int flag = UNSUPPORTED_CONFIG_FLAG + 1;
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].setConfigFlag(flag, /* value= */ true);
@@ -1138,7 +1134,7 @@
openAidlClients(/* numClients= */ 1);
Map<String, String> parametersSet = Map.of("mockParam1", "mockValue1",
"mockParam2", "mockValue2");
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].setParameters(parametersSet);
@@ -1192,7 +1188,7 @@
public void onCurrentProgramInfoChanged_withNonCurrentUser_doesNotInvokeCallback()
throws Exception {
openAidlClients(1);
- doReturn(USER_ID_2).when(() -> RadioServiceUserController.getCurrentUser());
+ doReturn(USER_ID_2).when(mUserControllerMock).getCurrentUser();
mHalTunerCallback.onCurrentProgramInfoChanged(AidlTestUtils.makeHalProgramInfo(
AidlTestUtils.makeHalFmSelector(AM_FM_FREQUENCY_LIST[1]), SIGNAL_QUALITY));
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/BroadcastRadioServiceHidlTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/BroadcastRadioServiceHidlTest.java
index acf698b..7c3f221 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/BroadcastRadioServiceHidlTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/BroadcastRadioServiceHidlTest.java
@@ -88,11 +88,12 @@
private IAnnouncementListener mAnnouncementListenerMock;
@Mock
private IBinder mBinderMock;
+ @Mock
+ private RadioServiceUserController mUserControllerMock;
@Override
protected void initializeSession(StaticMockitoSessionBuilder builder) {
- builder.spyStatic(RadioModule.class)
- .spyStatic(RadioServiceUserController.class);
+ builder.spyStatic(RadioModule.class);
}
@Test
@@ -156,7 +157,7 @@
@Test
public void openSession_forNonCurrentUser_throwsException() throws Exception {
createBroadcastRadioService();
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ when(mUserControllerMock.isCurrentOrSystemUser()).thenReturn(false);
IllegalStateException thrown = assertThrows(IllegalStateException.class,
() -> mBroadcastRadioService.openSession(FM_RADIO_MODULE_ID,
@@ -206,11 +207,11 @@
}
private void createBroadcastRadioService() throws RemoteException {
- doReturn(true).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ when(mUserControllerMock.isCurrentOrSystemUser()).thenReturn(true);
mockServiceManager();
mBroadcastRadioService = new BroadcastRadioService(/* nextModuleId= */ FM_RADIO_MODULE_ID,
- mServiceManagerMock);
+ mServiceManagerMock, mUserControllerMock);
}
private void mockServiceManager() throws RemoteException {
@@ -231,9 +232,9 @@
}).thenReturn(true);
doReturn(mFmRadioModuleMock).when(() -> RadioModule.tryLoadingModule(
- eq(FM_RADIO_MODULE_ID), anyString()));
+ eq(FM_RADIO_MODULE_ID), anyString(), any()));
doReturn(mDabRadioModuleMock).when(() -> RadioModule.tryLoadingModule(
- eq(DAB_RADIO_MODULE_ID), anyString()));
+ eq(DAB_RADIO_MODULE_ID), anyString(), any()));
when(mFmRadioModuleMock.getProperties()).thenReturn(mFmModuleMock);
when(mDabRadioModuleMock.getProperties()).thenReturn(mDabModuleMock);
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/RadioModuleHidlTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/RadioModuleHidlTest.java
index 1f5e770..b53f7ca 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/RadioModuleHidlTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/RadioModuleHidlTest.java
@@ -36,6 +36,8 @@
import android.hardware.radio.RadioManager;
import android.os.RemoteException;
+import com.android.server.broadcastradio.RadioServiceUserController;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -61,13 +63,16 @@
private IAnnouncementListener mListenerMock;
@Mock
private android.hardware.broadcastradio.V2_0.ICloseHandle mHalCloseHandleMock;
+ @Mock
+ private RadioServiceUserController mUserControllerMock;
private RadioModule mRadioModule;
private android.hardware.broadcastradio.V2_0.IAnnouncementListener mHalListener;
@Before
public void setup() throws RemoteException {
- mRadioModule = new RadioModule(mBroadcastRadioMock, TEST_MODULE_PROPERTIES);
+ mRadioModule = new RadioModule(mBroadcastRadioMock, TEST_MODULE_PROPERTIES,
+ mUserControllerMock);
when(mBroadcastRadioMock.getImage(anyInt())).thenReturn(new ArrayList<Byte>(0));
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/StartProgramListUpdatesFanoutTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/StartProgramListUpdatesFanoutTest.java
index 8c16d79..fa07447 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/StartProgramListUpdatesFanoutTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/StartProgramListUpdatesFanoutTest.java
@@ -38,13 +38,13 @@
import android.hardware.radio.UniqueProgramIdentifier;
import android.os.RemoteException;
-import com.android.dx.mockito.inline.extended.StaticMockitoSessionBuilder;
-import com.android.server.broadcastradio.ExtendedRadioMockitoTestCase;
import com.android.server.broadcastradio.RadioServiceUserController;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
import org.mockito.verification.VerificationWithTimeout;
@@ -55,7 +55,8 @@
/**
* Tests for v2 HAL RadioModule.
*/
-public class StartProgramListUpdatesFanoutTest extends ExtendedRadioMockitoTestCase {
+@RunWith(MockitoJUnitRunner.class)
+public class StartProgramListUpdatesFanoutTest {
private static final String TAG = "BroadcastRadioTests.hal2.StartProgramListUpdatesFanout";
private static final VerificationWithTimeout CB_TIMEOUT = timeout(500);
@@ -64,6 +65,8 @@
@Mock IBroadcastRadio mBroadcastRadioMock;
@Mock ITunerSession mHalTunerSessionMock;
private android.hardware.radio.ITunerCallback[] mAidlTunerCallbackMocks;
+ @Mock
+ private RadioServiceUserController mUserControllerMock;
// RadioModule under test
private RadioModule mRadioModule;
@@ -110,17 +113,12 @@
private static final RadioManager.ProgramInfo TEST_DAB_INFO = TestUtils.makeProgramInfo(
TEST_DAB_SELECTOR, TEST_QUALITY);
- @Override
- protected void initializeSession(StaticMockitoSessionBuilder builder) {
- builder.spyStatic(RadioServiceUserController.class);
- }
-
@Before
public void setup() throws RemoteException {
- doReturn(true).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(true).when(mUserControllerMock).isCurrentOrSystemUser();
- mRadioModule = new RadioModule(mBroadcastRadioMock,
- TestUtils.makeDefaultModuleProperties());
+ mRadioModule = new RadioModule(mBroadcastRadioMock, TestUtils.makeDefaultModuleProperties(),
+ mUserControllerMock);
doAnswer((Answer) invocation -> {
mHalTunerCallback = (ITunerCallback) invocation.getArguments()[0];
diff --git a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/TunerSessionHidlTest.java b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/TunerSessionHidlTest.java
index 55aae9d..62445cf 100644
--- a/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/TunerSessionHidlTest.java
+++ b/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/TunerSessionHidlTest.java
@@ -44,16 +44,12 @@
import android.hardware.radio.ProgramSelector;
import android.hardware.radio.RadioManager;
import android.hardware.radio.RadioTuner;
-import android.os.Binder;
import android.os.DeadObjectException;
import android.os.ParcelableException;
import android.os.RemoteException;
-import android.os.UserHandle;
import android.util.ArrayMap;
import android.util.ArraySet;
-import com.android.dx.mockito.inline.extended.StaticMockitoSessionBuilder;
-import com.android.server.broadcastradio.ExtendedRadioMockitoTestCase;
import com.android.server.broadcastradio.RadioServiceUserController;
import com.google.common.truth.Expect;
@@ -76,7 +72,7 @@
* Tests for HIDL HAL TunerSession.
*/
@RunWith(MockitoJUnitRunner.class)
-public final class TunerSessionHidlTest extends ExtendedRadioMockitoTestCase {
+public final class TunerSessionHidlTest {
private static final int USER_ID_1 = 11;
private static final int USER_ID_2 = 12;
@@ -104,27 +100,21 @@
public final Expect mExpect = Expect.create();
@Mock
- private UserHandle mUserHandleMock;
- @Mock
private IBroadcastRadio mBroadcastRadioMock;
@Mock
ITunerSession mHalTunerSessionMock;
private android.hardware.radio.ITunerCallback[] mAidlTunerCallbackMocks;
-
- @Override
- protected void initializeSession(StaticMockitoSessionBuilder builder) {
- builder.spyStatic(RadioServiceUserController.class).spyStatic(Binder.class);
- }
+ @Mock
+ private RadioServiceUserController mUserControllerMock;
@Before
public void setup() throws Exception {
- doReturn(USER_ID_1).when(mUserHandleMock).getIdentifier();
- doReturn(mUserHandleMock).when(() -> Binder.getCallingUserHandle());
- doReturn(true).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
- doReturn(USER_ID_1).when(() -> RadioServiceUserController.getCurrentUser());
+ doReturn(USER_ID_1).when(mUserControllerMock).getCallingUserId();
+ doReturn(true).when(mUserControllerMock).isCurrentOrSystemUser();
+ doReturn(USER_ID_1).when(mUserControllerMock).getCurrentUser();
mRadioModule = new RadioModule(mBroadcastRadioMock,
- TestUtils.makeDefaultModuleProperties());
+ TestUtils.makeDefaultModuleProperties(), mUserControllerMock);
doAnswer(invocation -> {
mHalTunerCallback = (ITunerCallback) invocation.getArguments()[0];
@@ -228,7 +218,7 @@
@Test
public void setConfiguration_forNonCurrentUser_doesNotInvokesCallback() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].setConfiguration(FM_BAND_CONFIG);
@@ -403,7 +393,7 @@
@Test
public void tune_forNonCurrentUser_doesNotTune() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
ProgramSelector initialSel = TestUtils.makeFmSelector(AM_FM_FREQUENCY_LIST[1]);
RadioManager.ProgramInfo tuneInfo =
TestUtils.makeProgramInfo(initialSel, SIGNAL_QUALITY);
@@ -481,7 +471,7 @@
openAidlClients(/* numClients= */ 1);
mHalCurrentInfo = TestUtils.makeHalProgramInfo(
Convert.programSelectorToHal(initialSel), SIGNAL_QUALITY);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].step(/* directionDown= */ true, /* skipSubChannel= */ false);
@@ -559,7 +549,7 @@
openAidlClients(/* numClients= */ 1);
mHalCurrentInfo = TestUtils.makeHalProgramInfo(
Convert.programSelectorToHal(initialSel), SIGNAL_QUALITY);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].seek(/* directionDown= */ true, /* skipSubChannel= */ false);
@@ -593,7 +583,7 @@
@Test
public void cancel_forNonCurrentUser_doesNotCancel() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].cancel();
@@ -663,7 +653,7 @@
@Test
public void startBackgroundScan_forNonCurrentUser_doesNotInvokesCallback() throws Exception {
openAidlClients(/* numClients= */ 1);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].startBackgroundScan();
@@ -676,7 +666,7 @@
openAidlClients(/* numClients= */ 1);
ProgramList.Filter filter = new ProgramList.Filter(new ArraySet<>(), new ArraySet<>(),
/* includeCategories= */ true, /* excludeModifications= */ false);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].startProgramListUpdates(filter);
@@ -715,7 +705,7 @@
ProgramList.Filter aidlFilter = new ProgramList.Filter(new ArraySet<>(), new ArraySet<>(),
/* includeCategories= */ true, /* excludeModifications= */ false);
mTunerSessions[0].startProgramListUpdates(aidlFilter);
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].stopProgramListUpdates();
@@ -781,7 +771,7 @@
public void setConfigFlag_forNonCurrentUser_doesNotSetConfigFlag() throws Exception {
openAidlClients(/* numClients= */ 1);
int flag = UNSUPPORTED_CONFIG_FLAG + 1;
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].setConfigFlag(flag, /* value= */ true);
@@ -846,7 +836,7 @@
openAidlClients(/* numClients= */ 1);
Map<String, String> parametersSet = Map.of("mockParam1", "mockValue1",
"mockParam2", "mockValue2");
- doReturn(false).when(() -> RadioServiceUserController.isCurrentOrSystemUser());
+ doReturn(false).when(mUserControllerMock).isCurrentOrSystemUser();
mTunerSessions[0].setParameters(parametersSet);
@@ -900,7 +890,7 @@
public void onCurrentProgramInfoChanged_withNonCurrentUser_doesNotInvokeCallback()
throws Exception {
openAidlClients(1);
- doReturn(USER_ID_2).when(() -> RadioServiceUserController.getCurrentUser());
+ doReturn(USER_ID_2).when(mUserControllerMock).getCurrentUser();
mHalTunerCallback.onCurrentProgramInfoChanged(TestUtils.makeHalProgramInfo(
TestUtils.makeHalFmSelector(/* freq= */ 97300), SIGNAL_QUALITY));
diff --git a/core/tests/ConnectivityManagerTest/Android.bp b/core/tests/ConnectivityManagerTest/Android.bp
index f17a28d..6421899 100644
--- a/core/tests/ConnectivityManagerTest/Android.bp
+++ b/core/tests/ConnectivityManagerTest/Android.bp
@@ -24,8 +24,8 @@
android_test {
name: "ConnectivityManagerTest",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/core/tests/GameManagerTests/Android.bp b/core/tests/GameManagerTests/Android.bp
index a252f8b..1abceb8 100644
--- a/core/tests/GameManagerTests/Android.bp
+++ b/core/tests/GameManagerTests/Android.bp
@@ -32,7 +32,7 @@
"platform-test-annotations",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/InputMethodCoreTests/Android.bp b/core/tests/InputMethodCoreTests/Android.bp
index ac64625..2b524d5 100644
--- a/core/tests/InputMethodCoreTests/Android.bp
+++ b/core/tests/InputMethodCoreTests/Android.bp
@@ -42,9 +42,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"framework",
"ext",
"framework-res",
diff --git a/core/tests/PackageInstallerSessions/Android.bp b/core/tests/PackageInstallerSessions/Android.bp
index b631df1..d10ecd0 100644
--- a/core/tests/PackageInstallerSessions/Android.bp
+++ b/core/tests/PackageInstallerSessions/Android.bp
@@ -39,8 +39,8 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
"framework",
"framework-res",
],
diff --git a/core/tests/PlatformCompatFramework/Android.bp b/core/tests/PlatformCompatFramework/Android.bp
index 2621d28..a3fdf7b 100644
--- a/core/tests/PlatformCompatFramework/Android.bp
+++ b/core/tests/PlatformCompatFramework/Android.bp
@@ -12,8 +12,8 @@
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/core/tests/bandwidthtests/Android.bp b/core/tests/bandwidthtests/Android.bp
index 8645b39..b735712 100644
--- a/core/tests/bandwidthtests/Android.bp
+++ b/core/tests/bandwidthtests/Android.bp
@@ -27,9 +27,9 @@
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "org.apache.http.legacy",
- "android.test.base",
+ "android.test.runner.stubs",
+ "org.apache.http.legacy.stubs",
+ "android.test.base.stubs",
],
static_libs: [
"junit",
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
index 1c0ea83..926edfed 100644
--- a/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
@@ -16,7 +16,7 @@
"compatibility-device-util-axt",
"junit",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
}
diff --git a/core/tests/bugreports/Android.bp b/core/tests/bugreports/Android.bp
index 15e07e5..664d54d 100644
--- a/core/tests/bugreports/Android.bp
+++ b/core/tests/bugreports/Android.bp
@@ -26,8 +26,8 @@
srcs: ["src/**/*.java"],
data: [":bugreport_artifacts"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.test",
+ "android.test.base.stubs.test",
],
static_libs: [
"android.tracing.flags-aconfig-java",
@@ -43,3 +43,10 @@
name: "bugreport_artifacts",
srcs: ["config/test-sysconfig.xml"],
}
+
+test_module_config {
+ name: "BugreportManagerTestCases_android_server_os",
+ base: "BugreportManagerTestCases",
+ test_suites: ["general-tests"],
+ exclude_annotations: ["androidx.test.filters.LargeTest"],
+}
diff --git a/core/tests/companiontests/Android.bp b/core/tests/companiontests/Android.bp
index d31b8f4..cb0951e 100644
--- a/core/tests/companiontests/Android.bp
+++ b/core/tests/companiontests/Android.bp
@@ -12,8 +12,8 @@
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
platform_apis: true,
diff --git a/core/tests/coretests/Android.bp b/core/tests/coretests/Android.bp
index 99cbf05..d98836f 100644
--- a/core/tests/coretests/Android.bp
+++ b/core/tests/coretests/Android.bp
@@ -107,10 +107,10 @@
],
libs: [
- "android.test.runner",
- "org.apache.http.legacy",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "org.apache.http.legacy.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"framework",
"ext",
"framework-res",
@@ -158,8 +158,8 @@
use_resource_processor: false,
libs: [
"framework-res",
- "android.test.runner",
- "org.apache.http.legacy",
+ "android.test.runner.stubs",
+ "org.apache.http.legacy.stubs",
],
uses_libs: [
"android.test.runner",
@@ -225,9 +225,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"framework",
"framework-res",
],
@@ -236,8 +236,8 @@
android_ravenwood_test {
name: "FrameworksCoreTestsRavenwood",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"core-test-rules", // for libcore.dalvik.system.CloseGuardSupport
@@ -299,26 +299,22 @@
auto_gen_config: true,
}
-FLAKY_OR_IGNORED = [
- "androidx.test.filters.FlakyTest",
- "org.junit.Ignore",
-]
-
test_module_config {
name: "FrameworksCoreTests_Presubmit",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_inputmethod",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -333,39 +329,40 @@
name: "FrameworksCoreTests_context",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.content.ContextTest"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_keyguard_manager",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.app.KeyguardManagerTest"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_property_invalidated_cache",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.app.PropertyInvalidatedCacheTests"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_android_content",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -374,36 +371,36 @@
"android.content.ComponentCallbacksControllerTest",
"android.content.ContextWrapperTest",
],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_sqlite",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.database.sqlite.SQLiteRawStatementTest"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_android_net",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.net"],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_battery_stats",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -415,6 +412,7 @@
name: "FrameworksCoreTests_environment",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -425,6 +423,7 @@
name: "FrameworksCoreTests_util_data_charset",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -438,6 +437,7 @@
name: "FrameworksCoreTests_xml",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -451,6 +451,7 @@
name: "FrameworksCoreTests_util_apk",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -461,6 +462,7 @@
name: "FrameworksCoreTests_textclassifier",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -472,6 +474,7 @@
name: "FrameworksCoreTests_internal_app",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -486,6 +489,7 @@
name: "FrameworksCoreTests_internal_content",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -496,6 +500,7 @@
name: "FrameworksCoreTests_internal_infra",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -506,17 +511,18 @@
name: "FrameworksCoreTests_internal_jank",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["com.android.internal.jank"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_internal_os_binder",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -528,6 +534,7 @@
name: "FrameworksCoreTests_internal_os_kernel",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -544,6 +551,7 @@
name: "FrameworksCoreTests_server_power",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -554,6 +562,7 @@
name: "FrameworksCoreTests_internal_security",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -565,28 +574,29 @@
name: "FrameworksCoreTests_internal_util_latency_tracker",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["com.android.internal.util.LatencyTrackerTest"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_content_capture_options",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.content.ContentCaptureOptionsTest"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_android_content_integrity",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -597,30 +607,31 @@
name: "FrameworksCoreTests_android_content_pm_PreSubmit",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.content.pm."],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_android_content_pm_PostSubmit",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.content.pm."],
include_annotations: ["android.platform.test.annotations.Postsubmit"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_android_content_res",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -637,18 +648,19 @@
name: "FrameworksCoreTests_android_content_res_PostSubmit",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.content.res."],
include_annotations: ["android.platform.test.annotations.Postsubmit"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_android_service",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -668,40 +680,41 @@
name: "FrameworksCoreTests_android_view_contentcapture",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.view.contentcapture"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_android_view_contentprotection",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["android.view.contentprotection"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_com_android_internal_content_Presubmit",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_filters: ["com.android.internal.content."],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_drawable",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -709,24 +722,10 @@
}
test_module_config {
- name: "FrameworksCoreTests_accessibility_NO_FLAKES",
- base: "FrameworksCoreTests",
- test_suites: [
- "device-tests",
- "device-platinum-tests",
- ],
- include_filters: [
- "com.android.internal.accessibility",
- "android.accessibilityservice",
- "android.view.accessibility",
- ],
- exclude_annotations: ["androidx.test.filters.FlakyTest"],
-}
-
-test_module_config {
name: "FrameworksCoreTests_accessibility",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -741,6 +740,7 @@
name: "FrameworksCoreTests_usage",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -751,6 +751,7 @@
name: "FrameworksCoreTests_fastdata",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -761,6 +762,7 @@
name: "FrameworksCoreTests_hardware_input",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -771,6 +773,7 @@
name: "FrameworksCoreTests_view_verified",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -781,9 +784,34 @@
}
test_module_config {
+ name: "FrameworksCoreTests_android_net_Presubmit",
+ base: "FrameworksCoreTests",
+ test_suites: [
+ "automotive-tests",
+ "device-platinum-tests",
+ "device-tests",
+ ],
+ include_filters: ["android.net"],
+ include_annotations: ["android.platform.test.annotations.Presubmit"],
+}
+
+test_module_config {
+ name: "FrameworksCoreTests_content_pm_Postsubmit",
+ base: "FrameworksCoreTests",
+ test_suites: [
+ "automotive-tests",
+ "device-platinum-tests",
+ "device-tests",
+ ],
+ include_filters: ["android.content.pm."],
+ include_annotations: ["android.platform.test.annotations.Postsubmit"],
+}
+
+test_module_config {
name: "FrameworksCoreTests_jank",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
@@ -792,18 +820,17 @@
"com.android.internal.jank.InteractionJankMonitorTest",
"com.android.internal.util.LatencyTrackerTest",
],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
name: "FrameworksCoreTests_Platinum",
base: "FrameworksCoreTests",
test_suites: [
+ "automotive-tests",
"device-tests",
"device-platinum-tests",
],
include_annotations: ["android.platform.test.annotations.PlatinumTest"],
- exclude_annotations: FLAKY_OR_IGNORED,
}
test_module_config {
diff --git a/core/tests/coretests/src/android/app/NotificationChannelTest.java b/core/tests/coretests/src/android/app/NotificationChannelTest.java
index e47ef2d..e19f887 100644
--- a/core/tests/coretests/src/android/app/NotificationChannelTest.java
+++ b/core/tests/coretests/src/android/app/NotificationChannelTest.java
@@ -47,12 +47,13 @@
import android.os.VibrationEffect;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.annotations.Presubmit;
+import android.platform.test.annotations.UsesFlags;
+import android.platform.test.flag.junit.FlagsParameterization;
import android.platform.test.flag.junit.SetFlagsRule;
import android.provider.MediaStore.Audio.AudioColumns;
import android.test.mock.MockContentResolver;
import android.util.Xml;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.modules.utils.TypedXmlPullParser;
@@ -61,6 +62,7 @@
import com.google.common.base.Strings;
import org.junit.Before;
+import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -71,14 +73,28 @@
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Field;
import java.util.Arrays;
+import java.util.List;
import java.util.function.Consumer;
-@RunWith(AndroidJUnit4.class)
+import platform.test.runner.parameterized.ParameterizedAndroidJunit4;
+import platform.test.runner.parameterized.Parameters;
+
+@RunWith(ParameterizedAndroidJunit4.class)
+@UsesFlags(android.app.Flags.class)
@SmallTest
@Presubmit
public class NotificationChannelTest {
+ @ClassRule
+ public static final SetFlagsRule.ClassRule mSetFlagsClassRule = new SetFlagsRule.ClassRule();
+
+ @Parameters(name = "{0}")
+ public static List<FlagsParameterization> getParams() {
+ return FlagsParameterization.allCombinationsOf(
+ Flags.FLAG_NOTIF_CHANNEL_CROP_VIBRATION_EFFECTS);
+ }
+
@Rule
- public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+ public final SetFlagsRule mSetFlagsRule;
private final String CLASS = "android.app.NotificationChannel";
@@ -86,6 +102,10 @@
ContentProvider mContentProvider;
IContentProvider mIContentProvider;
+ public NotificationChannelTest(FlagsParameterization flags) {
+ mSetFlagsRule = mSetFlagsClassRule.createSetFlagsRule(flags);
+ }
+
@Before
public void setUp() throws Exception {
mContext = mock(Context.class);
diff --git a/core/tests/coretests/src/android/content/pm/LauncherActivityInfoTest.java b/core/tests/coretests/src/android/content/pm/LauncherActivityInfoTest.java
index e19c4b1..3616ff5c 100644
--- a/core/tests/coretests/src/android/content/pm/LauncherActivityInfoTest.java
+++ b/core/tests/coretests/src/android/content/pm/LauncherActivityInfoTest.java
@@ -33,71 +33,169 @@
public class LauncherActivityInfoTest {
@Test
- public void testTrimStart() {
- // Invisible case
- assertThat(LauncherActivityInfo.trimStart("\u0009").toString()).isEmpty();
- // It is not supported in the system font
- assertThat(LauncherActivityInfo.trimStart("\u0FE1").toString()).isEmpty();
- // Surrogates case
- assertThat(LauncherActivityInfo.trimStart("\uD83E\uDD36").toString())
- .isEqualTo("\uD83E\uDD36");
- assertThat(LauncherActivityInfo.trimStart("\u0009\u0FE1\uD83E\uDD36A").toString())
- .isEqualTo("\uD83E\uDD36A");
- assertThat(LauncherActivityInfo.trimStart("\uD83E\uDD36A\u0009\u0FE1").toString())
- .isEqualTo("\uD83E\uDD36A\u0009\u0FE1");
- assertThat(LauncherActivityInfo.trimStart("A\uD83E\uDD36\u0009\u0FE1A").toString())
- .isEqualTo("A\uD83E\uDD36\u0009\u0FE1A");
- assertThat(LauncherActivityInfo.trimStart(
- "A\uD83E\uDD36\u0009\u0FE1A\uD83E\uDD36").toString())
- .isEqualTo("A\uD83E\uDD36\u0009\u0FE1A\uD83E\uDD36");
- assertThat(LauncherActivityInfo.trimStart(
- "\u0009\u0FE1\uD83E\uDD36A\u0009\u0FE1").toString())
- .isEqualTo("\uD83E\uDD36A\u0009\u0FE1");
+ public void testIsVisible_normal() {
+ // normal
+ assertThat(LauncherActivityInfo.isVisible("label")).isTrue();
+ // 1 surrogates case
+ assertThat(LauncherActivityInfo.isVisible("\uD83E\uDD36")).isTrue();
}
@Test
- public void testTrimEnd() {
- // Invisible case
- assertThat(LauncherActivityInfo.trimEnd("\u0009").toString()).isEmpty();
- // It is not supported in the system font
- assertThat(LauncherActivityInfo.trimEnd("\u0FE1").toString()).isEmpty();
- // Surrogates case
- assertThat(LauncherActivityInfo.trimEnd("\uD83E\uDD36").toString())
- .isEqualTo("\uD83E\uDD36");
- assertThat(LauncherActivityInfo.trimEnd("\u0009\u0FE1\uD83E\uDD36A").toString())
- .isEqualTo("\u0009\u0FE1\uD83E\uDD36A");
- assertThat(LauncherActivityInfo.trimEnd("\uD83E\uDD36A\u0009\u0FE1").toString())
- .isEqualTo("\uD83E\uDD36A");
- assertThat(LauncherActivityInfo.trimEnd("A\uD83E\uDD36\u0009\u0FE1A").toString())
- .isEqualTo("A\uD83E\uDD36\u0009\u0FE1A");
- assertThat(LauncherActivityInfo.trimEnd(
- "A\uD83E\uDD36\u0009\u0FE1A\uD83E\uDD36").toString())
- .isEqualTo("A\uD83E\uDD36\u0009\u0FE1A\uD83E\uDD36");
- assertThat(LauncherActivityInfo.trimEnd(
- "\u0009\u0FE1\uD83E\uDD36A\u0009\u0FE1").toString())
- .isEqualTo("\u0009\u0FE1\uD83E\uDD36A");
+ public void testIsVisible_onlyInvisibleCharacter() {
+ // 1 invisible
+ assertThat(LauncherActivityInfo.isVisible("\u0009")).isFalse();
+ // 2 invisible
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u3164")).isFalse();
+ // 3 invisible
+ assertThat(LauncherActivityInfo.isVisible("\u3000\u0009\u3164")).isFalse();
+ // 4 invisible
+ assertThat(LauncherActivityInfo.isVisible("\u200F\u3000\u0009\u3164")).isFalse();
}
@Test
- public void testTrim() {
- // Invisible case
- assertThat(LauncherActivityInfo.trim("\u0009").toString()).isEmpty();
- // It is not supported in the system font
- assertThat(LauncherActivityInfo.trim("\u0FE1").toString()).isEmpty();
- // Surrogates case
- assertThat(LauncherActivityInfo.trim("\uD83E\uDD36").toString())
- .isEqualTo("\uD83E\uDD36");
- assertThat(LauncherActivityInfo.trim("\u0009\u0FE1\uD83E\uDD36A").toString())
- .isEqualTo("\uD83E\uDD36A");
- assertThat(LauncherActivityInfo.trim("\uD83E\uDD36A\u0009\u0FE1").toString())
- .isEqualTo("\uD83E\uDD36A");
- assertThat(LauncherActivityInfo.trim("A\uD83E\uDD36\u0009\u0FE1A").toString())
- .isEqualTo("A\uD83E\uDD36\u0009\u0FE1A");
- assertThat(LauncherActivityInfo.trim(
- "A\uD83E\uDD36\u0009\u0FE1A\uD83E\uDD36").toString())
- .isEqualTo("A\uD83E\uDD36\u0009\u0FE1A\uD83E\uDD36");
- assertThat(LauncherActivityInfo.trim(
- "\u0009\u0FE1\uD83E\uDD36A\u0009\u0FE1").toString())
- .isEqualTo("\uD83E\uDD36A");
+ public void testIsVisible_onlyNotSupportedCharacter() {
+ // 1 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1")).isFalse();
+ // 2 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0FE2")).isFalse();
+ // 3 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0FE2\u0FE3")).isFalse();
+ // 4 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0FE2\u0FE3\u0FE4")).isFalse();
+ }
+
+ @Test
+ public void testIsVisible_invisibleAndNotSupportedCharacter() {
+ // 1 invisible, 1 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u0FE1")).isFalse();
+ // 1 invisible, 2 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u0FE1\u0FE2")).isFalse();
+ // 1 invisible, 3 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u0FE1\u0FE2\u0FE3")).isFalse();
+ // 1 invisible, 4 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u0FE1\u0FE2\u0FE3\u0FE4")).isFalse();
+
+ // 2 invisible, 1 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u3164\u0FE1")).isFalse();
+ // 2 invisible, 2 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u3164\u0FE1\u0FE2")).isFalse();
+ // 2 invisible, 3 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u3164\u0FE1\u0FE2\u0FE3")).isFalse();
+ // 2 invisible, 4 not supported
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u0009\u3164\u0FE1\u0FE2\u0FE3\u0FE4")).isFalse();
+
+ // 3 invisible, 1 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u3000\u0009\u3164\u0FE1")).isFalse();
+ // 3 invisible, 2 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u3000\u0009\u3164\u0FE1\u0FE2")).isFalse();
+ // 3 invisible, 3 not supported
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u3000\u0009\u3164\u0FE1\u0FE2\u0FE3")).isFalse();
+ // 3 invisible, 4 not supported
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u3000\u0009\u3164\u0FE1\u0FE2\u0FE3\u0FE4")).isFalse();
+
+ // 4 invisible, 1 not supported
+ assertThat(LauncherActivityInfo.isVisible("\u200F\u3000\u0009\u3164\u0FE1")).isFalse();
+ // 4 invisible, 2 not supported
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\u0FE1\u0FE2")).isFalse();
+ // 4 invisible, 3 not supported
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\u0FE1\u0FE2\u0FE3")).isFalse();
+ // 4 invisible, 4 not supported
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\u0FE1\u0FE2\u0FE3\u0FE4")).isFalse();
+
+ // 1 not supported, 1 invisible,
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0009")).isFalse();
+ // 1 not supported, 2 invisible
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0009\u3164")).isFalse();
+ // 1 not supported, 3 invisible
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u3000\u0009\u3164")).isFalse();
+ // 1 not supported, 4 invisible
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u200F\u3000\u0009\u3164")).isFalse();
+ }
+
+ @Test
+ public void testIsVisible_invisibleAndNormalCharacter() {
+ // 1 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0009\uD83E\uDD36")).isTrue();
+ // 2 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u3164\uD83E\uDD36")).isTrue();
+ // 3 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u3000\u0009\u3164\uD83E\uDD36")).isFalse();
+ // 4 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\uD83E\uDD36")).isFalse();
+ }
+
+ @Test
+ public void testIsVisible_notSupportedAndNormalCharacter() {
+ // 1 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\uD83E\uDD36")).isTrue();
+ // 2 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0FE2\uD83E\uDD36")).isTrue();
+ // 3 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0FE2\u0FE3\uD83E\uDD36")).isTrue();
+ // 4 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u0FE1\u0FE2\u0FE3\u0FE4\uD83E\uDD36")).isTrue();
+ }
+
+ @Test
+ public void testIsVisible_mixAllCharacter() {
+ // 1 invisible, 1 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u0FE1\uD83E\uDD36")).isTrue();
+ // 1 invisible, 1 not supported, 1 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u0FE1\u3164\uD83E\uDD36")).isTrue();
+ // 1 invisible, 1 not supported, 2 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u0009\u0FE1\u3000\u3164\uD83E\uDD36")).isTrue();
+ // 1 invisible, 1 not supported, 3 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u0009\u0FE1\u200F\u3000\u3164\uD83E\uDD36")).isTrue();
+
+ // 2 invisible, 1 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0009\u3164\u0FE1\uD83E\uDD36")).isTrue();
+ // 2 invisible, 2 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u0009\u3164\u0FE1\u0FE2\uD83E\uDD36")).isTrue();
+
+ // 3 invisible, 1 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u3000\u0009\u3164\u0FE1\uD83E\uDD36")).isFalse();
+ // 3 invisible, 2 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u3000\u0009\u3164\u0FE1\u0FE2\uD83E\uDD36")).isFalse();
+ // 3 invisible, 3 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u3000\u0009\u3164\u0FE1\u0FE2\u0FE3\uD83E\uDD36")).isFalse();
+
+ // 4 invisible, 1 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\u0FE1\uD83E\uDD36")).isFalse();
+ // 4 invisible, 2 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\u0FE1\u0FE2\uD83E\uDD36")).isFalse();
+ // 4 invisible, 3 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\u0FE1\u0FE2\u0FE3\uD83E\uDD36")).isFalse();
+ // 4 invisible, 4 not supported, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u200F\u3000\u0009\u3164\u0FE1\u0FE2\u0FE3\u0FE4\uD83E\uDD36")).isFalse();
+
+ // 1 not supported, 1 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0009\uD83E\uDD36")).isTrue();
+ // 1 not supported, 2 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible("\u0FE1\u0009\u3164\uD83E\uDD36")).isTrue();
+ // 1 not supported, 3 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u0FE1\u3000\u0009\u3164\uD83E\uDD36")).isTrue();
+ // 1 not supported, 4 invisible, 1 surrogates
+ assertThat(LauncherActivityInfo.isVisible(
+ "\u0FE1\u200F\u3000\u0009\u3164\uD83E\uDD36")).isTrue();
+
}
}
diff --git a/core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java b/core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java
index 519f23b..9d47709 100644
--- a/core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java
+++ b/core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java
@@ -25,6 +25,7 @@
import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseUtils;
+import android.database.DefaultDatabaseErrorHandler;
import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
@@ -538,4 +539,124 @@
assertEquals(1, db.mConnection.size());
}
+
+ // Create and open the database, allowing or disallowing double-quoted strings.
+ private void createDatabase(boolean noDoubleQuotedStrs) throws Exception {
+ // The open-flags that do not change in this test.
+ int flags = SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.OPEN_READWRITE;
+
+ // The flag to be tested.
+ int flagUnderTest = SQLiteDatabase.NO_DOUBLE_QUOTED_STRS;
+
+ if (noDoubleQuotedStrs) {
+ flags |= flagUnderTest;
+ } else {
+ flags &= ~flagUnderTest;
+ }
+ mDatabase = SQLiteDatabase.openDatabase(mDatabaseFile.getPath(), null, flags, null);
+ }
+
+ /**
+ * This test verifies that the NO_DOUBLE_QUOTED_STRS flag works as expected when opening a
+ * database. This does not test that the flag is initialized as expected from the system
+ * properties.
+ */
+ @Test
+ public void testNoDoubleQuotedStrings() throws Exception {
+ closeAndDeleteDatabase();
+ createDatabase(/* noDoubleQuotedStrs */ false);
+
+ mDatabase.beginTransaction();
+ try {
+ mDatabase.execSQL("CREATE TABLE t1 (t text);");
+ // Insert a value in double-quotes. This is invalid but accepted.
+ mDatabase.execSQL("INSERT INTO t1 (t) VALUES (\"foo\")");
+ } finally {
+ mDatabase.endTransaction();
+ }
+
+ closeAndDeleteDatabase();
+ createDatabase(/* noDoubleQuotedStrs */ true);
+
+ mDatabase.beginTransaction();
+ try {
+ mDatabase.execSQL("CREATE TABLE t1 (t text);");
+ try {
+ // Insert a value in double-quotes. This is invalid and must throw.
+ mDatabase.execSQL("INSERT INTO t1 (t) VALUES (\"foo\")");
+ fail("expected an exception");
+ } catch (SQLiteException e) {
+ assertTrue(e.toString().contains("no such column"));
+ }
+ } finally {
+ mDatabase.endTransaction();
+ }
+ closeAndDeleteDatabase();
+ }
+
+ @Test
+ public void testCloseCorruptionReport() throws Exception {
+ mDatabase.beginTransaction();
+ try {
+ mDatabase.execSQL("CREATE TABLE t2 (i int, j int);");
+ mDatabase.execSQL("INSERT INTO t2 (i, j) VALUES (2, 20)");
+ mDatabase.execSQL("INSERT INTO t2 (i, j) VALUES (3, 30)");
+ mDatabase.setTransactionSuccessful();
+ } finally {
+ mDatabase.endTransaction();
+ }
+
+ // Start a transaction and announce that the DB is corrupted.
+ DefaultDatabaseErrorHandler errorHandler = new DefaultDatabaseErrorHandler();
+
+ // Do not bother with endTransaction; the database will have been closed in the corruption
+ // handler.
+ mDatabase.beginTransaction();
+ try {
+ errorHandler.onCorruption(mDatabase);
+ mDatabase.execSQL("INSERT INTO t2 (i, j) VALUES (4, 40)");
+ fail("expected an exception");
+ } catch (IllegalStateException e) {
+ final Throwable cause = e.getCause();
+ assertNotNull(cause);
+ boolean found = false;
+ for (StackTraceElement s : cause.getStackTrace()) {
+ if (s.getMethodName().contains("onCorruption")) {
+ found = true;
+ }
+ }
+ assertTrue(found);
+ }
+ }
+
+ @Test
+ public void testCloseReport() throws Exception {
+ mDatabase.beginTransaction();
+ try {
+ mDatabase.execSQL("CREATE TABLE t2 (i int, j int);");
+ mDatabase.execSQL("INSERT INTO t2 (i, j) VALUES (2, 20)");
+ mDatabase.execSQL("INSERT INTO t2 (i, j) VALUES (3, 30)");
+ mDatabase.setTransactionSuccessful();
+ } finally {
+ mDatabase.endTransaction();
+ }
+
+ mDatabase.close();
+ try {
+ // Do not bother with endTransaction; the database has already been close.
+ mDatabase.beginTransaction();
+ fail("expected an exception");
+ } catch (IllegalStateException e) {
+ assertTrue(e.toString().contains("attempt to re-open an already-closed object"));
+ final Throwable cause = e.getCause();
+ assertNotNull(cause);
+ boolean found = false;
+ for (StackTraceElement s : cause.getStackTrace()) {
+ if (s.getMethodName().contains("testCloseReport")) {
+ found = true;
+ }
+ }
+ assertTrue(found);
+ }
+ }
}
diff --git a/core/tests/coretests/src/android/graphics/TypefaceSystemFallbackTest.java b/core/tests/coretests/src/android/graphics/TypefaceSystemFallbackTest.java
index 10aed8d..1429272 100644
--- a/core/tests/coretests/src/android/graphics/TypefaceSystemFallbackTest.java
+++ b/core/tests/coretests/src/android/graphics/TypefaceSystemFallbackTest.java
@@ -16,8 +16,6 @@
package android.graphics;
-import static com.android.text.flags.Flags.FLAG_VENDOR_CUSTOM_LOCALE_FALLBACK;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@@ -32,7 +30,6 @@
import android.graphics.fonts.SystemFonts;
import android.graphics.text.PositionedGlyphs;
import android.graphics.text.TextRunShaper;
-import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.text.FontConfig;
@@ -931,7 +928,6 @@
return String.format(xml, op, lang, font);
}
- @RequiresFlagsEnabled(FLAG_VENDOR_CUSTOM_LOCALE_FALLBACK)
@Test
public void testBuildSystemFallback__Customization_locale_prepend() {
final ArrayMap<String, Typeface> fontMap = new ArrayMap<>();
@@ -947,7 +943,6 @@
assertB3emFontIsUsed(typeface);
}
- @RequiresFlagsEnabled(FLAG_VENDOR_CUSTOM_LOCALE_FALLBACK)
@Test
public void testBuildSystemFallback__Customization_locale_replace() {
final ArrayMap<String, Typeface> fontMap = new ArrayMap<>();
@@ -963,7 +958,6 @@
assertB3emFontIsUsed(typeface);
}
- @RequiresFlagsEnabled(FLAG_VENDOR_CUSTOM_LOCALE_FALLBACK)
@Test
public void testBuildSystemFallback__Customization_locale_append() {
final ArrayMap<String, Typeface> fontMap = new ArrayMap<>();
@@ -979,7 +973,6 @@
assertA3emFontIsUsed(typeface);
}
- @RequiresFlagsEnabled(FLAG_VENDOR_CUSTOM_LOCALE_FALLBACK)
@Test
public void testBuildSystemFallback__Customization_locale_ScriptMismatch() {
final ArrayMap<String, Typeface> fontMap = new ArrayMap<>();
@@ -995,7 +988,6 @@
assertA3emFontIsUsed(typeface);
}
- @RequiresFlagsEnabled(FLAG_VENDOR_CUSTOM_LOCALE_FALLBACK)
@Test
public void testBuildSystemFallback__Customization_locale_SubscriptMatch() {
final ArrayMap<String, Typeface> fontMap = new ArrayMap<>();
diff --git a/core/tests/coretests/src/android/os/BinderTest.java b/core/tests/coretests/src/android/os/BinderTest.java
index 9767d67..90ec93e 100644
--- a/core/tests/coretests/src/android/os/BinderTest.java
+++ b/core/tests/coretests/src/android/os/BinderTest.java
@@ -24,18 +24,16 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.testng.Assert.assertThrows;
-import android.platform.test.annotations.IgnoreUnderRavenwood;
+import android.platform.test.annotations.DisabledOnRavenwood;
import android.platform.test.ravenwood.RavenwoodRule;
import androidx.test.filters.SmallTest;
import com.android.internal.os.BinderInternal;
-
import org.junit.Rule;
import org.junit.Test;
-@IgnoreUnderRavenwood(blockedBy = WorkSource.class)
public class BinderTest {
private static final int UID = 100;
@@ -89,6 +87,7 @@
@SmallTest
@Test(expected = java.lang.SecurityException.class)
+ @DisabledOnRavenwood(blockedBy = ServiceManagerNative.class)
public void testServiceManagerNativeSecurityException() throws RemoteException {
// Find the service manager
IServiceManager sServiceManager = ServiceManagerNative
@@ -101,6 +100,7 @@
@SmallTest
@Test(expected = java.lang.NullPointerException.class)
+ @DisabledOnRavenwood(blockedBy = ServiceManagerNative.class)
public void testServiceManagerNativeNullptrException() throws RemoteException {
// Find the service manager
IServiceManager sServiceManager = ServiceManagerNative
diff --git a/core/tests/coretests/src/android/os/BundleTest.java b/core/tests/coretests/src/android/os/BundleTest.java
index ded6fc5..31e0752 100644
--- a/core/tests/coretests/src/android/os/BundleTest.java
+++ b/core/tests/coretests/src/android/os/BundleTest.java
@@ -25,7 +25,6 @@
import static org.junit.Assert.assertTrue;
import android.platform.test.annotations.DisabledOnRavenwood;
-import android.platform.test.annotations.IgnoreUnderRavenwood;
import android.platform.test.annotations.Presubmit;
import android.platform.test.ravenwood.RavenwoodRule;
import android.util.Log;
@@ -131,7 +130,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = ParcelFileDescriptor.class)
public void testCreateFromParcel() throws Exception {
boolean withFd;
Parcel p;
@@ -312,7 +310,7 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
+ @DisabledOnRavenwood(reason = "Ravenwood tests run on the BCP")
public void kindofEquals_lazyValuesAndDifferentClassLoaders_returnsFalse() {
Parcelable p1 = new CustomParcelable(13, "Tiramisu");
Parcelable p2 = new CustomParcelable(13, "Tiramisu");
@@ -368,7 +366,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void readWriteLengthMismatch_logsWtf() throws Exception {
mWtfHandler = Log.setWtfHandler((tag, e, system) -> {
throw new RuntimeException(e);
@@ -383,7 +380,7 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
+ @DisabledOnRavenwood(reason = "Ravenwood tests run on the BCP")
public void getParcelable_whenThrowingAndNotDefusing_throws() throws Exception {
Bundle.setShouldDefuse(false);
Bundle bundle = new Bundle();
@@ -396,7 +393,7 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
+ @DisabledOnRavenwood(reason = "Ravenwood tests run on the BCP")
public void getParcelable_whenThrowingAndDefusing_returnsNull() throws Exception {
Bundle.setShouldDefuse(true);
Bundle bundle = new Bundle();
@@ -412,7 +409,7 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
+ @DisabledOnRavenwood(reason = "Ravenwood tests run on the BCP")
public void getParcelable_whenThrowingAndDefusing_leavesElement() throws Exception {
Bundle.setShouldDefuse(true);
Bundle bundle = new Bundle();
@@ -447,7 +444,6 @@
}
@Test
- @DisabledOnRavenwood(blockedBy = Parcel.class)
public void parcelledBundleWithBinder_shouldReturnHasBindersTrue() throws Exception {
Bundle bundle = new Bundle();
bundle.putParcelable("test", new CustomParcelable(13, "Tiramisu"));
@@ -470,7 +466,6 @@
}
@Test
- @DisabledOnRavenwood(blockedBy = Parcel.class)
public void parcelledBundleWithoutBinder_shouldReturnHasBindersFalse() throws Exception {
Bundle bundle = new Bundle();
bundle.putParcelable("test", new CustomParcelable(13, "Tiramisu"));
diff --git a/core/tests/coretests/src/android/os/ParcelNullabilityTest.java b/core/tests/coretests/src/android/os/ParcelNullabilityTest.java
index 09395f1..96316c4 100644
--- a/core/tests/coretests/src/android/os/ParcelNullabilityTest.java
+++ b/core/tests/coretests/src/android/os/ParcelNullabilityTest.java
@@ -20,7 +20,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import android.platform.test.annotations.IgnoreUnderRavenwood;
+import android.platform.test.annotations.DisabledOnRavenwood;
import android.platform.test.ravenwood.RavenwoodRule;
import android.util.ArrayMap;
@@ -67,7 +67,7 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
+ @DisabledOnRavenwood(blockedBy = android.text.Spanned.class)
public void nullCharSequence() {
Parcel p = Parcel.obtain();
p.writeCharSequence(null);
@@ -76,7 +76,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void nullStrongBinder() {
Parcel p = Parcel.obtain();
p.writeStrongBinder(null);
@@ -85,7 +84,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void nullStringInterface() {
Parcel p = Parcel.obtain();
p.writeStrongInterface(null);
diff --git a/core/tests/coretests/src/android/os/ParcelTest.java b/core/tests/coretests/src/android/os/ParcelTest.java
index 0373231..da9d687 100644
--- a/core/tests/coretests/src/android/os/ParcelTest.java
+++ b/core/tests/coretests/src/android/os/ParcelTest.java
@@ -23,7 +23,6 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
-import android.platform.test.annotations.IgnoreUnderRavenwood;
import android.platform.test.annotations.Presubmit;
import android.platform.test.ravenwood.RavenwoodRule;
import android.util.Log;
@@ -48,7 +47,6 @@
private static final String INTERFACE_TOKEN_2 = "Another IBinder interface token";
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testIsForRpc() {
Parcel p = Parcel.obtain();
assertEquals(false, p.isForRpc());
@@ -56,7 +54,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testCallingWorkSourceUidAfterWrite() {
Parcel p = Parcel.obtain();
// Method does not throw if replaceCallingWorkSourceUid is called before requests headers
@@ -77,7 +74,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testCallingWorkSourceUidAfterEnforce() {
Parcel p = Parcel.obtain();
p.writeInterfaceToken(INTERFACE_TOKEN_1);
@@ -95,7 +91,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testParcelWithMultipleHeaders() {
Parcel p = Parcel.obtain();
Binder.setCallingWorkSourceUid(WORK_SOURCE_1);
@@ -153,7 +148,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testCompareDataInRange_whenSameDataWithBinder() {
Binder binder = new Binder();
Parcel pA = Parcel.obtain();
@@ -313,7 +307,6 @@
* and 1M length for complex objects are allowed.
*/
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testAllocations_whenWithinLimit() {
Binder.setIsDirectlyHandlingTransactionOverride(true);
Parcel p = Parcel.obtain();
@@ -398,7 +391,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testHasBinders_AfterWritingBinderToParcel() {
Binder binder = new Binder();
Parcel pA = Parcel.obtain();
@@ -410,7 +402,6 @@
}
@Test
- @IgnoreUnderRavenwood(blockedBy = Parcel.class)
public void testHasBindersInRange_AfterWritingBinderToParcel() {
Binder binder = new Binder();
Parcel pA = Parcel.obtain();
diff --git a/core/tests/coretests/src/android/text/TextLineLetterSpacingTest.kt b/core/tests/coretests/src/android/text/TextLineLetterSpacingTest.kt
index 71980c1..e4e04a0 100644
--- a/core/tests/coretests/src/android/text/TextLineLetterSpacingTest.kt
+++ b/core/tests/coretests/src/android/text/TextLineLetterSpacingTest.kt
@@ -17,11 +17,9 @@
package android.text
import android.graphics.Paint
-import android.platform.test.annotations.RequiresFlagsEnabled
import android.platform.test.flag.junit.DeviceFlagsValueProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import com.android.text.flags.Flags.FLAG_LETTER_SPACING_JUSTIFICATION
import com.google.common.truth.Truth.assertThat
import org.junit.Rule
import org.junit.Test
@@ -40,7 +38,6 @@
@JvmField
val mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()
- @RequiresFlagsEnabled(FLAG_LETTER_SPACING_JUSTIFICATION)
@Test
fun calculateRunFlagTest() {
// Only one Bidi run
@@ -84,7 +81,6 @@
.isEqualTo(LEFT_EDGE)
}
- @RequiresFlagsEnabled(FLAG_LETTER_SPACING_JUSTIFICATION)
@Test
fun resolveRunFlagForSubSequenceTest() {
val runStart = 5
diff --git a/core/tests/coretests/src/android/widget/RemoteViewsProtoTest.java b/core/tests/coretests/src/android/widget/RemoteViewsProtoTest.java
deleted file mode 100644
index 7c14032..0000000
--- a/core/tests/coretests/src/android/widget/RemoteViewsProtoTest.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.widget;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import android.content.Context;
-import android.util.SizeF;
-import android.util.proto.ProtoInputStream;
-import android.util.proto.ProtoOutputStream;
-import android.view.View;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.frameworks.coretests.R;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
-
-import java.util.Map;
-
-/**
- * Tests for RemoteViews.
- */
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class RemoteViewsProtoTest {
-
- // This can point to any other package which exists on the device.
- private static final String OTHER_PACKAGE = "com.android.systemui";
-
- @Rule
- public final ExpectedException exception = ExpectedException.none();
-
- private Context mContext;
- private String mPackage;
- private LinearLayout mContainer;
-
- @Before
- public void setup() {
- mContext = InstrumentationRegistry.getContext();
- mPackage = mContext.getPackageName();
- mContainer = new LinearLayout(mContext);
- }
-
- @Test
- public void copy_canStillBeApplied() {
- RemoteViews original = new RemoteViews(mPackage, R.layout.remote_views_test);
-
- RemoteViews clone = recreateFromProto(original);
-
- clone.apply(mContext, mContainer);
- }
-
- @SuppressWarnings("ReturnValueIgnored")
- @Test
- public void clone_repeatedly() {
- RemoteViews original = new RemoteViews(mPackage, R.layout.remote_views_test);
-
- recreateFromProto(original);
- recreateFromProto(original);
-
- original.apply(mContext, mContainer);
- }
-
- @Test
- public void clone_chained() {
- RemoteViews original = new RemoteViews(mPackage, R.layout.remote_views_test);
-
- RemoteViews clone = recreateFromProto(recreateFromProto(original));
-
-
- clone.apply(mContext, mContainer);
- }
-
- @Test
- public void landscapePortraitViews_lightBackgroundLayoutFlag() {
- RemoteViews inner = new RemoteViews(mPackage, R.layout.remote_views_text);
- inner.setLightBackgroundLayoutId(R.layout.remote_views_light_background_text);
-
- RemoteViews parent = new RemoteViews(inner, inner);
- parent.addFlags(RemoteViews.FLAG_USE_LIGHT_BACKGROUND_LAYOUT);
-
- View view = recreateFromProto(parent).apply(mContext, mContainer);
- assertNull(view.findViewById(R.id.text));
- assertNotNull(view.findViewById(R.id.light_background_text));
- }
-
- @Test
- public void sizedViews_lightBackgroundLayoutFlag() {
- RemoteViews inner = new RemoteViews(mPackage, R.layout.remote_views_text);
- inner.setLightBackgroundLayoutId(R.layout.remote_views_light_background_text);
-
- RemoteViews parent = new RemoteViews(
- Map.of(new SizeF(0, 0), inner, new SizeF(100, 100), inner));
- parent.addFlags(RemoteViews.FLAG_USE_LIGHT_BACKGROUND_LAYOUT);
-
- View view = recreateFromProto(parent).apply(mContext, mContainer);
- assertNull(view.findViewById(R.id.text));
- assertNotNull(view.findViewById(R.id.light_background_text));
- }
-
- @Test
- public void nestedLandscapeViews() throws Exception {
- RemoteViews views = new RemoteViews(mPackage, R.layout.remote_views_test);
- for (int i = 0; i < 10; i++) {
- views = new RemoteViews(views, new RemoteViews(mPackage, R.layout.remote_views_test));
- }
- // writeTo/createFromProto works
- recreateFromProto(views);
-
- views = new RemoteViews(mPackage, R.layout.remote_views_test);
- for (int i = 0; i < 11; i++) {
- views = new RemoteViews(views, new RemoteViews(mPackage, R.layout.remote_views_test));
- }
- // writeTo/createFromProto fails
- exception.expect(IllegalArgumentException.class);
- recreateFromProtoNoRethrow(views);
- }
-
- private RemoteViews recreateFromProto(RemoteViews views) {
- try {
- return recreateFromProtoNoRethrow(views);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private RemoteViews recreateFromProtoNoRethrow(RemoteViews views) throws Exception {
- ProtoOutputStream out = new ProtoOutputStream();
- views.writePreviewToProto(mContext, out);
- ProtoInputStream in = new ProtoInputStream(out.getBytes());
- return RemoteViews.createPreviewFromProto(mContext, in);
- }
-}
diff --git a/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java b/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java
index d153edd..46dfcb5 100644
--- a/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java
+++ b/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java
@@ -44,6 +44,7 @@
import android.view.ImeBackAnimationController;
import android.view.MotionEvent;
+import androidx.annotation.NonNull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -61,6 +62,10 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
/**
* Tests for {@link WindowOnBackInvokedDispatcherTest}
@@ -117,6 +122,8 @@
mDispatcher = new WindowOnBackInvokedDispatcher(mContext, Looper.getMainLooper());
mDispatcher.attachToWindow(mWindowSession, mWindow, null, mImeBackAnimationController);
+ clearInvocations(mCallback1);
+ clearInvocations(mCallback2);
}
private void waitForIdle() {
@@ -472,6 +479,102 @@
verifyImeCallackRegistrations();
}
+ @Test
+ public void onBackInvoked_notCalledAfterCallbackUnregistration()
+ throws RemoteException, InterruptedException {
+ // Setup a callback that unregisters itself after the gesture is finished but before the
+ // fling animation has ended
+ final AtomicBoolean unregisterOnProgressUpdate = new AtomicBoolean(false);
+ final AtomicInteger onBackInvokedCalled = new AtomicInteger(0);
+ final CountDownLatch onBackCancelledCalled = new CountDownLatch(1);
+ OnBackAnimationCallback onBackAnimationCallback = new OnBackAnimationCallback() {
+ @Override
+ public void onBackProgressed(@NonNull BackEvent backEvent) {
+ if (unregisterOnProgressUpdate.get()) {
+ mDispatcher.unregisterOnBackInvokedCallback(this);
+ }
+ }
+
+ @Override
+ public void onBackInvoked() {
+ onBackInvokedCalled.getAndIncrement();
+ }
+
+ @Override
+ public void onBackCancelled() {
+ onBackCancelledCalled.countDown();
+ }
+ };
+ mDispatcher.registerOnBackInvokedCallback(PRIORITY_DEFAULT, onBackAnimationCallback);
+ OnBackInvokedCallbackInfo callbackInfo = assertSetCallbackInfo();
+
+ callbackInfo.getCallback().onBackStarted(mBackEvent);
+ waitForIdle();
+ assertTrue(mDispatcher.mProgressAnimator.isBackAnimationInProgress());
+
+ // simulate back gesture finished and onBackInvoked() called, which starts the fling slow
+ // down animation. By setting unregisterOnProgressUpdate to true, the callback will
+ // unregister itself as soon as it receives the first progress event (coming from the
+ // generated fling slow down events)
+ unregisterOnProgressUpdate.set(true);
+ callbackInfo.getCallback().onBackInvoked();
+ waitForIdle();
+ onBackCancelledCalled.await(1000, TimeUnit.MILLISECONDS);
+
+ // verify that onBackCancelled is called in this case instead of onBackInvoked
+ assertEquals(0, onBackCancelledCalled.getCount());
+ assertEquals(0, onBackInvokedCalled.get());
+ verify(mWindowSession).setOnBackInvokedCallbackInfo(Mockito.eq(mWindow), isNull());
+ assertFalse(mDispatcher.mProgressAnimator.isBackAnimationInProgress());
+ }
+
+ @Test
+ public void onBackCancelled_calledOnceAfterCallbackUnregistration()
+ throws RemoteException, InterruptedException {
+ // Setup a callback that unregisters itself after the gesture is finished but before the
+ // progress is animated back to 0f
+ final AtomicBoolean unregisterOnProgressUpdate = new AtomicBoolean(false);
+ final AtomicInteger onBackInvokedCalled = new AtomicInteger(0);
+ final CountDownLatch onBackCancelledCalled = new CountDownLatch(1);
+ OnBackAnimationCallback onBackAnimationCallback = new OnBackAnimationCallback() {
+ @Override
+ public void onBackProgressed(@NonNull BackEvent backEvent) {
+ if (unregisterOnProgressUpdate.get()) {
+ mDispatcher.unregisterOnBackInvokedCallback(this);
+ }
+ }
+
+ @Override
+ public void onBackInvoked() {
+ onBackInvokedCalled.getAndIncrement();
+ }
+
+ @Override
+ public void onBackCancelled() {
+ onBackCancelledCalled.countDown();
+ }
+ };
+ mDispatcher.registerOnBackInvokedCallback(PRIORITY_DEFAULT, onBackAnimationCallback);
+ OnBackInvokedCallbackInfo callbackInfo = assertSetCallbackInfo();
+
+ callbackInfo.getCallback().onBackStarted(mBackEvent);
+ waitForIdle();
+ assertTrue(mDispatcher.mProgressAnimator.isBackAnimationInProgress());
+
+ // simulate back gesture finished and onBackCancelled() called, which starts the progress
+ // animation back to 0f. On the first progress emission, the callback will unregister itself
+ unregisterOnProgressUpdate.set(true);
+ callbackInfo.getCallback().onBackCancelled();
+ waitForIdle();
+ onBackCancelledCalled.await(1000, TimeUnit.MILLISECONDS);
+
+ // verify that onBackCancelled is called exactly once in this case
+ assertEquals(0, onBackCancelledCalled.getCount());
+ assertEquals(0, onBackInvokedCalled.get());
+ verify(mWindowSession).setOnBackInvokedCallbackInfo(Mockito.eq(mWindow), isNull());
+ assertFalse(mDispatcher.mProgressAnimator.isBackAnimationInProgress());
+ }
+
private void verifyImeCallackRegistrations() throws RemoteException {
// verify default callback is replaced with ImeBackAnimationController
mDispatcher.registerOnBackInvokedCallbackUnchecked(mDefaultImeCallback, PRIORITY_DEFAULT);
diff --git a/core/tests/coretests/src/com/android/internal/widget/ViewGroupFaderTest.java b/core/tests/coretests/src/com/android/internal/widget/ViewGroupFaderTest.java
new file mode 100644
index 0000000..eeabc2f
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/widget/ViewGroupFaderTest.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.widget;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.platform.test.annotations.EnableFlags;
+import android.platform.test.flag.junit.SetFlagsRule;
+import android.test.AndroidTestCase;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.flags.Flags;
+
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * Tests for {@link ViewGroupFader}.
+ */
+public class ViewGroupFaderTest extends AndroidTestCase {
+
+ private Context mContext;
+ private ViewGroupFader mViewGroupFader;
+ private Resources mResources;
+
+ @Mock
+ private ViewGroup mViewGroup,mViewGroup1;
+
+ @Mock
+ private ViewGroupFader mockViewGroupFader;
+
+ @Mock
+ private ViewGroupFader.AnimationCallback mAnimationCallback;
+
+ @Mock
+ private ViewGroupFader.ChildViewBoundsProvider mChildViewBoundsProvider;
+
+ @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+
+ @Before
+ public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ final Context mContext = getInstrumentation().getContext();
+ mResources = spy(mContext.getResources());
+ when(mResources.getBoolean(com.android.internal.R.bool.config_enableViewGroupScalingFading))
+ .thenReturn(true);
+ when(mViewGroup.getResources()).thenReturn(mResources);
+
+ mViewGroupFader = new ViewGroupFader(
+ mViewGroup,
+ mAnimationCallback,
+ mChildViewBoundsProvider);
+ }
+
+ /** This test checks that for each child of the parent viewgroup,
+ * updateListElementFades is called for each of its child, when the Flag is set to true
+ */
+ @Test
+ @EnableFlags(Flags.FLAG_ENABLE_FADING_VIEW_GROUP)
+ public void testFadingAndScrollingAnimationWorking_FlagOn() {
+ mViewGroup.addView(mViewGroup1);
+ mViewGroupFader.updateFade();
+
+ for (int i = 0; i < mViewGroup.getChildCount(); i++) {
+ View child = mViewGroup.getChildAt(i);
+ verify(mockViewGroupFader).updateListElementFades((ViewGroup)child,true);
+ }
+ }
+
+ /** This test checks that for each child of the parent viewgroup,
+ * updateListElementFades is never called for each of its child, when the Flag is set to false
+ */
+ @Test
+ public void testFadingAndScrollingAnimationNotWorking_FlagOff() {
+ mViewGroup.addView(mViewGroup1);
+ mViewGroupFader.updateFade();
+
+ for (int i = 0; i < mViewGroup.getChildCount(); i++) {
+ View child = mViewGroup.getChildAt(i);
+ verify(mockViewGroupFader,never()).updateListElementFades((ViewGroup)child,true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/core/tests/devicestatetests/Android.bp b/core/tests/devicestatetests/Android.bp
index 60848b3..a3303c6 100644
--- a/core/tests/devicestatetests/Android.bp
+++ b/core/tests/devicestatetests/Android.bp
@@ -32,7 +32,7 @@
"platform-test-annotations",
"testng",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
}
diff --git a/core/tests/featureflagtests/Android.bp b/core/tests/featureflagtests/Android.bp
index d9f608e..c080667 100644
--- a/core/tests/featureflagtests/Android.bp
+++ b/core/tests/featureflagtests/Android.bp
@@ -19,8 +19,8 @@
"androidx.test.rules",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
certificate: "platform",
diff --git a/core/tests/hdmitests/Android.bp b/core/tests/hdmitests/Android.bp
index e11bc55..7a5757c 100644
--- a/core/tests/hdmitests/Android.bp
+++ b/core/tests/hdmitests/Android.bp
@@ -32,7 +32,7 @@
"platform-test-annotations",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp b/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp
index d439124..c9fdec0 100644
--- a/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp
+++ b/core/tests/hosttests/test-apps/DownloadManagerTestApp/Android.bp
@@ -27,8 +27,8 @@
"junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
diff --git a/core/tests/mockingcoretests/Android.bp b/core/tests/mockingcoretests/Android.bp
index 7fd813a..8657b8c 100644
--- a/core/tests/mockingcoretests/Android.bp
+++ b/core/tests/mockingcoretests/Android.bp
@@ -44,9 +44,9 @@
],
libs: [
- "android.test.base",
- "android.test.mock",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.runner.stubs.system",
],
// These are not normally accessible from apps so they must be explicitly included.
diff --git a/core/tests/packagemanagertests/Android.bp b/core/tests/packagemanagertests/Android.bp
index 5ce71c9..8ff4998 100644
--- a/core/tests/packagemanagertests/Android.bp
+++ b/core/tests/packagemanagertests/Android.bp
@@ -17,7 +17,7 @@
"frameworks-base-testutils",
"mockito-target-minus-junit4",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
}
diff --git a/core/tests/packagemonitortests/Android.bp b/core/tests/packagemonitortests/Android.bp
index b08850e..c3b084e 100644
--- a/core/tests/packagemonitortests/Android.bp
+++ b/core/tests/packagemonitortests/Android.bp
@@ -34,7 +34,7 @@
"mockito-target-minus-junit4",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
@@ -52,7 +52,7 @@
"compatibility-device-util-axt",
"frameworks-base-testutils",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/privacytests/Android.bp b/core/tests/privacytests/Android.bp
index 4e24cd5..ac9cede 100644
--- a/core/tests/privacytests/Android.bp
+++ b/core/tests/privacytests/Android.bp
@@ -16,7 +16,7 @@
"androidx.test.rules",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/core/tests/screenshothelpertests/Android.bp b/core/tests/screenshothelpertests/Android.bp
index 3c71e6e..49c3ee9 100644
--- a/core/tests/screenshothelpertests/Android.bp
+++ b/core/tests/screenshothelpertests/Android.bp
@@ -25,9 +25,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
platform_apis: true,
diff --git a/core/tests/systemproperties/Android.bp b/core/tests/systemproperties/Android.bp
index ed52ccc..ed99a1f 100644
--- a/core/tests/systemproperties/Android.bp
+++ b/core/tests/systemproperties/Android.bp
@@ -20,8 +20,8 @@
"ravenwood-junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
certificate: "platform",
@@ -37,8 +37,8 @@
"ravenwood-junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
srcs: [
"src/**/*.java",
diff --git a/core/tests/timetests/Android.bp b/core/tests/timetests/Android.bp
index c33d5ee..04bbe69 100644
--- a/core/tests/timetests/Android.bp
+++ b/core/tests/timetests/Android.bp
@@ -19,7 +19,7 @@
"platform-test-annotations",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
certificate: "platform",
test_suites: ["device-tests"],
}
diff --git a/core/tests/utillib/Android.bp b/core/tests/utillib/Android.bp
index 1d5c16c..b6f046b 100644
--- a/core/tests/utillib/Android.bp
+++ b/core/tests/utillib/Android.bp
@@ -28,5 +28,5 @@
srcs: ["**/*.java"],
static_libs: ["junit"],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs"],
}
diff --git a/core/tests/utiltests/Android.bp b/core/tests/utiltests/Android.bp
index f5563a7..cdc8a9e 100644
--- a/core/tests/utiltests/Android.bp
+++ b/core/tests/utiltests/Android.bp
@@ -39,9 +39,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
platform_apis: true,
@@ -55,7 +55,7 @@
android_ravenwood_test {
name: "FrameworksUtilTestsRavenwood",
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.annotation_annotation",
diff --git a/core/tests/vibrator/Android.bp b/core/tests/vibrator/Android.bp
index 920ab59..848e079 100644
--- a/core/tests/vibrator/Android.bp
+++ b/core/tests/vibrator/Android.bp
@@ -25,9 +25,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"framework",
"framework-res",
],
diff --git a/core/tests/vibrator/src/android/os/VibratorInfoTest.java b/core/tests/vibrator/src/android/os/VibratorInfoTest.java
index 73cd464..c810810 100644
--- a/core/tests/vibrator/src/android/os/VibratorInfoTest.java
+++ b/core/tests/vibrator/src/android/os/VibratorInfoTest.java
@@ -139,6 +139,35 @@
}
@Test
+ public void testAreEnvelopeEffectsSupported() {
+ VibratorInfo noCapabilities = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build();
+ assertFalse(noCapabilities.areEnvelopeEffectsSupported());
+ VibratorInfo envelopeEffectCapability = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
+ .setCapabilities(IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2)
+ .build();
+ assertTrue(envelopeEffectCapability.areEnvelopeEffectsSupported());
+ }
+
+ @Test
+ public void testEnvelopeEffectLimits() {
+ VibratorInfo info = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
+ .setMaxEnvelopeEffectSize(16)
+ .setMinEnvelopeEffectControlPointDurationMillis(20)
+ .setMaxEnvelopeEffectControlPointDurationMillis(1_000)
+ .build();
+ assertEquals(16, info.getMaxEnvelopeEffectSize());
+ assertEquals(20, info.getMinEnvelopeEffectControlPointDurationMillis());
+ assertEquals(1_000, info.getMaxEnvelopeEffectControlPointDurationMillis());
+ assertEquals(16_000, info.getMaxEnvelopeEffectDurationMillis());
+
+ VibratorInfo emptyInfo = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build();
+ assertEquals(0, emptyInfo.getMaxEnvelopeEffectSize());
+ assertEquals(0, emptyInfo.getMinEnvelopeEffectControlPointDurationMillis());
+ assertEquals(0, emptyInfo.getMaxEnvelopeEffectControlPointDurationMillis());
+ assertEquals(0, emptyInfo.getMaxEnvelopeEffectDurationMillis());
+ }
+
+ @Test
public void testGetDefaultBraking_returnsFirstSupportedBraking() {
assertEquals(Braking.NONE, new VibratorInfo.Builder(
TEST_VIBRATOR_ID).build().getDefaultBraking());
@@ -262,17 +291,20 @@
VibratorInfo.Builder completeBuilder2 = new VibratorInfo.Builder(TEST_VIBRATOR_ID + 2);
for (VibratorInfo.Builder builder :
- new VibratorInfo.Builder[] {completeBuilder, completeBuilder2}) {
+ new VibratorInfo.Builder[]{completeBuilder, completeBuilder2}) {
builder.setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
- .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 20)
- .setPrimitiveDelayMax(100)
- .setCompositionSizeMax(10)
- .setSupportedBraking(Braking.CLAB)
- .setPwlePrimitiveDurationMax(50)
- .setPwleSizeMax(20)
- .setQFactor(2f)
- .setFrequencyProfile(TEST_FREQUENCY_PROFILE);
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 20)
+ .setPrimitiveDelayMax(100)
+ .setCompositionSizeMax(10)
+ .setSupportedBraking(Braking.CLAB)
+ .setPwlePrimitiveDurationMax(50)
+ .setPwleSizeMax(20)
+ .setQFactor(2f)
+ .setFrequencyProfile(TEST_FREQUENCY_PROFILE)
+ .setMaxEnvelopeEffectSize(16)
+ .setMinEnvelopeEffectControlPointDurationMillis(20)
+ .setMaxEnvelopeEffectControlPointDurationMillis(1_000);
}
VibratorInfo complete = completeBuilder.build();
diff --git a/graphics/java/android/graphics/OWNERS b/graphics/java/android/graphics/OWNERS
index 9fa8f1b..ef8d26c 100644
--- a/graphics/java/android/graphics/OWNERS
+++ b/graphics/java/android/graphics/OWNERS
@@ -11,3 +11,4 @@
per-file FontFamily.java = file:fonts/OWNERS
per-file FontListParser.java = file:fonts/OWNERS
per-file Typeface.java = file:fonts/OWNERS
+per-file Paint.java = file:fonts/OWNERS
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index df95a91..b866382 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1805,16 +1805,7 @@
* @return true if elegant metrics are enabled for text drawing.
*/
public boolean isElegantTextHeight() {
- int rawValue = nGetElegantTextHeight(mNativePaint);
- switch (rawValue) {
- case ELEGANT_TEXT_HEIGHT_DISABLED:
- return false;
- case ELEGANT_TEXT_HEIGHT_ENABLED:
- return true;
- case ELEGANT_TEXT_HEIGHT_UNSET:
- default:
- return com.android.text.flags.Flags.deprecateUiFonts();
- }
+ return nGetElegantTextHeight(mNativePaint) != ELEGANT_TEXT_HEIGHT_DISABLED;
}
// Note: the following three values must be equal to the ones in the JNI file: Paint.cpp
diff --git a/graphics/java/android/graphics/fonts/FontCustomizationParser.java b/graphics/java/android/graphics/fonts/FontCustomizationParser.java
index ba5628c..b7bf055 100644
--- a/graphics/java/android/graphics/fonts/FontCustomizationParser.java
+++ b/graphics/java/android/graphics/fonts/FontCustomizationParser.java
@@ -182,10 +182,8 @@
// For ignoring the customization, consume the new-locale-family element but don't
// register any customizations.
- if (com.android.text.flags.Flags.vendorCustomLocaleFallback()) {
- outCustomization.add(new FontConfig.Customization.LocaleFallback(
- Locale.forLanguageTag(lang), intOp, family));
- }
+ outCustomization.add(new FontConfig.Customization.LocaleFallback(
+ Locale.forLanguageTag(lang), intOp, family));
} else {
throw new IllegalArgumentException("Unknown customizationType=" + customizationType);
}
diff --git a/graphics/java/android/graphics/fonts/SystemFonts.java b/graphics/java/android/graphics/fonts/SystemFonts.java
index f727f5b..0e25c34 100644
--- a/graphics/java/android/graphics/fonts/SystemFonts.java
+++ b/graphics/java/android/graphics/fonts/SystemFonts.java
@@ -306,13 +306,7 @@
long lastModifiedDate,
int configVersion
) {
- final String fontsXml;
- if (com.android.text.flags.Flags.newFontsFallbackXml()) {
- fontsXml = FONTS_XML;
- } else {
- fontsXml = LEGACY_FONTS_XML;
- }
- return getSystemFontConfigInternal(fontsXml, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR,
+ return getSystemFontConfigInternal(FONTS_XML, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR,
updatableFontMap, lastModifiedDate, configVersion);
}
@@ -337,13 +331,7 @@
* @hide
*/
public static @NonNull FontConfig getSystemPreinstalledFontConfig() {
- final String fontsXml;
- if (com.android.text.flags.Flags.newFontsFallbackXml()) {
- fontsXml = FONTS_XML;
- } else {
- fontsXml = LEGACY_FONTS_XML;
- }
- return getSystemFontConfigInternal(fontsXml, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR, null,
+ return getSystemFontConfigInternal(FONTS_XML, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR, null,
0, 0);
}
diff --git a/keystore/tests/Android.bp b/keystore/tests/Android.bp
index 7de4523..0dcf597 100644
--- a/keystore/tests/Android.bp
+++ b/keystore/tests/Android.bp
@@ -31,6 +31,6 @@
"mockito-target-minus-junit4",
],
platform_apis: true,
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
certificate: "platform",
}
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/BackupHelper.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/BackupHelper.java
index 4ce2942..bfccb29 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/BackupHelper.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/BackupHelper.java
@@ -16,16 +16,26 @@
package androidx.window.extensions.embedding;
+import static android.window.TaskFragmentOrganizer.KEY_RESTORE_TASK_FRAGMENTS_INFO;
+import static android.window.TaskFragmentOrganizer.KEY_RESTORE_TASK_FRAGMENT_PARENT_INFO;
+
import android.os.Build;
import android.os.Bundle;
+import android.os.IBinder;
import android.os.Looper;
import android.os.MessageQueue;
+import android.util.ArrayMap;
import android.util.Log;
+import android.util.SparseArray;
+import android.window.TaskFragmentInfo;
+import android.window.TaskFragmentParentInfo;
+import android.window.WindowContainerTransaction;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
/**
* Helper class to back up and restore the TaskFragmentOrganizer state, in order to resume
@@ -40,11 +50,21 @@
@NonNull
private final SplitController mController;
@NonNull
+ private final SplitPresenter mPresenter;
+ @NonNull
private final BackupIdler mBackupIdler = new BackupIdler();
private boolean mBackupIdlerScheduled;
- BackupHelper(@NonNull SplitController splitController, @NonNull Bundle savedState) {
+ private final List<ParcelableTaskContainerData> mParcelableTaskContainerDataList =
+ new ArrayList<>();
+ private final ArrayMap<IBinder, TaskFragmentInfo> mTaskFragmentInfos = new ArrayMap<>();
+ private final SparseArray<TaskFragmentParentInfo> mTaskFragmentParentInfos =
+ new SparseArray<>();
+
+ BackupHelper(@NonNull SplitController splitController, @NonNull SplitPresenter splitPresenter,
+ @NonNull Bundle savedState) {
mController = splitController;
+ mPresenter = splitPresenter;
if (!savedState.isEmpty()) {
restoreState(savedState);
@@ -67,13 +87,13 @@
public boolean queueIdle() {
synchronized (mController.mLock) {
mBackupIdlerScheduled = false;
- startBackup();
+ saveState();
}
return false;
}
}
- private void startBackup() {
+ private void saveState() {
final List<TaskContainer> taskContainers = mController.getTaskContainers();
if (taskContainers.isEmpty()) {
Log.w(TAG, "No task-container to back up");
@@ -97,13 +117,92 @@
return;
}
- final List<ParcelableTaskContainerData> parcelableTaskContainerDataList =
- savedState.getParcelableArrayList(KEY_TASK_CONTAINERS,
- ParcelableTaskContainerData.class);
- for (ParcelableTaskContainerData data : parcelableTaskContainerDataList) {
- final TaskContainer taskContainer = new TaskContainer(data, mController);
- if (DEBUG) Log.d(TAG, "Restoring task " + taskContainer.getTaskId());
- // TODO(b/289875940): implement the TaskContainer restoration.
+ if (DEBUG) Log.d(TAG, "Start restoring saved-state");
+ mParcelableTaskContainerDataList.addAll(savedState.getParcelableArrayList(
+ KEY_TASK_CONTAINERS, ParcelableTaskContainerData.class));
+ if (DEBUG) Log.d(TAG, "Retrieved tasks : " + mParcelableTaskContainerDataList.size());
+ if (mParcelableTaskContainerDataList.isEmpty()) {
+ return;
+ }
+
+ final List<TaskFragmentInfo> infos = savedState.getParcelableArrayList(
+ KEY_RESTORE_TASK_FRAGMENTS_INFO, TaskFragmentInfo.class);
+ for (TaskFragmentInfo info : infos) {
+ if (DEBUG) Log.d(TAG, "Retrieved: " + info);
+ mTaskFragmentInfos.put(info.getFragmentToken(), info);
+ mPresenter.updateTaskFragmentInfo(info);
+ }
+
+ final List<TaskFragmentParentInfo> parentInfos = savedState.getParcelableArrayList(
+ KEY_RESTORE_TASK_FRAGMENT_PARENT_INFO,
+ TaskFragmentParentInfo.class);
+ for (TaskFragmentParentInfo info : parentInfos) {
+ if (DEBUG) Log.d(TAG, "Retrieved: " + info);
+ mTaskFragmentParentInfos.put(info.getTaskId(), info);
}
}
-}
+
+ boolean hasPendingStateToRestore() {
+ return !mParcelableTaskContainerDataList.isEmpty();
+ }
+
+ /**
+ * Returns {@code true} if any of the {@link TaskContainer} is restored.
+ * Otherwise, returns {@code false}.
+ */
+ boolean rebuildTaskContainers(@NonNull WindowContainerTransaction wct,
+ @NonNull Set<EmbeddingRule> rules) {
+ if (mParcelableTaskContainerDataList.isEmpty()) {
+ return false;
+ }
+
+ if (DEBUG) Log.d(TAG, "Rebuilding TaskContainers.");
+ final ArrayMap<String, EmbeddingRule> embeddingRuleMap = new ArrayMap<>();
+ for (EmbeddingRule rule : rules) {
+ embeddingRuleMap.put(rule.getTag(), rule);
+ }
+
+ boolean restoredAny = false;
+ for (int i = mParcelableTaskContainerDataList.size() - 1; i >= 0; i--) {
+ final ParcelableTaskContainerData parcelableTaskContainerData =
+ mParcelableTaskContainerDataList.get(i);
+ final List<String> tags = parcelableTaskContainerData.getSplitRuleTags();
+ if (!embeddingRuleMap.containsAll(tags)) {
+ // has unknown tag, unable to restore.
+ if (DEBUG) {
+ Log.d(TAG, "Rebuilding TaskContainer abort! Unknown Tag. Task#"
+ + parcelableTaskContainerData.mTaskId);
+ }
+ continue;
+ }
+
+ mParcelableTaskContainerDataList.remove(parcelableTaskContainerData);
+ final TaskContainer taskContainer = new TaskContainer(parcelableTaskContainerData,
+ mController, mTaskFragmentInfos);
+ if (DEBUG) Log.d(TAG, "Created TaskContainer " + taskContainer);
+ mController.addTaskContainer(taskContainer.getTaskId(), taskContainer);
+
+ for (ParcelableSplitContainerData splitData :
+ parcelableTaskContainerData.getParcelableSplitContainerDataList()) {
+ final SplitRule rule = (SplitRule) embeddingRuleMap.get(splitData.mSplitRuleTag);
+ assert rule != null;
+ if (mController.getContainer(splitData.getPrimaryContainerToken()) != null
+ && mController.getContainer(splitData.getSecondaryContainerToken())
+ != null) {
+ taskContainer.addSplitContainer(
+ new SplitContainer(splitData, mController, rule));
+ }
+ }
+
+ mController.onTaskFragmentParentRestored(wct, taskContainer.getTaskId(),
+ mTaskFragmentParentInfos.get(taskContainer.getTaskId()));
+ restoredAny = true;
+ }
+
+ if (mParcelableTaskContainerDataList.isEmpty()) {
+ mTaskFragmentParentInfos.clear();
+ mTaskFragmentInfos.clear();
+ }
+ return restoredAny;
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableSplitContainerData.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableSplitContainerData.java
index 817cfce..cb280c5 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableSplitContainerData.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableSplitContainerData.java
@@ -89,13 +89,13 @@
};
@NonNull
- private IBinder getPrimaryContainerToken() {
+ IBinder getPrimaryContainerToken() {
return mSplitContainer != null ? mSplitContainer.getPrimaryContainer().getToken()
: mPrimaryContainerToken;
}
@NonNull
- private IBinder getSecondaryContainerToken() {
+ IBinder getSecondaryContainerToken() {
return mSplitContainer != null ? mSplitContainer.getSecondaryContainer().getToken()
: mSecondaryContainerToken;
}
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableTaskContainerData.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableTaskContainerData.java
index 7377d00..97aa699 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableTaskContainerData.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/ParcelableTaskContainerData.java
@@ -108,6 +108,15 @@
: mParcelableSplitContainerDataList;
}
+ @NonNull
+ List<String> getSplitRuleTags() {
+ final List<String> tags = new ArrayList<>();
+ for (ParcelableSplitContainerData data : getParcelableSplitContainerDataList()) {
+ tags.add(data.mSplitRuleTag);
+ }
+ return tags;
+ }
+
@Override
public int describeContents() {
return 0;
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitContainer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitContainer.java
index 6d436ec..faf73c2 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitContainer.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitContainer.java
@@ -86,6 +86,25 @@
}
}
+ /** This is only used when restoring it from a {@link ParcelableSplitContainerData}. */
+ SplitContainer(@NonNull ParcelableSplitContainerData parcelableData,
+ @NonNull SplitController splitController, @NonNull SplitRule splitRule) {
+ mParcelableData = parcelableData;
+ mPrimaryContainer = splitController.getContainer(parcelableData.getPrimaryContainerToken());
+ mSecondaryContainer = splitController.getContainer(
+ parcelableData.getSecondaryContainerToken());
+ mSplitRule = splitRule;
+ mDefaultSplitAttributes = splitRule.getDefaultSplitAttributes();
+ mCurrentSplitAttributes = mDefaultSplitAttributes;
+
+ if (shouldFinishPrimaryWithSecondary(splitRule)) {
+ mSecondaryContainer.addContainerToFinishOnExit(mPrimaryContainer);
+ }
+ if (shouldFinishSecondaryWithPrimary(splitRule)) {
+ mPrimaryContainer.addContainerToFinishOnExit(mSecondaryContainer);
+ }
+ }
+
void setPrimaryContainer(@NonNull TaskFragmentContainer primaryContainer) {
if (!mParcelableData.mIsPrimaryContainerMutable) {
throw new IllegalStateException("Cannot update primary TaskFragmentContainer");
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
index f2f2b7ea..db4bb0e 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
@@ -279,6 +279,26 @@
Log.i(TAG, "Setting embedding rules. Size: " + rules.size());
mSplitRules.clear();
mSplitRules.addAll(rules);
+
+ if (!Flags.aeBackStackRestore() || !mPresenter.isRebuildTaskContainersNeeded()) {
+ return;
+ }
+
+ try {
+ final TransactionRecord transactionRecord =
+ mTransactionManager.startNewTransaction();
+ final WindowContainerTransaction wct = transactionRecord.getTransaction();
+ if (mPresenter.rebuildTaskContainers(wct, rules)) {
+ transactionRecord.apply(false /* shouldApplyIndependently */);
+ updateCallbackIfNecessary();
+ } else {
+ transactionRecord.abort();
+ }
+ } catch (IllegalStateException ex) {
+ Log.e(TAG, "Having an existing transaction while running restoration with"
+ + "new rules!! It is likely too late to perform the restoration "
+ + "already!?", ex);
+ }
}
}
@@ -903,6 +923,12 @@
}
@GuardedBy("mLock")
+ void onTaskFragmentParentRestored(@NonNull WindowContainerTransaction wct, int taskId,
+ @NonNull TaskFragmentParentInfo parentInfo) {
+ onTaskFragmentParentInfoChanged(wct, taskId, parentInfo);
+ }
+
+ @GuardedBy("mLock")
void updateContainersInTaskIfVisible(@NonNull WindowContainerTransaction wct, int taskId) {
final TaskContainer taskContainer = getTaskContainer(taskId);
if (taskContainer == null) {
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java
index abc7b29..0c0ded9 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java
@@ -24,6 +24,7 @@
import static androidx.window.extensions.embedding.WindowAttributes.DIM_AREA_ON_TASK;
import android.annotation.AnimRes;
+import android.annotation.NonNull;
import android.app.Activity;
import android.app.ActivityThread;
import android.app.WindowConfiguration;
@@ -47,7 +48,6 @@
import android.window.WindowContainerTransaction;
import androidx.annotation.IntDef;
-import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.window.extensions.core.util.function.Function;
import androidx.window.extensions.embedding.SplitAttributes.SplitType;
@@ -67,6 +67,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import java.util.Set;
import java.util.concurrent.Executor;
/**
@@ -174,7 +175,7 @@
} else {
registerOrganizer();
}
- mBackupHelper = new BackupHelper(controller, outSavedState);
+ mBackupHelper = new BackupHelper(controller, this, outSavedState);
if (!SplitController.ENABLE_SHELL_TRANSITIONS) {
// TODO(b/207070762): cleanup with legacy app transition
// Animation will be handled by WM Shell when Shell transition is enabled.
@@ -186,6 +187,15 @@
mBackupHelper.scheduleBackup();
}
+ boolean isRebuildTaskContainersNeeded() {
+ return mBackupHelper.hasPendingStateToRestore();
+ }
+
+ boolean rebuildTaskContainers(@NonNull WindowContainerTransaction wct,
+ @NonNull Set<EmbeddingRule> rules) {
+ return mBackupHelper.rebuildTaskContainers(wct, rules);
+ }
+
/**
* Deletes the specified container and all other associated and dependent containers in the same
* transaction.
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskContainer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskContainer.java
index 608a3be..74cce68 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskContainer.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskContainer.java
@@ -31,6 +31,7 @@
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.IBinder;
+import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -147,14 +148,23 @@
/** This is only used when restoring it from a {@link ParcelableTaskContainerData}. */
TaskContainer(@NonNull ParcelableTaskContainerData data,
- @NonNull SplitController splitController) {
+ @NonNull SplitController splitController,
+ @NonNull ArrayMap<IBinder, TaskFragmentInfo> taskFragmentInfoMap) {
mParcelableTaskContainerData = new ParcelableTaskContainerData(data, this);
+ mInfo = new TaskFragmentParentInfo(new Configuration(), 0 /* displayId */, -1 /* taskId */,
+ false /* visible */, false /* hasDirectActivity */, null /* decorSurface */);
mSplitController = splitController;
for (ParcelableTaskFragmentContainerData tfData :
data.getParcelableTaskFragmentContainerDataList()) {
- final TaskFragmentContainer container =
- new TaskFragmentContainer(tfData, splitController, this);
- mContainers.add(container);
+ final TaskFragmentInfo info = taskFragmentInfoMap.get(tfData.mToken);
+ if (info != null && !info.isEmpty()) {
+ final TaskFragmentContainer container =
+ new TaskFragmentContainer(tfData, splitController, this);
+ container.setInfo(new WindowContainerTransaction(), info);
+ mContainers.add(container);
+ } else {
+ Log.d(TAG, "Drop " + tfData + " while restoring Task " + data.mTaskId);
+ }
}
}
diff --git a/libs/WindowManager/Jetpack/tests/unittest/Android.bp b/libs/WindowManager/Jetpack/tests/unittest/Android.bp
index 139ddda..bd430c0 100644
--- a/libs/WindowManager/Jetpack/tests/unittest/Android.bp
+++ b/libs/WindowManager/Jetpack/tests/unittest/Android.bp
@@ -47,9 +47,9 @@
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
// These are not normally accessible from apps so they must be explicitly included.
@@ -62,3 +62,10 @@
enabled: false,
},
}
+
+test_module_config {
+ name: "WMJetpackUnitTests_Presubmit",
+ base: "WMJetpackUnitTests",
+ test_suites: ["device-tests"],
+ include_annotations: ["android.platform.test.annotations.Presubmit"],
+}
diff --git a/libs/WindowManager/Shell/Android.bp b/libs/WindowManager/Shell/Android.bp
index a79bc97..94809f2 100644
--- a/libs/WindowManager/Shell/Android.bp
+++ b/libs/WindowManager/Shell/Android.bp
@@ -187,6 +187,9 @@
"shared/**/desktopmode/*.java",
"shared/**/desktopmode/*.kt",
],
+ static_libs: [
+ "com.android.window.flags.window-aconfig-java",
+ ],
}
android_library {
diff --git a/libs/WindowManager/Shell/multivalentTests/Android.bp b/libs/WindowManager/Shell/multivalentTests/Android.bp
index 1ad19c9..ee0d5bb 100644
--- a/libs/WindowManager/Shell/multivalentTests/Android.bp
+++ b/libs/WindowManager/Shell/multivalentTests/Android.bp
@@ -77,8 +77,8 @@
"platform-test-rules",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedViewTest.kt b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedViewTest.kt
new file mode 100644
index 0000000..35d459f
--- /dev/null
+++ b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedViewTest.kt
@@ -0,0 +1,324 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.bubbles.bar
+
+import android.app.ActivityManager
+import android.content.Context
+import android.graphics.Insets
+import android.graphics.Rect
+import android.view.LayoutInflater
+import android.view.View
+import android.view.WindowManager
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import com.android.internal.protolog.ProtoLog
+import com.android.wm.shell.R
+import com.android.wm.shell.bubbles.Bubble
+import com.android.wm.shell.bubbles.BubbleData
+import com.android.wm.shell.bubbles.BubbleExpandedViewManager
+import com.android.wm.shell.bubbles.BubblePositioner
+import com.android.wm.shell.bubbles.BubbleTaskView
+import com.android.wm.shell.bubbles.BubbleTaskViewFactory
+import com.android.wm.shell.bubbles.DeviceConfig
+import com.android.wm.shell.bubbles.RegionSamplingProvider
+import com.android.wm.shell.common.ShellExecutor
+import com.android.wm.shell.shared.bubbles.BubbleBarLocation
+import com.android.wm.shell.shared.handles.RegionSamplingHelper
+import com.android.wm.shell.taskview.TaskView
+import com.android.wm.shell.taskview.TaskViewTaskController
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+import java.util.Collections
+import java.util.concurrent.Executor
+
+/** Tests for [BubbleBarExpandedViewTest] */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class BubbleBarExpandedViewTest {
+ companion object {
+ const val SCREEN_WIDTH = 2000
+ const val SCREEN_HEIGHT = 1000
+ }
+
+ private val context = ApplicationProvider.getApplicationContext<Context>()
+ private val windowManager = context.getSystemService(WindowManager::class.java)
+
+ private lateinit var mainExecutor: TestExecutor
+ private lateinit var bgExecutor: TestExecutor
+
+ private lateinit var expandedViewManager: BubbleExpandedViewManager
+ private lateinit var positioner: BubblePositioner
+ private lateinit var bubbleTaskView: BubbleTaskView
+
+ private lateinit var bubbleExpandedView: BubbleBarExpandedView
+ private var testableRegionSamplingHelper: TestableRegionSamplingHelper? = null
+ private var regionSamplingProvider: TestRegionSamplingProvider? = null
+
+ @Before
+ fun setUp() {
+ ProtoLog.REQUIRE_PROTOLOGTOOL = false
+ mainExecutor = TestExecutor()
+ bgExecutor = TestExecutor()
+ positioner = BubblePositioner(context, windowManager)
+ positioner.setShowingInBubbleBar(true)
+ val deviceConfig =
+ DeviceConfig(
+ windowBounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
+ isLargeScreen = true,
+ isSmallTablet = false,
+ isLandscape = true,
+ isRtl = false,
+ insets = Insets.of(10, 20, 30, 40)
+ )
+ positioner.update(deviceConfig)
+
+ expandedViewManager = createExpandedViewManager()
+ bubbleTaskView = FakeBubbleTaskViewFactory().create()
+
+ val inflater = LayoutInflater.from(context)
+
+ regionSamplingProvider = TestRegionSamplingProvider()
+
+ bubbleExpandedView = (inflater.inflate(
+ R.layout.bubble_bar_expanded_view, null, false /* attachToRoot */
+ ) as BubbleBarExpandedView)
+ bubbleExpandedView.initialize(
+ expandedViewManager,
+ positioner,
+ false /* isOverflow */,
+ bubbleTaskView,
+ mainExecutor,
+ bgExecutor,
+ regionSamplingProvider
+ )
+
+ getInstrumentation().runOnMainSync(Runnable {
+ bubbleExpandedView.onAttachedToWindow()
+ // Helper should be created once attached to window
+ testableRegionSamplingHelper = regionSamplingProvider!!.helper
+ })
+ }
+
+ @After
+ fun tearDown() {
+ testableRegionSamplingHelper?.stopAndDestroy()
+ }
+
+ @Test
+ fun testCreateSamplingHelper_onAttach() {
+ assertThat(testableRegionSamplingHelper).isNotNull()
+ }
+
+ @Test
+ fun testDestroySamplingHelper_onDetach() {
+ bubbleExpandedView.onDetachedFromWindow()
+ assertThat(testableRegionSamplingHelper!!.isDestroyed).isTrue()
+ }
+
+ @Test
+ fun testStopSampling_onDragStart() {
+ bubbleExpandedView.setContentVisibility(true)
+ assertThat(testableRegionSamplingHelper!!.isStarted).isTrue()
+
+ bubbleExpandedView.setDragging(true)
+ assertThat(testableRegionSamplingHelper!!.isStopped).isTrue()
+ }
+
+ @Test
+ fun testStartSampling_onDragEnd() {
+ bubbleExpandedView.setDragging(true)
+ bubbleExpandedView.setContentVisibility(true)
+ assertThat(testableRegionSamplingHelper!!.isStopped).isTrue()
+
+ bubbleExpandedView.setDragging(false)
+ assertThat(testableRegionSamplingHelper!!.isStarted).isTrue()
+ }
+
+ @Test
+ fun testStartSampling_onContentVisible() {
+ bubbleExpandedView.setContentVisibility(true)
+ assertThat(testableRegionSamplingHelper!!.setWindowVisible).isTrue()
+ assertThat(testableRegionSamplingHelper!!.isStarted).isTrue()
+ }
+
+ @Test
+ fun testStopSampling_onContentInvisible() {
+ bubbleExpandedView.setContentVisibility(false)
+
+ assertThat(testableRegionSamplingHelper!!.setWindowInvisible).isTrue()
+ assertThat(testableRegionSamplingHelper!!.isStopped).isTrue()
+ }
+
+ @Test
+ fun testSampling_startStopAnimating_visible() {
+ bubbleExpandedView.isAnimating = true
+ bubbleExpandedView.setContentVisibility(true)
+ assertThat(testableRegionSamplingHelper!!.isStopped).isTrue()
+
+ bubbleExpandedView.isAnimating = false
+ assertThat(testableRegionSamplingHelper!!.isStarted).isTrue()
+ }
+
+ @Test
+ fun testSampling_startStopAnimating_invisible() {
+ bubbleExpandedView.isAnimating = true
+ bubbleExpandedView.setContentVisibility(false)
+ assertThat(testableRegionSamplingHelper!!.isStopped).isTrue()
+ testableRegionSamplingHelper!!.reset()
+
+ bubbleExpandedView.isAnimating = false
+ assertThat(testableRegionSamplingHelper!!.isStopped).isTrue()
+ }
+
+ private inner class FakeBubbleTaskViewFactory : BubbleTaskViewFactory {
+ override fun create(): BubbleTaskView {
+ val taskViewTaskController = mock<TaskViewTaskController>()
+ val taskView = TaskView(context, taskViewTaskController)
+ val taskInfo = mock<ActivityManager.RunningTaskInfo>()
+ whenever(taskViewTaskController.taskInfo).thenReturn(taskInfo)
+ return BubbleTaskView(taskView, mainExecutor)
+ }
+ }
+
+ private inner class TestRegionSamplingProvider : RegionSamplingProvider {
+
+ lateinit var helper: TestableRegionSamplingHelper
+
+ override fun createHelper(
+ sampledView: View?,
+ callback: RegionSamplingHelper.SamplingCallback?,
+ backgroundExecutor: Executor?,
+ mainExecutor: Executor?
+ ): RegionSamplingHelper {
+ helper = TestableRegionSamplingHelper(sampledView, callback, backgroundExecutor,
+ mainExecutor)
+ return helper
+ }
+ }
+
+ private inner class TestableRegionSamplingHelper(
+ sampledView: View?,
+ samplingCallback: SamplingCallback?,
+ backgroundExecutor: Executor?,
+ mainExecutor: Executor?
+ ) : RegionSamplingHelper(sampledView, samplingCallback, backgroundExecutor, mainExecutor) {
+
+ var isStarted = false
+ var isStopped = false
+ var isDestroyed = false
+ var setWindowVisible = false
+ var setWindowInvisible = false
+
+ override fun start(initialSamplingBounds: Rect) {
+ super.start(initialSamplingBounds)
+ isStarted = true
+ }
+
+ override fun stop() {
+ super.stop()
+ isStopped = true
+ }
+
+ override fun stopAndDestroy() {
+ super.stopAndDestroy()
+ isDestroyed = true
+ }
+
+ override fun setWindowVisible(visible: Boolean) {
+ super.setWindowVisible(visible)
+ if (visible) {
+ setWindowVisible = true
+ } else {
+ setWindowInvisible = true
+ }
+ }
+
+ fun reset() {
+ isStarted = false
+ isStopped = false
+ isDestroyed = false
+ setWindowVisible = false
+ setWindowInvisible = false
+ }
+ }
+
+ private fun createExpandedViewManager(): BubbleExpandedViewManager {
+ return object : BubbleExpandedViewManager {
+ override val overflowBubbles: List<Bubble>
+ get() = Collections.emptyList()
+
+ override fun setOverflowListener(listener: BubbleData.Listener) {
+ }
+
+ override fun collapseStack() {
+ }
+
+ override fun updateWindowFlagsForBackpress(intercept: Boolean) {
+ }
+
+ override fun promoteBubbleFromOverflow(bubble: Bubble) {
+ }
+
+ override fun removeBubble(key: String, reason: Int) {
+ }
+
+ override fun dismissBubble(bubble: Bubble, reason: Int) {
+ }
+
+ override fun setAppBubbleTaskId(key: String, taskId: Int) {
+ }
+
+ override fun isStackExpanded(): Boolean {
+ return true
+ }
+
+ override fun isShowingAsBubbleBar(): Boolean {
+ return true
+ }
+
+ override fun hideCurrentInputMethod() {
+ }
+
+ override fun updateBubbleBarLocation(location: BubbleBarLocation) {
+ }
+ }
+ }
+
+ private class TestExecutor : ShellExecutor {
+
+ private val runnables: MutableList<Runnable> = mutableListOf()
+
+ override fun execute(runnable: Runnable) {
+ runnables.add(runnable)
+ }
+
+ override fun executeDelayed(runnable: Runnable, delayMillis: Long) {
+ execute(runnable)
+ }
+
+ override fun removeCallbacks(runnable: Runnable?) {}
+
+ override fun hasCallback(runnable: Runnable?): Boolean = false
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/res/values-af/strings.xml b/libs/WindowManager/Shell/res/values-af/strings.xml
index 0ed5a72..4dbff34 100644
--- a/libs/WindowManager/Shell/res/values-af/strings.xml
+++ b/libs/WindowManager/Shell/res/values-af/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"vou <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> in"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>-instellings"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Maak borrel toe"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Gaan na volskerm"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Moenie dat gesprek \'n borrel word nie"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Klets met borrels"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nuwe gesprekke verskyn as swerwende ikone, of borrels Tik op borrel om dit oop te maak. Sleep om dit te skuif."</string>
diff --git a/libs/WindowManager/Shell/res/values-am/strings.xml b/libs/WindowManager/Shell/res/values-am/strings.xml
index c4d9158..d70a317 100644
--- a/libs/WindowManager/Shell/res/values-am/strings.xml
+++ b/libs/WindowManager/Shell/res/values-am/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>ን ሰብስብ"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"የ<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ቅንብሮች"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"አረፋን አሰናብት"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ወደ ሙሉ ማያ ገፅ ያንቀሳቅሱ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"ውይይቶችን በአረፋ አታሳይ"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"አረፋዎችን በመጠቀም ይወያዩ"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"አዲስ ውይይቶች እንደ ተንሳፋፊ አዶዎች ወይም አረፋዎች ሆነው ይታያሉ። አረፋን ለመክፈት መታ ያድርጉ። ለመውሰድ ይጎትቱት።"</string>
diff --git a/libs/WindowManager/Shell/res/values-ar/strings.xml b/libs/WindowManager/Shell/res/values-ar/strings.xml
index ced9ee9..cb316e9 100644
--- a/libs/WindowManager/Shell/res/values-ar/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ar/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"تصغير <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"إعدادات <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"إغلاق فقاعة المحادثة"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"الانتقال إلى وضع ملء الشاشة"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"عدم عرض المحادثة كفقاعة محادثة"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"الدردشة باستخدام فقاعات المحادثات"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"تظهر المحادثات الجديدة كرموز عائمة أو كفقاعات. انقر لفتح فقاعة المحادثة، واسحبها لتحريكها."</string>
diff --git a/libs/WindowManager/Shell/res/values-as/strings.xml b/libs/WindowManager/Shell/res/values-as/strings.xml
index 273d043..9f7fa7c 100644
--- a/libs/WindowManager/Shell/res/values-as/strings.xml
+++ b/libs/WindowManager/Shell/res/values-as/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> সংকোচন কৰক"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ছেটিং"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"বাবল অগ্ৰাহ্য কৰক"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"পূৰ্ণ স্ক্ৰীনলৈ নিয়ক"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"বাৰ্তালাপ বাবল নকৰিব"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Bubbles ব্যৱহাৰ কৰি চাট কৰক"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"নতুন বাৰ্তালাপ উপঙি থকা চিহ্নসমূহ অথবা bubbles হিচাপে প্ৰদর্শিত হয়। Bubbles খুলিবলৈ টিপক। এইটো স্থানান্তৰ কৰিবলৈ টানি নিয়ক।"</string>
diff --git a/libs/WindowManager/Shell/res/values-az/strings.xml b/libs/WindowManager/Shell/res/values-az/strings.xml
index 81bb544..90962f0 100644
--- a/libs/WindowManager/Shell/res/values-az/strings.xml
+++ b/libs/WindowManager/Shell/res/values-az/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"yığcamlaşdırın: <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ayarları"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Yumrucuğu ləğv edin"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Tam ekrana keçin"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Söhbəti yumrucuqda göstərmə"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Yumrucuqlardan istifadə edərək söhbət edin"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Yeni söhbətlər üzən nişanlar və ya yumrucuqlar kimi görünür. Yumrucuğu açmaq üçün toxunun. Hərəkət etdirmək üçün sürüşdürün."</string>
diff --git a/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml b/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml
index 898b844..9c6ed6b 100644
--- a/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"skupite oblačić <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Podešavanja za <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Odbaci oblačić"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Prebaci na ceo ekran"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ne koristi oblačiće za konverzaciju"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Ćaskajte u oblačićima"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nove konverzacije se prikazuju kao plutajuće ikone ili oblačići. Dodirnite da biste otvorili oblačić. Prevucite da biste ga premestili."</string>
diff --git a/libs/WindowManager/Shell/res/values-be/strings.xml b/libs/WindowManager/Shell/res/values-be/strings.xml
index c340729..e8b24bd 100644
--- a/libs/WindowManager/Shell/res/values-be/strings.xml
+++ b/libs/WindowManager/Shell/res/values-be/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>: згарнуць"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Налады \"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>\""</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Адхіліць апавяшчэнне"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Адкрыць у поўнаэкранным рэжыме"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Не паказваць размову ў выглядзе ўсплывальных апавяшчэнняў"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Усплывальныя чаты"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Новыя размовы будуць паказвацца як рухомыя значкі ці ўсплывальныя чаты. Націсніце, каб адкрыць усплывальны чат. Перацягніце яго, каб перамясціць."</string>
diff --git a/libs/WindowManager/Shell/res/values-bg/strings.xml b/libs/WindowManager/Shell/res/values-bg/strings.xml
index 076a815..1f188f6 100644
--- a/libs/WindowManager/Shell/res/values-bg/strings.xml
+++ b/libs/WindowManager/Shell/res/values-bg/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"свиване на <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Настройки за <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Отхвърляне на балончетата"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Преместване на цял екран"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Без балончета за разговора"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Чат с балончета"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Новите разговори се показват като плаващи икони, или балончета. Докоснете балонче, за да го отворите, или го плъзнете, за да го преместите."</string>
diff --git a/libs/WindowManager/Shell/res/values-bn/strings.xml b/libs/WindowManager/Shell/res/values-bn/strings.xml
index b0d6696..b572038 100644
--- a/libs/WindowManager/Shell/res/values-bn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-bn/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> আড়াল করুন"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> সেটিংস"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"বাবল খারিজ করুন"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ফুল-স্ক্রিন ব্যবহার করুন"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"কথোপকথন বাবল হিসেবে দেখাবে না"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"বাবল ব্যবহার করে চ্যাট করুন"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"নতুন কথোপকথন ভেসে থাকা আইকন বা বাবল হিসেবে দেখানো হয়। বাবল খুলতে ট্যাপ করুন। সেটি সরাতে ধরে টেনে আনুন।"</string>
diff --git a/libs/WindowManager/Shell/res/values-bs/strings.xml b/libs/WindowManager/Shell/res/values-bs/strings.xml
index 0196e5e..630b31b 100644
--- a/libs/WindowManager/Shell/res/values-bs/strings.xml
+++ b/libs/WindowManager/Shell/res/values-bs/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"sužavanje oblačića <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Postavke aplikacije <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Odbaci oblačić"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Prikaži preko cijelog ekrana"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Nemoj prikazivati razgovor u oblačićima"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chatajte koristeći oblačiće"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Novi razgovori se prikazuju kao plutajuće ikone ili oblačići. Dodirnite da otvorite oblačić. Prevucite da ga premjestite."</string>
diff --git a/libs/WindowManager/Shell/res/values-ca/strings.xml b/libs/WindowManager/Shell/res/values-ca/strings.xml
index fa4b627..98ec381 100644
--- a/libs/WindowManager/Shell/res/values-ca/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ca/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"replega <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Configuració de l\'aplicació <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Ignora la bombolla"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Mou a pantalla completa"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"No mostris la conversa com a bombolla"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Xateja amb bombolles"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Les converses noves es mostren com a icones flotants o bombolles. Toca per obrir una bombolla. Arrossega-la per moure-la."</string>
diff --git a/libs/WindowManager/Shell/res/values-cs/strings.xml b/libs/WindowManager/Shell/res/values-cs/strings.xml
index 3956fca..08d5bb5 100644
--- a/libs/WindowManager/Shell/res/values-cs/strings.xml
+++ b/libs/WindowManager/Shell/res/values-cs/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"sbalit <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Nastavení <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Zavřít bublinu"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Přejít na celou obrazovku"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Nezobrazovat konverzaci v bublinách"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chatujte pomocí bublin"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nové konverzace se zobrazují jako plovoucí ikony, neboli bubliny. Klepnutím bublinu otevřete. Přetažením ji posunete."</string>
diff --git a/libs/WindowManager/Shell/res/values-da/strings.xml b/libs/WindowManager/Shell/res/values-da/strings.xml
index afe4a1ab..ae1bb9a 100644
--- a/libs/WindowManager/Shell/res/values-da/strings.xml
+++ b/libs/WindowManager/Shell/res/values-da/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"skjul <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Indstillinger for <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Afvis boble"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Flyt til fuld skærm"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Vis ikke samtaler i bobler"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chat ved hjælp af bobler"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nye samtaler vises som svævende ikoner eller bobler. Tryk for at åbne boblen. Træk for at flytte den."</string>
diff --git a/libs/WindowManager/Shell/res/values-de/strings.xml b/libs/WindowManager/Shell/res/values-de/strings.xml
index 1e50339..abbfa66 100644
--- a/libs/WindowManager/Shell/res/values-de/strings.xml
+++ b/libs/WindowManager/Shell/res/values-de/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> minimieren"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Einstellungen für <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Bubble schließen"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Vollbildmodus"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Unterhaltung nicht als Bubble anzeigen"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Bubbles zum Chatten verwenden"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Neue Unterhaltungen erscheinen als unverankerte Symbole, „Bubbles“ genannt. Wenn du eine Bubble öffnen möchtest, tippe sie an. Wenn du sie verschieben möchtest, zieh an ihr."</string>
diff --git a/libs/WindowManager/Shell/res/values-el/strings.xml b/libs/WindowManager/Shell/res/values-el/strings.xml
index 5c3c6de..0f762d3 100644
--- a/libs/WindowManager/Shell/res/values-el/strings.xml
+++ b/libs/WindowManager/Shell/res/values-el/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"σύμπτυξη <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Ρυθμίσεις <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Παράβλ. για συννεφ."</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Μετακίνηση σε πλήρη οθόνη"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Να μην γίνει προβολή της συζήτησης σε συννεφάκια."</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Συζητήστε χρησιμοποιώντας συννεφάκια."</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Οι νέες συζητήσεις εμφανίζονται ως κινούμενα εικονίδια ή συννεφάκια. Πατήστε για να ανοίξετε το συννεφάκι. Σύρετε για να το μετακινήσετε."</string>
diff --git a/libs/WindowManager/Shell/res/values-en-rAU/strings.xml b/libs/WindowManager/Shell/res/values-en-rAU/strings.xml
index 51c69e5..2314e6b 100644
--- a/libs/WindowManager/Shell/res/values-en-rAU/strings.xml
+++ b/libs/WindowManager/Shell/res/values-en-rAU/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"collapse <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> settings"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Dismiss bubble"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Move to fullscreen"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Don’t bubble conversation"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chat using bubbles"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"New conversations appear as floating icons, or bubbles. Tap to open bubble. Drag to move it."</string>
diff --git a/libs/WindowManager/Shell/res/values-en-rGB/strings.xml b/libs/WindowManager/Shell/res/values-en-rGB/strings.xml
index 51c69e5..2314e6b 100644
--- a/libs/WindowManager/Shell/res/values-en-rGB/strings.xml
+++ b/libs/WindowManager/Shell/res/values-en-rGB/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"collapse <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> settings"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Dismiss bubble"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Move to fullscreen"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Don’t bubble conversation"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chat using bubbles"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"New conversations appear as floating icons, or bubbles. Tap to open bubble. Drag to move it."</string>
diff --git a/libs/WindowManager/Shell/res/values-en-rIN/strings.xml b/libs/WindowManager/Shell/res/values-en-rIN/strings.xml
index 51c69e5..2314e6b 100644
--- a/libs/WindowManager/Shell/res/values-en-rIN/strings.xml
+++ b/libs/WindowManager/Shell/res/values-en-rIN/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"collapse <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> settings"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Dismiss bubble"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Move to fullscreen"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Don’t bubble conversation"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chat using bubbles"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"New conversations appear as floating icons, or bubbles. Tap to open bubble. Drag to move it."</string>
diff --git a/libs/WindowManager/Shell/res/values-et/strings.xml b/libs/WindowManager/Shell/res/values-et/strings.xml
index d36a8d1..cfaa0d3 100644
--- a/libs/WindowManager/Shell/res/values-et/strings.xml
+++ b/libs/WindowManager/Shell/res/values-et/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"ahenda <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Rakenduse <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> seaded"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Sule mull"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Lülitu täisekraanile"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ära kuva vestlust mullina"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Vestelge mullide abil"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Uued vestlused kuvatakse hõljuvate ikoonidena ehk mullidena. Puudutage mulli avamiseks. Lohistage mulli, et seda liigutada."</string>
diff --git a/libs/WindowManager/Shell/res/values-eu/strings.xml b/libs/WindowManager/Shell/res/values-eu/strings.xml
index 2ee086e..509c97e 100644
--- a/libs/WindowManager/Shell/res/values-eu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-eu/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"tolestu <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> aplikazioaren ezarpenak"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Baztertu burbuila"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Joan pantaila osora"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ez erakutsi elkarrizketak burbuila gisa"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Txateatu burbuilen bidez"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Elkarrizketa berriak ikono gainerakor edo burbuila gisa agertzen dira. Sakatu burbuila irekitzeko. Arrasta ezazu mugitzeko."</string>
diff --git a/libs/WindowManager/Shell/res/values-fa/strings.xml b/libs/WindowManager/Shell/res/values-fa/strings.xml
index f4cdd5f..223b671 100644
--- a/libs/WindowManager/Shell/res/values-fa/strings.xml
+++ b/libs/WindowManager/Shell/res/values-fa/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"جمع کردن <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"تنظیمات <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"رد کردن حبابک"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"رفتن به حالت تمامصفحه"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"مکالمه در حباب نشان داده نشود"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"گپ بااستفاده از حبابکها"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"مکالمههای جدید بهصورت نمادهای شناور یا حبابکها نشان داده میشوند. برای باز کردن حبابکها تکضرب بزنید. برای جابهجایی، آن را بکشید."</string>
diff --git a/libs/WindowManager/Shell/res/values-fi/strings.xml b/libs/WindowManager/Shell/res/values-fi/strings.xml
index 6be2ee2..9083c4d 100644
--- a/libs/WindowManager/Shell/res/values-fi/strings.xml
+++ b/libs/WindowManager/Shell/res/values-fi/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"tiivistä <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>: asetukset"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Ohita kupla"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Siirrä koko näytölle"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Älä näytä kuplia keskusteluista"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chattaile kuplien avulla"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Uudet keskustelut näkyvät kelluvina kuvakkeina tai kuplina. Avaa kupla napauttamalla. Siirrä sitä vetämällä."</string>
diff --git a/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml b/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml
index 5470099..2f284ad 100644
--- a/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml
+++ b/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"réduire <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Paramètres <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Ignorer la bulle"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Passez en plein écran"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ne pas afficher les conversations dans des bulles"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Clavarder en utilisant des bulles"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Les nouvelles conversations s\'affichent sous forme d\'icônes flottantes (de bulles). Touchez une bulle pour l\'ouvrir. Faites-la glisser pour la déplacer."</string>
diff --git a/libs/WindowManager/Shell/res/values-gl/strings.xml b/libs/WindowManager/Shell/res/values-gl/strings.xml
index 36ad521..5126aa2 100644
--- a/libs/WindowManager/Shell/res/values-gl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-gl/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"contraer <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Configuración de <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Ignorar burbulla"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Cambiar á pantalla completa"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Non mostrar a conversa como burbulla"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chatear usando burbullas"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"As conversas novas aparecen como iconas flotantes ou burbullas. Toca para abrir a burbulla e arrastra para movela."</string>
diff --git a/libs/WindowManager/Shell/res/values-gu/strings.xml b/libs/WindowManager/Shell/res/values-gu/strings.xml
index 868ef5b..3418637 100644
--- a/libs/WindowManager/Shell/res/values-gu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-gu/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> નાનું કરો"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> સેટિંગ"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"બબલને છોડી દો"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"પૂર્ણસ્ક્રીન પર ખસો"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"વાતચીતને બબલ કરશો નહીં"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"બબલનો ઉપયોગ કરીને ચૅટ કરો"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"નવી વાતચીત ફ્લોટિંગ આઇકન અથવા બબલ જેવી દેખાશે. બબલને ખોલવા માટે ટૅપ કરો. તેને ખસેડવા માટે ખેંચો."</string>
diff --git a/libs/WindowManager/Shell/res/values-hi/strings.xml b/libs/WindowManager/Shell/res/values-hi/strings.xml
index 31c7307..8eaa86f 100644
--- a/libs/WindowManager/Shell/res/values-hi/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hi/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> को छोटा करें"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> की सेटिंग"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"बबल खारिज करें"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"फ़ुलस्क्रीन पर मूव करें"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"बातचीत को बबल न करें"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"बबल्स का इस्तेमाल करके चैट करें"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"नई बातचीत फ़्लोटिंग आइकॉन या बबल्स की तरह दिखेंगी. बबल को खोलने के लिए टैप करें. इसे एक जगह से दूसरी जगह ले जाने के लिए खींचें और छोड़ें."</string>
diff --git a/libs/WindowManager/Shell/res/values-hr/strings.xml b/libs/WindowManager/Shell/res/values-hr/strings.xml
index d99a65d8..5427a9b 100644
--- a/libs/WindowManager/Shell/res/values-hr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hr/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"sažmite oblačić <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Postavke za <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Odbaci oblačić"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Prebaci na cijeli zaslon"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Zaustavi razgovor u oblačićima"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Oblačići u chatu"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Novi razgovori pojavljuju se kao pomične ikone ili oblačići. Dodirnite za otvaranje oblačića. Povucite da biste ga premjestili."</string>
diff --git a/libs/WindowManager/Shell/res/values-hu/strings.xml b/libs/WindowManager/Shell/res/values-hu/strings.xml
index bed760e..5b337ea 100644
--- a/libs/WindowManager/Shell/res/values-hu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hu/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> összecsukása"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> beállításai"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Buborék elvetése"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Áthelyezés teljes képernyőre"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ne jelenjen meg a beszélgetés buborékban"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Buborékokat használó csevegés"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Az új beszélgetések lebegő ikonként, vagyis buborékként jelennek meg. A buborék megnyitásához koppintson rá. Áthelyezéshez húzza a kívánt helyre."</string>
diff --git a/libs/WindowManager/Shell/res/values-hy/strings.xml b/libs/WindowManager/Shell/res/values-hy/strings.xml
index fcb7254..ef38307 100644
--- a/libs/WindowManager/Shell/res/values-hy/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hy/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>. ծալել"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> – կարգավորումներ"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Փակել ամպիկը"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Տեղափոխել լիաէկրան ռեժիմ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Զրույցը չցուցադրել ամպիկի տեսքով"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Զրույցի ամպիկներ"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Նոր զրույցները կհայտնվեն լողացող պատկերակների կամ ամպիկների տեսքով։ Հպեք՝ ամպիկը բացելու համար։ Քաշեք՝ այն տեղափոխելու համար։"</string>
diff --git a/libs/WindowManager/Shell/res/values-in/strings.xml b/libs/WindowManager/Shell/res/values-in/strings.xml
index 85a9bbf..fcb3e72 100644
--- a/libs/WindowManager/Shell/res/values-in/strings.xml
+++ b/libs/WindowManager/Shell/res/values-in/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"ciutkan <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Setelan <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Tutup balon"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Pindahkan ke layar penuh"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Jangan gunakan percakapan balon"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chat dalam tampilan balon"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Percakapan baru muncul sebagai ikon mengambang, atau balon. Ketuk untuk membuka balon. Tarik untuk memindahkannya."</string>
diff --git a/libs/WindowManager/Shell/res/values-is/strings.xml b/libs/WindowManager/Shell/res/values-is/strings.xml
index 8041162..9755083 100644
--- a/libs/WindowManager/Shell/res/values-is/strings.xml
+++ b/libs/WindowManager/Shell/res/values-is/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"minnka <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Stillingar <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Loka blöðru"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Færa í allan skjáinn"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ekki setja samtal í blöðru"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Spjalla með blöðrum"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Ný samtöl birtast sem fljótandi tákn eða blöðrur. Ýttu til að opna blöðru. Dragðu hana til að færa."</string>
diff --git a/libs/WindowManager/Shell/res/values-iw/strings.xml b/libs/WindowManager/Shell/res/values-iw/strings.xml
index e1854fa1..ddbb89a 100644
--- a/libs/WindowManager/Shell/res/values-iw/strings.xml
+++ b/libs/WindowManager/Shell/res/values-iw/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"כיווץ של <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"הגדרות <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"סגירת בועה"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"הצגה במסך מלא"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"אין להציג בועות לשיחה"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"לדבר בבועות"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"שיחות חדשות מופיעות כסמלים צפים, או בועות. יש להקיש כדי לפתוח בועה. יש לגרור כדי להזיז אותה."</string>
diff --git a/libs/WindowManager/Shell/res/values-ja/strings.xml b/libs/WindowManager/Shell/res/values-ja/strings.xml
index 1f1ddc7..8284837 100644
--- a/libs/WindowManager/Shell/res/values-ja/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ja/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>を閉じます"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> の設定"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"バブルを閉じる"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"全画面表示に移動する"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"会話をバブルで表示しない"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"チャットでバブルを使う"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"新しい会話はフローティング アイコン(バブル)として表示されます。タップするとバブルが開きます。ドラッグしてバブルを移動できます。"</string>
diff --git a/libs/WindowManager/Shell/res/values-ka/strings.xml b/libs/WindowManager/Shell/res/values-ka/strings.xml
index e201a20..82828d8 100644
--- a/libs/WindowManager/Shell/res/values-ka/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ka/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>-ის ჩაკეცვა"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>-ის პარამეტრები"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ბუშტის დახურვა"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"სრულეკრანიან რეჟიმზე გადატანა"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"აიკრძალოს საუბრის ბუშტები"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ჩეთი ბუშტების გამოყენებით"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"ახალი საუბრები გამოჩნდება როგორც მოტივტივე ხატულები ან ბუშტები. შეეხეთ ბუშტის გასახსნელად. გადაიტანეთ ჩავლებით."</string>
diff --git a/libs/WindowManager/Shell/res/values-kk/strings.xml b/libs/WindowManager/Shell/res/values-kk/strings.xml
index 1c335dd..af4e4f3 100644
--- a/libs/WindowManager/Shell/res/values-kk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-kk/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>: жию"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> параметрлері"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Қалқымалы хабарды жабу"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Толық экранға ауысу"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Әңгіменің қалқыма хабары көрсетілмесін"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Қалқыма хабарлар арқылы сөйлесу"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Жаңа әңгімелер қалқыма белгішелер немесе хабарлар түрінде көрсетіледі. Қалқыма хабарды ашу үшін түртіңіз. Жылжыту үшін сүйреңіз."</string>
diff --git a/libs/WindowManager/Shell/res/values-km/strings.xml b/libs/WindowManager/Shell/res/values-km/strings.xml
index d0cceee..c3a3800 100644
--- a/libs/WindowManager/Shell/res/values-km/strings.xml
+++ b/libs/WindowManager/Shell/res/values-km/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"បង្រួម <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"ការកំណត់ <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ច្រានចោលពពុះ"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ផ្លាស់ទីទៅអេក្រង់ពេញ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"កុំបង្ហាញការសន្ទនាជាពពុះ"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ជជែកដោយប្រើពពុះ"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"ការសន្ទនាថ្មីៗបង្ហាញជាពពុះ ឬរូបអណ្ដែត។ ចុច ដើម្បីបើកពពុះ។ អូស ដើម្បីផ្លាស់ទីពពុះនេះ។"</string>
diff --git a/libs/WindowManager/Shell/res/values-kn/strings.xml b/libs/WindowManager/Shell/res/values-kn/strings.xml
index 63b5c68..aa8cec5 100644
--- a/libs/WindowManager/Shell/res/values-kn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-kn/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> ಅನ್ನು ಕುಗ್ಗಿಸಿ"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ಬಬಲ್ ವಜಾಗೊಳಿಸಿ"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ಫುಲ್ಸ್ಕ್ರೀನ್ಗೆ ಸರಿಸಿ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"ಸಂಭಾಷಣೆಯನ್ನು ಬಬಲ್ ಮಾಡಬೇಡಿ"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ಬಬಲ್ಸ್ ಬಳಸಿ ಚಾಟ್ ಮಾಡಿ"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"ಹೊಸ ಸಂಭಾಷಣೆಗಳು ತೇಲುವ ಐಕಾನ್ಗಳು ಅಥವಾ ಬಬಲ್ಸ್ ಆಗಿ ಗೋಚರಿಸುತ್ತವೆ. ಬಬಲ್ ತೆರೆಯಲು ಟ್ಯಾಪ್ ಮಾಡಿ. ಅದನ್ನು ಡ್ರ್ಯಾಗ್ ಮಾಡಲು ಎಳೆಯಿರಿ."</string>
diff --git a/libs/WindowManager/Shell/res/values-ko/strings.xml b/libs/WindowManager/Shell/res/values-ko/strings.xml
index b5efd10..fc2a1b9 100644
--- a/libs/WindowManager/Shell/res/values-ko/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ko/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> 접기"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> 설정"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"대화창 닫기"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"전체 화면으로 이동"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"대화를 대화창으로 표시하지 않기"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"대화창으로 채팅하기"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"새로운 대화가 플로팅 아이콘인 대화창으로 표시됩니다. 대화창을 열려면 탭하세요. 드래그하여 이동할 수 있습니다."</string>
diff --git a/libs/WindowManager/Shell/res/values-ky/strings.xml b/libs/WindowManager/Shell/res/values-ky/strings.xml
index e001efe..c294725 100644
--- a/libs/WindowManager/Shell/res/values-ky/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ky/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> жыйыштыруу"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> параметрлери"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Калкып чыкма билдирмени жабуу"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Толук экранга өтүү"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Жазышууда калкып чыкма билдирмелер көрүнбөсүн"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Калкып чыкма билдирмелер аркылуу маектешүү"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Жаңы жазышуулар калкыма сүрөтчөлөр же калкып чыкма билдирмелер түрүндө көрүнөт. Калкып чыкма билдирмелерди ачуу үчүн тийип коюңуз. Жылдыруу үчүн сүйрөңүз."</string>
diff --git a/libs/WindowManager/Shell/res/values-lo/strings.xml b/libs/WindowManager/Shell/res/values-lo/strings.xml
index 029c95b..7d2f999 100644
--- a/libs/WindowManager/Shell/res/values-lo/strings.xml
+++ b/libs/WindowManager/Shell/res/values-lo/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"ຫຍໍ້ <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> ລົງ"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"ການຕັ້ງຄ່າ <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ປິດຟອງໄວ້"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ຍ້າຍໄປໂໝດເຕັມຈໍ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"ຢ່າໃຊ້ຟອງໃນການສົນທະນາ"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ສົນທະນາໂດຍໃຊ້ຟອງ"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"ການສົນທະນາໃໝ່ຈະປາກົດເປັນໄອຄອນ ຫຼື ຟອງແບບລອຍ. ແຕະເພື່ອເປີດຟອງ. ລາກເພື່ອຍ້າຍມັນ."</string>
diff --git a/libs/WindowManager/Shell/res/values-lt/strings.xml b/libs/WindowManager/Shell/res/values-lt/strings.xml
index 791ddcd..be446a6 100644
--- a/libs/WindowManager/Shell/res/values-lt/strings.xml
+++ b/libs/WindowManager/Shell/res/values-lt/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"sutraukti „<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>“"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"„<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>“ nustatymai"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Atsisakyti burbulo"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Pereiti į viso ekrano režimą"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Nerodyti pokalbio burbule"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Pokalbis naudojant burbulus"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nauji pokalbiai rodomi kaip slankiosios piktogramos arba burbulai. Palieskite, kad atidarytumėte burbulą. Vilkite, kad perkeltumėte."</string>
diff --git a/libs/WindowManager/Shell/res/values-lv/strings.xml b/libs/WindowManager/Shell/res/values-lv/strings.xml
index 8a86687..ed0c05e 100644
--- a/libs/WindowManager/Shell/res/values-lv/strings.xml
+++ b/libs/WindowManager/Shell/res/values-lv/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"Sakļaut “<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>”"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Lietotnes <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> iestatījumi"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Nerādīt burbuli"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Pārvietot uz pilnekrāna režīmu"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Nerādīt sarunu burbuļos"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Tērzēšana, izmantojot burbuļus"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Jaunas sarunas tiek rādītas kā peldošas ikonas vai burbuļi. Pieskarieties, lai atvērtu burbuli. Velciet, lai to pārvietotu."</string>
diff --git a/libs/WindowManager/Shell/res/values-mk/strings.xml b/libs/WindowManager/Shell/res/values-mk/strings.xml
index 3a6b2f0..9b24b7f 100644
--- a/libs/WindowManager/Shell/res/values-mk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-mk/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"собери <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Поставки за <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Отфрли балонче"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Префрлете на цел екран"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Не прикажувај го разговорот во балончиња"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Разговор во балончиња"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Новите разговори ќе се појавуваат како лебдечки икони или балончиња. Допрете за отворање на балончето. Повлечете за да го преместите."</string>
diff --git a/libs/WindowManager/Shell/res/values-ml/strings.xml b/libs/WindowManager/Shell/res/values-ml/strings.xml
index 26e4a46..ac67f8d 100644
--- a/libs/WindowManager/Shell/res/values-ml/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ml/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> ചുരുക്കുക"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ക്രമീകരണം"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ബബിൾ ഡിസ്മിസ് ചെയ്യൂ"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"പൂർണ്ണസ്ക്രീനിലേക്ക് നീങ്ങുക"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"സംഭാഷണം ബബിൾ ചെയ്യരുത്"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ബബിളുകൾ ഉപയോഗിച്ച് ചാറ്റ് ചെയ്യുക"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"പുതിയ സംഭാഷണങ്ങൾ ഫ്ലോട്ടിംഗ് ഐക്കണുകളോ ബബിളുകളോ ആയി ദൃശ്യമാവുന്നു. ബബിൾ തുറക്കാൻ ടാപ്പ് ചെയ്യൂ. ഇത് നീക്കാൻ വലിച്ചിടുക."</string>
diff --git a/libs/WindowManager/Shell/res/values-mn/strings.xml b/libs/WindowManager/Shell/res/values-mn/strings.xml
index 505a4ad..6d5deb3 100644
--- a/libs/WindowManager/Shell/res/values-mn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-mn/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>-г хураах"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>-н тохиргоо"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Бөмбөлгийг хаах"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Бүтэн дэлгэц рүү очих"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Харилцан яриаг бүү бөмбөлөг болго"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Бөмбөлөг ашиглан чатлаарай"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Шинэ харилцан яриа нь хөвөгч дүрс тэмдэг эсвэл бөмбөлөг хэлбэрээр харагддаг. Бөмбөлгийг нээхийн тулд товшино уу. Түүнийг зөөхийн тулд чирнэ үү."</string>
diff --git a/libs/WindowManager/Shell/res/values-mr/strings.xml b/libs/WindowManager/Shell/res/values-mr/strings.xml
index cc35f11..49747f2 100644
--- a/libs/WindowManager/Shell/res/values-mr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-mr/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> कोलॅप्स करा"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> सेटिंग्ज"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"बबल डिसमिस करा"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"फुलस्क्रीनवर हलवा"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"संभाषणाला बबल करू नका"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"बबल वापरून चॅट करा"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"नवीन संभाषणे फ्लोटिंग आयकन किंवा बबल म्हणून दिसतात. बबल उघडण्यासाठी टॅप करा. हे हलवण्यासाठी ड्रॅग करा."</string>
diff --git a/libs/WindowManager/Shell/res/values-ms/strings.xml b/libs/WindowManager/Shell/res/values-ms/strings.xml
index 61d6614..dec3893 100644
--- a/libs/WindowManager/Shell/res/values-ms/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ms/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"kuncupkan <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Tetapan <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Ketepikan gelembung"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Alihkan kepada skrin penuh"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Jangan jadikan perbualan dalam bentuk gelembung"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Bersembang menggunakan gelembung"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Perbualan baharu muncul sebagai ikon terapung atau gelembung. Ketik untuk membuka gelembung. Seret untuk mengalihkan gelembung tersebut."</string>
diff --git a/libs/WindowManager/Shell/res/values-my/strings.xml b/libs/WindowManager/Shell/res/values-my/strings.xml
index 7841e07..908ef81 100644
--- a/libs/WindowManager/Shell/res/values-my/strings.xml
+++ b/libs/WindowManager/Shell/res/values-my/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> ကို ချုံ့ရန်"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ဆက်တင်များ"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ပူဖောင်းကွက် ပယ်ရန်"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ဖန်သားပြင်အပြည့်သို့ ရွှေ့ရန်"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"စကားဝိုင်းကို ပူဖောင်းကွက် မပြုလုပ်ပါနှင့်"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ပူဖောင်းကွက် သုံး၍ ချတ်လုပ်ခြင်း"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"စကားဝိုင်းအသစ်များကို မျောနေသည့် သင်္ကေတများ သို့မဟုတ် ပူဖောင်းကွက်များအဖြစ် မြင်ရပါမည်။ ပူဖောင်းကွက်ကိုဖွင့်ရန် တို့ပါ။ ရွှေ့ရန် ၎င်းကို ဖိဆွဲပါ။"</string>
diff --git a/libs/WindowManager/Shell/res/values-nb/strings.xml b/libs/WindowManager/Shell/res/values-nb/strings.xml
index ea2ae1b..01ca4ed 100644
--- a/libs/WindowManager/Shell/res/values-nb/strings.xml
+++ b/libs/WindowManager/Shell/res/values-nb/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"skjul <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>-innstillinger"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Lukk boblen"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Flytt til fullskjerm"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ikke vis samtaler i bobler"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chat med bobler"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nye samtaler vises som flytende ikoner eller bobler. Trykk for å åpne en boble. Dra for å flytte den."</string>
diff --git a/libs/WindowManager/Shell/res/values-ne/strings.xml b/libs/WindowManager/Shell/res/values-ne/strings.xml
index a3bd5ee..05ce071 100644
--- a/libs/WindowManager/Shell/res/values-ne/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ne/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> कोल्याप्स गर्नुहोस्"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> का सेटिङहरू"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"बबल खारेज गर्नुहोस्"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"सारेर फुल स्क्रिनमा लैजानुहोस्"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"वार्तालाप बबलको रूपमा नदेखाउनुहोस्"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"बबलहरू प्रयोग गरी कुराकानी गर्नुहोस्"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"नयाँ वार्तालापहरू तैरने आइकन वा बबलका रूपमा देखिन्छन्। बबल खोल्न ट्याप गर्नुहोस्। बबल सार्न सो बबललाई ड्र्याग गर्नुहोस्।"</string>
diff --git a/libs/WindowManager/Shell/res/values-nl/strings.xml b/libs/WindowManager/Shell/res/values-nl/strings.xml
index ad2c60f..9ec4444 100644
--- a/libs/WindowManager/Shell/res/values-nl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-nl/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> samenvouwen"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Instellingen voor <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Bubbel sluiten"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Naar volledig scherm"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Gesprekken niet in bubbels tonen"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chatten met bubbels"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nieuwe gesprekken worden als zwevende iconen of bubbels getoond. Tik om een bubbel te openen. Sleep om een bubbel te verplaatsen."</string>
diff --git a/libs/WindowManager/Shell/res/values-or/strings.xml b/libs/WindowManager/Shell/res/values-or/strings.xml
index 76f2715..7ee7342 100644
--- a/libs/WindowManager/Shell/res/values-or/strings.xml
+++ b/libs/WindowManager/Shell/res/values-or/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> ସଙ୍କୁଚିତ କରନ୍ତୁ"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ସେଟିଂସ୍"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ବବଲ୍ ଖାରଜ କରନ୍ତୁ"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ପୂର୍ଣ୍ଣସ୍କ୍ରିନକୁ ମୁଭ କରନ୍ତୁ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"ବାର୍ତ୍ତାଳାପକୁ ବବଲ୍ କରନ୍ତୁ ନାହିଁ"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ବବଲଗୁଡ଼ିକୁ ବ୍ୟବହାର କରି ଚାଟ୍ କରନ୍ତୁ"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"ନୂଆ ବାର୍ତ୍ତାଳାପଗୁଡ଼ିକ ଫ୍ଲୋଟିଂ ଆଇକନ୍ କିମ୍ବା ବବଲ୍ ଭାବେ ଦେଖାଯିବ। ବବଲ୍ ଖୋଲିବାକୁ ଟାପ୍ କରନ୍ତୁ। ଏହାକୁ ମୁଭ୍ କରିବାକୁ ଟାଣନ୍ତୁ।"</string>
diff --git a/libs/WindowManager/Shell/res/values-pa/strings.xml b/libs/WindowManager/Shell/res/values-pa/strings.xml
index cd7fd47..cc31e3c 100644
--- a/libs/WindowManager/Shell/res/values-pa/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pa/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> ਨੂੰ ਸਮੇਟੋ"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ਸੈਟਿੰਗਾਂ"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ਬਬਲ ਨੂੰ ਖਾਰਜ ਕਰੋ"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ਪੂਰੀ-ਸਕ੍ਰੀਨ \'ਤੇ ਜਾਓ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"ਗੱਲਬਾਤ \'ਤੇ ਬਬਲ ਨਾ ਲਾਓ"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"ਬਬਲ ਵਰਤਦੇ ਹੋਏ ਚੈਟ ਕਰੋ"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"ਨਵੀਆਂ ਗੱਲਾਂਬਾਤਾਂ ਫਲੋਟਿੰਗ ਪ੍ਰਤੀਕਾਂ ਜਾਂ ਬਬਲ ਦੇ ਰੂਪ ਵਿੱਚ ਦਿਸਦੀਆਂ ਹਨ। ਬਬਲ ਨੂੰ ਖੋਲ੍ਹਣ ਲਈ ਟੈਪ ਕਰੋ। ਇਸਨੂੰ ਲਿਜਾਣ ਲਈ ਘਸੀਟੋ।"</string>
diff --git a/libs/WindowManager/Shell/res/values-pl/strings.xml b/libs/WindowManager/Shell/res/values-pl/strings.xml
index d33b6f1..5dd14c9 100644
--- a/libs/WindowManager/Shell/res/values-pl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pl/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"zwiń dymek <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> – ustawienia"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Zamknij dymek"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Zmień tryb na pełnoekranowy"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Nie wyświetlaj rozmowy jako dymka"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Czatuj, korzystając z dymków"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nowe rozmowy będą wyświetlane jako pływające ikony lub dymki. Kliknij, by otworzyć dymek. Przeciągnij, by go przenieść."</string>
diff --git a/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml b/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml
index c7a00ff..d9c3d44 100644
--- a/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"fechar <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Configurações de <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Dispensar balão"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Mude para tela cheia"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Não criar balões de conversa"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Converse usando balões"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Novas conversas aparecerão como ícones flutuantes, ou balões. Toque para abrir o balão. Arraste para movê-lo."</string>
diff --git a/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml b/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml
index d141447..1ace699 100644
--- a/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"reduzir <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Definições de <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Ignorar balão"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Mudar para ecrã inteiro"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Não apresentar a conversa em balões"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Converse no chat através de balões"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"As novas conversas aparecem como ícones flutuantes ou balões. Toque para abrir o balão. Arraste para o mover."</string>
diff --git a/libs/WindowManager/Shell/res/values-pt/strings.xml b/libs/WindowManager/Shell/res/values-pt/strings.xml
index c7a00ff..d9c3d44 100644
--- a/libs/WindowManager/Shell/res/values-pt/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pt/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"fechar <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Configurações de <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Dispensar balão"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Mude para tela cheia"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Não criar balões de conversa"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Converse usando balões"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Novas conversas aparecerão como ícones flutuantes, ou balões. Toque para abrir o balão. Arraste para movê-lo."</string>
diff --git a/libs/WindowManager/Shell/res/values-ro/strings.xml b/libs/WindowManager/Shell/res/values-ro/strings.xml
index 9bc7660..ffaea97 100644
--- a/libs/WindowManager/Shell/res/values-ro/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ro/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"restrânge <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Setări <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Închide balonul"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Treci la ecran complet"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Nu afișa conversația în balon"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chat cu baloane"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Conversațiile noi apar ca pictograme flotante sau baloane. Atinge pentru a deschide balonul. Trage pentru a-l muta."</string>
diff --git a/libs/WindowManager/Shell/res/values-ru/strings.xml b/libs/WindowManager/Shell/res/values-ru/strings.xml
index 044e3b02..6231e3e 100644
--- a/libs/WindowManager/Shell/res/values-ru/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ru/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"Свернуть <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>: настройки"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Скрыть всплывающий чат"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Перейти в полноэкранный режим"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Не показывать всплывающий чат для разговора"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Всплывающие чаты"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Новые разговоры будут появляться в виде плавающих значков, или всплывающих чатов. Чтобы открыть чат, нажмите на него, а чтобы переместить – перетащите."</string>
diff --git a/libs/WindowManager/Shell/res/values-si/strings.xml b/libs/WindowManager/Shell/res/values-si/strings.xml
index da2541e..824bd8d 100644
--- a/libs/WindowManager/Shell/res/values-si/strings.xml
+++ b/libs/WindowManager/Shell/res/values-si/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> හකුළන්න"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> සැකසීම්"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"බුබුලු ඉවත ලන්න"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"පූර්ණ තිරය වෙත ගෙන යන්න"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"සංවාදය බුබුලු නොදමන්න"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"බුබුලු භාවිතයෙන් කතාබහ කරන්න"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"නව සංවාද පාවෙන අයිකන හෝ බුබුලු ලෙස දිස් වේ. බුබුල විවෘත කිරීමට තට්ටු කරන්න. එය ගෙන යාමට අදින්න."</string>
diff --git a/libs/WindowManager/Shell/res/values-sk/strings.xml b/libs/WindowManager/Shell/res/values-sk/strings.xml
index 394a4ca..4a1508d 100644
--- a/libs/WindowManager/Shell/res/values-sk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sk/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"zbaliť <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Nastavenia aplikácie <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Zavrieť bublinu"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Presunúť na celú obrazovku"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Nezobrazovať konverzáciu ako bublinu"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Čet pomocou bublín"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nové konverzácie sa zobrazujú ako plávajúce ikony či bubliny. Bublinu otvoríte klepnutím. Premiestnite ju presunutím."</string>
diff --git a/libs/WindowManager/Shell/res/values-sl/strings.xml b/libs/WindowManager/Shell/res/values-sl/strings.xml
index a90c2c2..dd2f9f0 100644
--- a/libs/WindowManager/Shell/res/values-sl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sl/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"strnitev oblačka <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Nastavitve za <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Opusti oblaček"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Premik na celozaslonski način"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Pogovora ne prikaži v oblačku"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Klepet z oblački"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Novi pogovori so prikazani kot lebdeče ikone ali oblački. Če želite odpreti oblaček, se ga dotaknite. Če ga želite premakniti, ga povlecite."</string>
diff --git a/libs/WindowManager/Shell/res/values-sq/strings.xml b/libs/WindowManager/Shell/res/values-sq/strings.xml
index 706e75f..322525b 100644
--- a/libs/WindowManager/Shell/res/values-sq/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sq/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"palos <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Cilësimet e <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Hiqe flluskën"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Kalo në ekran të plotë"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Mos e vendos bisedën në flluskë"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Bisedo duke përdorur flluskat"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Bisedat e reja shfaqen si ikona pluskuese ose flluska. Trokit për të hapur flluskën. Zvarrit për ta zhvendosur."</string>
diff --git a/libs/WindowManager/Shell/res/values-sr/strings.xml b/libs/WindowManager/Shell/res/values-sr/strings.xml
index 539a00a2..87ae78e 100644
--- a/libs/WindowManager/Shell/res/values-sr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sr/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"скупите облачић <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Подешавања за <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Одбаци облачић"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Пребаци на цео екран"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Не користи облачиће за конверзацију"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Ћаскајте у облачићима"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Нове конверзације се приказују као плутајуће иконе или облачићи. Додирните да бисте отворили облачић. Превуците да бисте га преместили."</string>
diff --git a/libs/WindowManager/Shell/res/values-sv/strings.xml b/libs/WindowManager/Shell/res/values-sv/strings.xml
index 549eb10..6942e95 100644
--- a/libs/WindowManager/Shell/res/values-sv/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sv/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"komprimera <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Inställningar för <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Stäng bubbla"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Flytta till helskärm"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Visa inte konversationen i bubblor"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Chatta med bubblor"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Nya konversationer visas som flytande ikoner, så kallade bubblor. Tryck på bubblan om du vill öppna den. Dra den om du vill flytta den."</string>
diff --git a/libs/WindowManager/Shell/res/values-sw/strings.xml b/libs/WindowManager/Shell/res/values-sw/strings.xml
index 9c34690..30d6870 100644
--- a/libs/WindowManager/Shell/res/values-sw/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sw/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"kunja <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Mipangilio ya <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Ondoa kiputo"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Hamishia kwenye skrini nzima"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Usiweke viputo kwenye mazungumzo"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Piga gumzo ukitumia viputo"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Mazungumzo mapya huonekena kama aikoni au viputo vinavyoelea. Gusa ili ufungue kiputo. Buruta ili ukisogeze."</string>
diff --git a/libs/WindowManager/Shell/res/values-ta/strings.xml b/libs/WindowManager/Shell/res/values-ta/strings.xml
index 7e996f3..9e51416 100644
--- a/libs/WindowManager/Shell/res/values-ta/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ta/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> ஐச் சுருக்கும்"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> அமைப்புகள்"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"குமிழை அகற்று"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"முழுத்திரைக்கு மாற்று"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"உரையாடலைக் குமிழாக்காதே"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"குமிழ்களைப் பயன்படுத்தி அரட்டையடியுங்கள்"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"புதிய உரையாடல்கள் மிதக்கும் ஐகான்களாகவோ குமிழ்களாகவோ தோன்றும். குமிழைத் திறக்க தட்டவும். நகர்த்த இழுக்கவும்."</string>
diff --git a/libs/WindowManager/Shell/res/values-te/strings.xml b/libs/WindowManager/Shell/res/values-te/strings.xml
index 984cea8..be770ca 100644
--- a/libs/WindowManager/Shell/res/values-te/strings.xml
+++ b/libs/WindowManager/Shell/res/values-te/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>ను కుదించండి"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> సెట్టింగ్లు"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"బబుల్ను విస్మరించు"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"ఫుల్ స్క్రీన్కు వెళ్లండి"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"సంభాషణను బబుల్ చేయవద్దు"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"బబుల్స్ను ఉపయోగించి చాట్ చేయండి"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"కొత్త సంభాషణలు తేలియాడే చిహ్నాలుగా లేదా బబుల్స్ లాగా కనిపిస్తాయి. బబుల్ని తెరవడానికి నొక్కండి. తరలించడానికి లాగండి."</string>
diff --git a/libs/WindowManager/Shell/res/values-th/strings.xml b/libs/WindowManager/Shell/res/values-th/strings.xml
index 3460b07..e7975ac 100644
--- a/libs/WindowManager/Shell/res/values-th/strings.xml
+++ b/libs/WindowManager/Shell/res/values-th/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"ยุบ <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"การตั้งค่า <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"ปิดบับเบิล"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"เปลี่ยนเป็นแบบเต็มหน้าจอ"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"ไม่ต้องแสดงการสนทนาเป็นบับเบิล"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"แชทโดยใช้บับเบิล"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"การสนทนาใหม่ๆ จะปรากฏเป็นไอคอนแบบลอยหรือบับเบิล แตะเพื่อเปิดบับเบิล ลากเพื่อย้ายที่"</string>
diff --git a/libs/WindowManager/Shell/res/values-tl/strings.xml b/libs/WindowManager/Shell/res/values-tl/strings.xml
index dc30912..72d0926 100644
--- a/libs/WindowManager/Shell/res/values-tl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-tl/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"i-collapse ang <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Mga setting ng <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"I-dismiss ang bubble"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Lumipat sa fullscreen"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Huwag ipakita sa bubble ang mga pag-uusap"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Mag-chat gamit ang bubbles"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Lumalabas bilang mga nakalutang na icon o bubble ang mga bagong pag-uusap. I-tap para buksan ang bubble. I-drag para ilipat ito."</string>
diff --git a/libs/WindowManager/Shell/res/values-tr/strings.xml b/libs/WindowManager/Shell/res/values-tr/strings.xml
index e9e2173..2b02f47 100644
--- a/libs/WindowManager/Shell/res/values-tr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-tr/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"daralt: <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ayarları"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Baloncuğu kapat"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Tam ekrana taşı"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Görüşmeyi baloncuk olarak görüntüleme"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Baloncukları kullanarak sohbet edin"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Yeni görüşmeler kayan simgeler veya baloncuk olarak görünür. Açmak için baloncuğa dokunun. Baloncuğu taşımak için sürükleyin."</string>
diff --git a/libs/WindowManager/Shell/res/values-uk/strings.xml b/libs/WindowManager/Shell/res/values-uk/strings.xml
index e1b6e35..47126ac 100644
--- a/libs/WindowManager/Shell/res/values-uk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-uk/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"згорнути \"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>\""</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Налаштування параметра \"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>\""</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Закрити підказку"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Перейти в повноекранний режим"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Не показувати спливаючі чати для розмов"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Спливаючий чат"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Нові повідомлення чату з\'являються у вигляді спливаючих значків. Щоб відкрити чат, натисніть його, а щоб перемістити – перетягніть."</string>
diff --git a/libs/WindowManager/Shell/res/values-ur/strings.xml b/libs/WindowManager/Shell/res/values-ur/strings.xml
index 0508e6d..859288f 100644
--- a/libs/WindowManager/Shell/res/values-ur/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ur/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g> کو سکیڑیں"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> ترتیبات"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"بلبلہ برخاست کریں"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"مکمل اسکرین پر منتقل کریں"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"گفتگو بلبلہ نہ کریں"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"بلبلے کے ذریعے چیٹ کریں"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"نئی گفتگوئیں فلوٹنگ آئیکن یا بلبلے کے طور پر ظاہر ہوں گی۔ بلبلہ کھولنے کے لیے تھپتھپائیں۔ اسے منتقل کرنے کے لیے گھسیٹیں۔"</string>
diff --git a/libs/WindowManager/Shell/res/values-uz/strings.xml b/libs/WindowManager/Shell/res/values-uz/strings.xml
index 5de3b7b..625fc8e 100644
--- a/libs/WindowManager/Shell/res/values-uz/strings.xml
+++ b/libs/WindowManager/Shell/res/values-uz/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>ni yopish"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> sozlamalari"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Bulutchani yopish"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Butun ekranga koʻchirish"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Suhbatlar bulutchalar shaklida chiqmasin"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Bulutchalar yordamida subhatlashish"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Yangi xabarlar qalqib chiquvchi belgilar yoki bulutchalar kabi chiqadi. Xabarni ochish uchun bildirishnoma ustiga bosing. Xabarni qayta joylash uchun bildirishnomani suring."</string>
diff --git a/libs/WindowManager/Shell/res/values-vi/strings.xml b/libs/WindowManager/Shell/res/values-vi/strings.xml
index 9b2f898..2e643dd 100644
--- a/libs/WindowManager/Shell/res/values-vi/strings.xml
+++ b/libs/WindowManager/Shell/res/values-vi/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"thu gọn <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"Cài đặt <xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Đóng bong bóng"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Chuyển sang toàn màn hình"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Dừng sử dụng bong bóng cho cuộc trò chuyện"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Trò chuyện bằng bong bóng trò chuyện"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Các cuộc trò chuyện mới sẽ xuất hiện dưới dạng biểu tượng nổi hoặc bong bóng trò chuyện. Nhấn để mở bong bóng trò chuyện. Kéo để di chuyển bong bóng trò chuyện."</string>
diff --git a/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml b/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml
index b45b76e..f023f53 100644
--- a/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"收起“<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>”"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>设置"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"关闭消息气泡"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"移至全屏"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"不以消息气泡形式显示对话"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"使用消息气泡聊天"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"新对话会以浮动图标或消息气泡形式显示。点按即可打开消息气泡。拖动即可移动消息气泡。"</string>
diff --git a/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml b/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml
index ae776b8..5c2ef04 100644
--- a/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"收埋<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"「<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>」設定"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"關閉小視窗氣泡"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"移至全螢幕"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"不要透過小視窗顯示對話"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"使用小視窗進行即時通訊"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"新對話會以浮動圖示 (小視窗) 顯示。輕按即可開啟小視窗。拖曳即可移動小視窗。"</string>
diff --git a/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml b/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml
index 5bfc6b8..a362d5b 100644
--- a/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"收合「<xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>」"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"「<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g>」設定"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"關閉對話框"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"移至全螢幕"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"不要以對話框形式顯示對話"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"透過對話框來聊天"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"新的對話會以浮動圖示或對話框形式顯示。輕觸即可開啟對話框,拖曳則可移動對話框。"</string>
diff --git a/libs/WindowManager/Shell/res/values-zu/strings.xml b/libs/WindowManager/Shell/res/values-zu/strings.xml
index 0598d62..3a3f431 100644
--- a/libs/WindowManager/Shell/res/values-zu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zu/strings.xml
@@ -73,8 +73,7 @@
<string name="bubble_accessibility_announce_collapse" msgid="3178806224494537097">"goqa <xliff:g id="BUBBLE_TITLE">%1$s</xliff:g>"</string>
<string name="bubbles_app_settings" msgid="3617224938701566416">"<xliff:g id="NOTIFICATION_TITLE">%1$s</xliff:g> izilungiselelo"</string>
<string name="bubble_dismiss_text" msgid="8816558050659478158">"Cashisa ibhamuza"</string>
- <!-- no translation found for bubble_fullscreen_text (1006758103218086231) -->
- <skip />
+ <string name="bubble_fullscreen_text" msgid="1006758103218086231">"Hambisa esikrinini esigcwele"</string>
<string name="bubbles_dont_bubble_conversation" msgid="310000317885712693">"Ungayibhamuzi ingxoxo"</string>
<string name="bubbles_user_education_title" msgid="2112319053732691899">"Xoxa usebenzisa amabhamuza"</string>
<string name="bubbles_user_education_description" msgid="4215862563054175407">"Izingxoxo ezintsha zivela njengezithonjana ezintantayo, noma amabhamuza. Thepha ukuze uvule ibhamuza. Hudula ukuze ulihambise."</string>
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index 2d98a2b..755e0d5 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -569,7 +569,7 @@
<!-- The thickness in dp for all desktop drag transition regions. -->
<dimen name="desktop_mode_transition_region_thickness">44dp</dimen>
- <item type="dimen" format="float" name="desktop_mode_fullscreen_region_scale">0.4</item>
+ <item type="dimen" format="float" name="desktop_mode_fullscreen_region_scale">0.2</item>
<!-- The height on the screen where drag to the left or right edge will result in a
desktop task snapping to split size. The empty space between this and the top is to allow
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeFlags.kt b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeFlags.kt
index 424d4bf..b5d63bd 100644
--- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeFlags.kt
+++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeFlags.kt
@@ -49,6 +49,7 @@
SIZE_CONSTRAINTS(Flags::enableDesktopWindowingSizeConstraints, true),
DISABLE_SNAP_RESIZE(Flags::disableNonResizableAppSnapResizing, true),
DYNAMIC_INITIAL_BOUNDS(Flags::enableWindowingDynamicInitialBounds, false),
+ SCALED_RESIZING(Flags::enableWindowingScaledResizing, false),
ENABLE_DESKTOP_WINDOWING_TASK_LIMIT(Flags::enableDesktopWindowingTaskLimit, true),
BACK_NAVIGATION(Flags::enableDesktopWindowingBackNavigation, true),
EDGE_DRAG_RESIZE(Flags::enableWindowingEdgeDragResize, true),
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/handles/RegionSamplingHelper.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/handles/RegionSamplingHelper.java
index b92b8ef..a06cf78 100644
--- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/handles/RegionSamplingHelper.java
+++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/handles/RegionSamplingHelper.java
@@ -329,7 +329,7 @@
/**
* Get the sampled region of interest from the sampled view
* @param sampledView The view that this helper is attached to for convenience
- * @return the region to be sampled in sceen coordinates. Return {@code null} to avoid
+ * @return the region to be sampled in screen coordinates. Return {@code null} to avoid
* sampling in this frame
*/
Rect getSampledRegion(View sampledView);
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/pip/PipContentOverlay.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/pip/PipContentOverlay.java
index cf39415..6c83d88 100644
--- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/pip/PipContentOverlay.java
+++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/pip/PipContentOverlay.java
@@ -29,7 +29,6 @@
import android.graphics.drawable.Drawable;
import android.util.TypedValue;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.window.TaskSnapshot;
/**
@@ -75,7 +74,7 @@
public PipColorOverlay(Context context) {
mContext = context;
- mLeash = new SurfaceControl.Builder(new SurfaceSession())
+ mLeash = new SurfaceControl.Builder()
.setCallsite(TAG)
.setName(LAYER_NAME)
.setColorLayer()
@@ -123,7 +122,7 @@
public PipSnapshotOverlay(TaskSnapshot snapshot, Rect sourceRectHint) {
mSnapshot = snapshot;
mSourceRectHint = new Rect(sourceRectHint);
- mLeash = new SurfaceControl.Builder(new SurfaceSession())
+ mLeash = new SurfaceControl.Builder()
.setCallsite(TAG)
.setName(LAYER_NAME)
.build();
@@ -183,7 +182,7 @@
mBitmap = Bitmap.createBitmap(overlaySize, overlaySize, Bitmap.Config.ARGB_8888);
prepareAppIconOverlay(appIcon);
- mLeash = new SurfaceControl.Builder(new SurfaceSession())
+ mLeash = new SurfaceControl.Builder()
.setCallsite(TAG)
.setName(LAYER_NAME)
.build();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/apptoweb/AssistContentRequester.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/apptoweb/AssistContentRequester.kt
new file mode 100644
index 0000000..249185e
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/apptoweb/AssistContentRequester.kt
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.apptoweb
+
+import android.app.ActivityTaskManager
+import android.app.IActivityTaskManager
+import android.app.IAssistDataReceiver
+import android.app.assist.AssistContent
+import android.content.Context
+import android.graphics.Bitmap
+import android.os.Bundle
+import android.os.RemoteException
+import android.util.Slog
+import java.lang.ref.WeakReference
+import java.util.Collections
+import java.util.WeakHashMap
+import java.util.concurrent.Executor
+
+/**
+ * Can be used to request the AssistContent from a provided task id, useful for getting the web uri
+ * if provided from the task.
+ */
+class AssistContentRequester(
+ context: Context,
+ private val callBackExecutor: Executor,
+ private val systemInteractionExecutor: Executor
+) {
+ interface Callback {
+ // Called when the [AssistContent] of the requested task is available.
+ fun onAssistContentAvailable(assistContent: AssistContent?)
+ }
+
+ private val activityTaskManager: IActivityTaskManager = ActivityTaskManager.getService()
+ private val attributionTag: String? = context.attributionTag
+ private val packageName: String = context.applicationContext.packageName
+
+ // If system loses the callback, our internal cache of original callback will also get cleared.
+ private val pendingCallbacks = Collections.synchronizedMap(WeakHashMap<Any, Callback>())
+
+ /**
+ * Request the [AssistContent] from the task with the provided id.
+ *
+ * @param taskId to query for the content.
+ * @param callback to call when the content is available, called on the main thread.
+ */
+ fun requestAssistContent(taskId: Int, callback: Callback) {
+ // ActivityTaskManager interaction here is synchronous, so call off the main thread.
+ systemInteractionExecutor.execute {
+ try {
+ val success = activityTaskManager.requestAssistDataForTask(
+ AssistDataReceiver(callback, this),
+ taskId,
+ packageName,
+ attributionTag,
+ false /* fetchStructure */
+ )
+ if (!success) {
+ executeOnMainExecutor { callback.onAssistContentAvailable(null) }
+ }
+ } catch (e: RemoteException) {
+ Slog.e(TAG, "Requesting assist content failed for task: $taskId", e)
+ }
+ }
+ }
+
+ private fun executeOnMainExecutor(callback: Runnable) {
+ callBackExecutor.execute(callback)
+ }
+
+ private class AssistDataReceiver(
+ callback: Callback,
+ parent: AssistContentRequester
+ ) : IAssistDataReceiver.Stub() {
+ // The AssistDataReceiver binder callback object is passed to a system server, that may
+ // keep hold of it for longer than the lifetime of the AssistContentRequester object,
+ // potentially causing a memory leak. In the callback passed to the system server, only
+ // keep a weak reference to the parent object and lookup its callback if it still exists.
+ private val parentRef: WeakReference<AssistContentRequester>
+ private val callbackKey = Any()
+
+ init {
+ parent.pendingCallbacks[callbackKey] = callback
+ parentRef = WeakReference(parent)
+ }
+
+ override fun onHandleAssistData(data: Bundle?) {
+ val content = data?.getParcelable(ASSIST_KEY_CONTENT, AssistContent::class.java)
+ if (content == null) {
+ Slog.d(TAG, "Received AssistData, but no AssistContent found")
+ return
+ }
+ val requester = parentRef.get()
+ if (requester != null) {
+ val callback = requester.pendingCallbacks[callbackKey]
+ if (callback != null) {
+ requester.executeOnMainExecutor { callback.onAssistContentAvailable(content) }
+ } else {
+ Slog.d(TAG, "Callback received after calling UI was disposed of")
+ }
+ } else {
+ Slog.d(TAG, "Callback received after Requester was collected")
+ }
+ }
+
+ override fun onHandleAssistScreenshot(screenshot: Bitmap) {}
+ }
+
+ companion object {
+ private const val TAG = "AssistContentRequester"
+ private const val ASSIST_KEY_CONTENT = "content"
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java
index 7b3b207..f478b44 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java
@@ -874,10 +874,6 @@
// start post animation
dispatchOnBackInvoked(mActiveCallback);
} else {
- if (migrateBackToTransition
- && mBackTransitionHandler.mPrepareOpenTransition != null) {
- mBackTransitionHandler.createClosePrepareTransition();
- }
tryDispatchOnBackCancelled(mActiveCallback);
}
}
@@ -982,7 +978,6 @@
mShellBackAnimationRegistry.resetDefaultCrossActivity();
cancelLatencyTracking();
mReceivedNullNavigationInfo = false;
- mBackTransitionHandler.mLastTrigger = triggerBack;
if (mBackNavigationInfo != null) {
mPreviousNavigationType = mBackNavigationInfo.getType();
mBackNavigationInfo.onBackNavigationFinished(triggerBack);
@@ -1103,7 +1098,6 @@
endLatencyTracking();
if (!validateAnimationTargets(apps)) {
Log.e(TAG, "Invalid animation targets!");
- mBackTransitionHandler.consumeQueuedTransitionIfNeeded();
return;
}
mBackAnimationFinishedCallback = finishedCallback;
@@ -1113,7 +1107,6 @@
return;
}
kickStartAnimation();
- mBackTransitionHandler.consumeQueuedTransitionIfNeeded();
});
}
@@ -1121,7 +1114,6 @@
public void onAnimationCancelled() {
mShellExecutor.execute(
() -> {
- mBackTransitionHandler.consumeQueuedTransitionIfNeeded();
if (!mShellBackAnimationRegistry.cancel(
mBackNavigationInfo != null
? mBackNavigationInfo.getType()
@@ -1160,8 +1152,6 @@
boolean mCloseTransitionRequested;
SurfaceControl.Transaction mFinishOpenTransaction;
Transitions.TransitionFinishCallback mFinishOpenTransitionCallback;
- QueuedTransition mQueuedTransition = null;
- boolean mLastTrigger;
// The Transition to make behindActivity become visible
IBinder mPrepareOpenTransition;
// The Transition to make behindActivity become invisible, if prepare open exist and
@@ -1169,8 +1159,8 @@
IBinder mClosePrepareTransition;
TransitionInfo mOpenTransitionInfo;
void onAnimationFinished() {
- if (!mCloseTransitionRequested && mClosePrepareTransition == null) {
- applyFinishOpenTransition();
+ if (!mCloseTransitionRequested && mPrepareOpenTransition != null) {
+ createClosePrepareTransition();
}
if (mOnAnimationFinishCallback != null) {
mOnAnimationFinishCallback.run();
@@ -1178,13 +1168,6 @@
}
}
- void consumeQueuedTransitionIfNeeded() {
- if (mQueuedTransition != null) {
- mQueuedTransition.consume();
- mQueuedTransition = null;
- }
- }
-
private void applyFinishOpenTransition() {
mOpenTransitionInfo = null;
mPrepareOpenTransition = null;
@@ -1215,7 +1198,9 @@
@NonNull SurfaceControl.Transaction st,
@NonNull SurfaceControl.Transaction ft,
@NonNull Transitions.TransitionFinishCallback finishCallback) {
- if (info.getType() == WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION) {
+ final boolean isPrepareTransition =
+ info.getType() == WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION;
+ if (isPrepareTransition) {
kickStartAnimation();
}
// Both mShellExecutor and Transitions#mMainExecutor are ShellMainThread, so we don't
@@ -1240,21 +1225,14 @@
}
if (mApps == null || mApps.length == 0) {
- if (mBackNavigationInfo != null && mShellBackAnimationRegistry
- .isWaitingAnimation(mBackNavigationInfo.getType())) {
- // Waiting for animation? Queue update to wait for animation start.
- consumeQueuedTransitionIfNeeded();
- mQueuedTransition = new QueuedTransition(info, st, ft, finishCallback);
- return true;
- } else if (mLastTrigger) {
- // animation was done, consume directly
+ if (mCloseTransitionRequested) {
+ // animation never start, consume directly
applyAndFinish(st, ft, finishCallback);
return true;
- } else {
- // animation was cancelled but transition haven't happen, we must handle it
- if (mClosePrepareTransition == null && mCurrentTracker.isFinished()) {
- createClosePrepareTransition();
- }
+ } else if (mClosePrepareTransition == null && isPrepareTransition) {
+ // Gesture animation was cancelled before prepare transition ready, create
+ // the close prepare transition
+ createClosePrepareTransition();
}
}
@@ -1265,6 +1243,10 @@
}
void createClosePrepareTransition() {
+ if (mClosePrepareTransition != null) {
+ Log.e(TAG, "Re-create close prepare transition");
+ return;
+ }
final WindowContainerTransaction wct = new WindowContainerTransaction();
wct.restoreBackNavi();
mClosePrepareTransition = mTransitions.startTransition(
@@ -1402,10 +1384,10 @@
}
if (info.getType() == TRANSIT_CLOSE_PREPARE_BACK_NAVIGATION
- && !mCloseTransitionRequested && info.getChanges().isEmpty() && mApps != null) {
- // Wait for post animation finish
+ && !mCloseTransitionRequested && info.getChanges().isEmpty() && mApps == null) {
finishCallback.onTransitionFinished(null);
t.apply();
+ applyFinishOpenTransition();
return;
}
if (isNotGestureBackTransition(info) || shouldCancelAnimation(info)
@@ -1413,9 +1395,6 @@
if (mPrepareOpenTransition != null) {
applyFinishOpenTransition();
}
- if (mQueuedTransition != null) {
- consumeQueuedTransitionIfNeeded();
- }
return;
}
// Handle the commit transition if this handler is running the open transition.
@@ -1423,11 +1402,9 @@
t.apply();
if (mCloseTransitionRequested) {
if (mApps == null || mApps.length == 0) {
- if (mQueuedTransition == null) {
- // animation was done
- applyFinishOpenTransition();
- mCloseTransitionRequested = false;
- } // let queued transition finish.
+ // animation was done
+ applyFinishOpenTransition();
+ mCloseTransitionRequested = false;
} else {
// we are animating, wait until animation finish
mOnAnimationFinishCallback = () -> {
@@ -1621,41 +1598,6 @@
}
return null;
}
-
- class QueuedTransition {
- final TransitionInfo mInfo;
- final SurfaceControl.Transaction mSt;
- final SurfaceControl.Transaction mFt;
- final Transitions.TransitionFinishCallback mFinishCallback;
- QueuedTransition(@NonNull TransitionInfo info,
- @NonNull SurfaceControl.Transaction st,
- @NonNull SurfaceControl.Transaction ft,
- @NonNull Transitions.TransitionFinishCallback finishCallback) {
- mInfo = info;
- mSt = st;
- mFt = ft;
- mFinishCallback = finishCallback;
- }
-
- void consume() {
- // not animating, consume transition directly
- if (mApps == null || mApps.length == 0) {
- applyAndFinish(mSt, mFt, mFinishCallback);
- return;
- }
- // we are animating
- if (handlePrepareTransition(mInfo, mSt, mFt, mFinishCallback)) {
- // handle merge transition if any
- if (mCloseTransitionRequested) {
- mOnAnimationFinishCallback = () -> {
- applyFinishOpenTransition();
- mCloseTransitionRequested = false;
- };
- }
- }
- handleCloseTransition(mInfo, mSt, mFt, mFinishCallback);
- }
- }
}
private static boolean isNotGestureBackTransition(@NonNull TransitionInfo info) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
index 0c95934..169361a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
@@ -609,7 +609,8 @@
callback.onBubbleViewsReady(bubble);
}
},
- mMainExecutor);
+ mMainExecutor,
+ mBgExecutor);
if (mInflateSynchronously) {
mInflationTaskLegacy.onPostExecute(mInflationTaskLegacy.doInBackground());
} else {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt
index f32974e..68c4657 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt
@@ -80,7 +80,10 @@
expandedViewManager,
positioner,
/* isOverflow= */ true,
- /* bubbleTaskView= */ null
+ /* bubbleTaskView= */ null,
+ /* mainExecutor= */ null,
+ /* backgroundExecutor= */ null,
+ /* regionSamplingProvider= */ null
)
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewHelper.java
index 5f8f0fd..0c0fd7b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTaskViewHelper.java
@@ -60,6 +60,9 @@
/** Called when back is pressed on the task root. */
void onBackPressed();
+
+ /** Called when task removal has started. */
+ void onTaskRemovalStarted();
}
private final Context mContext;
@@ -190,6 +193,7 @@
((ViewGroup) mParentView).removeView(mTaskView);
mTaskView = null;
}
+ mListener.onTaskRemovalStarted();
}
@Override
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java
index 13855f7..3982a23 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java
@@ -38,6 +38,7 @@
import android.util.Log;
import android.util.PathParser;
import android.view.LayoutInflater;
+import android.view.View;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
@@ -47,6 +48,7 @@
import com.android.wm.shell.R;
import com.android.wm.shell.bubbles.bar.BubbleBarExpandedView;
import com.android.wm.shell.bubbles.bar.BubbleBarLayerView;
+import com.android.wm.shell.shared.handles.RegionSamplingHelper;
import java.lang.ref.WeakReference;
import java.util.Objects;
@@ -222,7 +224,16 @@
ProtoLog.v(WM_SHELL_BUBBLES, "Task initializing bubble bar expanded view key=%s",
mBubble.getKey());
viewInfo.bubbleBarExpandedView.initialize(mExpandedViewManager.get(),
- mPositioner.get(), false /* isOverflow */, viewInfo.taskView);
+ mPositioner.get(), false /* isOverflow */, viewInfo.taskView,
+ mMainExecutor, mBgExecutor, new RegionSamplingProvider() {
+ @Override
+ public RegionSamplingHelper createHelper(View sampledView,
+ RegionSamplingHelper.SamplingCallback callback,
+ Executor backgroundExecutor, Executor mainExecutor) {
+ return RegionSamplingProvider.super.createHelper(sampledView,
+ callback, backgroundExecutor, mainExecutor);
+ }
+ });
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTaskLegacy.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTaskLegacy.java
index 5cfebf8..1b7bb0d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTaskLegacy.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTaskLegacy.java
@@ -38,6 +38,7 @@
import android.util.Log;
import android.util.PathParser;
import android.view.LayoutInflater;
+import android.view.View;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
@@ -46,6 +47,7 @@
import com.android.wm.shell.R;
import com.android.wm.shell.bubbles.bar.BubbleBarExpandedView;
import com.android.wm.shell.bubbles.bar.BubbleBarLayerView;
+import com.android.wm.shell.shared.handles.RegionSamplingHelper;
import java.lang.ref.WeakReference;
import java.util.Objects;
@@ -85,6 +87,7 @@
private boolean mSkipInflation;
private Callback mCallback;
private Executor mMainExecutor;
+ private Executor mBackgroundExecutor;
/**
* Creates a task to load information for the provided {@link Bubble}. Once all info
@@ -100,7 +103,8 @@
BubbleIconFactory factory,
boolean skipInflation,
Callback c,
- Executor mainExecutor) {
+ Executor mainExecutor,
+ Executor backgroundExecutor) {
mBubble = b;
mContext = new WeakReference<>(context);
mExpandedViewManager = new WeakReference<>(expandedViewManager);
@@ -112,6 +116,7 @@
mSkipInflation = skipInflation;
mCallback = c;
mMainExecutor = mainExecutor;
+ mBackgroundExecutor = backgroundExecutor;
}
@Override
@@ -123,7 +128,7 @@
if (mLayerView.get() != null) {
return BubbleViewInfo.populateForBubbleBar(mContext.get(), mExpandedViewManager.get(),
mTaskViewFactory.get(), mPositioner.get(), mLayerView.get(), mIconFactory,
- mBubble, mSkipInflation);
+ mBubble, mSkipInflation, mMainExecutor, mBackgroundExecutor);
} else {
return BubbleViewInfo.populate(mContext.get(), mExpandedViewManager.get(),
mTaskViewFactory.get(), mPositioner.get(), mStackView.get(), mIconFactory,
@@ -188,7 +193,9 @@
BubbleBarLayerView layerView,
BubbleIconFactory iconFactory,
Bubble b,
- boolean skipInflation) {
+ boolean skipInflation,
+ Executor mainExecutor,
+ Executor backgroundExecutor) {
BubbleViewInfo info = new BubbleViewInfo();
if (!skipInflation && !b.isInflated()) {
@@ -197,7 +204,16 @@
info.bubbleBarExpandedView = (BubbleBarExpandedView) inflater.inflate(
R.layout.bubble_bar_expanded_view, layerView, false /* attachToRoot */);
info.bubbleBarExpandedView.initialize(
- expandedViewManager, positioner, false /* isOverflow */, bubbleTaskView);
+ expandedViewManager, positioner, false /* isOverflow */, bubbleTaskView,
+ mainExecutor, backgroundExecutor, new RegionSamplingProvider() {
+ @Override
+ public RegionSamplingHelper createHelper(View sampledView,
+ RegionSamplingHelper.SamplingCallback callback,
+ Executor backgroundExecutor, Executor mainExecutor) {
+ return RegionSamplingProvider.super.createHelper(sampledView,
+ callback, backgroundExecutor, mainExecutor);
+ }
+ });
}
if (!populateCommonInfo(info, c, b, iconFactory)) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/RegionSamplingProvider.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/RegionSamplingProvider.java
new file mode 100644
index 0000000..30f5c8fd
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/RegionSamplingProvider.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.bubbles;
+
+import android.view.View;
+
+import com.android.wm.shell.shared.handles.RegionSamplingHelper;
+
+import java.util.concurrent.Executor;
+
+/**
+ * Wrapper to provide a {@link com.android.wm.shell.shared.handles.RegionSamplingHelper} to allow
+ * testing it.
+ */
+public interface RegionSamplingProvider {
+
+ /** Creates and returns the region sampling helper */
+ default RegionSamplingHelper createHelper(View sampledView,
+ RegionSamplingHelper.SamplingCallback callback,
+ Executor backgroundExecutor,
+ Executor mainExecutor) {
+ return new RegionSamplingHelper(sampledView,
+ callback, backgroundExecutor, mainExecutor);
+ }
+
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java
index 565fde0..74c3748 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java
@@ -253,6 +253,7 @@
return;
}
setDragPivot(bbev);
+ bbev.setDragging(true);
// Corner radius gets scaled, apply the reverse scale to ensure we have the desired radius
final float cornerRadius = bbev.getDraggedCornerRadius() / EXPANDED_VIEW_DRAG_SCALE;
@@ -329,6 +330,7 @@
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
bbev.resetPivot();
+ bbev.setDragging(false);
}
});
startNewDragAnimation(animatorSet);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java
index f90b2aa..ec235a5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java
@@ -19,10 +19,7 @@
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import android.annotation.Nullable;
-import android.app.ActivityManager;
import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.Color;
import android.graphics.Insets;
import android.graphics.Outline;
import android.graphics.Rect;
@@ -37,6 +34,7 @@
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
+import androidx.annotation.VisibleForTesting;
import com.android.wm.shell.R;
import com.android.wm.shell.bubbles.Bubble;
@@ -46,9 +44,12 @@
import com.android.wm.shell.bubbles.BubbleTaskView;
import com.android.wm.shell.bubbles.BubbleTaskViewHelper;
import com.android.wm.shell.bubbles.Bubbles;
+import com.android.wm.shell.bubbles.RegionSamplingProvider;
import com.android.wm.shell.shared.bubbles.BubbleBarLocation;
+import com.android.wm.shell.shared.handles.RegionSamplingHelper;
import com.android.wm.shell.taskview.TaskView;
+import java.util.concurrent.Executor;
import java.util.function.Supplier;
/** Expanded view of a bubble when it's part of the bubble bar. */
@@ -92,16 +93,35 @@
private boolean mIsOverflow;
private BubbleTaskViewHelper mBubbleTaskViewHelper;
private BubbleBarMenuViewController mMenuViewController;
- private @Nullable Supplier<Rect> mLayerBoundsSupplier;
- private @Nullable Listener mListener;
+ @Nullable
+ private Supplier<Rect> mLayerBoundsSupplier;
+ @Nullable
+ private Listener mListener;
private BubbleBarHandleView mHandleView;
- private @Nullable TaskView mTaskView;
- private @Nullable BubbleOverflowContainerView mOverflowView;
+ @Nullable
+ private TaskView mTaskView;
+ @Nullable
+ private BubbleOverflowContainerView mOverflowView;
+ /**
+ * The handle shown in the caption area is tinted based on the background color of the area.
+ * This can vary so we sample the caption region and update the handle color based on that.
+ * If we're showing the overflow, the helper and executors will be null.
+ */
+ @Nullable
+ private RegionSamplingHelper mRegionSamplingHelper;
+ @Nullable
+ private RegionSamplingProvider mRegionSamplingProvider;
+ @Nullable
+ private Executor mMainExecutor;
+ @Nullable
+ private Executor mBackgroundExecutor;
+ private final Rect mSampleRect = new Rect();
+ private final int[] mLoc = new int[2];
+
+ /** Height of the caption inset at the top of the TaskView */
private int mCaptionHeight;
-
- private int mBackgroundColor;
/** Corner radius used when view is resting */
private float mRestingCornerRadius = 0f;
/** Corner radius applied while dragging */
@@ -116,6 +136,7 @@
*/
private boolean mIsContentVisible = false;
private boolean mIsAnimating;
+ private boolean mIsDragging;
public BubbleBarExpandedView(Context context) {
this(context, null);
@@ -154,21 +175,20 @@
setOnTouchListener((v, event) -> true);
}
- @Override
- protected void onDetachedFromWindow() {
- super.onDetachedFromWindow();
- // Hide manage menu when view disappears
- mMenuViewController.hideMenu(false /* animated */);
- }
-
/** Initializes the view, must be called before doing anything else. */
public void initialize(BubbleExpandedViewManager expandedViewManager,
BubblePositioner positioner,
boolean isOverflow,
- @Nullable BubbleTaskView bubbleTaskView) {
+ @Nullable BubbleTaskView bubbleTaskView,
+ @Nullable Executor mainExecutor,
+ @Nullable Executor backgroundExecutor,
+ @Nullable RegionSamplingProvider regionSamplingProvider) {
mManager = expandedViewManager;
mPositioner = positioner;
mIsOverflow = isOverflow;
+ mMainExecutor = mainExecutor;
+ mBackgroundExecutor = backgroundExecutor;
+ mRegionSamplingProvider = regionSamplingProvider;
if (mIsOverflow) {
mOverflowView = (BubbleOverflowContainerView) LayoutInflater.from(getContext()).inflate(
@@ -191,6 +211,7 @@
mTaskView.setEnableSurfaceClipping(true);
mTaskView.setCornerRadius(mCurrentCornerRadius);
mTaskView.setVisibility(VISIBLE);
+ mTaskView.setCaptionInsets(Insets.of(0, mCaptionHeight, 0, 0));
// Handle view needs to draw on top of task view.
bringChildToFront(mHandleView);
@@ -245,32 +266,40 @@
return mHandleView;
}
- // TODO (b/275087636): call this when theme/config changes
/** Updates the view based on the current theme. */
public void applyThemeAttrs() {
+ mCaptionHeight = getResources().getDimensionPixelSize(
+ R.dimen.bubble_bar_expanded_view_caption_height);
mRestingCornerRadius = getResources().getDimensionPixelSize(
- R.dimen.bubble_bar_expanded_view_corner_radius
- );
+ R.dimen.bubble_bar_expanded_view_corner_radius);
mDraggedCornerRadius = getResources().getDimensionPixelSize(
- R.dimen.bubble_bar_expanded_view_corner_radius_dragged
- );
+ R.dimen.bubble_bar_expanded_view_corner_radius_dragged);
mCurrentCornerRadius = mRestingCornerRadius;
- final TypedArray ta = mContext.obtainStyledAttributes(new int[]{
- android.R.attr.colorBackgroundFloating});
- mBackgroundColor = ta.getColor(0, Color.WHITE);
- ta.recycle();
- mCaptionHeight = getResources().getDimensionPixelSize(
- R.dimen.bubble_bar_expanded_view_caption_height);
-
if (mTaskView != null) {
mTaskView.setCornerRadius(mCurrentCornerRadius);
- updateHandleColor(true /* animated */);
+ mTaskView.setCaptionInsets(Insets.of(0, mCaptionHeight, 0, 0));
}
}
@Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ // Hide manage menu when view disappears
+ mMenuViewController.hideMenu(false /* animated */);
+ if (mRegionSamplingHelper != null) {
+ mRegionSamplingHelper.stopAndDestroy();
+ }
+ }
+
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ recreateRegionSamplingHelper();
+ }
+
+ @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (mTaskView != null) {
@@ -284,16 +313,13 @@
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if (mTaskView != null) {
- mTaskView.layout(l, t, r,
- t + mTaskView.getMeasuredHeight());
- mTaskView.setCaptionInsets(Insets.of(0, mCaptionHeight, 0, 0));
+ mTaskView.layout(l, t, r, t + mTaskView.getMeasuredHeight());
}
}
@Override
public void onTaskCreated() {
setContentVisibility(true);
- updateHandleColor(false /* animated */);
if (mListener != null) {
mListener.onTaskCreated();
}
@@ -305,11 +331,70 @@
}
@Override
+ public void onTaskRemovalStarted() {
+ if (mRegionSamplingHelper != null) {
+ mRegionSamplingHelper.stopAndDestroy();
+ }
+ }
+
+ @Override
public void onBackPressed() {
if (mListener == null) return;
mListener.onBackPressed();
}
+ /**
+ * Set whether this view is currently being dragged.
+ *
+ * When dragging, the handle is hidden and content shouldn't be sampled. When dragging has
+ * ended we should start again.
+ */
+ public void setDragging(boolean isDragging) {
+ if (isDragging != mIsDragging) {
+ mIsDragging = isDragging;
+ updateSamplingState();
+ }
+ }
+
+ /** Returns whether region sampling should be enabled, i.e. if task view content is visible. */
+ private boolean shouldSampleRegion() {
+ return mTaskView != null
+ && mTaskView.getTaskInfo() != null
+ && !mIsDragging
+ && !mIsAnimating
+ && mIsContentVisible;
+ }
+
+ /**
+ * Handles starting or stopping the region sampling helper based on
+ * {@link #shouldSampleRegion()}.
+ */
+ private void updateSamplingState() {
+ if (mRegionSamplingHelper == null) return;
+ boolean shouldSample = shouldSampleRegion();
+ if (shouldSample) {
+ mRegionSamplingHelper.start(getCaptionSampleRect());
+ } else {
+ mRegionSamplingHelper.stop();
+ }
+ }
+
+ /** Returns the current area of the caption bar, in screen coordinates. */
+ Rect getCaptionSampleRect() {
+ if (mTaskView == null) return null;
+ mTaskView.getLocationOnScreen(mLoc);
+ mSampleRect.set(mLoc[0], mLoc[1],
+ mLoc[0] + mTaskView.getWidth(),
+ mLoc[1] + mCaptionHeight);
+ return mSampleRect;
+ }
+
+ @VisibleForTesting
+ @Nullable
+ public RegionSamplingHelper getRegionSamplingHelper() {
+ return mRegionSamplingHelper;
+ }
+
/** Cleans up the expanded view, should be called when the bubble is no longer active. */
public void cleanUpExpandedState() {
mMenuViewController.hideMenu(false /* animated */);
@@ -394,27 +479,14 @@
if (!mIsAnimating) {
mTaskView.setAlpha(visible ? 1f : 0f);
+ if (mRegionSamplingHelper != null) {
+ mRegionSamplingHelper.setWindowVisible(visible);
+ }
+ updateSamplingState();
}
}
/**
- * Updates the handle color based on the task view status bar or background color; if those
- * are transparent it defaults to the background color pulled from system theme attributes.
- */
- private void updateHandleColor(boolean animated) {
- if (mTaskView == null || mTaskView.getTaskInfo() == null) return;
- int color = mBackgroundColor;
- ActivityManager.TaskDescription taskDescription = mTaskView.getTaskInfo().taskDescription;
- if (taskDescription.getStatusBarColor() != Color.TRANSPARENT) {
- color = taskDescription.getStatusBarColor();
- } else if (taskDescription.getBackgroundColor() != Color.TRANSPARENT) {
- color = taskDescription.getBackgroundColor();
- }
- final boolean isRegionDark = Color.luminance(color) <= 0.5;
- mHandleView.updateHandleColor(isRegionDark, animated);
- }
-
- /**
* Sets the alpha of both this view and the task view.
*/
public void setTaskViewAlpha(float alpha) {
@@ -442,6 +514,11 @@
*/
public void setAnimating(boolean animating) {
mIsAnimating = animating;
+ if (mIsAnimating) {
+ // Stop sampling while animating -- when animating is done setContentVisibility will
+ // re-trigger sampling if we're visible.
+ updateSamplingState();
+ }
// If we're done animating, apply the correct visibility.
if (!animating) {
setContentVisibility(mIsContentVisible);
@@ -481,6 +558,37 @@
}
}
+ private void recreateRegionSamplingHelper() {
+ if (mRegionSamplingHelper != null) {
+ mRegionSamplingHelper.stopAndDestroy();
+ }
+ if (mMainExecutor == null || mBackgroundExecutor == null
+ || mRegionSamplingProvider == null) {
+ // Null when it's the overflow / don't need sampling then.
+ return;
+ }
+ mRegionSamplingHelper = mRegionSamplingProvider.createHelper(this,
+ new RegionSamplingHelper.SamplingCallback() {
+ @Override
+ public void onRegionDarknessChanged(boolean isRegionDark) {
+ if (mHandleView != null) {
+ mHandleView.updateHandleColor(isRegionDark,
+ true /* animated */);
+ }
+ }
+
+ @Override
+ public Rect getSampledRegion(View sampledView) {
+ return getCaptionSampleRect();
+ }
+
+ @Override
+ public boolean isSamplingEnabled() {
+ return shouldSampleRegion();
+ }
+ }, mMainExecutor, mBackgroundExecutor);
+ }
+
private class HandleViewAccessibilityDelegate extends AccessibilityDelegate {
@Override
public void onInitializeAccessibilityNodeInfo(@NonNull View host,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java
index c91567d..e781c07 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java
@@ -42,7 +42,9 @@
private final @ColorInt int mHandleLightColor;
private final @ColorInt int mHandleDarkColor;
- private @Nullable ObjectAnimator mColorChangeAnim;
+ private @ColorInt int mCurrentColor;
+ @Nullable
+ private ObjectAnimator mColorChangeAnim;
public BubbleBarHandleView(Context context) {
this(context, null /* attrs */);
@@ -88,13 +90,17 @@
*
* @param isRegionDark Whether the background behind the handle is dark, and thus the handle
* should be light (and vice versa).
- * @param animated Whether to animate the change, or apply it immediately.
+ * @param animated Whether to animate the change, or apply it immediately.
*/
public void updateHandleColor(boolean isRegionDark, boolean animated) {
int newColor = isRegionDark ? mHandleLightColor : mHandleDarkColor;
+ if (newColor == mCurrentColor) {
+ return;
+ }
if (mColorChangeAnim != null) {
mColorChangeAnim.cancel();
}
+ mCurrentColor = newColor;
if (animated) {
mColorChangeAnim = ObjectAnimator.ofArgb(this, "backgroundColor", newColor);
mColorChangeAnim.addListener(new AnimatorListenerAdapter() {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SurfaceUtils.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SurfaceUtils.java
index 4b138e4..dd17e29 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SurfaceUtils.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SurfaceUtils.java
@@ -17,7 +17,6 @@
package com.android.wm.shell.common;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
/**
* Helpers for handling surface.
@@ -25,16 +24,15 @@
public class SurfaceUtils {
/** Creates a dim layer above host surface. */
public static SurfaceControl makeDimLayer(SurfaceControl.Transaction t, SurfaceControl host,
- String name, SurfaceSession surfaceSession) {
- final SurfaceControl dimLayer = makeColorLayer(host, name, surfaceSession);
+ String name) {
+ final SurfaceControl dimLayer = makeColorLayer(host, name);
t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f});
return dimLayer;
}
/** Creates a color layer for host surface. */
- public static SurfaceControl makeColorLayer(SurfaceControl host, String name,
- SurfaceSession surfaceSession) {
- return new SurfaceControl.Builder(surfaceSession)
+ public static SurfaceControl makeColorLayer(SurfaceControl host, String name) {
+ return new SurfaceControl.Builder()
.setParent(host)
.setColorLayer()
.setName(name)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java
index ef33b38..3dc86de 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java
@@ -42,7 +42,6 @@
import android.view.ScrollCaptureResponse;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
-import android.view.SurfaceSession;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
@@ -311,7 +310,7 @@
@Override
protected SurfaceControl getParentSurface(IWindow window,
WindowManager.LayoutParams attrs) {
- SurfaceControl leash = new SurfaceControl.Builder(new SurfaceSession())
+ SurfaceControl leash = new SurfaceControl.Builder()
.setContainerLayer()
.setName("SystemWindowLeash")
.setHidden(false)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhonePipKeepClearAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhonePipKeepClearAlgorithm.java
index 133242d..a27caf8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhonePipKeepClearAlgorithm.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PhonePipKeepClearAlgorithm.java
@@ -57,6 +57,12 @@
Rect startingBounds = pipBoundsState.getBounds().isEmpty()
? pipBoundsAlgorithm.getEntryDestinationBoundsIgnoringKeepClearAreas()
: pipBoundsState.getBounds();
+ // If IME is not showing and restore bounds (pre-IME bounds) is not empty, we should set PiP
+ // bounds to the restore bounds.
+ if (!pipBoundsState.isImeShowing() && !pipBoundsState.getRestoreBounds().isEmpty()) {
+ startingBounds.set(pipBoundsState.getRestoreBounds());
+ pipBoundsState.clearRestoreBounds();
+ }
Rect insets = new Rect();
pipBoundsAlgorithm.getInsetBounds(insets);
if (pipBoundsState.isImeShowing()) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java
index 140d776..c487f75 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java
@@ -86,6 +86,7 @@
@NonNull private final Rect mExpandedBounds = new Rect();
@NonNull private final Rect mNormalMovementBounds = new Rect();
@NonNull private final Rect mExpandedMovementBounds = new Rect();
+ @NonNull private final Rect mRestoreBounds = new Rect();
@NonNull private final PipDisplayLayoutState mPipDisplayLayoutState;
private final Point mMaxSize = new Point();
private final Point mMinSize = new Point();
@@ -404,6 +405,10 @@
public void setImeVisibility(boolean imeShowing, int imeHeight) {
mIsImeShowing = imeShowing;
mImeHeight = imeHeight;
+ // If IME is showing, save the current PiP bounds in case we need to restore it later.
+ if (mIsImeShowing) {
+ mRestoreBounds.set(getBounds());
+ }
}
/** Returns whether the IME is currently showing. */
@@ -411,6 +416,16 @@
return mIsImeShowing;
}
+ /** Returns the bounds to restore PiP to (bounds before IME was expanded). */
+ public Rect getRestoreBounds() {
+ return mRestoreBounds;
+ }
+
+ /** Sets mRestoreBounds to (0,0,0,0). */
+ public void clearRestoreBounds() {
+ mRestoreBounds.setEmpty();
+ }
+
/** Returns the IME height. */
public int getImeHeight() {
return mImeHeight;
@@ -521,6 +536,10 @@
/** Set whether the user has resized the PIP. */
public void setHasUserResizedPip(boolean hasUserResizedPip) {
mHasUserResizedPip = hasUserResizedPip;
+ // If user resized PiP while IME is showing, clear the pre-IME restore bounds.
+ if (hasUserResizedPip && isImeShowing()) {
+ clearRestoreBounds();
+ }
}
/** Returns whether the user has moved the PIP. */
@@ -531,6 +550,10 @@
/** Set whether the user has moved the PIP. */
public void setHasUserMovedPip(boolean hasUserMovedPip) {
mHasUserMovedPip = hasUserMovedPip;
+ // If user moved PiP while IME is showing, clear the pre-IME restore bounds.
+ if (hasUserMovedPip && isImeShowing()) {
+ clearRestoreBounds();
+ }
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java
index 8156a9c..f7f45ae 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerSnapAlgorithm.java
@@ -235,7 +235,7 @@
private SnapTarget snap(int position, boolean hardDismiss) {
if (shouldApplyFreeSnapMode(position)) {
- return new SnapTarget(position, position, SNAP_TO_NONE);
+ return new SnapTarget(position, SNAP_TO_NONE);
}
int minIndex = -1;
float minDistance = Float.MAX_VALUE;
@@ -263,7 +263,7 @@
if (dockedSide == DOCKED_RIGHT) {
startPos += mInsets.left;
}
- mTargets.add(new SnapTarget(startPos, startPos, SNAP_TO_START_AND_DISMISS, 0.35f));
+ mTargets.add(new SnapTarget(startPos, SNAP_TO_START_AND_DISMISS, 0.35f));
switch (mSnapMode) {
case SNAP_MODE_16_9:
addRatio16_9Targets(isHorizontalDivision, dividerMax);
@@ -278,7 +278,7 @@
addMinimizedTarget(isHorizontalDivision, dockedSide);
break;
}
- mTargets.add(new SnapTarget(dividerMax, dividerMax, SNAP_TO_END_AND_DISMISS, 0.35f));
+ mTargets.add(new SnapTarget(dividerMax, SNAP_TO_END_AND_DISMISS, 0.35f));
}
private void addNonDismissingTargets(boolean isHorizontalDivision, int topPosition,
@@ -325,14 +325,14 @@
*/
private void maybeAddTarget(int position, int smallerSize, @SnapPosition int snapPosition) {
if (smallerSize >= mMinimalSizeResizableTask) {
- mTargets.add(new SnapTarget(position, position, snapPosition));
+ mTargets.add(new SnapTarget(position, snapPosition));
}
}
private void addMiddleTarget(boolean isHorizontalDivision) {
int position = DockedDividerUtils.calculateMiddlePosition(isHorizontalDivision,
mInsets, mDisplayWidth, mDisplayHeight, mDividerSize);
- mTargets.add(new SnapTarget(position, position, SNAP_TO_50_50));
+ mTargets.add(new SnapTarget(position, SNAP_TO_50_50));
}
private void addMinimizedTarget(boolean isHorizontalDivision, int dockedSide) {
@@ -346,7 +346,7 @@
position = mDisplayWidth - position - mInsets.right - mDividerSize;
}
}
- mTargets.add(new SnapTarget(position, position, SNAP_TO_MINIMIZE));
+ mTargets.add(new SnapTarget(position, SNAP_TO_MINIMIZE));
}
public SnapTarget getMiddleTarget() {
@@ -377,20 +377,15 @@
}
/**
- * Represents a snap target for the divider.
+ * An object, calculated at boot time, representing a legal position for the split screen
+ * divider (i.e. the divider can be dragged to this spot).
*/
public static class SnapTarget {
/** Position of this snap target. The right/bottom edge of the top/left task snaps here. */
public final int position;
/**
- * Like {@link #position}, but used to calculate the task bounds which might be different
- * from the stack bounds.
- */
- public final int taskPosition;
-
- /**
- * An int describing the placement of the divider in this snap target.
+ * An int (enum) describing the placement of the divider in this snap target.
*/
public final @SnapPosition int snapPosition;
@@ -402,14 +397,13 @@
*/
private final float distanceMultiplier;
- public SnapTarget(int position, int taskPosition, @SnapPosition int snapPosition) {
- this(position, taskPosition, snapPosition, 1f);
+ public SnapTarget(int position, @SnapPosition int snapPosition) {
+ this(position, snapPosition, 1f);
}
- public SnapTarget(int position, int taskPosition, @SnapPosition int snapPosition,
+ public SnapTarget(int position, @SnapPosition int snapPosition,
float distanceMultiplier) {
this.position = position;
- this.taskPosition = taskPosition;
this.snapPosition = snapPosition;
this.distanceMultiplier = distanceMultiplier;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
index 7175e36..de3152a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
@@ -43,7 +43,6 @@
import android.view.LayoutInflater;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
-import android.view.SurfaceSession;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;
@@ -74,7 +73,6 @@
private static final String GAP_BACKGROUND_SURFACE_NAME = "GapBackground";
private final IconProvider mIconProvider;
- private final SurfaceSession mSurfaceSession;
private Drawable mIcon;
private ImageView mVeilIconView;
@@ -103,17 +101,15 @@
private int mOffsetY;
private int mRunningAnimationCount = 0;
- public SplitDecorManager(Configuration configuration, IconProvider iconProvider,
- SurfaceSession surfaceSession) {
+ public SplitDecorManager(Configuration configuration, IconProvider iconProvider) {
super(configuration, null /* rootSurface */, null /* hostInputToken */);
mIconProvider = iconProvider;
- mSurfaceSession = surfaceSession;
}
@Override
protected SurfaceControl getParentSurface(IWindow window, WindowManager.LayoutParams attrs) {
// Can't set position for the ViewRootImpl SC directly. Create a leash to manipulate later.
- final SurfaceControl.Builder builder = new SurfaceControl.Builder(new SurfaceSession())
+ final SurfaceControl.Builder builder = new SurfaceControl.Builder()
.setContainerLayer()
.setName(TAG)
.setHidden(true)
@@ -238,7 +234,7 @@
if (mBackgroundLeash == null) {
mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
- RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
+ RESIZING_BACKGROUND_SURFACE_NAME);
t.setColor(mBackgroundLeash, getResizingBackgroundColor(resizingTask))
.setLayer(mBackgroundLeash, Integer.MAX_VALUE - 1);
}
@@ -248,7 +244,7 @@
final int left = isLandscape ? mOldMainBounds.width() : 0;
final int top = isLandscape ? 0 : mOldMainBounds.height();
mGapBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
- GAP_BACKGROUND_SURFACE_NAME, mSurfaceSession);
+ GAP_BACKGROUND_SURFACE_NAME);
// Fill up another side bounds area.
t.setColor(mGapBackgroundLeash, getResizingBackgroundColor(resizingTask))
.setLayer(mGapBackgroundLeash, Integer.MAX_VALUE - 2)
@@ -405,7 +401,7 @@
if (mBackgroundLeash == null) {
// Initialize background
mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
- RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
+ RESIZING_BACKGROUND_SURFACE_NAME);
t.setColor(mBackgroundLeash, getResizingBackgroundColor(resizingTask))
.setLayer(mBackgroundLeash, Integer.MAX_VALUE - 1);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
index 2a934cb..b8aa1b1 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
@@ -72,11 +72,12 @@
import com.android.wm.shell.common.DisplayInsetsController;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.pip.PipUtils;
+import com.android.wm.shell.common.split.DividerSnapAlgorithm.SnapTarget;
+import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.shared.animation.Interpolators;
import com.android.wm.shell.shared.split.SplitScreenConstants.PersistentSnapPosition;
import com.android.wm.shell.shared.split.SplitScreenConstants.SnapPosition;
import com.android.wm.shell.shared.split.SplitScreenConstants.SplitPosition;
-import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.splitscreen.StageTaskListener;
import java.io.PrintWriter;
@@ -543,7 +544,7 @@
* to middle position if the provided SnapTarget is not supported.
*/
public void setDivideRatio(@PersistentSnapPosition int snapPosition) {
- final DividerSnapAlgorithm.SnapTarget snapTarget = mDividerSnapAlgorithm.findSnapTarget(
+ final SnapTarget snapTarget = mDividerSnapAlgorithm.findSnapTarget(
snapPosition);
setDividerPosition(snapTarget != null
@@ -577,7 +578,7 @@
* Sets new divider position and updates bounds correspondingly. Notifies listener if the new
* target indicates dismissing split.
*/
- public void snapToTarget(int currentPosition, DividerSnapAlgorithm.SnapTarget snapTarget) {
+ public void snapToTarget(int currentPosition, SnapTarget snapTarget) {
switch (snapTarget.snapPosition) {
case SNAP_TO_START_AND_DISMISS:
flingDividerPosition(currentPosition, snapTarget.position, FLING_RESIZE_DURATION,
@@ -613,10 +614,10 @@
}
/**
- * Returns {@link DividerSnapAlgorithm.SnapTarget} which matches passing position and velocity.
+ * Returns {@link SnapTarget} which matches passing position and velocity.
* If hardDismiss is set to {@code true}, it will be harder to reach dismiss target.
*/
- public DividerSnapAlgorithm.SnapTarget findSnapTarget(int position, float velocity,
+ public SnapTarget findSnapTarget(int position, float velocity,
boolean hardDismiss) {
return mDividerSnapAlgorithm.calculateSnapTarget(position, velocity, hardDismiss);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java
index 46c1a43..c5f1974 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java
@@ -36,7 +36,6 @@
import android.view.LayoutInflater;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
-import android.view.SurfaceSession;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;
@@ -98,7 +97,7 @@
@Override
protected SurfaceControl getParentSurface(IWindow window, WindowManager.LayoutParams attrs) {
// Can't set position for the ViewRootImpl SC directly. Create a leash to manipulate later.
- final SurfaceControl.Builder builder = new SurfaceControl.Builder(new SurfaceSession())
+ final SurfaceControl.Builder builder = new SurfaceControl.Builder()
.setContainerLayer()
.setName(TAG)
.setHidden(true)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManagerAbstract.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManagerAbstract.java
index 0564c95..d2b4f1a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManagerAbstract.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManagerAbstract.java
@@ -38,7 +38,6 @@
import android.view.IWindow;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
-import android.view.SurfaceSession;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;
@@ -173,7 +172,7 @@
@Override
protected SurfaceControl getParentSurface(IWindow window, WindowManager.LayoutParams attrs) {
String className = getClass().getSimpleName();
- final SurfaceControl.Builder builder = new SurfaceControl.Builder(new SurfaceSession())
+ final SurfaceControl.Builder builder = new SurfaceControl.Builder()
.setContainerLayer()
.setName(className + "Leash")
.setHidden(false)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/api/CompatUIComponent.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/api/CompatUIComponent.kt
index 831b331..abc26cf 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/api/CompatUIComponent.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/api/CompatUIComponent.kt
@@ -24,7 +24,6 @@
import android.view.IWindow
import android.view.SurfaceControl
import android.view.SurfaceControlViewHost
-import android.view.SurfaceSession
import android.view.View
import android.view.WindowManager
import android.view.WindowlessWindowManager
@@ -106,7 +105,7 @@
attrs: WindowManager.LayoutParams
): SurfaceControl? {
val className = javaClass.simpleName
- val builder = SurfaceControl.Builder(SurfaceSession())
+ val builder = SurfaceControl.Builder()
.setContainerLayer()
.setName(className + "Leash")
.setHidden(false)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
index 02ecfd9..7054c17c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
@@ -38,6 +38,7 @@
import com.android.wm.shell.WindowManagerShellWrapper;
import com.android.wm.shell.activityembedding.ActivityEmbeddingController;
import com.android.wm.shell.apptoweb.AppToWebGenericLinksParser;
+import com.android.wm.shell.apptoweb.AssistContentRequester;
import com.android.wm.shell.bubbles.BubbleController;
import com.android.wm.shell.bubbles.BubbleData;
import com.android.wm.shell.bubbles.BubbleDataRepository;
@@ -240,6 +241,7 @@
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
InteractionJankMonitor interactionJankMonitor,
AppToWebGenericLinksParser genericLinksParser,
+ AssistContentRequester assistContentRequester,
MultiInstanceHelper multiInstanceHelper,
Optional<DesktopTasksLimiter> desktopTasksLimiter,
Optional<DesktopActivityOrientationChangeHandler> desktopActivityOrientationHandler) {
@@ -263,6 +265,7 @@
rootTaskDisplayAreaOrganizer,
interactionJankMonitor,
genericLinksParser,
+ assistContentRequester,
multiInstanceHelper,
desktopTasksLimiter,
desktopActivityOrientationHandler);
@@ -291,6 +294,15 @@
return new AppToWebGenericLinksParser(context, mainExecutor);
}
+ @Provides
+ static AssistContentRequester provideAssistContentRequester(
+ Context context,
+ @ShellMainThread ShellExecutor shellExecutor,
+ @ShellBackgroundThread ShellExecutor bgExecutor
+ ) {
+ return new AssistContentRequester(context, shellExecutor, bgExecutor);
+ }
+
//
// Freeform
//
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java
index bfc0ee8..7261919 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java
@@ -45,6 +45,7 @@
import androidx.annotation.VisibleForTesting;
+import com.android.internal.policy.SystemBarUtils;
import com.android.wm.shell.R;
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
import com.android.wm.shell.common.DisplayController;
@@ -173,8 +174,7 @@
final Region region = new Region();
int transitionHeight = mDragStartState == DragStartState.FROM_FREEFORM
|| mDragStartState == DragStartState.DRAGGED_INTENT
- ? mContext.getResources().getDimensionPixelSize(
- com.android.wm.shell.R.dimen.desktop_mode_transition_region_thickness)
+ ? SystemBarUtils.getStatusBarHeight(mContext)
: 2 * layout.stableInsets().top;
// A Rect at the top of the screen that takes up the center 40%.
if (mDragStartState == DragStartState.FROM_FREEFORM) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java
index 1ffa541..832e2d2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java
@@ -118,7 +118,7 @@
@Override
public IBinder startMinimizedModeTransition(WindowContainerTransaction wct) {
- final int type = WindowManager.TRANSIT_TO_BACK;
+ final int type = Transitions.TRANSIT_MINIMIZE;
final IBinder token = mTransitions.startTransition(type, wct, this);
mPendingTransitionTokens.add(token);
return token;
@@ -161,7 +161,8 @@
transition, info.getType(), change);
break;
case WindowManager.TRANSIT_TO_BACK:
- transitionHandled |= startMinimizeTransition(transition);
+ transitionHandled |= startMinimizeTransition(
+ transition, info.getType(), change);
break;
case WindowManager.TRANSIT_CLOSE:
if (change.getTaskInfo().getWindowingMode() == WINDOWING_MODE_FREEFORM) {
@@ -227,8 +228,20 @@
return handled;
}
- private boolean startMinimizeTransition(IBinder transition) {
- return mPendingTransitionTokens.contains(transition);
+ private boolean startMinimizeTransition(
+ IBinder transition,
+ int type,
+ TransitionInfo.Change change) {
+ if (!mPendingTransitionTokens.contains(transition)) {
+ return false;
+ }
+
+ final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
+ if (type != Transitions.TRANSIT_MINIMIZE) {
+ return false;
+ }
+ // TODO(b/361524575): Add minimize animations
+ return true;
}
private boolean startCloseTransition(IBinder transition, TransitionInfo.Change change,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/BackgroundWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/BackgroundWindowManager.java
index 71cc8df..422656c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/BackgroundWindowManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/BackgroundWindowManager.java
@@ -38,7 +38,6 @@
import android.view.LayoutInflater;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
-import android.view.SurfaceSession;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;
@@ -105,7 +104,7 @@
@Override
protected SurfaceControl getParentSurface(IWindow window, WindowManager.LayoutParams attrs) {
- final SurfaceControl.Builder builder = new SurfaceControl.Builder(new SurfaceSession())
+ final SurfaceControl.Builder builder = new SurfaceControl.Builder()
.setColorLayer()
.setBufferSize(mDisplayBounds.width(), mDisplayBounds.height())
.setFormat(PixelFormat.RGB_888)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java
index 4df649c..f060158 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java
@@ -497,13 +497,8 @@
mCurrentValue = value;
}
- boolean shouldApplyCornerRadius() {
- return !isOutPipDirection(mTransitionDirection);
- }
-
boolean shouldApplyShadowRadius() {
- return !isOutPipDirection(mTransitionDirection)
- && !isRemovePipDirection(mTransitionDirection);
+ return !isRemovePipDirection(mTransitionDirection);
}
boolean inScaleTransition() {
@@ -556,7 +551,7 @@
final float alpha = getStartValue() * (1 - fraction) + getEndValue() * fraction;
setCurrentValue(alpha);
getSurfaceTransactionHelper().alpha(tx, leash, alpha)
- .round(tx, leash, shouldApplyCornerRadius())
+ .round(tx, leash, true /* applyCornerRadius */)
.shadow(tx, leash, shouldApplyShadowRadius());
if (!handlePipTransaction(leash, tx, destinationBounds, alpha)) {
tx.apply();
@@ -572,7 +567,7 @@
getSurfaceTransactionHelper()
.resetScale(tx, leash, getDestinationBounds())
.crop(tx, leash, getDestinationBounds())
- .round(tx, leash, shouldApplyCornerRadius())
+ .round(tx, leash, true /* applyCornerRadius */)
.shadow(tx, leash, shouldApplyShadowRadius());
tx.show(leash);
tx.apply();
@@ -686,13 +681,11 @@
getSurfaceTransactionHelper().scaleAndCrop(tx, leash,
adjustedSourceRectHint, initialSourceValue, bounds, insets,
isInPipDirection, fraction);
- if (shouldApplyCornerRadius()) {
- final Rect sourceBounds = new Rect(initialContainerRect);
- sourceBounds.inset(insets);
- getSurfaceTransactionHelper()
- .round(tx, leash, sourceBounds, bounds)
- .shadow(tx, leash, shouldApplyShadowRadius());
- }
+ final Rect sourceBounds = new Rect(initialContainerRect);
+ sourceBounds.inset(insets);
+ getSurfaceTransactionHelper()
+ .round(tx, leash, sourceBounds, bounds)
+ .shadow(tx, leash, shouldApplyShadowRadius());
}
if (!handlePipTransaction(leash, tx, bounds, /* alpha= */ 1f)) {
tx.apply();
@@ -741,11 +734,9 @@
.rotateAndScaleWithCrop(tx, leash, initialContainerRect, bounds,
insets, degree, x, y, isOutPipDirection,
rotationDelta == ROTATION_270 /* clockwise */);
- if (shouldApplyCornerRadius()) {
- getSurfaceTransactionHelper()
- .round(tx, leash, sourceBounds, bounds)
- .shadow(tx, leash, shouldApplyShadowRadius());
- }
+ getSurfaceTransactionHelper()
+ .round(tx, leash, sourceBounds, bounds)
+ .shadow(tx, leash, shouldApplyShadowRadius());
if (!handlePipTransaction(leash, tx, bounds, 1f /* alpha */)) {
tx.apply();
}
@@ -761,7 +752,7 @@
void onStartTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) {
getSurfaceTransactionHelper()
.alpha(tx, leash, 1f)
- .round(tx, leash, shouldApplyCornerRadius())
+ .round(tx, leash, true /* applyCornerRadius */)
.shadow(tx, leash, shouldApplyShadowRadius());
tx.show(leash);
tx.apply();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
index 05d1984..2138acc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
@@ -1102,6 +1102,8 @@
return;
}
+ // NOTE(b/365300020): Legacy enter PiP path, clear the swipe state.
+ mPipTransitionState.setInSwipePipToHomeTransition(false);
final int enterAnimationType = mEnterAnimationType;
if (enterAnimationType == ANIM_TYPE_ALPHA) {
startTransaction.setAlpha(leash, 0f);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentTasks.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentTasks.aidl
index ebfd357..799028a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentTasks.aidl
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentTasks.aidl
@@ -21,8 +21,8 @@
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
-import android.view.IRecentsAnimationRunner;
+import com.android.wm.shell.recents.IRecentsAnimationRunner;
import com.android.wm.shell.recents.IRecentTasksListener;
import com.android.wm.shell.shared.GroupedRecentTaskInfo;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationController.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationController.aidl
new file mode 100644
index 0000000..964e5fd
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationController.aidl
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.recents;
+
+import android.graphics.GraphicBuffer;
+import android.view.IRemoteAnimationFinishedCallback;
+import android.view.RemoteAnimationTarget;
+import android.view.SurfaceControl;
+import android.window.PictureInPictureSurfaceTransaction;
+import android.window.TaskSnapshot;
+import android.window.WindowAnimationState;
+
+import com.android.internal.os.IResultReceiver;
+
+/**
+ * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the
+ * runner control certain aspects of the recents animation, and to notify window manager when the
+ * animation has completed.
+ *
+ * {@hide}
+ */
+interface IRecentsAnimationController {
+
+ /**
+ * Takes a screenshot of the task associated with the given {@param taskId}. Only valid for the
+ * current set of task ids provided to the handler.
+ */
+ TaskSnapshot screenshotTask(int taskId);
+
+ /**
+ * Sets the final surface transaction on a Task. This is used by Launcher to notify the system
+ * that animating Activity to PiP has completed and the associated task surface should be
+ * updated accordingly. This should be called before `finish`
+ * @param taskId for which the leash should be updated
+ * @param finishTransaction leash operations for the final transform.
+ * @param overlay the surface control for an overlay being shown above the pip (can be null)
+ */
+ void setFinishTaskTransaction(int taskId,
+ in PictureInPictureSurfaceTransaction finishTransaction, in SurfaceControl overlay);
+
+ /**
+ * Notifies to the system that the animation into Recents should end, and all leashes associated
+ * with remote animation targets should be relinquished. If {@param moveHomeToTop} is true, then
+ * the home activity should be moved to the top. Otherwise, the home activity is hidden and the
+ * user is returned to the app.
+ * @param sendUserLeaveHint If set to true, {@link Activity#onUserLeaving} will be sent to the
+ * top resumed app, false otherwise.
+ */
+ void finish(boolean moveHomeToTop, boolean sendUserLeaveHint, in IResultReceiver finishCb);
+
+ /**
+ * Called by the handler to indicate that the recents animation input consumer should be
+ * enabled. This is currently used to work around an issue where registering an input consumer
+ * mid-animation causes the existing motion event chain to be canceled. Instead, the caller
+ * may register the recents animation input consumer prior to starting the recents animation
+ * and then enable it mid-animation to start receiving touch events.
+ */
+ void setInputConsumerEnabled(boolean enabled);
+
+ /**
+ * Sets a state for controller to decide which surface is the destination when the recents
+ * animation is cancelled through fail safe mechanism.
+ */
+ void setWillFinishToHome(boolean willFinishToHome);
+
+ /**
+ * Detach navigation bar from app.
+ *
+ * The system reparents the leash of navigation bar to the app when the recents animation starts
+ * and Launcher should call this method to let system restore the navigation bar to its
+ * original position when the quick switch gesture is finished and will run the fade-in
+ * animation If {@param moveHomeToTop} is {@code true}. Otherwise, restore the navigtation bar
+ * without animation.
+ *
+ * @param moveHomeToTop if {@code true}, the home activity should be moved to the top.
+ * Otherwise, the home activity is hidden and the user is returned to the
+ * app.
+ */
+ void detachNavigationBarFromApp(boolean moveHomeToTop);
+
+ /**
+ * Hand off the ongoing animation of a set of remote targets, to be run by another handler using
+ * the given starting parameters.
+ *
+ * Once the handoff is complete, operations on the old leashes for the given targets as well as
+ * callbacks will become no-ops.
+ *
+ * The number of targets MUST match the number of states, and each state MUST match the target
+ * at the same index.
+ */
+ oneway void handOffAnimation(in RemoteAnimationTarget[] targets,
+ in WindowAnimationState[] states);
+}
diff --git a/core/java/android/view/IRecentsAnimationRunner.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationRunner.aidl
similarity index 93%
rename from core/java/android/view/IRecentsAnimationRunner.aidl
rename to libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationRunner.aidl
index 37663d5..32c79a2 100644
--- a/core/java/android/view/IRecentsAnimationRunner.aidl
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationRunner.aidl
@@ -14,15 +14,15 @@
* limitations under the License.
*/
-package android.view;
+package com.android.wm.shell.recents;
-import android.app.ActivityManager;
import android.graphics.Rect;
import android.view.RemoteAnimationTarget;
-import android.view.IRecentsAnimationController;
import android.window.TaskSnapshot;
import android.os.Bundle;
+import com.android.wm.shell.recents.IRecentsAnimationController;
+
/**
* Interface that is used to callback from window manager to the process that runs a recents
* animation to start or cancel it.
@@ -55,7 +55,6 @@
* @param minimizedHomeBounds Specifies the bounds of the minimized home app, will be
* {@code null} if the device is not currently in split screen
*/
- @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
void onAnimationStart(in IRecentsAnimationController controller,
in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers,
in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras) = 2;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
index 9af33a8..a6e25a9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
@@ -37,7 +37,6 @@
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseIntArray;
-import android.view.IRecentsAnimationRunner;
import android.window.WindowContainerToken;
import androidx.annotation.BinderThread;
@@ -54,6 +53,7 @@
import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.desktopmode.DesktopModeTaskRepository;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
+import com.android.wm.shell.recents.IRecentsAnimationRunner;
import com.android.wm.shell.shared.GroupedRecentTaskInfo;
import com.android.wm.shell.shared.annotations.ExternalThread;
import com.android.wm.shell.shared.annotations.ShellMainThread;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
index c90da05..c660000 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
@@ -49,8 +49,6 @@
import android.util.Pair;
import android.util.Slog;
import android.view.Display;
-import android.view.IRecentsAnimationController;
-import android.view.IRecentsAnimationRunner;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.window.PictureInPictureSurfaceTransaction;
@@ -1024,10 +1022,6 @@
}
@Override
- public void setAnimationTargetsBehindSystemBars(boolean behindSystemBars) {
- }
-
- @Override
public void setFinishTaskTransaction(int taskId,
PictureInPictureSurfaceTransaction finishTransaction, SurfaceControl overlay) {
mExecutor.execute(() -> {
@@ -1254,14 +1248,6 @@
}
@Override
- public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) {
- }
-
- @Override
- public void cleanupScreenshot() {
- }
-
- @Override
public void setWillFinishToHome(boolean willFinishToHome) {
mExecutor.execute(() -> {
mWillFinishToHome = willFinishToHome;
@@ -1269,14 +1255,6 @@
}
/**
- * @see IRecentsAnimationController#removeTask
- */
- @Override
- public boolean removeTask(int taskId) {
- return false;
- }
-
- /**
* @see IRecentsAnimationController#detachNavigationBarFromApp
*/
@Override
@@ -1292,13 +1270,6 @@
}
});
}
-
- /**
- * @see IRecentsAnimationController#animateNavigationBarToApp(long)
- */
- @Override
- public void animateNavigationBarToApp(long duration) {
- }
};
/** Utility class to track the state of a task as-seen by recents. */
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/MainStage.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/MainStage.java
deleted file mode 100644
index 1dad413..0000000
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/MainStage.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.wm.shell.splitscreen;
-
-import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN;
-
-import android.content.Context;
-import android.view.SurfaceSession;
-import android.window.WindowContainerToken;
-import android.window.WindowContainerTransaction;
-
-import com.android.internal.protolog.ProtoLog;
-import com.android.launcher3.icons.IconProvider;
-import com.android.wm.shell.ShellTaskOrganizer;
-import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.windowdecor.WindowDecorViewModel;
-
-import java.util.Optional;
-
-/**
- * Main stage for split-screen mode. When split-screen is active all standard activity types launch
- * on the main stage, except for task that are explicitly pinned to the {@link StageTaskListener}.
- * @see StageCoordinator
- */
-class MainStage extends StageTaskListener {
- private boolean mIsActive = false;
-
- MainStage(Context context, ShellTaskOrganizer taskOrganizer, int displayId,
- StageListenerCallbacks callbacks, SyncTransactionQueue syncQueue,
- SurfaceSession surfaceSession, IconProvider iconProvider,
- Optional<WindowDecorViewModel> windowDecorViewModel) {
- super(context, taskOrganizer, displayId, callbacks, syncQueue, surfaceSession,
- iconProvider, windowDecorViewModel);
- }
-
- boolean isActive() {
- return mIsActive;
- }
-
- void activate(WindowContainerTransaction wct, boolean includingTopTask) {
- if (mIsActive) return;
- ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "activate: main stage includingTopTask=%b",
- includingTopTask);
-
- if (includingTopTask) {
- reparentTopTask(wct);
- }
-
- mIsActive = true;
- }
-
- void deactivate(WindowContainerTransaction wct) {
- deactivate(wct, false /* toTop */);
- }
-
- void deactivate(WindowContainerTransaction wct, boolean toTop) {
- if (!mIsActive) return;
- ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "deactivate: main stage toTop=%b rootTaskInfo=%s",
- toTop, mRootTaskInfo);
- mIsActive = false;
-
- if (mRootTaskInfo == null) return;
- final WindowContainerToken rootToken = mRootTaskInfo.token;
- wct.reparentTasks(
- rootToken,
- null /* newParent */,
- null /* windowingModes */,
- null /* activityTypes */,
- toTop);
- }
-}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java
index 526c1d4..b36b1f8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java
@@ -44,7 +44,7 @@
int STAGE_TYPE_UNDEFINED = -1;
/**
* The main stage type.
- * @see MainStage
+ * @see StageTaskListener
*/
int STAGE_TYPE_MAIN = 0;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java
index 7e165af..793e2aa 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java
@@ -61,7 +61,6 @@
import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.view.WindowManager;
import android.widget.Toast;
import android.window.RemoteTransition;
@@ -897,7 +896,7 @@
private SurfaceControl reparentSplitTasksForAnimation(RemoteAnimationTarget[] apps,
SurfaceControl.Transaction t, String callsite) {
- final SurfaceControl.Builder builder = new SurfaceControl.Builder(new SurfaceSession())
+ final SurfaceControl.Builder builder = new SurfaceControl.Builder()
.setContainerLayer()
.setName("RecentsAnimationSplitTasks")
.setHidden(false)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitscreenEventLogger.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitscreenEventLogger.java
index 1e6fa28..2033902 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitscreenEventLogger.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitscreenEventLogger.java
@@ -24,6 +24,7 @@
import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__CHILD_TASK_ENTER_PIP;
import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__DEVICE_FOLDED;
import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__DRAG_DIVIDER;
+import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__FULLSCREEN_REQUEST;
import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__FULLSCREEN_SHORTCUT;
import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__DESKTOP_MODE;
import static com.android.internal.util.FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__RECREATE_SPLIT;
@@ -45,6 +46,7 @@
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_DEVICE_FOLDED;
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_DRAG_DIVIDER;
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_DESKTOP_MODE;
+import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_FULLSCREEN_REQUEST;
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_FULLSCREEN_SHORTCUT;
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_RECREATE_SPLIT;
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_RETURN_HOME;
@@ -211,6 +213,8 @@
return SPLITSCREEN_UICHANGED__EXIT_REASON__FULLSCREEN_SHORTCUT;
case EXIT_REASON_DESKTOP_MODE:
return SPLITSCREEN_UICHANGED__EXIT_REASON__DESKTOP_MODE;
+ case EXIT_REASON_FULLSCREEN_REQUEST:
+ return SPLITSCREEN_UICHANGED__EXIT_REASON__FULLSCREEN_REQUEST;
case EXIT_REASON_UNKNOWN:
// Fall through
default:
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index f3959cc..1b143eb 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -34,6 +34,7 @@
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_REORDER;
+import static com.android.wm.shell.Flags.enableFlexibleSplit;
import static com.android.wm.shell.common.split.SplitLayout.PARALLAX_ALIGN_CENTER;
import static com.android.wm.shell.common.split.SplitScreenUtils.reverseSplitPosition;
import static com.android.wm.shell.common.split.SplitScreenUtils.splitFailureMessage;
@@ -103,7 +104,6 @@
import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.view.WindowManager;
import android.widget.Toast;
import android.window.DisplayAreaInfo;
@@ -154,14 +154,12 @@
import java.util.concurrent.Executor;
/**
- * Coordinates the staging (visibility, sizing, ...) of the split-screen {@link MainStage} and
- * other stages.
+ * Coordinates the staging (visibility, sizing, ...) of the split-screen stages.
* Some high-level rules:
* - The {@link StageCoordinator} is only considered active if the other stages contain at
* least one child task.
- * - The {@link MainStage} should only have children if the coordinator is active.
- * - The {@link SplitLayout} divider is only visible if both the {@link MainStage}
- * and other stages are visible.
+ * - The {@link SplitLayout} divider is only visible if multiple {@link StageTaskListener}s are
+ * visible
* - Both stages are put under a single-top root task.
* This rules are mostly implemented in {@link #onStageVisibilityChanged(StageListenerImpl)} and
* {@link #onStageHasChildrenChanged(StageListenerImpl).}
@@ -172,9 +170,7 @@
private static final String TAG = StageCoordinator.class.getSimpleName();
- private final SurfaceSession mSurfaceSession = new SurfaceSession();
-
- private final MainStage mMainStage;
+ private final StageTaskListener mMainStage;
private final StageListenerImpl mMainStageListener = new StageListenerImpl();
private final StageTaskListener mSideStage;
private final StageListenerImpl mSideStageListener = new StageListenerImpl();
@@ -329,13 +325,12 @@
taskOrganizer.createRootTask(displayId, WINDOWING_MODE_FULLSCREEN, this /* listener */);
ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "Creating main/side root task");
- mMainStage = new MainStage(
+ mMainStage = new StageTaskListener(
mContext,
mTaskOrganizer,
mDisplayId,
mMainStageListener,
mSyncQueue,
- mSurfaceSession,
iconProvider,
mWindowDecorViewModel);
mSideStage = new StageTaskListener(
@@ -344,7 +339,6 @@
mDisplayId,
mSideStageListener,
mSyncQueue,
- mSurfaceSession,
iconProvider,
mWindowDecorViewModel);
mDisplayController = displayController;
@@ -367,8 +361,9 @@
@VisibleForTesting
StageCoordinator(Context context, int displayId, SyncTransactionQueue syncQueue,
- ShellTaskOrganizer taskOrganizer, MainStage mainStage, StageTaskListener sideStage,
- DisplayController displayController, DisplayImeController displayImeController,
+ ShellTaskOrganizer taskOrganizer, StageTaskListener mainStage,
+ StageTaskListener sideStage, DisplayController displayController,
+ DisplayImeController displayImeController,
DisplayInsetsController displayInsetsController, SplitLayout splitLayout,
Transitions transitions, TransactionPool transactionPool, ShellExecutor mainExecutor,
Handler mainHandler, Optional<RecentTasksController> recentTasks,
@@ -420,6 +415,10 @@
return mSideStageListener.mVisible && mMainStageListener.mVisible;
}
+ private void activateSplit(WindowContainerTransaction wct, boolean includingTopTask) {
+ mMainStage.activate(wct, includingTopTask);
+ }
+
public boolean isSplitActive() {
return mMainStage.isActive();
}
@@ -505,10 +504,10 @@
ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "removeFromSideStage: task=%d", taskId);
final WindowContainerTransaction wct = new WindowContainerTransaction();
- /**
- * {@link MainStage} will be deactivated in {@link #onStageHasChildrenChanged} if the
- * other stages no longer have children.
- */
+
+ // MainStage will be deactivated in onStageHasChildrenChanged() if the other stages
+ // no longer have children.
+
final boolean result = mSideStage.removeTask(taskId,
isSplitActive() ? mMainStage.mRootTaskInfo.token : null,
wct);
@@ -805,7 +804,7 @@
if (!isSplitActive()) {
// Build a request WCT that will launch both apps such that task 0 is on the main stage
// while task 1 is on the side stage.
- mMainStage.activate(wct, false /* reparent */);
+ activateSplit(wct, false /* reparentToTop */);
}
mSplitLayout.setDivideRatio(snapPosition);
updateWindowBounds(mSplitLayout, wct);
@@ -872,7 +871,7 @@
if (!isSplitActive()) {
// Build a request WCT that will launch both apps such that task 0 is on the main stage
// while task 1 is on the side stage.
- mMainStage.activate(wct, false /* reparent */);
+ activateSplit(wct, false /* reparentToTop */);
}
setSideStagePosition(splitPosition, wct);
@@ -1176,6 +1175,7 @@
mSplitTransitions.startDismissTransition(wct, this, mLastActiveStage, reason);
setSplitsVisible(false);
mBreakOnNextWake = false;
+ logExit(reason);
}
void exitSplitScreenOnHide(boolean exitSplitScreenOnHide) {
@@ -1266,6 +1266,7 @@
final WindowContainerTransaction wct = new WindowContainerTransaction();
prepareExitSplitScreen(stage, wct);
mSplitTransitions.startDismissTransition(wct, this, stage, exitReason);
+ logExit(exitReason);
}
/**
@@ -1362,6 +1363,7 @@
mMainStage.doForAllChildTasks(taskId -> recentTasks.removeSplitPair(taskId));
mSideStage.doForAllChildTasks(taskId -> recentTasks.removeSplitPair(taskId));
});
+ logExit(exitReason);
}
/**
@@ -1439,7 +1441,7 @@
setSideStagePosition(startPosition, wct);
mSideStage.addTask(taskInfo, wct);
}
- mMainStage.activate(wct, true /* includingTopTask */);
+ activateSplit(wct, true /* reparentToTop */);
prepareSplitLayout(wct, resizeAnim);
}
@@ -1580,7 +1582,7 @@
if (stage == STAGE_TYPE_MAIN) {
mLogger.logMainStageAppChange(getMainStagePosition(), mMainStage.getTopChildTaskUid(),
mSplitLayout.isLeftRightSplit());
- } else {
+ } else if (stage == STAGE_TYPE_SIDE) {
mLogger.logSideStageAppChange(getSideStagePosition(), mSideStage.getTopChildTaskUid(),
mSplitLayout.isLeftRightSplit());
}
@@ -2276,6 +2278,7 @@
if (isOpening && inFullscreen) {
// One task is opening into fullscreen mode, remove the corresponding split record.
mRecentTasks.ifPresent(recentTasks -> recentTasks.removeSplitPair(triggerTask.taskId));
+ logExit(EXIT_REASON_FULLSCREEN_REQUEST);
}
if (isSplitActive()) {
@@ -2403,6 +2406,7 @@
if (triggerTask != null) {
mRecentTasks.ifPresent(
recentTasks -> recentTasks.removeSplitPair(triggerTask.taskId));
+ logExit(EXIT_REASON_CHILD_TASK_ENTER_PIP);
}
@StageType int topStage = STAGE_TYPE_UNDEFINED;
if (isSplitScreenVisible()) {
@@ -2744,7 +2748,10 @@
final int dismissTop = mainChild != null ? STAGE_TYPE_MAIN :
(sideChild != null ? STAGE_TYPE_SIDE : STAGE_TYPE_UNDEFINED);
pendingEnter.cancel(
- (cancelWct, cancelT) -> prepareExitSplitScreen(dismissTop, cancelWct));
+ (cancelWct, cancelT) -> {
+ prepareExitSplitScreen(dismissTop, cancelWct);
+ logExit(EXIT_REASON_UNKNOWN);
+ });
Log.w(TAG, splitFailureMessage("startPendingEnterAnimation",
"launched 2 tasks in split, but didn't receive "
+ "2 tasks in transition. Possibly one of them failed to launch"));
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
index 4593553..d64c0a2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
@@ -39,7 +39,6 @@
import android.util.SparseArray;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;
@@ -72,6 +71,10 @@
public class StageTaskListener implements ShellTaskOrganizer.TaskListener {
private static final String TAG = StageTaskListener.class.getSimpleName();
+ // No current way to enforce this but if enableFlexibleSplit() is enabled, then only 1 of the
+ // stages should have this be set/being used
+ private boolean mIsActive;
+
/** Callback interface for listening to changes in a split-screen stage. */
public interface StageListenerCallbacks {
void onRootTaskAppeared();
@@ -89,7 +92,6 @@
private final Context mContext;
private final StageListenerCallbacks mCallbacks;
- private final SurfaceSession mSurfaceSession;
private final SyncTransactionQueue mSyncQueue;
private final IconProvider mIconProvider;
private final Optional<WindowDecorViewModel> mWindowDecorViewModel;
@@ -104,12 +106,11 @@
StageTaskListener(Context context, ShellTaskOrganizer taskOrganizer, int displayId,
StageListenerCallbacks callbacks, SyncTransactionQueue syncQueue,
- SurfaceSession surfaceSession, IconProvider iconProvider,
+ IconProvider iconProvider,
Optional<WindowDecorViewModel> windowDecorViewModel) {
mContext = context;
mCallbacks = callbacks;
mSyncQueue = syncQueue;
- mSurfaceSession = surfaceSession;
mIconProvider = iconProvider;
mWindowDecorViewModel = windowDecorViewModel;
taskOrganizer.createRootTask(displayId, WINDOWING_MODE_MULTI_WINDOW, this);
@@ -199,12 +200,11 @@
mRootTaskInfo = taskInfo;
mSplitDecorManager = new SplitDecorManager(
mRootTaskInfo.configuration,
- mIconProvider,
- mSurfaceSession);
+ mIconProvider);
mCallbacks.onRootTaskAppeared();
sendStatusChanged();
mSyncQueue.runInSync(t -> mDimLayer =
- SurfaceUtils.makeDimLayer(t, mRootLeash, "Dim layer", mSurfaceSession));
+ SurfaceUtils.makeDimLayer(t, mRootLeash, "Dim layer"));
} else if (taskInfo.parentTaskId == mRootTaskInfo.taskId) {
final int taskId = taskInfo.taskId;
mChildrenLeashes.put(taskId, leash);
@@ -475,6 +475,44 @@
});
}
+ // ---------
+ // Previously only used in MainStage
+ boolean isActive() {
+ return mIsActive;
+ }
+
+ void activate(WindowContainerTransaction wct, boolean includingTopTask) {
+ if (mIsActive) return;
+ ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "activate: includingTopTask=%b",
+ includingTopTask);
+
+ if (includingTopTask) {
+ reparentTopTask(wct);
+ }
+
+ mIsActive = true;
+ }
+
+ void deactivate(WindowContainerTransaction wct) {
+ deactivate(wct, false /* toTop */);
+ }
+
+ void deactivate(WindowContainerTransaction wct, boolean toTop) {
+ if (!mIsActive) return;
+ ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "deactivate: toTop=%b rootTaskInfo=%s",
+ toTop, mRootTaskInfo);
+ mIsActive = false;
+
+ if (mRootTaskInfo == null) return;
+ final WindowContainerToken rootToken = mRootTaskInfo.token;
+ wct.reparentTasks(
+ rootToken,
+ null /* newParent */,
+ null /* windowingModes */,
+ null /* activityTypes */,
+ toTop);
+ }
+
// --------
// Previously only used in SideStage
boolean removeAllTasks(WindowContainerTransaction wct, boolean toTop) {
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 fac3592..2e9b53e 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
@@ -33,7 +33,6 @@
import android.util.SparseArray;
import android.view.IWindow;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;
import android.window.SplashScreenView;
@@ -204,7 +203,7 @@
@Override
protected SurfaceControl getParentSurface(IWindow window,
WindowManager.LayoutParams attrs) {
- final SurfaceControl.Builder builder = new SurfaceControl.Builder(new SurfaceSession())
+ final SurfaceControl.Builder builder = new SurfaceControl.Builder()
.setContainerLayer()
.setName("Windowless window")
.setHidden(false)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
index 4fc6c44..f40e0ba 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
@@ -18,8 +18,8 @@
import static android.app.ActivityOptions.ANIM_CLIP_REVEAL;
import static android.app.ActivityOptions.ANIM_CUSTOM;
-import static android.app.ActivityOptions.ANIM_NONE;
import static android.app.ActivityOptions.ANIM_FROM_STYLE;
+import static android.app.ActivityOptions.ANIM_NONE;
import static android.app.ActivityOptions.ANIM_OPEN_CROSS_PROFILE_APPS;
import static android.app.ActivityOptions.ANIM_SCALE_UP;
import static android.app.ActivityOptions.ANIM_SCENE_TRANSITION;
@@ -92,7 +92,6 @@
import android.util.ArrayMap;
import android.view.Choreographer;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
@@ -134,8 +133,6 @@
private final TransitionAnimation mTransitionAnimation;
private final DevicePolicyManager mDevicePolicyManager;
- private final SurfaceSession mSurfaceSession = new SurfaceSession();
-
/** Keeps track of the currently-running animations associated with each transition. */
private final ArrayMap<IBinder, ArrayList<Animator>> mAnimations = new ArrayMap<>();
@@ -473,7 +470,7 @@
change.getLeash(),
startTransaction);
} else if (isOnlyTranslucent && TransitionUtil.isOpeningType(info.getType())
- && TransitionUtil.isClosingType(mode)) {
+ && TransitionUtil.isClosingType(mode)) {
// If there is a closing translucent task in an OPENING transition, we will
// actually select a CLOSING animation, so move the closing task into
// the animating part of the z-order.
@@ -705,7 +702,7 @@
TransitionInfo.Change change, TransitionInfo info, int animHint,
ArrayList<Animator> animations, Runnable onAnimFinish) {
final int rootIdx = TransitionUtil.rootIndexFor(change, info);
- final ScreenRotationAnimation anim = new ScreenRotationAnimation(mContext, mSurfaceSession,
+ final ScreenRotationAnimation anim = new ScreenRotationAnimation(mContext,
mTransactionPool, startTransaction, change, info.getRoot(rootIdx).getLeash(),
animHint);
// The rotation animation may consist of 3 animations: fade-out screenshot, fade-in real
@@ -759,6 +756,7 @@
options = info.getAnimationOptions();
}
final int overrideType = options != null ? options.getType() : ANIM_NONE;
+ final int userId = options != null ? options.getUserId() : UserHandle.USER_CURRENT;
final Rect endBounds = TransitionUtil.isClosingType(changeMode)
? mRotator.getEndBoundsInStartRotation(change)
: change.getEndAbsBounds();
@@ -767,12 +765,12 @@
a = mTransitionAnimation.loadKeyguardExitAnimation(flags,
(changeFlags & FLAG_SHOW_WALLPAPER) != 0);
} else if (type == TRANSIT_KEYGUARD_UNOCCLUDE) {
- a = mTransitionAnimation.loadKeyguardUnoccludeAnimation();
+ a = mTransitionAnimation.loadKeyguardUnoccludeAnimation(userId);
} else if ((changeFlags & FLAG_IS_VOICE_INTERACTION) != 0) {
if (isOpeningType) {
- a = mTransitionAnimation.loadVoiceActivityOpenAnimation(enter);
+ a = mTransitionAnimation.loadVoiceActivityOpenAnimation(enter, userId);
} else {
- a = mTransitionAnimation.loadVoiceActivityExitAnimation(enter);
+ a = mTransitionAnimation.loadVoiceActivityExitAnimation(enter, userId);
}
} else if (changeMode == TRANSIT_CHANGE) {
// In the absence of a specific adapter, we just want to keep everything stationary.
@@ -783,9 +781,9 @@
} else if (overrideType == ANIM_CUSTOM
&& (!isTask || options.getOverrideTaskTransition())) {
a = mTransitionAnimation.loadAnimationRes(options.getPackageName(), enter
- ? options.getEnterResId() : options.getExitResId());
+ ? options.getEnterResId() : options.getExitResId(), userId);
} else if (overrideType == ANIM_OPEN_CROSS_PROFILE_APPS && enter) {
- a = mTransitionAnimation.loadCrossProfileAppEnterAnimation();
+ a = mTransitionAnimation.loadCrossProfileAppEnterAnimation(userId);
} else if (overrideType == ANIM_CLIP_REVEAL) {
a = mTransitionAnimation.createClipRevealAnimationLocked(type, wallpaperTransit, enter,
endBounds, endBounds, options.getTransitionBounds());
@@ -905,9 +903,9 @@
final Rect bounds = change.getEndAbsBounds();
// Show the right drawable depending on the user we're transitioning to.
final Drawable thumbnailDrawable = change.hasFlags(FLAG_CROSS_PROFILE_OWNER_THUMBNAIL)
- ? mContext.getDrawable(R.drawable.ic_account_circle)
- : change.hasFlags(FLAG_CROSS_PROFILE_WORK_THUMBNAIL)
- ? mEnterpriseThumbnailDrawable : null;
+ ? mContext.getDrawable(R.drawable.ic_account_circle)
+ : change.hasFlags(FLAG_CROSS_PROFILE_WORK_THUMBNAIL)
+ ? mEnterpriseThumbnailDrawable : null;
if (thumbnailDrawable == null) {
return;
}
@@ -918,7 +916,7 @@
}
final SurfaceControl.Transaction transaction = mTransactionPool.acquire();
- final WindowThumbnail wt = WindowThumbnail.createAndAttach(mSurfaceSession,
+ final WindowThumbnail wt = WindowThumbnail.createAndAttach(
change.getLeash(), thumbnail, transaction);
final Animation a =
mTransitionAnimation.createCrossProfileAppsThumbnailAnimationLocked(bounds);
@@ -943,7 +941,7 @@
@NonNull Runnable finishCallback, TransitionInfo.Change change,
TransitionInfo.AnimationOptions options, float cornerRadius) {
final SurfaceControl.Transaction transaction = mTransactionPool.acquire();
- final WindowThumbnail wt = WindowThumbnail.createAndAttach(mSurfaceSession,
+ final WindowThumbnail wt = WindowThumbnail.createAndAttach(
change.getLeash(), options.getThumbnail(), transaction);
final Rect bounds = change.getEndAbsBounds();
final int orientation = mContext.getResources().getConfiguration().orientation;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/HomeTransitionObserver.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/HomeTransitionObserver.java
index 3d79a1c..c385f9a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/HomeTransitionObserver.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/HomeTransitionObserver.java
@@ -74,8 +74,12 @@
final boolean isBackGesture = change.hasFlags(FLAG_BACK_GESTURE_ANIMATED);
if (taskInfo.getActivityType() == ACTIVITY_TYPE_HOME) {
if (Flags.migratePredictiveBackTransition()) {
- if (!isBackGesture && TransitionUtil.isOpenOrCloseMode(mode)) {
- notifyHomeVisibilityChanged(TransitionUtil.isOpeningType(mode));
+ final boolean gestureToHomeTransition = isBackGesture
+ && TransitionUtil.isClosingType(info.getType());
+ if (gestureToHomeTransition
+ || (!isBackGesture && TransitionUtil.isOpenOrCloseMode(mode))) {
+ notifyHomeVisibilityChanged(gestureToHomeTransition
+ || TransitionUtil.isOpeningType(mode));
}
} else {
if (TransitionUtil.isOpenOrCloseMode(mode) || isBackGesture) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java
index 0bf9d36..5802e2c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java
@@ -38,7 +38,6 @@
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
-import android.view.SurfaceSession;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.window.ScreenCapture;
@@ -112,7 +111,7 @@
/** Intensity of light/whiteness of the layout after rotation occurs. */
private float mEndLuma;
- ScreenRotationAnimation(Context context, SurfaceSession session, TransactionPool pool,
+ ScreenRotationAnimation(Context context, TransactionPool pool,
Transaction t, TransitionInfo.Change change, SurfaceControl rootLeash, int animHint) {
mContext = context;
mTransactionPool = pool;
@@ -126,7 +125,7 @@
mStartRotation = change.getStartRotation();
mEndRotation = change.getEndRotation();
- mAnimLeash = new SurfaceControl.Builder(session)
+ mAnimLeash = new SurfaceControl.Builder()
.setParent(rootLeash)
.setEffectLayer()
.setCallsite("ShellRotationAnimation")
@@ -153,7 +152,7 @@
return;
}
- mScreenshotLayer = new SurfaceControl.Builder(session)
+ mScreenshotLayer = new SurfaceControl.Builder()
.setParent(mAnimLeash)
.setBLASTLayer()
.setSecure(screenshotBuffer.containsSecureLayers())
@@ -178,7 +177,7 @@
t.setCrop(mSurfaceControl, new Rect(0, 0, mEndWidth, mEndHeight));
if (!isCustomRotate()) {
- mBackColorSurface = new SurfaceControl.Builder(session)
+ mBackColorSurface = new SurfaceControl.Builder()
.setParent(rootLeash)
.setColorLayer()
.setOpaque(true)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
index 7dc336b..aba8b61 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
@@ -196,6 +196,9 @@
/** Transition to set windowing mode after exit pip transition is finished animating. */
public static final int TRANSIT_CLEANUP_PIP_EXIT = WindowManager.TRANSIT_FIRST_CUSTOM + 19;
+ /** Transition type to minimize a task. */
+ public static final int TRANSIT_MINIMIZE = WindowManager.TRANSIT_FIRST_CUSTOM + 20;
+
/** Transition type for desktop mode transitions. */
public static final int TRANSIT_DESKTOP_MODE_TYPES =
WindowManager.TRANSIT_FIRST_CUSTOM + 100;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/WindowThumbnail.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/WindowThumbnail.java
index 2c668ed..341f2bc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/WindowThumbnail.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/WindowThumbnail.java
@@ -21,7 +21,6 @@
import android.graphics.PixelFormat;
import android.hardware.HardwareBuffer;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
/**
* Represents a surface that is displayed over a transition surface.
@@ -33,10 +32,10 @@
private WindowThumbnail() {}
/** Create a thumbnail surface and attach it over a parent surface. */
- static WindowThumbnail createAndAttach(SurfaceSession surfaceSession, SurfaceControl parent,
+ static WindowThumbnail createAndAttach(SurfaceControl parent,
HardwareBuffer thumbnailHeader, SurfaceControl.Transaction t) {
WindowThumbnail windowThumbnail = new WindowThumbnail();
- windowThumbnail.mSurfaceControl = new SurfaceControl.Builder(surfaceSession)
+ windowThumbnail.mSurfaceControl = new SurfaceControl.Builder()
.setParent(parent)
.setName("WindowThumanil : " + parent.toString())
.setCallsite("WindowThumanil")
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/AbstractTaskPositionerDecorator.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/AbstractTaskPositionerDecorator.kt
new file mode 100644
index 0000000..6dd5ac6
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/AbstractTaskPositionerDecorator.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.windowdecor
+
+/**
+ * Abstract decorator for a [TaskPositioner].
+ */
+abstract class AbstractTaskPositionerDecorator(
+ private val taskPositioner: TaskPositioner
+) : TaskPositioner by taskPositioner
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
index c88c1e2..0f8bd28 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
@@ -90,6 +90,7 @@
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.apptoweb.AppToWebGenericLinksParser;
+import com.android.wm.shell.apptoweb.AssistContentRequester;
import com.android.wm.shell.common.DisplayChangeController;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.DisplayInsetsController;
@@ -182,6 +183,7 @@
private final Region mExclusionRegion = Region.obtain();
private boolean mInImmersiveMode;
private final String mSysUIPackageName;
+ private final AssistContentRequester mAssistContentRequester;
private final DisplayChangeController.OnDisplayChangingListener mOnDisplayChangingListener;
private final ISystemGestureExclusionListener mGestureExclusionListener =
@@ -197,6 +199,7 @@
});
}
};
+ private final TaskPositionerFactory mTaskPositionerFactory;
public DesktopModeWindowDecorViewModel(
Context context,
@@ -217,6 +220,7 @@
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
InteractionJankMonitor interactionJankMonitor,
AppToWebGenericLinksParser genericLinksParser,
+ AssistContentRequester assistContentRequester,
MultiInstanceHelper multiInstanceHelper,
Optional<DesktopTasksLimiter> desktopTasksLimiter,
Optional<DesktopActivityOrientationChangeHandler> activityOrientationChangeHandler
@@ -238,6 +242,7 @@
transitions,
desktopTasksController,
genericLinksParser,
+ assistContentRequester,
multiInstanceHelper,
new DesktopModeWindowDecoration.Factory(),
new InputMonitorFactory(),
@@ -246,7 +251,8 @@
new SparseArray<>(),
interactionJankMonitor,
desktopTasksLimiter,
- activityOrientationChangeHandler);
+ activityOrientationChangeHandler,
+ new TaskPositionerFactory());
}
@VisibleForTesting
@@ -267,6 +273,7 @@
Transitions transitions,
Optional<DesktopTasksController> desktopTasksController,
AppToWebGenericLinksParser genericLinksParser,
+ AssistContentRequester assistContentRequester,
MultiInstanceHelper multiInstanceHelper,
DesktopModeWindowDecoration.Factory desktopModeWindowDecorFactory,
InputMonitorFactory inputMonitorFactory,
@@ -275,7 +282,8 @@
SparseArray<DesktopModeWindowDecoration> windowDecorByTaskId,
InteractionJankMonitor interactionJankMonitor,
Optional<DesktopTasksLimiter> desktopTasksLimiter,
- Optional<DesktopActivityOrientationChangeHandler> activityOrientationChangeHandler) {
+ Optional<DesktopActivityOrientationChangeHandler> activityOrientationChangeHandler,
+ TaskPositionerFactory taskPositionerFactory) {
mContext = context;
mMainExecutor = shellExecutor;
mMainHandler = mainHandler;
@@ -304,6 +312,7 @@
mInteractionJankMonitor = interactionJankMonitor;
mDesktopTasksLimiter = desktopTasksLimiter;
mActivityOrientationChangeHandler = activityOrientationChangeHandler;
+ mAssistContentRequester = assistContentRequester;
mOnDisplayChangingListener = (displayId, fromRotation, toRotation, displayAreaInfo, t) -> {
DesktopModeWindowDecoration decoration;
RunningTaskInfo taskInfo;
@@ -329,6 +338,7 @@
}
}
};
+ mTaskPositionerFactory = taskPositionerFactory;
shellInit.addInitCallback(this::onInit, this);
}
@@ -626,7 +636,7 @@
} else if (id == R.id.caption_handle || id == R.id.open_menu_button) {
if (!decoration.isHandleMenuActive()) {
moveTaskToFront(decoration.mTaskInfo);
- decoration.createHandleMenu(mSplitScreenController);
+ decoration.createHandleMenu();
}
} else if (id == R.id.maximize_window) {
// TODO(b/346441962): move click detection logic into the decor's
@@ -822,7 +832,10 @@
decoration.mTaskSurface,
e.getRawX(dragPointerIdx),
newTaskBounds);
- updateDragStatus(e.getActionMasked());
+ // Flip mIsDragging only if the bounds actually changed.
+ if (mIsDragging || !newTaskBounds.equals(mOnDragStartInitialBounds)) {
+ updateDragStatus(e.getActionMasked());
+ }
return true;
}
case MotionEvent.ACTION_UP:
@@ -1270,26 +1283,22 @@
mSyncQueue,
mRootTaskDisplayAreaOrganizer,
mGenericLinksParser,
+ mAssistContentRequester,
mMultiInstanceHelper);
mWindowDecorByTaskId.put(taskInfo.taskId, windowDecoration);
- final DragPositioningCallback dragPositioningCallback;
- if (!DesktopModeStatus.isVeiledResizeEnabled()) {
- dragPositioningCallback = new FluidResizeTaskPositioner(
- mTaskOrganizer, mTransitions, windowDecoration, mDisplayController,
- mDragStartListener, mTransactionFactory);
- windowDecoration.setTaskDragResizer(
- (FluidResizeTaskPositioner) dragPositioningCallback);
- } else {
- dragPositioningCallback = new VeiledResizeTaskPositioner(
- mTaskOrganizer, windowDecoration, mDisplayController,
- mDragStartListener, mTransitions, mInteractionJankMonitor);
- windowDecoration.setTaskDragResizer(
- (VeiledResizeTaskPositioner) dragPositioningCallback);
- }
+ final TaskPositioner taskPositioner = mTaskPositionerFactory.create(
+ mTaskOrganizer,
+ windowDecoration,
+ mDisplayController,
+ mDragStartListener,
+ mTransitions,
+ mInteractionJankMonitor,
+ mTransactionFactory);
+ windowDecoration.setTaskDragResizer(taskPositioner);
final DesktopModeTouchEventListener touchEventListener =
- new DesktopModeTouchEventListener(taskInfo, dragPositioningCallback);
+ new DesktopModeTouchEventListener(taskInfo, taskPositioner);
windowDecoration.setOnMaximizeOrRestoreClickListener(() -> {
onMaximizeOrRestore(taskInfo.taskId, "maximize_menu");
return Unit.INSTANCE;
@@ -1323,7 +1332,7 @@
windowDecoration.setCaptionListeners(
touchEventListener, touchEventListener, touchEventListener, touchEventListener);
windowDecoration.setExclusionRegionListener(mExclusionRegionListener);
- windowDecoration.setDragPositioningCallback(dragPositioningCallback);
+ windowDecoration.setDragPositioningCallback(taskPositioner);
windowDecoration.setDragDetector(touchEventListener.mDragDetector);
windowDecoration.relayout(taskInfo, startT, finishT,
false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */);
@@ -1472,6 +1481,25 @@
}
}
}
+
+ @VisibleForTesting
+ static class TaskPositionerFactory {
+ TaskPositioner create(
+ ShellTaskOrganizer taskOrganizer,
+ DesktopModeWindowDecoration windowDecoration,
+ DisplayController displayController,
+ DragPositioningCallbackUtility.DragStartListener dragStartListener,
+ Transitions transitions,
+ InteractionJankMonitor interactionJankMonitor,
+ Supplier<SurfaceControl.Transaction> transactionFactory) {
+ if (!DesktopModeStatus.isVeiledResizeEnabled()) {
+ return new FluidResizeTaskPositioner(
+ taskOrganizer, transitions, windowDecoration, displayController,
+ dragStartListener, transactionFactory);
+ }
+ return new VeiledResizeTaskPositioner(
+ taskOrganizer, windowDecoration, displayController,
+ dragStartListener, transitions, interactionJankMonitor);
+ }
+ }
}
-
-
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
index 8a012cd..142be91 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
@@ -38,6 +38,7 @@
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.WindowConfiguration.WindowingMode;
+import android.app.assist.AssistContent;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
@@ -76,6 +77,7 @@
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.apptoweb.AppToWebGenericLinksParser;
import com.android.wm.shell.apptoweb.AppToWebUtils;
+import com.android.wm.shell.apptoweb.AssistContentRequester;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.MultiInstanceHelper;
@@ -151,6 +153,7 @@
private CharSequence mAppName;
private CapturedLink mCapturedLink;
private Uri mGenericLink;
+ private Uri mWebUri;
private Consumer<Uri> mOpenInBrowserClickListener;
private ExclusionRegionListener mExclusionRegionListener;
@@ -159,6 +162,7 @@
private final MaximizeMenuFactory mMaximizeMenuFactory;
private final HandleMenuFactory mHandleMenuFactory;
private final AppToWebGenericLinksParser mGenericLinksParser;
+ private final AssistContentRequester mAssistContentRequester;
// Hover state for the maximize menu and button. The menu will remain open as long as either of
// these is true. See {@link #onMaximizeHoverStateChanged()}.
@@ -185,16 +189,16 @@
SyncTransactionQueue syncQueue,
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
AppToWebGenericLinksParser genericLinksParser,
+ AssistContentRequester assistContentRequester,
MultiInstanceHelper multiInstanceHelper) {
this (context, userContext, displayController, splitScreenController, taskOrganizer,
taskInfo, taskSurface, handler, bgExecutor, choreographer, syncQueue,
- rootTaskDisplayAreaOrganizer, genericLinksParser, SurfaceControl.Builder::new,
- SurfaceControl.Transaction::new, WindowContainerTransaction::new,
- SurfaceControl::new, new WindowManagerWrapper(
+ rootTaskDisplayAreaOrganizer, genericLinksParser, assistContentRequester,
+ SurfaceControl.Builder::new, SurfaceControl.Transaction::new,
+ WindowContainerTransaction::new, SurfaceControl::new, new WindowManagerWrapper(
context.getSystemService(WindowManager.class)),
- new SurfaceControlViewHostFactory() {},
- DefaultMaximizeMenuFactory.INSTANCE, DefaultHandleMenuFactory.INSTANCE,
- multiInstanceHelper);
+ new SurfaceControlViewHostFactory() {}, DefaultMaximizeMenuFactory.INSTANCE,
+ DefaultHandleMenuFactory.INSTANCE, multiInstanceHelper);
}
DesktopModeWindowDecoration(
@@ -211,6 +215,7 @@
SyncTransactionQueue syncQueue,
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
AppToWebGenericLinksParser genericLinksParser,
+ AssistContentRequester assistContentRequester,
Supplier<SurfaceControl.Builder> surfaceControlBuilderSupplier,
Supplier<SurfaceControl.Transaction> surfaceControlTransactionSupplier,
Supplier<WindowContainerTransaction> windowContainerTransactionSupplier,
@@ -231,6 +236,7 @@
mSyncQueue = syncQueue;
mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer;
mGenericLinksParser = genericLinksParser;
+ mAssistContentRequester = assistContentRequester;
mMaximizeMenuFactory = maximizeMenuFactory;
mHandleMenuFactory = handleMenuFactory;
mMultiInstanceHelper = multiInstanceHelper;
@@ -489,6 +495,8 @@
// Otherwise, return the generic link which is set to null if a generic link is unavailable.
if (mCapturedLink != null && !mCapturedLink.mExpired) {
return mCapturedLink.mUri;
+ } else if (mWebUri != null) {
+ return mWebUri;
}
return mGenericLink;
}
@@ -994,18 +1002,32 @@
}
/**
- * Create and display handle menu window.
+ * Updates app info and creates and displays handle menu window.
*/
- void createHandleMenu(SplitScreenController splitScreenController) {
+ void createHandleMenu() {
+ // Requests assist content. When content is received, calls {@link #onAssistContentReceived}
+ // which sets app info and creates the handle menu.
+ mAssistContentRequester.requestAssistContent(
+ mTaskInfo.taskId, this::onAssistContentReceived);
+ }
+
+ /**
+ * Called when assist content is received. updates the saved links and creates the handle menu.
+ */
+ @VisibleForTesting
+ void onAssistContentReceived(@Nullable AssistContent assistContent) {
+ mWebUri = assistContent == null ? null : assistContent.getWebUri();
loadAppInfoIfNeeded();
updateGenericLink();
+
+ // Create and display handle menu
mHandleMenu = mHandleMenuFactory.create(
this,
mWindowManagerWrapper,
mRelayoutParams.mLayoutResId,
mAppIconBitmap,
mAppName,
- splitScreenController,
+ mSplitScreenController,
DesktopModeStatus.canEnterDesktopMode(mContext),
Flags.enableDesktopWindowingMultiInstanceFeatures()
&& mMultiInstanceHelper
@@ -1019,6 +1041,7 @@
mHandleMenu.show(
/* onToDesktopClickListener= */ () -> {
mOnToDesktopClickListener.accept(APP_HANDLE_MENU_BUTTON);
+ mOnToDesktopClickListener.accept(APP_HANDLE_MENU_BUTTON);
return Unit.INSTANCE;
},
/* onToFullscreenClickListener= */ mOnToFullscreenClickListener,
@@ -1340,6 +1363,7 @@
SyncTransactionQueue syncQueue,
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
AppToWebGenericLinksParser genericLinksParser,
+ AssistContentRequester assistContentRequester,
MultiInstanceHelper multiInstanceHelper) {
return new DesktopModeWindowDecoration(
context,
@@ -1355,6 +1379,7 @@
syncQueue,
rootTaskDisplayAreaOrganizer,
genericLinksParser,
+ assistContentRequester,
multiInstanceHelper);
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositioner.java
index e2d42b2..3853f1f 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositioner.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositioner.java
@@ -49,8 +49,7 @@
* that we send the final shell transition since we still utilize the {@link #onTransitionConsumed}
* callback.
*/
-class FluidResizeTaskPositioner implements DragPositioningCallback,
- TaskDragResizer, Transitions.TransitionHandler {
+class FluidResizeTaskPositioner implements TaskPositioner, Transitions.TransitionHandler {
private final ShellTaskOrganizer mTaskOrganizer;
private final Transitions mTransitions;
private final WindowDecoration mWindowDecoration;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt
index fd6c4d8..fb81ed4 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt
@@ -30,7 +30,6 @@
import android.view.LayoutInflater
import android.view.SurfaceControl
import android.view.SurfaceControlViewHost
-import android.view.SurfaceSession
import android.view.WindowManager
import android.view.WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL
import android.view.WindowlessWindowManager
@@ -66,7 +65,6 @@
private val lightColors = dynamicLightColorScheme(context)
private val darkColors = dynamicDarkColorScheme(context)
- private val surfaceSession = SurfaceSession()
private lateinit var iconView: ImageView
private var iconSize = 0
@@ -126,7 +124,7 @@
.setCallsite("ResizeVeil#setupResizeVeil")
.build()
backgroundSurface = surfaceControlBuilderFactory
- .create("Resize veil background of Task=" + taskInfo.taskId, surfaceSession)
+ .create("Resize veil background of Task=" + taskInfo.taskId)
.setColorLayer()
.setHidden(true)
.setParent(veilSurface)
@@ -399,10 +397,6 @@
fun create(name: String): SurfaceControl.Builder {
return SurfaceControl.Builder().setName(name)
}
-
- fun create(name: String, surfaceSession: SurfaceSession): SurfaceControl.Builder {
- return SurfaceControl.Builder(surfaceSession).setName(name)
- }
}
companion object {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskDragResizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskDragResizer.java
index 40421b5..d7ea0c3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskDragResizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskDragResizer.java
@@ -19,7 +19,7 @@
/**
* Holds the state of a drag resize.
*/
-interface TaskDragResizer {
+public interface TaskDragResizer {
/**
* Returns true if task is currently being resized or animating the final transition after
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskPositioner.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskPositioner.kt
new file mode 100644
index 0000000..96c43da
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskPositioner.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.windowdecor
+
+/**
+ * Interface for TaskPositioner.
+ */
+interface TaskPositioner : DragPositioningCallback, TaskDragResizer
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java
index 4a884eb5..5998155 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java
@@ -47,8 +47,7 @@
* If the drag is resizing the task, we resize the veil instead.
* If the drag is repositioning, we update in the typical manner.
*/
-public class VeiledResizeTaskPositioner implements DragPositioningCallback,
- TaskDragResizer, Transitions.TransitionHandler {
+public class VeiledResizeTaskPositioner implements TaskPositioner, Transitions.TransitionHandler {
private DesktopModeWindowDecoration mDesktopWindowDecoration;
private ShellTaskOrganizer mTaskOrganizer;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt
index dfa5ab4..9ef4b8c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt
@@ -29,6 +29,7 @@
import android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
import android.view.WindowManager
import android.widget.ImageButton
+import com.android.internal.policy.SystemBarUtils
import com.android.window.flags.Flags
import com.android.wm.shell.R
import com.android.wm.shell.shared.animation.Interpolators
@@ -74,7 +75,10 @@
) {
captionHandle.imageTintList = ColorStateList.valueOf(getCaptionHandleBarColor(taskInfo))
this.taskInfo = taskInfo
- if (!isCaptionVisible && hasStatusBarInputLayer()) {
+ // If handle is not in status bar region(i.e., bottom stage in vertical split),
+ // do not create an input layer
+ if (position.y >= SystemBarUtils.getStatusBarHeight(context)) return
+ if (!isCaptionVisible && hasStatusBarInputLayer() ) {
disposeStatusBarInputLayer()
return
}
@@ -120,7 +124,7 @@
inputManager.pilferPointers(v.viewRootImpl.inputToken)
}
captionHandle.dispatchTouchEvent(event)
- true
+ return@setOnTouchListener true
}
windowManagerWrapper.updateViewLayout(view, lp)
}
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt
index ec1d4f7..7640cb1 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt
@@ -195,6 +195,25 @@
.associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
)
+ val CORNER_RESIZE_TO_MAXIMUM_SIZE =
+ FlickerConfigEntry(
+ scenarioId = ScenarioId("CORNER_RESIZE_TO_MAXIMUM_SIZE"),
+ extractor =
+ TaggedScenarioExtractorBuilder()
+ .setTargetTag(CujType.CUJ_DESKTOP_MODE_RESIZE_WINDOW)
+ .setTransitionMatcher(
+ TaggedCujTransitionMatcher(associatedTransitionRequired = false)
+ )
+ .build(),
+ assertions =
+ AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS +
+ listOf(
+ AppLayerIncreasesInSize(DESKTOP_MODE_APP),
+ AppWindowHasMaxDisplayHeight(DESKTOP_MODE_APP),
+ AppWindowHasMaxDisplayWidth(DESKTOP_MODE_APP)
+ ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
+ )
+
val SNAP_RESIZE_LEFT_WITH_BUTTON =
FlickerConfigEntry(
scenarioId = ScenarioId("SNAP_RESIZE_LEFT_WITH_BUTTON"),
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt
new file mode 100644
index 0000000..0b98ba2
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.flicker
+
+import android.tools.Rotation
+import android.tools.flicker.FlickerConfig
+import android.tools.flicker.annotation.ExpectedScenarios
+import android.tools.flicker.annotation.FlickerConfigProvider
+import android.tools.flicker.config.FlickerConfig
+import android.tools.flicker.config.FlickerServiceConfig
+import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner
+import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE
+import com.android.wm.shell.scenarios.ResizeAppWithCornerResize
+import org.junit.Test
+import org.junit.runner.RunWith
+
+/**
+ * Resize app window using corner resize to the greatest possible height and width in
+ * landscape mode.
+ *
+ * Assert that the maximum window size constraint is maintained.
+ */
+@RunWith(FlickerServiceJUnit4ClassRunner::class)
+class ResizeAppToMaximumWindowSizeLandscape : ResizeAppWithCornerResize(
+ rotation = Rotation.ROTATION_90
+) {
+ @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"])
+ @Test
+ override fun resizeAppWithCornerResizeToMaximumSize() =
+ super.resizeAppWithCornerResizeToMaximumSize()
+
+ companion object {
+ @JvmStatic
+ @FlickerConfigProvider
+ fun flickerConfigProvider(): FlickerConfig =
+ FlickerConfig().use(FlickerServiceConfig.DEFAULT).use(CORNER_RESIZE_TO_MAXIMUM_SIZE)
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt
new file mode 100644
index 0000000..b1c04d3
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.flicker
+
+import android.tools.flicker.FlickerConfig
+import android.tools.flicker.annotation.ExpectedScenarios
+import android.tools.flicker.annotation.FlickerConfigProvider
+import android.tools.flicker.config.FlickerConfig
+import android.tools.flicker.config.FlickerServiceConfig
+import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner
+import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE
+import com.android.wm.shell.scenarios.ResizeAppWithCornerResize
+import org.junit.Test
+import org.junit.runner.RunWith
+
+/**
+ * Resize app window using corner resize to the greatest possible height and width in
+ * portrait mode.
+ *
+ * Assert that the maximum window size constraint is maintained.
+ */
+@RunWith(FlickerServiceJUnit4ClassRunner::class)
+class ResizeAppToMaximumWindowSizePortrait : ResizeAppWithCornerResize() {
+ @ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"])
+ @Test
+ override fun resizeAppWithCornerResizeToMaximumSize() =
+ super.resizeAppWithCornerResizeToMaximumSize()
+
+ companion object {
+ @JvmStatic
+ @FlickerConfigProvider
+ fun flickerConfigProvider(): FlickerConfig =
+ FlickerConfig().use(FlickerServiceConfig.DEFAULT).use(CORNER_RESIZE_TO_MAXIMUM_SIZE)
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/CloseAllAppsWithAppHeaderExitTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/CloseAllAppsWithAppHeaderExitTest.kt
new file mode 100644
index 0000000..a4dc52b
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/CloseAllAppsWithAppHeaderExitTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.CloseAllAppsWithAppHeaderExit
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [CloseAllAppsWithAppHeaderExit]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class CloseAllAppsWithAppHeaderExitTest() : CloseAllAppsWithAppHeaderExit()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/EnterDesktopWithDragTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/EnterDesktopWithDragTest.kt
new file mode 100644
index 0000000..3d95f97
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/EnterDesktopWithDragTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.EnterDesktopWithDrag
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [EnterDesktopWithDrag]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class EnterDesktopWithDragTest : EnterDesktopWithDrag()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ExitDesktopWithDragToTopDragZoneTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ExitDesktopWithDragToTopDragZoneTest.kt
new file mode 100644
index 0000000..140c5ec
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ExitDesktopWithDragToTopDragZoneTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.ExitDesktopWithDragToTopDragZone
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [ExitDesktopWithDragToTopDragZone]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class ExitDesktopWithDragToTopDragZoneTest : ExitDesktopWithDragToTopDragZone()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/MaximizeAppWindowTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/MaximizeAppWindowTest.kt
new file mode 100644
index 0000000..3d3dcd0
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/MaximizeAppWindowTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.MaximizeAppWindow
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [MaximizeAppWindow]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class MaximizeAppWindowTest : MaximizeAppWindow()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/OpenAppsInDesktopModeTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/OpenAppsInDesktopModeTest.kt
new file mode 100644
index 0000000..263e89f6
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/OpenAppsInDesktopModeTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.OpenAppsInDesktopMode
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [OpenAppsInDesktopMode]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class OpenAppsInDesktopModeTest : OpenAppsInDesktopMode()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppCornerMultiWindowAndPipTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppCornerMultiWindowAndPipTest.kt
new file mode 100644
index 0000000..13f4775
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppCornerMultiWindowAndPipTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.ResizeAppCornerMultiWindowAndPip
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [ResizeAppCornerMultiWindowAndPip]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class ResizeAppCornerMultiWindowAndPipTest : ResizeAppCornerMultiWindowAndPip()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppCornerMultiWindowTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppCornerMultiWindowTest.kt
new file mode 100644
index 0000000..bc9bb41
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppCornerMultiWindowTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.ResizeAppCornerMultiWindow
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [ResizeAppCornerMultiWindow]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class ResizeAppCornerMultiWindowTest : ResizeAppCornerMultiWindow()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppWithCornerResizeTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppWithCornerResizeTest.kt
new file mode 100644
index 0000000..46168eb
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppWithCornerResizeTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.ResizeAppWithCornerResize
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [ResizeAppWithCornerResize]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class ResizeAppWithCornerResizeTest : ResizeAppWithCornerResize()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppWithEdgeResizeTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppWithEdgeResizeTest.kt
new file mode 100644
index 0000000..ee24200
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/ResizeAppWithEdgeResizeTest.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.server.wm.flicker.helpers.MotionEventHelper
+import com.android.wm.shell.scenarios.ResizeAppWithEdgeResize
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [ResizeAppWithEdgeResize]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class ResizeAppWithEdgeResizeTest :
+ ResizeAppWithEdgeResize(MotionEventHelper.InputMethod.TOUCHPAD)
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SnapResizeAppWindowWithButtonTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SnapResizeAppWindowWithButtonTest.kt
new file mode 100644
index 0000000..38e85c7
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SnapResizeAppWindowWithButtonTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.SnapResizeAppWindowWithButton
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [SnapResizeAppWindowWithButton]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class SnapResizeAppWindowWithButtonTest : SnapResizeAppWindowWithButton()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SnapResizeAppWindowWithDragTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SnapResizeAppWindowWithDragTest.kt
new file mode 100644
index 0000000..082a3fb
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SnapResizeAppWindowWithDragTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.SnapResizeAppWindowWithDrag
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [SnapResizeAppWindowWithDrag]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class SnapResizeAppWindowWithDragTest : SnapResizeAppWindowWithDrag()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SwitchToOverviewFromDesktopTest.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SwitchToOverviewFromDesktopTest.kt
new file mode 100644
index 0000000..fdd0d81
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/SwitchToOverviewFromDesktopTest.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.functional
+
+import android.platform.test.annotations.Postsubmit
+import com.android.wm.shell.scenarios.SwitchToOverviewFromDesktop
+import org.junit.runner.RunWith
+import org.junit.runners.BlockJUnit4ClassRunner
+
+/* Functional test for [SwitchToOverviewFromDesktop]. */
+@RunWith(BlockJUnit4ClassRunner::class)
+@Postsubmit
+class SwitchToOverviewFromDesktopTest : SwitchToOverviewFromDesktop()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/CloseAllAppsWithAppHeaderExit.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/CloseAllAppsWithAppHeaderExit.kt
index e9056f3..351a700 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/CloseAllAppsWithAppHeaderExit.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/CloseAllAppsWithAppHeaderExit.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.Rotation
@@ -33,15 +32,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class CloseAllAppsWithAppHeaderExit
-@JvmOverloads
+@Ignore("Base Test Class")
+abstract class CloseAllAppsWithAppHeaderExit
constructor(val rotation: Rotation = Rotation.ROTATION_0) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/DragAppWindowMultiWindow.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/DragAppWindowMultiWindow.kt
index ca1dc1a..3f9927f 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/DragAppWindowMultiWindow.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/DragAppWindowMultiWindow.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
import com.android.server.wm.flicker.helpers.ImeAppHelper
import com.android.server.wm.flicker.helpers.MailAppHelper
@@ -26,13 +25,11 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class DragAppWindowMultiWindow : DragAppWindowScenarioTestBase()
+@Ignore("Test Base Class")
+abstract class DragAppWindowMultiWindow : DragAppWindowScenarioTestBase()
{
private val imeAppHelper = ImeAppHelper(instrumentation)
private val testApp = DesktopModeAppHelper(SimpleAppHelper(instrumentation))
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/EnterDesktopWithDrag.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/EnterDesktopWithDrag.kt
index f4d6414..967bd29 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/EnterDesktopWithDrag.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/EnterDesktopWithDrag.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import android.tools.flicker.rules.ChangeDisplayOrientationRule
@@ -25,19 +24,16 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class EnterDesktopWithDrag
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class EnterDesktopWithDrag
constructor(
val rotation: Rotation = Rotation.ROTATION_0,
isResizeable: Boolean = true,
- isLandscapeApp: Boolean = true
+ isLandscapeApp: Boolean = true,
) : DesktopScenarioCustomAppTestBase(isResizeable, isLandscapeApp) {
@Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation)
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ExitDesktopWithDragToTopDragZone.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ExitDesktopWithDragToTopDragZone.kt
index b616e53..824c448 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ExitDesktopWithDragToTopDragZone.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ExitDesktopWithDragToTopDragZone.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import com.android.window.flags.Flags
@@ -24,19 +23,16 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class ExitDesktopWithDragToTopDragZone
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class ExitDesktopWithDragToTopDragZone
constructor(
val rotation: Rotation = Rotation.ROTATION_0,
isResizeable: Boolean = true,
- isLandscapeApp: Boolean = true
+ isLandscapeApp: Boolean = true,
) : DesktopScenarioCustomAppTestBase(isResizeable, isLandscapeApp) {
@Rule @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation)
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximizeAppWindow.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximizeAppWindow.kt
index 426f40b..a54d497 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximizeAppWindow.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximizeAppWindow.kt
@@ -17,7 +17,6 @@
package com.android.wm.shell.scenarios
import android.app.Instrumentation
-import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import android.tools.flicker.rules.ChangeDisplayOrientationRule
@@ -33,15 +32,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class MaximizeAppWindow
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class MaximizeAppWindow
constructor(private val rotation: Rotation = Rotation.ROTATION_0, isResizable: Boolean = true) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/OpenAppsInDesktopMode.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/OpenAppsInDesktopMode.kt
index a5c794b..aad266f 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/OpenAppsInDesktopMode.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/OpenAppsInDesktopMode.kt
@@ -17,7 +17,6 @@
package com.android.wm.shell.scenarios
import android.app.Instrumentation
-import android.platform.test.annotations.Postsubmit
import android.tools.flicker.rules.ChangeDisplayOrientationRule
import android.tools.NavBar
import android.tools.Rotation
@@ -36,14 +35,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class OpenAppsInDesktopMode(val rotation: Rotation = Rotation.ROTATION_0) {
+@Ignore("Test Base Class")
+abstract class OpenAppsInDesktopMode(val rotation: Rotation = Rotation.ROTATION_0) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
private val tapl = LauncherInstrumentation()
@@ -83,4 +80,4 @@
secondApp.exit(wmHelper)
firstApp.exit(wmHelper)
}
-}
\ No newline at end of file
+}
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindow.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindow.kt
index b6bca7a..bfee318 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindow.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindow.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.Rotation
@@ -34,15 +33,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class ResizeAppCornerMultiWindow
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class ResizeAppCornerMultiWindow
constructor(val rotation: Rotation = Rotation.ROTATION_0,
val horizontalChange: Int = 50,
val verticalChange: Int = -50) {
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindowAndPip.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindowAndPip.kt
index 285ea13..5b1b64e 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindowAndPip.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppCornerMultiWindowAndPip.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.Rotation
@@ -35,15 +34,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class ResizeAppCornerMultiWindowAndPip
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class ResizeAppCornerMultiWindowAndPip
constructor(val rotation: Rotation = Rotation.ROTATION_0,
val horizontalChange: Int = 50,
val verticalChange: Int = -50) {
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt
index 42940a9..bd25639 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.Rotation
@@ -32,16 +31,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class ResizeAppWithCornerResize
-@JvmOverloads
-constructor(
+@Ignore("Test Base Class")
+abstract class ResizeAppWithCornerResize(
val rotation: Rotation = Rotation.ROTATION_0,
val horizontalChange: Int = 200,
val verticalChange: Int = -200,
@@ -83,6 +78,25 @@
)
}
+ @Test
+ open fun resizeAppWithCornerResizeToMaximumSize() {
+ val maxResizeChange = 3000
+ testApp.cornerResize(
+ wmHelper,
+ device,
+ DesktopModeAppHelper.Corners.RIGHT_TOP,
+ maxResizeChange,
+ -maxResizeChange
+ )
+ testApp.cornerResize(
+ wmHelper,
+ device,
+ DesktopModeAppHelper.Corners.LEFT_BOTTOM,
+ -maxResizeChange,
+ maxResizeChange
+ )
+ }
+
@After
fun teardown() {
testApp.exit(wmHelper)
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithEdgeResize.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithEdgeResize.kt
index d094967..6780238 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithEdgeResize.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithEdgeResize.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.Rotation
@@ -32,15 +31,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class ResizeAppWithEdgeResize
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class ResizeAppWithEdgeResize
constructor(
val inputMethod: MotionEventHelper.InputMethod,
val rotation: Rotation = Rotation.ROTATION_90
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithButton.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithButton.kt
index 33242db..2b40497 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithButton.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithButton.kt
@@ -17,7 +17,6 @@
package com.android.wm.shell.scenarios
import android.app.Instrumentation
-import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import android.tools.traces.parsers.WindowManagerStateHelper
@@ -32,15 +31,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class SnapResizeAppWindowWithButton
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class SnapResizeAppWindowWithButton
constructor(private val toLeft: Boolean = true, isResizable: Boolean = true) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithDrag.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithDrag.kt
index 14eb779..b4bd7e1 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithDrag.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SnapResizeAppWindowWithDrag.kt
@@ -17,7 +17,6 @@
package com.android.wm.shell.scenarios
import android.app.Instrumentation
-import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import android.tools.traces.parsers.WindowManagerStateHelper
@@ -32,15 +31,12 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class SnapResizeAppWindowWithDrag
-@JvmOverloads
+@Ignore("Test Base Class")
+abstract class SnapResizeAppWindowWithDrag
constructor(private val toLeft: Boolean = true, isResizable: Boolean = true) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
@@ -72,4 +68,4 @@
fun teardown() {
testApp.exit(wmHelper)
}
-}
\ No newline at end of file
+}
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SwitchToOverviewFromDesktop.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SwitchToOverviewFromDesktop.kt
index 53e36e23..dad2eb6 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SwitchToOverviewFromDesktop.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/SwitchToOverviewFromDesktop.kt
@@ -16,7 +16,6 @@
package com.android.wm.shell.scenarios
-import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.Rotation
@@ -31,20 +30,17 @@
import org.junit.After
import org.junit.Assume
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.BlockJUnit4ClassRunner
/**
* Base test for opening recent apps overview from desktop mode.
*
* Navigation mode can be passed as a constructor parameter, by default it is set to gesture navigation.
*/
-@RunWith(BlockJUnit4ClassRunner::class)
-@Postsubmit
-open class SwitchToOverviewFromDesktop
-@JvmOverloads
+@Ignore("Base Test Class")
+abstract class SwitchToOverviewFromDesktop
constructor(val navigationMode: NavBar = NavBar.MODE_GESTURAL) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
diff --git a/libs/WindowManager/Shell/tests/flicker/Android.bp b/libs/WindowManager/Shell/tests/flicker/Android.bp
index 7305f49..58559ac 100644
--- a/libs/WindowManager/Shell/tests/flicker/Android.bp
+++ b/libs/WindowManager/Shell/tests/flicker/Android.bp
@@ -59,7 +59,7 @@
enabled: false,
},
test_suites: ["device-tests"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"wm-shell-flicker-utils",
"androidx.test.ext.junit",
diff --git a/libs/WindowManager/Shell/tests/unittest/Android.bp b/libs/WindowManager/Shell/tests/unittest/Android.bp
index 006a4a9..049a5a0 100644
--- a/libs/WindowManager/Shell/tests/unittest/Android.bp
+++ b/libs/WindowManager/Shell/tests/unittest/Android.bp
@@ -66,9 +66,9 @@
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
index 413e495..e514dc3 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
@@ -49,7 +49,6 @@
import android.os.RemoteException;
import android.util.SparseArray;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.window.ITaskOrganizer;
import android.window.ITaskOrganizerController;
import android.window.TaskAppearedInfo;
@@ -169,7 +168,7 @@
public void testTaskLeashReleasedAfterVanished() throws RemoteException {
assumeFalse(ENABLE_SHELL_TRANSITIONS);
RunningTaskInfo taskInfo = createTaskInfo(/* taskId= */ 1, WINDOWING_MODE_MULTI_WINDOW);
- SurfaceControl taskLeash = new SurfaceControl.Builder(new SurfaceSession())
+ SurfaceControl taskLeash = new SurfaceControl.Builder()
.setName("task").build();
mOrganizer.registerOrganizer();
mOrganizer.onTaskAppeared(taskInfo, taskLeash);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java
index 1e4b8b6..b53ea38 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java
@@ -692,6 +692,8 @@
mBackTransitionHandler.startAnimation(mockBinder, tInfo, st, ft, callback);
verify(mBackTransitionHandler).handlePrepareTransition(
eq(tInfo), eq(st), eq(ft), eq(callback));
+
+ mBackTransitionHandler.onAnimationFinished();
final TransitionInfo.Change openToClose = createAppChange(openTaskId, TRANSIT_CLOSE,
FLAG_BACK_GESTURE_ANIMATED);
tInfo2 = createTransitionInfo(TRANSIT_CLOSE_PREPARE_BACK_NAVIGATION, openToClose);
@@ -700,7 +702,6 @@
mBackTransitionHandler.mergeAnimation(mBackTransitionHandler.mClosePrepareTransition,
tInfo2, st, mock(IBinder.class), mergeCallback);
assertTrue("Change should be consumed", tInfo2.getChanges().isEmpty());
- mBackTransitionHandler.onAnimationFinished();
verify(callback).onTransitionFinished(any());
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java
index 4d0348b..9b019dd 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java
@@ -177,6 +177,31 @@
assertEquals(1, finishCallbackCalled.getCount());
}
+ @Test
+ public void testOnBackInvokedFinishCallbackNotInvokedWhenRemoved() throws InterruptedException {
+ // Give the animator some progress.
+ final BackMotionEvent backEvent = backMotionEventFrom(100, mTargetProgress);
+ mMainThreadHandler.post(
+ () -> mProgressAnimator.onBackProgressed(backEvent));
+ mTargetProgressCalled.await(1, TimeUnit.SECONDS);
+ assertNotNull(mReceivedBackEvent);
+
+ // Trigger back invoked animation
+ CountDownLatch finishCallbackCalled = new CountDownLatch(1);
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(
+ () -> mProgressAnimator.onBackInvoked(finishCallbackCalled::countDown));
+
+ // remove onBackCancelled finishCallback (while progress is still animating to 0)
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(
+ () -> mProgressAnimator.removeOnBackInvokedFinishCallback());
+
+ // call reset (which triggers the finishCallback invocation, if one is present)
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> mProgressAnimator.reset());
+
+ // verify that finishCallback is not invoked
+ assertEquals(1, finishCallbackCalled.getCount());
+ }
+
private void onGestureProgress(BackEvent backEvent) {
if (mTargetProgress == backEvent.getProgress()) {
mReceivedBackEvent = backEvent;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
index 09fcd8b..82b3a7d 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
@@ -20,8 +20,6 @@
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_END_AND_DISMISS;
-import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_START_AND_DISMISS;
import static com.google.common.truth.Truth.assertThat;
@@ -150,8 +148,8 @@
@UiThreadTest
public void testSnapToDismissStart() {
// verify it callbacks properly when the snap target indicates dismissing split.
- DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0 /* position */,
- SNAP_TO_START_AND_DISMISS);
+ DividerSnapAlgorithm.SnapTarget snapTarget =
+ mSplitLayout.mDividerSnapAlgorithm.getDismissStartTarget();
mSplitLayout.snapToTarget(mSplitLayout.getDividerPosition(), snapTarget);
waitDividerFlingFinished();
@@ -162,8 +160,8 @@
@UiThreadTest
public void testSnapToDismissEnd() {
// verify it callbacks properly when the snap target indicates dismissing split.
- DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0 /* position */,
- SNAP_TO_END_AND_DISMISS);
+ DividerSnapAlgorithm.SnapTarget snapTarget =
+ mSplitLayout.mDividerSnapAlgorithm.getDismissEndTarget();
mSplitLayout.snapToTarget(mSplitLayout.getDividerPosition(), snapTarget);
waitDividerFlingFinished();
@@ -203,9 +201,4 @@
new Rect(0, 0, 1080, 2160));
return configuration;
}
-
- private static DividerSnapAlgorithm.SnapTarget getSnapTarget(int position, int flag) {
- return new DividerSnapAlgorithm.SnapTarget(
- position /* position */, position /* taskPosition */, flag);
- }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicatorTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicatorTest.kt
index f558e87..2b7f86f 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicatorTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicatorTest.kt
@@ -22,6 +22,7 @@
import android.testing.AndroidTestingRunner
import android.view.SurfaceControl
import androidx.test.filters.SmallTest
+import com.android.internal.policy.SystemBarUtils
import com.android.wm.shell.R
import com.android.wm.shell.RootTaskDisplayAreaOrganizer
import com.android.wm.shell.ShellTestCase
@@ -67,8 +68,7 @@
createVisualIndicator(DesktopModeVisualIndicator.DragStartState.FROM_FREEFORM)
testRegion = visualIndicator.calculateFullscreenRegion(displayLayout, CAPTION_HEIGHT)
- val transitionHeight = context.resources.getDimensionPixelSize(
- R.dimen.desktop_mode_transition_region_thickness)
+ val transitionHeight = SystemBarUtils.getStatusBarHeight(context)
val toFullscreenScale = mContext.resources.getFloat(
R.dimen.desktop_mode_fullscreen_region_scale
)
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithmTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithmTest.java
index 8c7b47e..e3798e9 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithmTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithmTest.java
@@ -109,6 +109,7 @@
final Rect pipBounds = new Rect(0, 0, 100, 100);
final Rect keepClearRect = new Rect(50, 50, 150, 150);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
when(mMockPipBoundsState.getRestrictedKeepClearAreas()).thenReturn(Set.of(keepClearRect));
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
@@ -127,6 +128,7 @@
final Rect pipBounds = new Rect(0, 0, 100, 100);
final Rect keepClearRect = new Rect(100, 100, 150, 150);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
when(mMockPipBoundsState.getRestrictedKeepClearAreas()).thenReturn(Set.of(keepClearRect));
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
@@ -145,6 +147,7 @@
final Rect pipBounds = new Rect(0, 0, 100, 100);
final Rect keepClearRect = new Rect(50, 50, 150, 150);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
when(mMockPipBoundsState.isStashed()).thenReturn(true);
when(mMockPipBoundsState.getRestrictedKeepClearAreas()).thenReturn(Set.of(keepClearRect));
doAnswer(invocation -> {
@@ -164,6 +167,7 @@
final Rect pipBounds = new Rect(0, 0, 100, 100);
final Rect keepClearRect = new Rect(100, 100, 150, 150);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
when(mMockPipBoundsState.isStashed()).thenReturn(true);
when(mMockPipBoundsState.getRestrictedKeepClearAreas()).thenReturn(Set.of(keepClearRect));
doAnswer(invocation -> {
@@ -185,6 +189,7 @@
final Rect expected = new Rect(
0, DISPLAY_BOUNDS.bottom - 100, 100, DISPLAY_BOUNDS.bottom);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
arg0.set(DISPLAY_BOUNDS);
@@ -205,6 +210,7 @@
final Rect expected = new Rect(
0, DISPLAY_BOUNDS.bottom - 100, 100, DISPLAY_BOUNDS.bottom);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
arg0.set(DISPLAY_BOUNDS);
@@ -227,6 +233,7 @@
DISPLAY_BOUNDS.right - 100, DISPLAY_BOUNDS.bottom - 100,
DISPLAY_BOUNDS.right, DISPLAY_BOUNDS.bottom);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
arg0.set(DISPLAY_BOUNDS);
@@ -249,6 +256,7 @@
DISPLAY_BOUNDS.right - 100, DISPLAY_BOUNDS.bottom - 100,
DISPLAY_BOUNDS.right, DISPLAY_BOUNDS.bottom);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
arg0.set(DISPLAY_BOUNDS);
@@ -269,6 +277,7 @@
final Rect expected = new Rect(
0, DISPLAY_BOUNDS.bottom - 100, 100, DISPLAY_BOUNDS.bottom);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
when(mMockPipBoundsState.isStashed()).thenReturn(true);
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
@@ -289,6 +298,7 @@
final Rect expected = new Rect(
0, DISPLAY_BOUNDS.bottom - 100, 100, DISPLAY_BOUNDS.bottom);
when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(new Rect(0, 0, 0, 0));
when(mMockPipBoundsState.isStashed()).thenReturn(true);
doAnswer(invocation -> {
Rect arg0 = invocation.getArgument(0);
@@ -301,4 +311,40 @@
assertEquals(expected, outBounds);
}
+
+ @Test
+ public void adjust_restoreBoundsPresent_appliesRestoreBounds() {
+ final Rect pipBounds = new Rect(0, 0, 100, 100);
+ final Rect restoreBounds = new Rect(50, 50, 150, 150);
+ when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(restoreBounds);
+ when(mMockPipBoundsState.hasUserMovedPip()).thenReturn(true);
+ doAnswer(invocation -> {
+ Rect arg0 = invocation.getArgument(0);
+ arg0.set(DISPLAY_BOUNDS);
+ return null;
+ }).when(mMockPipBoundsAlgorithm).getInsetBounds(any(Rect.class));
+
+ final Rect outBounds = mPipKeepClearAlgorithm.adjust(
+ mMockPipBoundsState, mMockPipBoundsAlgorithm);
+ assertEquals(restoreBounds, outBounds);
+ }
+
+ @Test
+ public void adjust_restoreBoundsCleared_boundsUnchanged() {
+ final Rect pipBounds = new Rect(0, 0, 100, 100);
+ final Rect restoreBounds = new Rect(0, 0, 0, 0);
+ when(mMockPipBoundsState.getBounds()).thenReturn(pipBounds);
+ when(mMockPipBoundsState.getRestoreBounds()).thenReturn(restoreBounds);
+ when(mMockPipBoundsState.hasUserMovedPip()).thenReturn(true);
+ doAnswer(invocation -> {
+ Rect arg0 = invocation.getArgument(0);
+ arg0.set(DISPLAY_BOUNDS);
+ return null;
+ }).when(mMockPipBoundsAlgorithm).getInsetBounds(any(Rect.class));
+
+ final Rect outBounds = mPipKeepClearAlgorithm.adjust(
+ mMockPipBoundsState, mMockPipBoundsAlgorithm);
+ assertEquals(pipBounds, outBounds);
+ }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/MainStageTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/MainStageTests.java
deleted file mode 100644
index b1befc4..0000000
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/MainStageTests.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.wm.shell.splitscreen;
-
-import static android.view.Display.DEFAULT_DISPLAY;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import android.app.ActivityManager;
-import android.view.SurfaceControl;
-import android.view.SurfaceSession;
-import android.window.WindowContainerTransaction;
-
-import androidx.test.annotation.UiThreadTest;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.launcher3.icons.IconProvider;
-import com.android.wm.shell.ShellTaskOrganizer;
-import com.android.wm.shell.ShellTestCase;
-import com.android.wm.shell.TestRunningTaskInfoBuilder;
-import com.android.wm.shell.common.SyncTransactionQueue;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import java.util.Optional;
-
-/** Tests for {@link MainStage} */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class MainStageTests extends ShellTestCase {
- @Mock private ShellTaskOrganizer mTaskOrganizer;
- @Mock private StageTaskListener.StageListenerCallbacks mCallbacks;
- @Mock private SyncTransactionQueue mSyncQueue;
- @Mock private ActivityManager.RunningTaskInfo mRootTaskInfo;
- @Mock private SurfaceControl mRootLeash;
- @Mock private IconProvider mIconProvider;
- private WindowContainerTransaction mWct = new WindowContainerTransaction();
- private SurfaceSession mSurfaceSession = new SurfaceSession();
- private MainStage mMainStage;
-
- @Before
- @UiThreadTest
- public void setup() {
- MockitoAnnotations.initMocks(this);
- mRootTaskInfo = new TestRunningTaskInfoBuilder().build();
- mMainStage = new MainStage(mContext, mTaskOrganizer, DEFAULT_DISPLAY, mCallbacks,
- mSyncQueue, mSurfaceSession, mIconProvider, Optional.empty());
- mMainStage.onTaskAppeared(mRootTaskInfo, mRootLeash);
- }
-
- @Test
- public void testActiveDeactivate() {
- mMainStage.activate(mWct, true /* reparent */);
- assertThat(mMainStage.isActive()).isTrue();
-
- mMainStage.deactivate(mWct);
- assertThat(mMainStage.isActive()).isFalse();
- }
-}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTestUtils.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTestUtils.java
index 4de2278..66dcef6 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTestUtils.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTestUtils.java
@@ -24,7 +24,6 @@
import android.graphics.Rect;
import android.os.Handler;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import com.android.dx.mockito.inline.extended.ExtendedMockito;
import com.android.wm.shell.ShellTaskOrganizer;
@@ -74,10 +73,10 @@
final SurfaceControl mRootLeash;
TestStageCoordinator(Context context, int displayId, SyncTransactionQueue syncQueue,
- ShellTaskOrganizer taskOrganizer, MainStage mainStage, StageTaskListener sideStage,
- DisplayController displayController, DisplayImeController imeController,
- DisplayInsetsController insetsController, SplitLayout splitLayout,
- Transitions transitions, TransactionPool transactionPool,
+ ShellTaskOrganizer taskOrganizer, StageTaskListener mainStage,
+ StageTaskListener sideStage, DisplayController displayController,
+ DisplayImeController imeController, DisplayInsetsController insetsController,
+ SplitLayout splitLayout, Transitions transitions, TransactionPool transactionPool,
ShellExecutor mainExecutor, Handler mainHandler,
Optional<RecentTasksController> recentTasks,
LaunchAdjacentController launchAdjacentController,
@@ -89,7 +88,7 @@
// Prepare root task for testing.
mRootTask = new TestRunningTaskInfoBuilder().build();
- mRootLeash = new SurfaceControl.Builder(new SurfaceSession()).setName("test").build();
+ mRootLeash = new SurfaceControl.Builder().setName("test").build();
onTaskAppeared(mRootTask, mRootLeash);
}
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java
index e167433..ce3944a 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java
@@ -53,7 +53,6 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.window.IRemoteTransition;
import android.window.RemoteTransition;
import android.window.TransitionInfo;
@@ -106,7 +105,6 @@
@Mock private DisplayInsetsController mDisplayInsetsController;
@Mock private TransactionPool mTransactionPool;
@Mock private Transitions mTransitions;
- @Mock private SurfaceSession mSurfaceSession;
@Mock private IconProvider mIconProvider;
@Mock private WindowDecorViewModel mWindowDecorViewModel;
@Mock private ShellExecutor mMainExecutor;
@@ -116,7 +114,7 @@
@Mock private SplitScreen.SplitInvocationListener mInvocationListener;
private final TestShellExecutor mTestShellExecutor = new TestShellExecutor();
private SplitLayout mSplitLayout;
- private MainStage mMainStage;
+ private StageTaskListener mMainStage;
private StageTaskListener mSideStage;
private StageCoordinator mStageCoordinator;
private SplitScreenTransitions mSplitScreenTransitions;
@@ -133,12 +131,12 @@
doReturn(mockExecutor).when(mTransitions).getAnimExecutor();
doReturn(mock(SurfaceControl.Transaction.class)).when(mTransactionPool).acquire();
mSplitLayout = SplitTestUtils.createMockSplitLayout();
- mMainStage = spy(new MainStage(mContext, mTaskOrganizer, DEFAULT_DISPLAY, mock(
- StageTaskListener.StageListenerCallbacks.class), mSyncQueue, mSurfaceSession,
+ mMainStage = spy(new StageTaskListener(mContext, mTaskOrganizer, DEFAULT_DISPLAY, mock(
+ StageTaskListener.StageListenerCallbacks.class), mSyncQueue,
mIconProvider, Optional.of(mWindowDecorViewModel)));
mMainStage.onTaskAppeared(new TestRunningTaskInfoBuilder().build(), createMockSurface());
mSideStage = spy(new StageTaskListener(mContext, mTaskOrganizer, DEFAULT_DISPLAY, mock(
- StageTaskListener.StageListenerCallbacks.class), mSyncQueue, mSurfaceSession,
+ StageTaskListener.StageListenerCallbacks.class), mSyncQueue,
mIconProvider, Optional.of(mWindowDecorViewModel)));
mSideStage.onTaskAppeared(new TestRunningTaskInfoBuilder().build(), createMockSurface());
mStageCoordinator = new SplitTestUtils.TestStageCoordinator(mContext, DEFAULT_DISPLAY,
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java
index c9e1414..a6c16c4 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java
@@ -50,7 +50,6 @@
import android.os.Handler;
import android.os.Looper;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.window.RemoteTransition;
import android.window.WindowContainerTransaction;
@@ -97,7 +96,7 @@
@Mock
private SyncTransactionQueue mSyncQueue;
@Mock
- private MainStage mMainStage;
+ private StageTaskListener mMainStage;
@Mock
private StageTaskListener mSideStage;
@Mock
@@ -119,7 +118,6 @@
private final Rect mBounds2 = new Rect(5, 10, 15, 20);
private final Rect mRootBounds = new Rect(0, 0, 45, 60);
- private SurfaceSession mSurfaceSession = new SurfaceSession();
private SurfaceControl mRootLeash;
private SurfaceControl mDividerLeash;
private ActivityManager.RunningTaskInfo mRootTask;
@@ -139,7 +137,7 @@
mDisplayInsetsController, mSplitLayout, mTransitions, mTransactionPool,
mMainExecutor, mMainHandler, Optional.empty(), mLaunchAdjacentController,
Optional.empty()));
- mDividerLeash = new SurfaceControl.Builder(mSurfaceSession).setName("fakeDivider").build();
+ mDividerLeash = new SurfaceControl.Builder().setName("fakeDivider").build();
when(mSplitLayout.getBounds1()).thenReturn(mBounds1);
when(mSplitLayout.getBounds2()).thenReturn(mBounds2);
@@ -149,7 +147,7 @@
when(mSplitLayout.getDividerLeash()).thenReturn(mDividerLeash);
mRootTask = new TestRunningTaskInfoBuilder().build();
- mRootLeash = new SurfaceControl.Builder(mSurfaceSession).setName("test").build();
+ mRootLeash = new SurfaceControl.Builder().setName("test").build();
mStageCoordinator.onTaskAppeared(mRootTask, mRootLeash);
mSideStage.mRootTaskInfo = new TestRunningTaskInfoBuilder().build();
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageTaskListenerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageTaskListenerTests.java
index acd612e..b7b7d0d 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageTaskListenerTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageTaskListenerTests.java
@@ -32,7 +32,6 @@
import android.app.ActivityManager;
import android.os.SystemProperties;
import android.view.SurfaceControl;
-import android.view.SurfaceSession;
import android.window.WindowContainerTransaction;
import androidx.test.annotation.UiThreadTest;
@@ -82,7 +81,6 @@
private WindowContainerTransaction mWct;
@Captor
private ArgumentCaptor<SyncTransactionQueue.TransactionRunnable> mRunnableCaptor;
- private SurfaceSession mSurfaceSession = new SurfaceSession();
private SurfaceControl mSurfaceControl;
private ActivityManager.RunningTaskInfo mRootTask;
private StageTaskListener mStageTaskListener;
@@ -97,12 +95,11 @@
DEFAULT_DISPLAY,
mCallbacks,
mSyncQueue,
- mSurfaceSession,
mIconProvider,
Optional.of(mWindowDecorViewModel));
mRootTask = new TestRunningTaskInfoBuilder().build();
mRootTask.parentTaskId = INVALID_TASK_ID;
- mSurfaceControl = new SurfaceControl.Builder(mSurfaceSession).setName("test").build();
+ mSurfaceControl = new SurfaceControl.Builder().setName("test").build();
mStageTaskListener.onTaskAppeared(mRootTask, mSurfaceControl);
}
@@ -199,4 +196,13 @@
assertThat(mStageTaskListener.removeTask(task.taskId, null, mWct)).isTrue();
verify(mWct).reparent(eq(task.token), isNull(), eq(false));
}
+
+ @Test
+ public void testActiveDeactivate() {
+ mStageTaskListener.activate(mWct, true /* reparent */);
+ assertThat(mStageTaskListener.isActive()).isTrue();
+
+ mStageTaskListener.deactivate(mWct);
+ assertThat(mStageTaskListener.isActive()).isFalse();
+ }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java
index 1984885..17fd95b 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java
@@ -49,7 +49,6 @@
import android.testing.TestableLooper;
import android.view.SurfaceControl;
import android.view.SurfaceHolder;
-import android.view.SurfaceSession;
import android.view.ViewTreeObserver;
import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;
@@ -95,7 +94,6 @@
Looper mViewLooper;
TestHandler mViewHandler;
- SurfaceSession mSession;
SurfaceControl mLeash;
Context mContext;
@@ -106,7 +104,7 @@
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- mLeash = new SurfaceControl.Builder(mSession)
+ mLeash = new SurfaceControl.Builder()
.setName("test")
.build();
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/HomeTransitionObserverTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/HomeTransitionObserverTest.java
index f51a960..8f49de0 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/HomeTransitionObserverTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/HomeTransitionObserverTest.java
@@ -20,6 +20,7 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.window.TransitionInfo.FLAG_BACK_GESTURE_ANIMATED;
@@ -39,6 +40,7 @@
import android.os.Looper;
import android.os.RemoteException;
import android.platform.test.annotations.RequiresFlagsDisabled;
+import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.view.SurfaceControl;
@@ -213,6 +215,35 @@
verify(mListener, times(1)).onHomeVisibilityChanged(true);
}
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_MIGRATE_PREDICTIVE_BACK_TRANSITION)
+ public void testHomeActivityWithBackGestureNotifiesHomeIsVisibleAfterClose()
+ throws RemoteException {
+ TransitionInfo info = mock(TransitionInfo.class);
+ TransitionInfo.Change change = mock(TransitionInfo.Change.class);
+ ActivityManager.RunningTaskInfo taskInfo = mock(ActivityManager.RunningTaskInfo.class);
+ when(change.getTaskInfo()).thenReturn(taskInfo);
+ when(info.getChanges()).thenReturn(new ArrayList<>(List.of(change)));
+ when(info.getType()).thenReturn(TRANSIT_PREPARE_BACK_NAVIGATION);
+
+ when(change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)).thenReturn(true);
+ setupTransitionInfo(taskInfo, change, ACTIVITY_TYPE_HOME, TRANSIT_OPEN, true);
+
+ mHomeTransitionObserver.onTransitionReady(mock(IBinder.class),
+ info,
+ mock(SurfaceControl.Transaction.class),
+ mock(SurfaceControl.Transaction.class));
+ verify(mListener, times(0)).onHomeVisibilityChanged(anyBoolean());
+
+ when(info.getType()).thenReturn(TRANSIT_TO_BACK);
+ setupTransitionInfo(taskInfo, change, ACTIVITY_TYPE_HOME, TRANSIT_CHANGE, true);
+ mHomeTransitionObserver.onTransitionReady(mock(IBinder.class),
+ info,
+ mock(SurfaceControl.Transaction.class),
+ mock(SurfaceControl.Transaction.class));
+ verify(mListener, times(1)).onHomeVisibilityChanged(true);
+ }
+
/**
* Helper class to initialize variables for the rest.
*/
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java
index 7c63fda..7937a84 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java
@@ -76,7 +76,6 @@
import android.platform.test.flag.junit.SetFlagsRule;
import android.util.ArraySet;
import android.util.Pair;
-import android.view.IRecentsAnimationRunner;
import android.view.Surface;
import android.view.SurfaceControl;
import android.window.IRemoteTransition;
@@ -107,6 +106,7 @@
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.ShellExecutor;
+import com.android.wm.shell.recents.IRecentsAnimationRunner;
import com.android.wm.shell.recents.RecentTasksController;
import com.android.wm.shell.recents.RecentsTransitionHandler;
import com.android.wm.shell.shared.ShellSharedConstants;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt
index be0549b..2c805e8 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt
@@ -34,6 +34,7 @@
import android.hardware.input.InputManager
import android.net.Uri
import android.os.Handler
+import android.os.SystemClock
import android.os.UserHandle
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
@@ -52,10 +53,12 @@
import android.view.InsetsSource
import android.view.InsetsState
import android.view.KeyEvent
+import android.view.MotionEvent
import android.view.Surface
import android.view.SurfaceControl
import android.view.SurfaceView
import android.view.View
+import android.view.ViewRootImpl
import android.view.WindowInsets.Type.statusBars
import android.widget.Toast
import android.window.WindowContainerTransaction
@@ -73,6 +76,7 @@
import com.android.wm.shell.TestRunningTaskInfoBuilder
import com.android.wm.shell.TestShellExecutor
import com.android.wm.shell.apptoweb.AppToWebGenericLinksParser
+import com.android.wm.shell.apptoweb.AssistContentRequester
import com.android.wm.shell.common.DisplayChangeController
import com.android.wm.shell.common.DisplayController
import com.android.wm.shell.common.DisplayInsetsController
@@ -165,6 +169,7 @@
@Mock private lateinit var mockInteractionJankMonitor: InteractionJankMonitor
@Mock private lateinit var mockGenericLinksParser: AppToWebGenericLinksParser
@Mock private lateinit var mockUserHandle: UserHandle
+ @Mock private lateinit var mockAssistContentRequester: AssistContentRequester
@Mock private lateinit var mockToast: Toast
private val bgExecutor = TestShellExecutor()
@Mock private lateinit var mockMultiInstanceHelper: MultiInstanceHelper
@@ -172,6 +177,10 @@
@Mock private lateinit var mockFreeformTaskTransitionStarter: FreeformTaskTransitionStarter
@Mock private lateinit var mockActivityOrientationChangeHandler:
DesktopActivityOrientationChangeHandler
+ @Mock private lateinit var mockInputManager: InputManager
+ @Mock private lateinit var mockTaskPositionerFactory:
+ DesktopModeWindowDecorViewModel.TaskPositionerFactory
+ @Mock private lateinit var mockTaskPositioner: TaskPositioner
private lateinit var spyContext: TestableContext
private val transactionFactory = Supplier<SurfaceControl.Transaction> {
@@ -201,6 +210,7 @@
doNothing().`when`(spyContext).startActivity(any())
shellInit = ShellInit(mockShellExecutor)
windowDecorByTaskIdSpy.clear()
+ spyContext.addMockSystemService(InputManager::class.java, mockInputManager)
desktopModeWindowDecorViewModel = DesktopModeWindowDecorViewModel(
spyContext,
mockShellExecutor,
@@ -218,6 +228,7 @@
mockTransitions,
Optional.of(mockDesktopTasksController),
mockGenericLinksParser,
+ mockAssistContentRequester,
mockMultiInstanceHelper,
mockDesktopModeWindowDecorFactory,
mockInputMonitorFactory,
@@ -226,12 +237,15 @@
windowDecorByTaskIdSpy,
mockInteractionJankMonitor,
Optional.of(mockTasksLimiter),
- Optional.of(mockActivityOrientationChangeHandler)
+ Optional.of(mockActivityOrientationChangeHandler),
+ mockTaskPositionerFactory
)
desktopModeWindowDecorViewModel.setSplitScreenController(mockSplitScreenController)
whenever(mockDisplayController.getDisplayLayout(any())).thenReturn(mockDisplayLayout)
whenever(mockDisplayLayout.stableInsets()).thenReturn(STABLE_INSETS)
whenever(mockInputMonitorFactory.create(any(), any())).thenReturn(mockInputMonitor)
+ whenever(mockTaskPositionerFactory.create(any(), any(), any(), any(), any(), any(), any()))
+ .thenReturn(mockTaskPositioner)
doReturn(mockToast).`when` { Toast.makeText(any(), anyInt(), anyInt()) }
@@ -1055,6 +1069,55 @@
verify(wct, never()).setBounds(eq(thirdTask.token), any())
}
+ @Test
+ fun testCloseButtonInFreeform_closeWindow_ignoreMoveEventsWithoutBoundsChange() {
+ val onClickListenerCaptor = forClass(View.OnClickListener::class.java)
+ as ArgumentCaptor<View.OnClickListener>
+ val onTouchListenerCaptor = forClass(View.OnTouchListener::class.java)
+ as ArgumentCaptor<View.OnTouchListener>
+ val decor = createOpenTaskDecoration(
+ windowingMode = WINDOWING_MODE_FREEFORM,
+ onCaptionButtonClickListener = onClickListenerCaptor,
+ onCaptionButtonTouchListener = onTouchListenerCaptor
+ )
+
+ whenever(mockTaskPositioner.onDragPositioningStart(any(), any(), any()))
+ .thenReturn(INITIAL_BOUNDS)
+ whenever(mockTaskPositioner.onDragPositioningMove(any(), any()))
+ .thenReturn(INITIAL_BOUNDS)
+ whenever(mockTaskPositioner.onDragPositioningEnd(any(), any()))
+ .thenReturn(INITIAL_BOUNDS)
+
+ val view = mock(View::class.java)
+ whenever(view.id).thenReturn(R.id.close_window)
+ val viewRootImpl = mock(ViewRootImpl::class.java)
+ whenever(view.getViewRootImpl()).thenReturn(viewRootImpl)
+ whenever(viewRootImpl.getInputToken()).thenReturn(null)
+
+ desktopModeWindowDecorViewModel
+ .setFreeformTaskTransitionStarter(mockFreeformTaskTransitionStarter)
+
+ onTouchListenerCaptor.value.onTouch(view,
+ MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(),
+ MotionEvent.ACTION_DOWN, /* x= */ 0f, /* y= */ 0f, /* metaState= */ 0))
+ onTouchListenerCaptor.value.onTouch(view,
+ MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(),
+ MotionEvent.ACTION_MOVE, /* x= */ 0f, /* y= */ 0f, /* metaState= */ 0))
+ onTouchListenerCaptor.value.onTouch(view,
+ MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(),
+ MotionEvent.ACTION_UP, /* x= */ 0f, /* y= */ 0f, /* metaState= */ 0))
+ onClickListenerCaptor.value.onClick(view)
+
+ val transactionCaptor = argumentCaptor<WindowContainerTransaction>()
+ verify(mockFreeformTaskTransitionStarter).startRemoveTransition(transactionCaptor.capture())
+ val wct = transactionCaptor.firstValue
+
+ assertEquals(1, wct.getHierarchyOps().size)
+ assertEquals(HierarchyOp.HIERARCHY_OP_TYPE_REMOVE_TASK,
+ wct.getHierarchyOps().get(0).getType())
+ assertEquals(decor.mTaskInfo.token.asBinder(), wct.getHierarchyOps().get(0).getContainer())
+ }
+
private fun createOpenTaskDecoration(
@WindowingMode windowingMode: Int,
taskSurface: SurfaceControl = SurfaceControl(),
@@ -1073,7 +1136,9 @@
onOpenInBrowserClickListener: ArgumentCaptor<Consumer<Uri>> =
forClass(Consumer::class.java) as ArgumentCaptor<Consumer<Uri>>,
onCaptionButtonClickListener: ArgumentCaptor<View.OnClickListener> =
- forClass(View.OnClickListener::class.java) as ArgumentCaptor<View.OnClickListener>
+ forClass(View.OnClickListener::class.java) as ArgumentCaptor<View.OnClickListener>,
+ onCaptionButtonTouchListener: ArgumentCaptor<View.OnTouchListener> =
+ forClass(View.OnTouchListener::class.java) as ArgumentCaptor<View.OnTouchListener>
): DesktopModeWindowDecoration {
val decor = setUpMockDecorationForTask(createTask(windowingMode = windowingMode))
onTaskOpening(decor.mTaskInfo, taskSurface)
@@ -1085,7 +1150,8 @@
verify(decor).setOnToSplitScreenClickListener(onToSplitScreenClickListenerCaptor.capture())
verify(decor).setOpenInBrowserClickListener(onOpenInBrowserClickListener.capture())
verify(decor).setCaptionListeners(
- onCaptionButtonClickListener.capture(), any(), any(), any())
+ onCaptionButtonClickListener.capture(), onCaptionButtonTouchListener.capture(),
+ any(), any())
return decor
}
@@ -1131,7 +1197,7 @@
whenever(
mockDesktopModeWindowDecorFactory.create(
any(), any(), any(), any(), any(), eq(task), any(), any(), any(), any(), any(),
- any(), any(), any())
+ any(), any(), any(), any())
).thenReturn(decoration)
decoration.mTaskInfo = task
whenever(decoration.isFocused).thenReturn(task.isFocused)
@@ -1172,5 +1238,6 @@
companion object {
private const val TAG = "DesktopModeWindowDecorViewModelTests"
private val STABLE_INSETS = Rect(0, 100, 0, 0)
+ private val INITIAL_BOUNDS = Rect(0, 0, 100, 100)
}
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java
index 258c860..b9e542a0 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java
@@ -46,6 +46,7 @@
import static org.mockito.Mockito.when;
import android.app.ActivityManager;
+import android.app.assist.AssistContent;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
@@ -88,6 +89,7 @@
import com.android.wm.shell.TestRunningTaskInfoBuilder;
import com.android.wm.shell.TestShellExecutor;
import com.android.wm.shell.apptoweb.AppToWebGenericLinksParser;
+import com.android.wm.shell.apptoweb.AssistContentRequester;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.MultiInstanceHelper;
import com.android.wm.shell.common.ShellExecutor;
@@ -133,6 +135,7 @@
private static final Uri TEST_URI1 = Uri.parse("https://www.google.com/");
private static final Uri TEST_URI2 = Uri.parse("https://docs.google.com/");
+ private static final Uri TEST_URI3 = Uri.parse("https://slides.google.com/");
@Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(DEVICE_DEFAULT);
@@ -175,6 +178,8 @@
@Mock
private WindowManager mMockWindowManager;
@Mock
+ private AssistContentRequester mMockAssistContentRequester;
+ @Mock
private HandleMenu mMockHandleMenu;
@Mock
private HandleMenuFactory mMockHandleMenuFactory;
@@ -189,7 +194,8 @@
private SurfaceControl.Transaction mMockTransaction;
private StaticMockitoSession mMockitoSession;
private TestableContext mTestableContext;
- private ShellExecutor mBgExecutor = new TestShellExecutor();
+ private final ShellExecutor mBgExecutor = new TestShellExecutor();
+ private final AssistContent mAssistContent = new AssistContent();
/** Set up run before test class. */
@BeforeClass
@@ -673,10 +679,11 @@
public void capturedLink_handleMenuBrowserLinkSetToCapturedLinkIfValid() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
final DesktopModeWindowDecoration decor = createWindowDecoration(
- taskInfo, TEST_URI1 /* captured link */, TEST_URI2 /* generic link */);
+ taskInfo, TEST_URI1 /* captured link */, TEST_URI2 /* web uri */,
+ TEST_URI3 /* generic link */);
// Verify handle menu's browser link set as captured link
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
verifyHandleMenuCreated(TEST_URI1);
}
@@ -685,7 +692,8 @@
public void capturedLink_postsOnCapturedLinkExpiredRunnable() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
final DesktopModeWindowDecoration decor = createWindowDecoration(
- taskInfo, TEST_URI1 /* captured link */, null /* generic link */);
+ taskInfo, TEST_URI1 /* captured link */, null /* web uri */,
+ null /* generic link */);
final ArgumentCaptor<Runnable> runnableArgument = ArgumentCaptor.forClass(Runnable.class);
// Run runnable to set captured link to expired
@@ -694,7 +702,7 @@
// Verify captured link is no longer valid by verifying link is not set as handle menu
// browser link.
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
verifyHandleMenuCreated(null /* uri */);
}
@@ -703,7 +711,8 @@
public void capturedLink_capturedLinkNotResetToSameLink() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
final DesktopModeWindowDecoration decor = createWindowDecoration(
- taskInfo, TEST_URI1 /* captured link */, null /* generic link */);
+ taskInfo, TEST_URI1 /* captured link */, null /* web uri */,
+ null /* generic link */);
final ArgumentCaptor<Runnable> runnableArgument = ArgumentCaptor.forClass(Runnable.class);
// Run runnable to set captured link to expired
@@ -714,7 +723,7 @@
decor.relayout(taskInfo);
// Verify handle menu's browser link not set to captured link since link is expired
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
verifyHandleMenuCreated(null /* uri */);
}
@@ -723,11 +732,12 @@
public void capturedLink_capturedLinkStillUsedIfExpiredAfterHandleMenuCreation() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
final DesktopModeWindowDecoration decor = createWindowDecoration(
- taskInfo, TEST_URI1 /* captured link */, null /* generic link */);
+ taskInfo, TEST_URI1 /* captured link */, null /* web uri */,
+ null /* generic link */);
final ArgumentCaptor<Runnable> runnableArgument = ArgumentCaptor.forClass(Runnable.class);
// Create handle menu before link expires
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
// Run runnable to set captured link to expired
verify(mMockHandler).postDelayed(runnableArgument.capture(), anyLong());
@@ -735,7 +745,7 @@
// Verify handle menu's browser link is set to captured link since menu was opened before
// captured link expired
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
verifyHandleMenuCreated(TEST_URI1);
}
@@ -744,12 +754,13 @@
public void capturedLink_capturedLinkExpiresAfterClick() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
final DesktopModeWindowDecoration decor = createWindowDecoration(
- taskInfo, TEST_URI1 /* captured link */, null /* generic link */);
+ taskInfo, TEST_URI1 /* captured link */, null /* web uri */,
+ null /* generic link */);
final ArgumentCaptor<Function1<Uri, Unit>> openInBrowserCaptor =
ArgumentCaptor.forClass(Function1.class);
// Simulate menu opening and clicking open in browser button
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
verify(mMockHandleMenu).show(
any(),
any(),
@@ -763,7 +774,7 @@
// Verify handle menu's browser link not set to captured link since link not valid after
// open in browser clicked
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
verifyHandleMenuCreated(null /* uri */);
}
@@ -772,10 +783,11 @@
public void capturedLink_openInBrowserListenerCalledOnClick() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
final DesktopModeWindowDecoration decor = createWindowDecoration(
- taskInfo, TEST_URI1 /* captured link */, null /* generic link */);
+ taskInfo, TEST_URI1 /* captured link */, null /* web uri */,
+ null /* generic link */);
final ArgumentCaptor<Function1<Uri, Unit>> openInBrowserCaptor =
ArgumentCaptor.forClass(Function1.class);
- decor.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decor);
verify(mMockHandleMenu).show(
any(),
any(),
@@ -793,24 +805,38 @@
@Test
@EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_APP_TO_WEB)
- public void genericLink_genericLinkUsedWhenCapturedLinkUnavailable() {
+ public void webUriLink_webUriLinkUsedWhenCapturedLinkUnavailable() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
final DesktopModeWindowDecoration decor = createWindowDecoration(
- taskInfo, null /* captured link */, TEST_URI2 /* generic link */);
-
- // Verify handle menu's browser link set as generic link no captured link is available
- decor.createHandleMenu(mMockSplitScreenController);
+ taskInfo, null /* captured link */, TEST_URI2 /* web uri */,
+ TEST_URI3 /* generic link */);
+ // Verify handle menu's browser link set as web uri link when captured link is unavailable
+ createHandleMenu(decor);
verifyHandleMenuCreated(TEST_URI2);
}
@Test
+ @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_APP_TO_WEB)
+ public void genericLink_genericLinkUsedWhenCapturedLinkAndWebUriUnavailable() {
+ final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(true /* visible */);
+ final DesktopModeWindowDecoration decor = createWindowDecoration(
+ taskInfo, null /* captured link */, null /* web uri */,
+ TEST_URI3 /* generic link */);
+
+ // Verify handle menu's browser link set as generic link when captured link and web uri link
+ // are unavailable
+ createHandleMenu(decor);
+ verifyHandleMenuCreated(TEST_URI3);
+ }
+
+ @Test
public void handleMenu_onCloseMenuClick_closesMenu() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);
final DesktopModeWindowDecoration decoration = createWindowDecoration(taskInfo,
true /* relayout */);
final ArgumentCaptor<Function0<Unit>> closeClickListener =
ArgumentCaptor.forClass(Function0.class);
- decoration.createHandleMenu(mMockSplitScreenController);
+ createHandleMenu(decoration);
verify(mMockHandleMenu).show(
any(),
any(),
@@ -860,9 +886,10 @@
private DesktopModeWindowDecoration createWindowDecoration(
ActivityManager.RunningTaskInfo taskInfo, @Nullable Uri capturedLink,
- @Nullable Uri genericLink) {
+ @Nullable Uri webUri, @Nullable Uri genericLink) {
taskInfo.capturedLink = capturedLink;
taskInfo.capturedLinkTimestamp = System.currentTimeMillis();
+ mAssistContent.setWebUri(webUri);
final String genericLinkString = genericLink == null ? null : genericLink.toString();
doReturn(genericLinkString).when(mMockGenericLinksParser).getGenericLink(any());
// Relayout to set captured link
@@ -894,11 +921,10 @@
mContext, mMockDisplayController, mMockSplitScreenController,
mMockShellTaskOrganizer, taskInfo, mMockSurfaceControl, mMockHandler, mBgExecutor,
mMockChoreographer, mMockSyncQueue, mMockRootTaskDisplayAreaOrganizer,
- mMockGenericLinksParser, SurfaceControl.Builder::new, mMockTransactionSupplier,
- WindowContainerTransaction::new, SurfaceControl::new,
- new WindowManagerWrapper(mMockWindowManager),
- mMockSurfaceControlViewHostFactory, maximizeMenuFactory, mMockHandleMenuFactory,
- mMockMultiInstanceHelper);
+ mMockGenericLinksParser, mMockAssistContentRequester, SurfaceControl.Builder::new,
+ mMockTransactionSupplier, WindowContainerTransaction::new, SurfaceControl::new,
+ new WindowManagerWrapper(mMockWindowManager), mMockSurfaceControlViewHostFactory,
+ maximizeMenuFactory, mMockHandleMenuFactory, mMockMultiInstanceHelper);
windowDecor.setCaptionListeners(mMockTouchEventListener, mMockTouchEventListener,
mMockTouchEventListener, mMockTouchEventListener);
windowDecor.setExclusionRegionListener(mMockExclusionRegionListener);
@@ -926,6 +952,13 @@
}
+ private void createHandleMenu(@NonNull DesktopModeWindowDecoration decor) {
+ decor.createHandleMenu();
+ // Call DesktopModeWindowDecoration#onAssistContentReceived because decor waits to receive
+ // {@link AssistContent} before creating the menu
+ decor.onAssistContentReceived(mAssistContent);
+ }
+
private static boolean hasNoInputChannelFeature(RelayoutParams params) {
return (params.mInputFeatures & WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL)
!= 0;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeVeilTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeVeilTest.kt
index a07be79..e0d16aa 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeVeilTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeVeilTest.kt
@@ -97,7 +97,7 @@
.thenReturn(spyResizeVeilSurfaceBuilder)
doReturn(mockResizeVeilSurface).whenever(spyResizeVeilSurfaceBuilder).build()
whenever(mockSurfaceControlBuilderFactory
- .create(eq("Resize veil background of Task=" + taskInfo.taskId), any()))
+ .create(eq("Resize veil background of Task=" + taskInfo.taskId)))
.thenReturn(spyBackgroundSurfaceBuilder)
doReturn(mockBackgroundSurface).whenever(spyBackgroundSurfaceBuilder).build()
whenever(mockSurfaceControlBuilderFactory
diff --git a/libs/dream/lowlight/tests/Android.bp b/libs/dream/lowlight/tests/Android.bp
index 4254783..d3e1016 100644
--- a/libs/dream/lowlight/tests/Android.bp
+++ b/libs/dream/lowlight/tests/Android.bp
@@ -37,9 +37,9 @@
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/libs/hostgraphics/Android.bp b/libs/hostgraphics/Android.bp
index 09232b6..a58493a 100644
--- a/libs/hostgraphics/Android.bp
+++ b/libs/hostgraphics/Android.bp
@@ -7,6 +7,17 @@
default_applicable_licenses: ["frameworks_base_license"],
}
+cc_library_headers {
+ name: "libhostgraphics_headers",
+ host_supported: true,
+ export_include_dirs: ["include"],
+ target: {
+ windows: {
+ enabled: true,
+ },
+ },
+}
+
cc_library_host_static {
name: "libhostgraphics",
@@ -30,12 +41,13 @@
],
header_libs: [
+ "libhostgraphics_headers",
"libnativebase_headers",
"libnativedisplay_headers",
"libnativewindow_headers",
],
- export_include_dirs: ["."],
+ export_include_dirs: ["include"],
target: {
windows: {
diff --git a/libs/hostgraphics/gui/BufferItem.h b/libs/hostgraphics/include/gui/BufferItem.h
similarity index 100%
rename from libs/hostgraphics/gui/BufferItem.h
rename to libs/hostgraphics/include/gui/BufferItem.h
diff --git a/libs/hostgraphics/gui/BufferItemConsumer.h b/libs/hostgraphics/include/gui/BufferItemConsumer.h
similarity index 100%
rename from libs/hostgraphics/gui/BufferItemConsumer.h
rename to libs/hostgraphics/include/gui/BufferItemConsumer.h
diff --git a/libs/hostgraphics/gui/BufferQueue.h b/libs/hostgraphics/include/gui/BufferQueue.h
similarity index 100%
rename from libs/hostgraphics/gui/BufferQueue.h
rename to libs/hostgraphics/include/gui/BufferQueue.h
diff --git a/libs/hostgraphics/gui/ConsumerBase.h b/libs/hostgraphics/include/gui/ConsumerBase.h
similarity index 100%
rename from libs/hostgraphics/gui/ConsumerBase.h
rename to libs/hostgraphics/include/gui/ConsumerBase.h
diff --git a/libs/hostgraphics/gui/IGraphicBufferConsumer.h b/libs/hostgraphics/include/gui/IGraphicBufferConsumer.h
similarity index 100%
rename from libs/hostgraphics/gui/IGraphicBufferConsumer.h
rename to libs/hostgraphics/include/gui/IGraphicBufferConsumer.h
diff --git a/libs/hostgraphics/gui/IGraphicBufferProducer.h b/libs/hostgraphics/include/gui/IGraphicBufferProducer.h
similarity index 100%
rename from libs/hostgraphics/gui/IGraphicBufferProducer.h
rename to libs/hostgraphics/include/gui/IGraphicBufferProducer.h
diff --git a/libs/hostgraphics/gui/Surface.h b/libs/hostgraphics/include/gui/Surface.h
similarity index 100%
rename from libs/hostgraphics/gui/Surface.h
rename to libs/hostgraphics/include/gui/Surface.h
diff --git a/libs/hostgraphics/ui/Fence.h b/libs/hostgraphics/include/ui/Fence.h
similarity index 100%
rename from libs/hostgraphics/ui/Fence.h
rename to libs/hostgraphics/include/ui/Fence.h
diff --git a/libs/hostgraphics/ui/GraphicBuffer.h b/libs/hostgraphics/include/ui/GraphicBuffer.h
similarity index 100%
rename from libs/hostgraphics/ui/GraphicBuffer.h
rename to libs/hostgraphics/include/ui/GraphicBuffer.h
diff --git a/libs/hwui/FeatureFlags.h b/libs/hwui/FeatureFlags.h
index c1c30f5..fddcf29 100644
--- a/libs/hwui/FeatureFlags.h
+++ b/libs/hwui/FeatureFlags.h
@@ -25,22 +25,6 @@
namespace text_feature {
-inline bool fix_double_underline() {
-#ifdef __ANDROID__
- return com_android_text_flags_fix_double_underline();
-#else
- return true;
-#endif // __ANDROID__
-}
-
-inline bool deprecate_ui_fonts() {
-#ifdef __ANDROID__
- return com_android_text_flags_deprecate_ui_fonts();
-#else
- return true;
-#endif // __ANDROID__
-}
-
inline bool letter_spacing_justification() {
#ifdef __ANDROID__
return com_android_text_flags_letter_spacing_justification();
diff --git a/libs/hwui/HardwareBitmapUploader.cpp b/libs/hwui/HardwareBitmapUploader.cpp
index a2748b0..236c3736 100644
--- a/libs/hwui/HardwareBitmapUploader.cpp
+++ b/libs/hwui/HardwareBitmapUploader.cpp
@@ -318,6 +318,11 @@
return has101012Support;
}
+bool HardwareBitmapUploader::has10101010Support() {
+ static bool has1010110Support = checkSupport(AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM);
+ return has1010110Support;
+}
+
bool HardwareBitmapUploader::hasAlpha8Support() {
static bool hasAlpha8Support = checkSupport(AHARDWAREBUFFER_FORMAT_R8_UNORM);
return hasAlpha8Support;
@@ -376,6 +381,19 @@
}
formatInfo.format = GL_RGBA;
break;
+ case kRGBA_10x6_SkColorType:
+ formatInfo.isSupported = HardwareBitmapUploader::has10101010Support();
+ if (formatInfo.isSupported) {
+ formatInfo.type = 0; // Not supported in GL
+ formatInfo.bufferFormat = AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM;
+ formatInfo.vkFormat = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16;
+ } else {
+ formatInfo.type = GL_UNSIGNED_BYTE;
+ formatInfo.bufferFormat = AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
+ formatInfo.vkFormat = VK_FORMAT_R8G8B8A8_UNORM;
+ }
+ formatInfo.format = 0; // Not supported in GL
+ break;
case kAlpha_8_SkColorType:
formatInfo.isSupported = HardwareBitmapUploader::hasAlpha8Support();
if (formatInfo.isSupported) {
diff --git a/libs/hwui/HardwareBitmapUploader.h b/libs/hwui/HardwareBitmapUploader.h
index 00ee996..76cb80b 100644
--- a/libs/hwui/HardwareBitmapUploader.h
+++ b/libs/hwui/HardwareBitmapUploader.h
@@ -33,12 +33,14 @@
#ifdef __ANDROID__
static bool hasFP16Support();
static bool has1010102Support();
+ static bool has10101010Support();
static bool hasAlpha8Support();
#else
static bool hasFP16Support() {
return true;
}
static bool has1010102Support() { return true; }
+ static bool has10101010Support() { return true; }
static bool hasAlpha8Support() { return true; }
#endif
};
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index 72e83af..9e825fb 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -841,9 +841,6 @@
sk_sp<SkTextBlob> textBlob(builder.make());
applyLooper(&paintCopy, [&](const SkPaint& p) { mCanvas->drawTextBlob(textBlob, 0, 0, p); });
- if (!text_feature::fix_double_underline()) {
- drawTextDecorations(x, y, totalAdvance, paintCopy);
- }
}
void SkiaCanvas::drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset,
diff --git a/libs/hwui/hwui/Canvas.cpp b/libs/hwui/hwui/Canvas.cpp
index 80b6c03..5af4af2 100644
--- a/libs/hwui/hwui/Canvas.cpp
+++ b/libs/hwui/hwui/Canvas.cpp
@@ -110,28 +110,26 @@
DrawTextFunctor f(layout, this, paint, x, y, layout.getAdvance());
MinikinUtils::forFontRun(layout, &paint, f);
- if (text_feature::fix_double_underline()) {
- Paint copied(paint);
- PaintFilter* filter = getPaintFilter();
- if (filter != nullptr) {
- filter->filterFullPaint(&copied);
+ Paint copied(paint);
+ PaintFilter* filter = getPaintFilter();
+ if (filter != nullptr) {
+ filter->filterFullPaint(&copied);
+ }
+ const bool isUnderline = copied.isUnderline();
+ const bool isStrikeThru = copied.isStrikeThru();
+ if (isUnderline || isStrikeThru) {
+ const SkScalar left = x;
+ const SkScalar right = x + layout.getAdvance();
+ if (isUnderline) {
+ const SkScalar top = y + f.getUnderlinePosition();
+ drawStroke(left, right, top, f.getUnderlineThickness(), copied, this);
}
- const bool isUnderline = copied.isUnderline();
- const bool isStrikeThru = copied.isStrikeThru();
- if (isUnderline || isStrikeThru) {
- const SkScalar left = x;
- const SkScalar right = x + layout.getAdvance();
- if (isUnderline) {
- const SkScalar top = y + f.getUnderlinePosition();
- drawStroke(left, right, top, f.getUnderlineThickness(), copied, this);
- }
- if (isStrikeThru) {
- float textSize = paint.getSkFont().getSize();
- const float position = textSize * Paint::kStdStrikeThru_Top;
- const SkScalar thickness = textSize * Paint::kStdStrikeThru_Thickness;
- const SkScalar top = y + position;
- drawStroke(left, right, top, thickness, copied, this);
- }
+ if (isStrikeThru) {
+ float textSize = paint.getSkFont().getSize();
+ const float position = textSize * Paint::kStdStrikeThru_Top;
+ const SkScalar thickness = textSize * Paint::kStdStrikeThru_Thickness;
+ const SkScalar top = y + position;
+ drawStroke(left, right, top, thickness, copied, this);
}
}
}
diff --git a/libs/hwui/hwui/Canvas.h b/libs/hwui/hwui/Canvas.h
index 4eb6918..b6988b2 100644
--- a/libs/hwui/hwui/Canvas.h
+++ b/libs/hwui/hwui/Canvas.h
@@ -28,11 +28,9 @@
#include "pipeline/skia/AnimatedDrawables.h"
#include "utils/Macros.h"
-class SkAnimatedImage;
enum class SkBlendMode;
class SkCanvasState;
class SkRRect;
-class SkRuntimeShaderBuilder;
class SkVertices;
namespace minikin {
diff --git a/libs/hwui/hwui/DrawTextFunctor.h b/libs/hwui/hwui/DrawTextFunctor.h
index 0efb2c8..d7bf201 100644
--- a/libs/hwui/hwui/DrawTextFunctor.h
+++ b/libs/hwui/hwui/DrawTextFunctor.h
@@ -142,32 +142,30 @@
canvas->drawGlyphs(glyphFunc, glyphCount, paint, x, y, totalAdvance);
}
- if (text_feature::fix_double_underline()) {
- // Extract underline position and thickness.
- if (paint.isUnderline()) {
- SkFontMetrics metrics;
- paint.getSkFont().getMetrics(&metrics);
- const float textSize = paint.getSkFont().getSize();
- SkScalar position;
- if (!metrics.hasUnderlinePosition(&position)) {
- position = textSize * Paint::kStdUnderline_Top;
- }
- SkScalar thickness;
- if (!metrics.hasUnderlineThickness(&thickness)) {
- thickness = textSize * Paint::kStdUnderline_Thickness;
- }
-
- // If multiple fonts are used, use the most bottom position and most thick stroke
- // width as the underline position. This follows the CSS standard:
- // https://www.w3.org/TR/css-text-decor-3/#text-underline-position-property
- // <quote>
- // The exact position and thickness of line decorations is UA-defined in this level.
- // However, for underlines and overlines the UA must use a single thickness and
- // position on each line for the decorations deriving from a single decorating box.
- // </quote>
- underlinePosition = std::max(underlinePosition, position);
- underlineThickness = std::max(underlineThickness, thickness);
+ // Extract underline position and thickness.
+ if (paint.isUnderline()) {
+ SkFontMetrics metrics;
+ paint.getSkFont().getMetrics(&metrics);
+ const float textSize = paint.getSkFont().getSize();
+ SkScalar position;
+ if (!metrics.hasUnderlinePosition(&position)) {
+ position = textSize * Paint::kStdUnderline_Top;
}
+ SkScalar thickness;
+ if (!metrics.hasUnderlineThickness(&thickness)) {
+ thickness = textSize * Paint::kStdUnderline_Thickness;
+ }
+
+ // If multiple fonts are used, use the most bottom position and most thick stroke
+ // width as the underline position. This follows the CSS standard:
+ // https://www.w3.org/TR/css-text-decor-3/#text-underline-position-property
+ // <quote>
+ // The exact position and thickness of line decorations is UA-defined in this level.
+ // However, for underlines and overlines the UA must use a single thickness and
+ // position on each line for the decorations deriving from a single decorating box.
+ // </quote>
+ underlinePosition = std::max(underlinePosition, position);
+ underlineThickness = std::max(underlineThickness, thickness);
}
}
diff --git a/libs/hwui/hwui/MinikinUtils.cpp b/libs/hwui/hwui/MinikinUtils.cpp
index d66d7f8..ede385a 100644
--- a/libs/hwui/hwui/MinikinUtils.cpp
+++ b/libs/hwui/hwui/MinikinUtils.cpp
@@ -53,9 +53,7 @@
if (familyVariant.has_value()) {
minikinPaint.familyVariant = familyVariant.value();
} else {
- minikinPaint.familyVariant = text_feature::deprecate_ui_fonts()
- ? minikin::FamilyVariant::ELEGANT
- : minikin::FamilyVariant::DEFAULT;
+ minikinPaint.familyVariant = minikin::FamilyVariant::ELEGANT;
}
return minikinPaint;
}
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index dfda25d..8ec0430 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -654,6 +654,9 @@
if (vsyncId != UiFrameInfoBuilder::INVALID_VSYNC_ID) {
const auto inputEventId =
static_cast<int32_t>(mCurrentFrameInfo->get(FrameInfoIndex::InputEventId));
+ ATRACE_FORMAT(
+ "frameTimelineInfo(frameNumber=%llu, vsyncId=%lld, inputEventId=0x%" PRIx32 ")",
+ frameCompleteNr, vsyncId, inputEventId);
const ANativeWindowFrameTimelineInfo ftl = {
.frameNumber = frameCompleteNr,
.frameTimelineVsyncId = vsyncId,
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index bce84ae..e302393 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -318,6 +318,15 @@
tailPNext = &deviceFaultFeatures->pNext;
}
+ if (grExtensions.hasExtension(VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME, 1)) {
+ VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* formatFeatures =
+ new VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT;
+ formatFeatures->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT;
+ formatFeatures->pNext = nullptr;
+ *tailPNext = formatFeatures;
+ tailPNext = &formatFeatures->pNext;
+ }
+
// query to get the physical device features
mGetPhysicalDeviceFeatures2(mPhysicalDevice, &features);
// this looks like it would slow things down,
diff --git a/libs/hwui/tests/unit/UnderlineTest.cpp b/libs/hwui/tests/unit/UnderlineTest.cpp
index c70a304..ecb06d8 100644
--- a/libs/hwui/tests/unit/UnderlineTest.cpp
+++ b/libs/hwui/tests/unit/UnderlineTest.cpp
@@ -109,9 +109,7 @@
return f;
}
-TEST_WITH_FLAGS(UnderlineTest, Roboto,
- REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(com::android::text::flags,
- fix_double_underline))) {
+TEST(UnderlineTest, Roboto) {
float textSize = 100;
Paint paint;
paint.getSkFont().setSize(textSize);
@@ -123,9 +121,7 @@
EXPECT_EQ(ROBOTO_THICKNESS_EM * textSize, functor.getUnderlineThickness());
}
-TEST_WITH_FLAGS(UnderlineTest, NotoCJK,
- REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(com::android::text::flags,
- fix_double_underline))) {
+TEST(UnderlineTest, NotoCJK) {
float textSize = 100;
Paint paint;
paint.getSkFont().setSize(textSize);
@@ -137,9 +133,7 @@
EXPECT_EQ(NOTO_CJK_THICKNESS_EM * textSize, functor.getUnderlineThickness());
}
-TEST_WITH_FLAGS(UnderlineTest, Mixture,
- REQUIRES_FLAGS_ENABLED(ACONFIG_FLAG(com::android::text::flags,
- fix_double_underline))) {
+TEST(UnderlineTest, Mixture) {
float textSize = 100;
Paint paint;
paint.getSkFont().setSize(textSize);
diff --git a/libs/hwui/utils/Color.cpp b/libs/hwui/utils/Color.cpp
index 6a560b3..9673c5f 100644
--- a/libs/hwui/utils/Color.cpp
+++ b/libs/hwui/utils/Color.cpp
@@ -49,6 +49,10 @@
colorType = kRGBA_1010102_SkColorType;
alphaType = kPremul_SkAlphaType;
break;
+ case AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM:
+ colorType = kRGBA_10x6_SkColorType;
+ alphaType = kPremul_SkAlphaType;
+ break;
case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
colorType = kRGBA_F16_SkColorType;
alphaType = kPremul_SkAlphaType;
@@ -86,6 +90,8 @@
return AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM;
case kRGBA_1010102_SkColorType:
return AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM;
+ case kRGBA_10x6_SkColorType:
+ return AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM;
case kARGB_4444_SkColorType:
// Hardcoding the value from android::PixelFormat
static constexpr uint64_t kRGBA4444 = 7;
@@ -108,6 +114,8 @@
return kRGB_565_SkColorType;
case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
return kRGBA_1010102_SkColorType;
+ case AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM:
+ return kRGBA_10x6_SkColorType;
case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
return kRGBA_F16_SkColorType;
case AHARDWAREBUFFER_FORMAT_R8_UNORM:
diff --git a/libs/securebox/tests/Android.bp b/libs/securebox/tests/Android.bp
index 80b501d..8429cf4 100644
--- a/libs/securebox/tests/Android.bp
+++ b/libs/securebox/tests/Android.bp
@@ -35,9 +35,9 @@
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/location/java/android/location/flags/location.aconfig b/location/java/android/location/flags/location.aconfig
index 3c387d3..bbd91fc 100644
--- a/location/java/android/location/flags/location.aconfig
+++ b/location/java/android/location/flags/location.aconfig
@@ -109,3 +109,11 @@
description: "Flag for GNSS configuration from resource"
bug: "317734846"
}
+
+flag {
+ name: "enable_ni_supl_message_injection_by_carrier_config"
+ namespace: "location"
+ description: "Flag for enabling NI SUPL message injection by carrier config"
+ bug: "242105192"
+ is_fixed_read_only: true
+}
diff --git a/media/java/android/media/tv/flags/media_tv.aconfig b/media/java/android/media/tv/flags/media_tv.aconfig
index 93bca21..c814c95 100644
--- a/media/java/android/media/tv/flags/media_tv.aconfig
+++ b/media/java/android/media/tv/flags/media_tv.aconfig
@@ -48,3 +48,11 @@
description: "Tuner V4.0 APIs for Android W"
bug: "320419647"
}
+
+flag {
+ name: "hdmi_control_enhanced_behavior"
+ is_exported: true
+ namespace: "media_tv"
+ description: "Enhance HDMI-CEC power state and activeness transitions"
+ bug: "332780751"
+}
diff --git a/media/lib/tvremote/tests/Android.bp b/media/lib/tvremote/tests/Android.bp
index 280c515..83061cf 100644
--- a/media/lib/tvremote/tests/Android.bp
+++ b/media/lib/tvremote/tests/Android.bp
@@ -11,9 +11,9 @@
name: "TvRemoteTests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "com.android.media.tv.remoteprovider",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "com.android.media.tv.remoteprovider.impl",
],
static_libs: [
"mockito-target-minus-junit4",
diff --git a/media/mca/tests/Android.bp b/media/mca/tests/Android.bp
index 04f083d..463e131 100644
--- a/media/mca/tests/Android.bp
+++ b/media/mca/tests/Android.bp
@@ -10,8 +10,8 @@
android_test {
name: "CameraEffectsTests",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/media/packages/BluetoothMidiService/tests/unit/Android.bp b/media/packages/BluetoothMidiService/tests/unit/Android.bp
index 67c7e42..54d6dfc 100644
--- a/media/packages/BluetoothMidiService/tests/unit/Android.bp
+++ b/media/packages/BluetoothMidiService/tests/unit/Android.bp
@@ -39,8 +39,8 @@
test_suites: ["device-tests"],
libs: [
"framework-res",
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
}
diff --git a/media/tests/LoudnessCodecApiTest/Android.bp b/media/tests/LoudnessCodecApiTest/Android.bp
index 5ca0fc9..5d1153d 100644
--- a/media/tests/LoudnessCodecApiTest/Android.bp
+++ b/media/tests/LoudnessCodecApiTest/Android.bp
@@ -25,3 +25,10 @@
resource_dirs: ["res"],
test_suites: ["device-tests"],
}
+
+test_module_config {
+ name: "LoudnessCodecApiTest_Presubmit",
+ base: "LoudnessCodecApiTest",
+ test_suites: ["device-tests"],
+ include_annotations: ["android.platform.test.annotations.Presubmit"],
+}
diff --git a/media/tests/MediaFrameworkTest/Android.bp b/media/tests/MediaFrameworkTest/Android.bp
index 028c97e..571e24f 100644
--- a/media/tests/MediaFrameworkTest/Android.bp
+++ b/media/tests/MediaFrameworkTest/Android.bp
@@ -11,9 +11,9 @@
name: "mediaframeworktest",
srcs: ["**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"mockito-target-inline-minus-junit4",
diff --git a/media/tests/MediaRouter/Android.bp b/media/tests/MediaRouter/Android.bp
index d21cb93..e4f88a6 100644
--- a/media/tests/MediaRouter/Android.bp
+++ b/media/tests/MediaRouter/Android.bp
@@ -14,8 +14,8 @@
srcs: ["**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
diff --git a/media/tests/TunerTest/Android.bp b/media/tests/TunerTest/Android.bp
index 8e8816c..634438e 100644
--- a/media/tests/TunerTest/Android.bp
+++ b/media/tests/TunerTest/Android.bp
@@ -13,14 +13,14 @@
srcs: ["**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.rules",
"compatibility-device-util-axt",
- "testng"
+ "testng",
],
platform_apis: true,
diff --git a/media/tests/projection/Android.bp b/media/tests/projection/Android.bp
index fd5f195..94db2c0 100644
--- a/media/tests/projection/Android.bp
+++ b/media/tests/projection/Android.bp
@@ -18,9 +18,9 @@
srcs: ["**/*.java"],
libs: [
- "android.test.base",
- "android.test.mock",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt
index 346c87d..25c063d6 100644
--- a/native/android/libandroid.map.txt
+++ b/native/android/libandroid.map.txt
@@ -367,6 +367,7 @@
APerformanceHint_sendHint;
APerformanceHint_getThreadIds;
APerformanceHint_createSessionInternal;
+ APerformanceHint_setUseFMQForTesting;
extern "C++" {
ASurfaceControl_registerSurfaceStatsListener*;
ASurfaceControl_unregisterSurfaceStatsListener*;
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
index e91c7a9..095d7d1 100644
--- a/native/android/performance_hint.cpp
+++ b/native/android/performance_hint.cpp
@@ -16,10 +16,14 @@
#define LOG_TAG "perf_hint"
+#include <aidl/android/hardware/power/ChannelConfig.h>
+#include <aidl/android/hardware/power/ChannelMessage.h>
+#include <aidl/android/hardware/power/SessionConfig.h>
#include <aidl/android/hardware/power/SessionHint.h>
#include <aidl/android/hardware/power/SessionMode.h>
#include <aidl/android/hardware/power/SessionTag.h>
#include <aidl/android/hardware/power/WorkDuration.h>
+#include <aidl/android/hardware/power/WorkDurationFixedV1.h>
#include <aidl/android/os/IHintManager.h>
#include <aidl/android/os/IHintSession.h>
#include <android-base/stringprintf.h>
@@ -28,6 +32,8 @@
#include <android/binder_status.h>
#include <android/performance_hint.h>
#include <android/trace.h>
+#include <android_os.h>
+#include <fmq/AidlMessageQueue.h>
#include <inttypes.h>
#include <performance_hint_private.h>
#include <utils/SystemClock.h>
@@ -45,6 +51,10 @@
// Namespace for AIDL types coming from the PowerHAL
namespace hal = aidl::android::hardware::power;
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using HalChannelMessageContents = hal::ChannelMessage::ChannelMessageContents;
+using HalMessageQueue = ::android::AidlMessageQueue<hal::ChannelMessage, SynchronizedReadWrite>;
+using HalFlagQueue = ::android::AidlMessageQueue<int8_t, SynchronizedReadWrite>;
using android::base::StringPrintf;
struct APerformanceHintSession;
@@ -54,18 +64,60 @@
// Shared lock for the whole PerformanceHintManager and sessions
static std::mutex sHintMutex = std::mutex{};
+class FMQWrapper {
+public:
+ bool isActive();
+ bool isSupported();
+ bool startChannel(IHintManager* manager);
+ void stopChannel(IHintManager* manager);
+ // Number of elements the FMQ can hold
+ bool reportActualWorkDurations(std::optional<hal::SessionConfig>& config,
+ hal::WorkDuration* durations, size_t count) REQUIRES(sHintMutex);
+ bool updateTargetWorkDuration(std::optional<hal::SessionConfig>& config,
+ int64_t targetDurationNanos) REQUIRES(sHintMutex);
+ bool sendHint(std::optional<hal::SessionConfig>& config, SessionHint hint) REQUIRES(sHintMutex);
+ bool setMode(std::optional<hal::SessionConfig>& config, hal::SessionMode, bool enabled)
+ REQUIRES(sHintMutex);
+ void setToken(ndk::SpAIBinder& token);
+ void attemptWake();
+ void setUnsupported();
+
+private:
+ template <HalChannelMessageContents::Tag T, bool urgent = false,
+ class C = HalChannelMessageContents::_at<T>>
+ bool sendMessages(std::optional<hal::SessionConfig>& config, C* message, size_t count = 1)
+ REQUIRES(sHintMutex);
+ template <HalChannelMessageContents::Tag T, class C = HalChannelMessageContents::_at<T>>
+ void writeBuffer(C* message, hal::SessionConfig& config, size_t count) REQUIRES(sHintMutex);
+
+ bool isActiveLocked() REQUIRES(sHintMutex);
+ bool updatePersistentTransaction() REQUIRES(sHintMutex);
+ std::shared_ptr<HalMessageQueue> mQueue GUARDED_BY(sHintMutex) = nullptr;
+ std::shared_ptr<HalFlagQueue> mFlagQueue GUARDED_BY(sHintMutex) = nullptr;
+ // android::hardware::EventFlag* mEventFlag GUARDED_BY(sHintMutex) = nullptr;
+ android::hardware::EventFlag* mEventFlag = nullptr;
+ int32_t mWriteMask;
+ ndk::SpAIBinder mToken = nullptr;
+ // Used to track if operating on the fmq consistently fails
+ bool mCorrupted = false;
+ // Used to keep a persistent transaction open with FMQ to reduce latency a bit
+ size_t mAvailableSlots GUARDED_BY(sHintMutex) = 0;
+ bool mHalSupported = true;
+ HalMessageQueue::MemTransaction mFmqTransaction GUARDED_BY(sHintMutex);
+};
struct APerformanceHintManager {
public:
static APerformanceHintManager* getInstance();
- APerformanceHintManager(std::shared_ptr<IHintManager> service, int64_t preferredRateNanos);
+ APerformanceHintManager(std::shared_ptr<IHintManager>& service, int64_t preferredRateNanos);
APerformanceHintManager() = delete;
- ~APerformanceHintManager() = default;
+ ~APerformanceHintManager();
APerformanceHintSession* createSession(const int32_t* threadIds, size_t size,
int64_t initialTargetWorkDurationNanos,
hal::SessionTag tag = hal::SessionTag::APP);
int64_t getPreferredRateNanos() const;
+ FMQWrapper& getFMQWrapper();
private:
// Necessary to create an empty binder object
@@ -83,6 +135,7 @@
std::shared_ptr<IHintManager> mHintManager;
ndk::SpAIBinder mToken;
const int64_t mPreferredRateNanos;
+ FMQWrapper mFMQWrapper;
};
struct APerformanceHintSession {
@@ -121,40 +174,57 @@
std::vector<int64_t> mLastHintSentTimestamp GUARDED_BY(sHintMutex);
// Cached samples
std::vector<hal::WorkDuration> mActualWorkDurations GUARDED_BY(sHintMutex);
- std::string mSessionName GUARDED_BY(sHintMutex);
+ std::string mSessionName;
static int64_t sIDCounter GUARDED_BY(sHintMutex);
// The most recent set of thread IDs
std::vector<int32_t> mLastThreadIDs GUARDED_BY(sHintMutex);
std::optional<hal::SessionConfig> mSessionConfig GUARDED_BY(sHintMutex);
// Tracing helpers
void traceThreads(std::vector<int32_t>& tids) REQUIRES(sHintMutex);
- void tracePowerEfficient(bool powerEfficient) REQUIRES(sHintMutex);
- void traceActualDuration(int64_t actualDuration) REQUIRES(sHintMutex);
- void traceBatchSize(size_t batchSize) REQUIRES(sHintMutex);
- void traceTargetDuration(int64_t targetDuration) REQUIRES(sHintMutex);
+ void tracePowerEfficient(bool powerEfficient);
+ void traceActualDuration(int64_t actualDuration);
+ void traceBatchSize(size_t batchSize);
+ void traceTargetDuration(int64_t targetDuration);
};
static std::shared_ptr<IHintManager>* gIHintManagerForTesting = nullptr;
-static APerformanceHintManager* gHintManagerForTesting = nullptr;
+static std::shared_ptr<APerformanceHintManager> gHintManagerForTesting = nullptr;
+
+static std::optional<bool> gForceFMQEnabled = std::nullopt;
+
// Start above the int32 range so we don't collide with config sessions
int64_t APerformanceHintSession::sIDCounter = INT32_MAX;
+static FMQWrapper& getFMQ() {
+ return APerformanceHintManager::getInstance()->getFMQWrapper();
+}
+
// ===================================== APerformanceHintManager implementation
-APerformanceHintManager::APerformanceHintManager(std::shared_ptr<IHintManager> manager,
+APerformanceHintManager::APerformanceHintManager(std::shared_ptr<IHintManager>& manager,
int64_t preferredRateNanos)
: mHintManager(std::move(manager)), mPreferredRateNanos(preferredRateNanos) {
static AIBinder_Class* tokenBinderClass =
AIBinder_Class_define("phm_token", tokenStubOnCreate, tokenStubOnDestroy,
tokenStubOnTransact);
mToken = ndk::SpAIBinder(AIBinder_new(tokenBinderClass, nullptr));
+ if (mFMQWrapper.isSupported()) {
+ mFMQWrapper.setToken(mToken);
+ mFMQWrapper.startChannel(mHintManager.get());
+ }
+}
+
+APerformanceHintManager::~APerformanceHintManager() {
+ mFMQWrapper.stopChannel(mHintManager.get());
}
APerformanceHintManager* APerformanceHintManager::getInstance() {
- if (gHintManagerForTesting) return gHintManagerForTesting;
+ if (gHintManagerForTesting) {
+ return gHintManagerForTesting.get();
+ }
if (gIHintManagerForTesting) {
- APerformanceHintManager* manager = create(*gIHintManagerForTesting);
- gIHintManagerForTesting = nullptr;
- return manager;
+ gHintManagerForTesting =
+ std::shared_ptr<APerformanceHintManager>(create(*gIHintManagerForTesting));
+ return gHintManagerForTesting.get();
}
static APerformanceHintManager* instance = create(nullptr);
return instance;
@@ -178,7 +248,7 @@
if (preferredRateNanos <= 0) {
preferredRateNanos = -1L;
}
- return new APerformanceHintManager(std::move(manager), preferredRateNanos);
+ return new APerformanceHintManager(manager, preferredRateNanos);
}
APerformanceHintSession* APerformanceHintManager::createSession(
@@ -187,15 +257,20 @@
std::vector<int32_t> tids(threadIds, threadIds + size);
std::shared_ptr<IHintSession> session;
ndk::ScopedAStatus ret;
- std::optional<hal::SessionConfig> sessionConfig;
+ hal::SessionConfig sessionConfig{.id = -1};
ret = mHintManager->createHintSessionWithConfig(mToken, tids, initialTargetWorkDurationNanos,
tag, &sessionConfig, &session);
if (!ret.isOk() || !session) {
+ ALOGE("%s: PerformanceHint cannot create session. %s", __FUNCTION__, ret.getMessage());
return nullptr;
}
auto out = new APerformanceHintSession(mHintManager, std::move(session), mPreferredRateNanos,
- initialTargetWorkDurationNanos, sessionConfig);
+ initialTargetWorkDurationNanos,
+ sessionConfig.id == -1
+ ? std::nullopt
+ : std::make_optional<hal::SessionConfig>(
+ std::move(sessionConfig)));
std::scoped_lock lock(sHintMutex);
out->traceThreads(tids);
out->traceTargetDuration(initialTargetWorkDurationNanos);
@@ -207,8 +282,15 @@
return mPreferredRateNanos;
}
+FMQWrapper& APerformanceHintManager::getFMQWrapper() {
+ return mFMQWrapper;
+}
+
// ===================================== APerformanceHintSession implementation
+constexpr int kNumEnums =
+ ndk::enum_range<hal::SessionHint>().end() - ndk::enum_range<hal::SessionHint>().begin();
+
APerformanceHintSession::APerformanceHintSession(std::shared_ptr<IHintManager> hintManager,
std::shared_ptr<IHintSession> session,
int64_t preferredRateNanos,
@@ -220,14 +302,11 @@
mTargetDurationNanos(targetDurationNanos),
mFirstTargetMetTimestamp(0),
mLastTargetMetTimestamp(0),
+ mLastHintSentTimestamp(std::vector<int64_t>(kNumEnums, 0)),
mSessionConfig(sessionConfig) {
if (sessionConfig->id > INT32_MAX) {
ALOGE("Session ID too large, must fit 32-bit integer");
}
- std::scoped_lock lock(sHintMutex);
- constexpr int numEnums =
- ndk::enum_range<hal::SessionHint>().end() - ndk::enum_range<hal::SessionHint>().begin();
- mLastHintSentTimestamp = std::vector<int64_t>(numEnums, 0);
int64_t traceId = sessionConfig.has_value() ? sessionConfig->id : ++sIDCounter;
mSessionName = android::base::StringPrintf("ADPF Session %" PRId64, traceId);
}
@@ -244,19 +323,18 @@
ALOGE("%s: targetDurationNanos must be positive", __FUNCTION__);
return EINVAL;
}
- {
- std::scoped_lock lock(sHintMutex);
- if (mTargetDurationNanos == targetDurationNanos) {
- return 0;
+ std::scoped_lock lock(sHintMutex);
+ if (mTargetDurationNanos == targetDurationNanos) {
+ return 0;
+ }
+ if (!getFMQ().updateTargetWorkDuration(mSessionConfig, targetDurationNanos)) {
+ ndk::ScopedAStatus ret = mHintSession->updateTargetWorkDuration(targetDurationNanos);
+ if (!ret.isOk()) {
+ ALOGE("%s: HintSession updateTargetWorkDuration failed: %s", __FUNCTION__,
+ ret.getMessage());
+ return EPIPE;
}
}
- ndk::ScopedAStatus ret = mHintSession->updateTargetWorkDuration(targetDurationNanos);
- if (!ret.isOk()) {
- ALOGE("%s: HintSession updateTargetWorkDuration failed: %s", __FUNCTION__,
- ret.getMessage());
- return EPIPE;
- }
- std::scoped_lock lock(sHintMutex);
mTargetDurationNanos = targetDurationNanos;
/**
* Most of the workload is target_duration dependent, so now clear the cached samples
@@ -292,11 +370,13 @@
return 0;
}
- ndk::ScopedAStatus ret = mHintSession->sendHint(hint);
+ if (!getFMQ().sendHint(mSessionConfig, hint)) {
+ ndk::ScopedAStatus ret = mHintSession->sendHint(hint);
- if (!ret.isOk()) {
- ALOGE("%s: HintSession sendHint failed: %s", __FUNCTION__, ret.getMessage());
- return EPIPE;
+ if (!ret.isOk()) {
+ ALOGE("%s: HintSession sendHint failed: %s", __FUNCTION__, ret.getMessage());
+ return EPIPE;
+ }
}
mLastHintSentTimestamp[hint] = now;
return 0;
@@ -369,10 +449,10 @@
int APerformanceHintSession::reportActualWorkDurationInternal(AWorkDuration* workDuration) {
int64_t actualTotalDurationNanos = workDuration->durationNanos;
+ traceActualDuration(workDuration->durationNanos);
int64_t now = uptimeNanos();
workDuration->timeStampNanos = now;
std::scoped_lock lock(sHintMutex);
- traceActualDuration(workDuration->durationNanos);
mActualWorkDurations.push_back(std::move(*workDuration));
if (actualTotalDurationNanos >= mTargetDurationNanos) {
@@ -396,20 +476,177 @@
mLastTargetMetTimestamp = now;
}
- ndk::ScopedAStatus ret = mHintSession->reportActualWorkDuration2(mActualWorkDurations);
- if (!ret.isOk()) {
- ALOGE("%s: HintSession reportActualWorkDuration failed: %s", __FUNCTION__,
- ret.getMessage());
- mFirstTargetMetTimestamp = 0;
- mLastTargetMetTimestamp = 0;
- traceBatchSize(mActualWorkDurations.size());
- return ret.getExceptionCode() == EX_ILLEGAL_ARGUMENT ? EINVAL : EPIPE;
+ if (!getFMQ().reportActualWorkDurations(mSessionConfig, mActualWorkDurations.data(),
+ mActualWorkDurations.size())) {
+ ndk::ScopedAStatus ret = mHintSession->reportActualWorkDuration2(mActualWorkDurations);
+ if (!ret.isOk()) {
+ ALOGE("%s: HintSession reportActualWorkDuration failed: %s", __FUNCTION__,
+ ret.getMessage());
+ mFirstTargetMetTimestamp = 0;
+ mLastTargetMetTimestamp = 0;
+ traceBatchSize(mActualWorkDurations.size());
+ return ret.getExceptionCode() == EX_ILLEGAL_ARGUMENT ? EINVAL : EPIPE;
+ }
}
+
mActualWorkDurations.clear();
traceBatchSize(0);
return 0;
}
+
+// ===================================== FMQ wrapper implementation
+
+bool FMQWrapper::isActive() {
+ std::scoped_lock lock{sHintMutex};
+ return isActiveLocked();
+}
+
+bool FMQWrapper::isActiveLocked() {
+ return mQueue != nullptr;
+}
+
+void FMQWrapper::setUnsupported() {
+ mHalSupported = false;
+}
+
+bool FMQWrapper::isSupported() {
+ if (!mHalSupported) {
+ return false;
+ }
+ // Used for testing
+ if (gForceFMQEnabled.has_value()) {
+ return *gForceFMQEnabled;
+ }
+ return android::os::adpf_use_fmq_channel_fixed();
+}
+
+bool FMQWrapper::startChannel(IHintManager* manager) {
+ if (isSupported() && !isActive()) {
+ std::optional<hal::ChannelConfig> config;
+ auto ret = manager->getSessionChannel(mToken, &config);
+ if (ret.isOk() && config.has_value()) {
+ std::scoped_lock lock{sHintMutex};
+ mQueue = std::make_shared<HalMessageQueue>(config->channelDescriptor, true);
+ if (config->eventFlagDescriptor.has_value()) {
+ mFlagQueue = std::make_shared<HalFlagQueue>(*config->eventFlagDescriptor, true);
+ android::hardware::EventFlag::createEventFlag(mFlagQueue->getEventFlagWord(),
+ &mEventFlag);
+ mWriteMask = config->writeFlagBitmask;
+ }
+ updatePersistentTransaction();
+ } else if (ret.isOk() && !config.has_value()) {
+ ALOGV("FMQ channel enabled but unsupported.");
+ setUnsupported();
+ } else {
+ ALOGE("%s: FMQ channel initialization failed: %s", __FUNCTION__, ret.getMessage());
+ }
+ }
+ return isActive();
+}
+
+void FMQWrapper::stopChannel(IHintManager* manager) {
+ {
+ std::scoped_lock lock{sHintMutex};
+ if (!isActiveLocked()) {
+ return;
+ }
+ mFlagQueue = nullptr;
+ mQueue = nullptr;
+ }
+ manager->closeSessionChannel();
+}
+
+template <HalChannelMessageContents::Tag T, class C>
+void FMQWrapper::writeBuffer(C* message, hal::SessionConfig& config, size_t) {
+ new (mFmqTransaction.getSlot(0)) hal::ChannelMessage{
+ .sessionID = static_cast<int32_t>(config.id),
+ .timeStampNanos = ::android::uptimeNanos(),
+ .data = HalChannelMessageContents::make<T, C>(std::move(*message)),
+ };
+}
+
+template <>
+void FMQWrapper::writeBuffer<HalChannelMessageContents::workDuration>(hal::WorkDuration* messages,
+ hal::SessionConfig& config,
+ size_t count) {
+ for (size_t i = 0; i < count; ++i) {
+ hal::WorkDuration& message = messages[i];
+ new (mFmqTransaction.getSlot(i)) hal::ChannelMessage{
+ .sessionID = static_cast<int32_t>(config.id),
+ .timeStampNanos =
+ (i == count - 1) ? ::android::uptimeNanos() : message.timeStampNanos,
+ .data = HalChannelMessageContents::make<HalChannelMessageContents::workDuration,
+ hal::WorkDurationFixedV1>({
+ .durationNanos = message.cpuDurationNanos,
+ .workPeriodStartTimestampNanos = message.workPeriodStartTimestampNanos,
+ .cpuDurationNanos = message.cpuDurationNanos,
+ .gpuDurationNanos = message.gpuDurationNanos,
+ }),
+ };
+ }
+}
+
+template <HalChannelMessageContents::Tag T, bool urgent, class C>
+bool FMQWrapper::sendMessages(std::optional<hal::SessionConfig>& config, C* message, size_t count) {
+ if (!isActiveLocked() || !config.has_value() || mCorrupted) {
+ return false;
+ }
+ // If we didn't reserve enough space, try re-creating the transaction
+ if (count > mAvailableSlots) {
+ if (!updatePersistentTransaction()) {
+ return false;
+ }
+ // If we actually don't have enough space, give up
+ if (count > mAvailableSlots) {
+ return false;
+ }
+ }
+ writeBuffer<T, C>(message, *config, count);
+ mQueue->commitWrite(count);
+ mEventFlag->wake(mWriteMask);
+ // Re-create the persistent transaction after writing
+ updatePersistentTransaction();
+ return true;
+}
+
+void FMQWrapper::setToken(ndk::SpAIBinder& token) {
+ mToken = token;
+}
+
+bool FMQWrapper::updatePersistentTransaction() {
+ mAvailableSlots = mQueue->availableToWrite();
+ if (mAvailableSlots > 0 && !mQueue->beginWrite(mAvailableSlots, &mFmqTransaction)) {
+ ALOGE("ADPF FMQ became corrupted, falling back to binder calls!");
+ mCorrupted = true;
+ return false;
+ }
+ return true;
+}
+
+bool FMQWrapper::reportActualWorkDurations(std::optional<hal::SessionConfig>& config,
+ hal::WorkDuration* durations, size_t count) {
+ return sendMessages<HalChannelMessageContents::workDuration>(config, durations, count);
+}
+
+bool FMQWrapper::updateTargetWorkDuration(std::optional<hal::SessionConfig>& config,
+ int64_t targetDurationNanos) {
+ return sendMessages<HalChannelMessageContents::targetDuration>(config, &targetDurationNanos);
+}
+
+bool FMQWrapper::sendHint(std::optional<hal::SessionConfig>& config, SessionHint hint) {
+ return sendMessages<HalChannelMessageContents::hint>(config,
+ reinterpret_cast<hal::SessionHint*>(
+ &hint));
+}
+
+bool FMQWrapper::setMode(std::optional<hal::SessionConfig>& config, hal::SessionMode mode,
+ bool enabled) {
+ hal::ChannelMessage::ChannelMessageContents::SessionModeSetter modeObj{.modeInt = mode,
+ .enabled = enabled};
+ return sendMessages<HalChannelMessageContents::mode, true>(config, &modeObj);
+}
+
// ===================================== Tracing helpers
void APerformanceHintSession::traceThreads(std::vector<int32_t>& tids) {
@@ -585,7 +822,12 @@
}
void APerformanceHint_setIHintManagerForTesting(void* iManager) {
- delete gHintManagerForTesting;
- gHintManagerForTesting = nullptr;
+ if (iManager == nullptr) {
+ gHintManagerForTesting = nullptr;
+ }
gIHintManagerForTesting = static_cast<std::shared_ptr<IHintManager>*>(iManager);
}
+
+void APerformanceHint_setUseFMQForTesting(bool enabled) {
+ gForceFMQEnabled = enabled;
+}
diff --git a/native/android/tests/performance_hint/Android.bp b/native/android/tests/performance_hint/Android.bp
index 608d5d8..f6f1da1 100644
--- a/native/android/tests/performance_hint/Android.bp
+++ b/native/android/tests/performance_hint/Android.bp
@@ -36,10 +36,13 @@
srcs: ["PerformanceHintNativeTest.cpp"],
shared_libs: [
+ "android.hardware.common.fmq-V1-ndk",
"libandroid",
- "liblog",
"libbinder",
"libbinder_ndk",
+ "libcutils",
+ "libfmq",
+ "liblog",
"libpowermanager",
"libutils",
],
@@ -56,8 +59,8 @@
],
cflags: [
- "-Werror",
"-Wall",
+ "-Werror",
],
header_libs: [
diff --git a/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
index d19fa98..9de3a6f 100644
--- a/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
+++ b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
@@ -24,6 +24,7 @@
#include <android/binder_manager.h>
#include <android/binder_status.h>
#include <android/performance_hint.h>
+#include <fmq/AidlMessageQueue.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <performance_hint_private.h>
@@ -31,11 +32,16 @@
#include <memory>
#include <vector>
+using namespace std::chrono_literals;
namespace hal = aidl::android::hardware::power;
using aidl::android::os::IHintManager;
using aidl::android::os::IHintSession;
using ndk::ScopedAStatus;
using ndk::SpAIBinder;
+using HalChannelMessageContents = hal::ChannelMessage::ChannelMessageContents;
+
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using HalFlagQueue = ::android::AidlMessageQueue<int8_t, SynchronizedReadWrite>;
using namespace android;
using namespace testing;
@@ -44,7 +50,7 @@
public:
MOCK_METHOD(ScopedAStatus, createHintSessionWithConfig,
(const SpAIBinder& token, const ::std::vector<int32_t>& tids, int64_t durationNanos,
- hal::SessionTag tag, std::optional<hal::SessionConfig>* config,
+ hal::SessionTag tag, hal::SessionConfig* config,
std::shared_ptr<IHintSession>* _aidl_return),
(override));
MOCK_METHOD(ScopedAStatus, getHintSessionPreferredRate, (int64_t * _aidl_return), (override));
@@ -56,7 +62,9 @@
(const std::shared_ptr<IHintSession>& hintSession, ::std::vector<int32_t>* tids),
(override));
MOCK_METHOD(ScopedAStatus, getSessionChannel,
- (const ::ndk::SpAIBinder& in_token, hal::ChannelConfig* _aidl_return), (override));
+ (const ::ndk::SpAIBinder& in_token,
+ std::optional<hal::ChannelConfig>* _aidl_return),
+ (override));
MOCK_METHOD(ScopedAStatus, closeSessionChannel, (), (override));
MOCK_METHOD(SpAIBinder, asBinder, (), (override));
MOCK_METHOD(bool, isRemote, (), (override));
@@ -92,10 +100,12 @@
}
APerformanceHintManager* createManager() {
+ APerformanceHint_setUseFMQForTesting(mUsingFMQ);
ON_CALL(*mMockIHintManager, getHintSessionPreferredRate(_))
.WillByDefault(DoAll(SetArgPointee<0>(123L), [] { return ScopedAStatus::ok(); }));
return APerformanceHint_getManager();
}
+
APerformanceHintSession* createSession(APerformanceHintManager* manager,
int64_t targetDuration = 56789L, bool isHwui = false) {
mMockSession = ndk::SharedRefBase::make<NiceMock<MockIHintSession>>();
@@ -106,8 +116,7 @@
ON_CALL(*mMockIHintManager,
createHintSessionWithConfig(_, Eq(tids), Eq(targetDuration), _, _, _))
- .WillByDefault(DoAll(SetArgPointee<4>(std::make_optional<hal::SessionConfig>(
- {.id = sessionId})),
+ .WillByDefault(DoAll(SetArgPointee<4>(hal::SessionConfig({.id = sessionId})),
SetArgPointee<5>(std::shared_ptr<IHintSession>(mMockSession)),
[] { return ScopedAStatus::ok(); }));
@@ -133,8 +142,47 @@
return APerformanceHint_createSession(manager, tids.data(), tids.size(), targetDuration);
}
+ void setFMQEnabled(bool enabled) {
+ mUsingFMQ = enabled;
+ if (enabled) {
+ mMockFMQ = std::make_shared<
+ AidlMessageQueue<hal::ChannelMessage, SynchronizedReadWrite>>(kMockQueueSize,
+ true);
+ mMockFlagQueue =
+ std::make_shared<AidlMessageQueue<int8_t, SynchronizedReadWrite>>(1, true);
+ hardware::EventFlag::createEventFlag(mMockFlagQueue->getEventFlagWord(), &mEventFlag);
+
+ ON_CALL(*mMockIHintManager, getSessionChannel(_, _))
+ .WillByDefault([&](ndk::SpAIBinder, std::optional<hal::ChannelConfig>* config) {
+ config->emplace(
+ hal::ChannelConfig{.channelDescriptor = mMockFMQ->dupeDesc(),
+ .eventFlagDescriptor =
+ mMockFlagQueue->dupeDesc(),
+ .readFlagBitmask =
+ static_cast<int32_t>(mReadBits),
+ .writeFlagBitmask =
+ static_cast<int32_t>(mWriteBits)});
+ return ::ndk::ScopedAStatus::ok();
+ });
+ }
+ }
+ uint32_t mReadBits = 0x00000001;
+ uint32_t mWriteBits = 0x00000002;
std::shared_ptr<NiceMock<MockIHintManager>> mMockIHintManager = nullptr;
std::shared_ptr<NiceMock<MockIHintSession>> mMockSession = nullptr;
+ std::shared_ptr<AidlMessageQueue<hal::ChannelMessage, SynchronizedReadWrite>> mMockFMQ;
+ std::shared_ptr<AidlMessageQueue<int8_t, SynchronizedReadWrite>> mMockFlagQueue;
+ hardware::EventFlag* mEventFlag;
+ int kMockQueueSize = 20;
+ bool mUsingFMQ = false;
+
+ template <HalChannelMessageContents::Tag T, class C = HalChannelMessageContents::_at<T>>
+ void expectToReadFromFmq(C expected) {
+ hal::ChannelMessage readData;
+ mMockFMQ->readBlocking(&readData, 1, mReadBits, mWriteBits, 1000000000, mEventFlag);
+ C got = static_cast<C>(readData.data.get<T>());
+ ASSERT_EQ(got, expected);
+ }
};
bool equalsWithoutTimestamp(hal::WorkDuration lhs, hal::WorkDuration rhs) {
@@ -306,7 +354,7 @@
actualWorkDurations.push_back(pair.duration);
EXPECT_CALL(*mMockSession, reportActualWorkDuration2(WorkDurationEq(actualWorkDurations)))
- .Times(Exactly(1));
+ .Times(Exactly(pair.expectedResult == OK));
result = APerformanceHint_reportActualWorkDuration2(session,
reinterpret_cast<AWorkDuration*>(
&pair.duration));
@@ -327,3 +375,48 @@
AWorkDuration_setActualGpuDurationNanos(aWorkDuration, 8);
AWorkDuration_release(aWorkDuration);
}
+
+TEST_F(PerformanceHintTest, TestCreateUsingFMQ) {
+ setFMQEnabled(true);
+ APerformanceHintManager* manager = createManager();
+ APerformanceHintSession* session = createSession(manager);
+ ASSERT_TRUE(session);
+}
+
+TEST_F(PerformanceHintTest, TestUpdateTargetWorkDurationUsingFMQ) {
+ setFMQEnabled(true);
+ APerformanceHintManager* manager = createManager();
+ APerformanceHintSession* session = createSession(manager);
+ APerformanceHint_updateTargetWorkDuration(session, 456);
+ expectToReadFromFmq<HalChannelMessageContents::Tag::targetDuration>(456);
+}
+
+TEST_F(PerformanceHintTest, TestSendHintUsingFMQ) {
+ setFMQEnabled(true);
+ APerformanceHintManager* manager = createManager();
+ APerformanceHintSession* session = createSession(manager);
+ APerformanceHint_sendHint(session, SessionHint::CPU_LOAD_UP);
+ expectToReadFromFmq<HalChannelMessageContents::Tag::hint>(hal::SessionHint::CPU_LOAD_UP);
+}
+
+TEST_F(PerformanceHintTest, TestReportActualUsingFMQ) {
+ setFMQEnabled(true);
+ APerformanceHintManager* manager = createManager();
+ APerformanceHintSession* session = createSession(manager);
+ hal::WorkDuration duration{.timeStampNanos = 3,
+ .durationNanos = 999999,
+ .workPeriodStartTimestampNanos = 1,
+ .cpuDurationNanos = 999999,
+ .gpuDurationNanos = 999999};
+
+ hal::WorkDurationFixedV1 durationExpected{
+ .durationNanos = duration.durationNanos,
+ .workPeriodStartTimestampNanos = duration.workPeriodStartTimestampNanos,
+ .cpuDurationNanos = duration.cpuDurationNanos,
+ .gpuDurationNanos = duration.gpuDurationNanos,
+ };
+
+ APerformanceHint_reportActualWorkDuration2(session,
+ reinterpret_cast<AWorkDuration*>(&duration));
+ expectToReadFromFmq<HalChannelMessageContents::Tag::workDuration>(durationExpected);
+}
diff --git a/nfc/Android.bp b/nfc/Android.bp
index 0282e6f..db3dcb0 100644
--- a/nfc/Android.bp
+++ b/nfc/Android.bp
@@ -38,8 +38,8 @@
name: "framework-nfc",
libs: [
"unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
- "framework-permission-s",
- "framework-permission",
+ "framework-permission-s.stubs.module_lib",
+ "framework-permission.stubs.module_lib",
],
static_libs: [
"android.nfc.flags-aconfig-java",
diff --git a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
index ea5a036..b28237c 100644
--- a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -69,6 +69,29 @@
private static final String TAG = "ApduServiceInfo";
/**
+ * Component level {@link android.content.pm.PackageManager.Property PackageManager
+ * .Property} for a system application to change its icon and label
+ * on the default applications page. This property should be added to an
+ * {@link HostApduService} declaration in the manifest.
+ *
+ * <p>For example:
+ * <pre>
+ * <service
+ * android:apduServiceBanner="@drawable/product_logo"
+ * android:label="@string/service_label">
+ * <property
+ * android:name="android.content.PROPERTY_WALLET_ICON_AND_LABEL_HOLDER"
+ * android:value="true"/>
+ * </service>
+ * </pre>
+ * @hide
+ */
+ @SystemApi
+ @FlaggedApi(android.permission.flags.Flags.FLAG_WALLET_ROLE_ICON_PROPERTY_ENABLED)
+ public static final String PROPERTY_WALLET_PREFERRED_BANNER_AND_LABEL =
+ "android.nfc.cardemulation.PROPERTY_WALLET_PREFERRED_BANNER_AND_LABEL";
+
+ /**
* The service that implements this
*/
private final ResolveInfo mService;
diff --git a/nfc/tests/Android.bp b/nfc/tests/Android.bp
index 6ebc03c..bfa814d 100644
--- a/nfc/tests/Android.bp
+++ b/nfc/tests/Android.bp
@@ -32,7 +32,7 @@
],
libs: [
"framework-nfc.impl",
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
srcs: ["src/**/*.java"],
platform_apis: true,
diff --git a/packages/CarrierDefaultApp/tests/unit/Android.bp b/packages/CarrierDefaultApp/tests/unit/Android.bp
index 0d08ec6..bec81ad 100644
--- a/packages/CarrierDefaultApp/tests/unit/Android.bp
+++ b/packages/CarrierDefaultApp/tests/unit/Android.bp
@@ -25,8 +25,8 @@
name: "CarrierDefaultAppUnitTests",
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
"SlicePurchaseController",
],
static_libs: [
diff --git a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
index 4df8365..63d57c4 100644
--- a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
@@ -52,7 +52,7 @@
<string name="permission_contacts" msgid="3858319347208004438">"Contactos"</string>
<string name="permission_calendar" msgid="6805668388691290395">"Calendario"</string>
<string name="permission_microphone" msgid="2152206421428732949">"Micrófono"</string>
- <string name="permission_call_logs" msgid="5546761417694586041">"Registros de llamadas"</string>
+ <string name="permission_call_logs" msgid="5546761417694586041">"Llamadas"</string>
<string name="permission_nearby_devices" msgid="7530973297737123481">"Dispositivos cercanos"</string>
<string name="permission_media_routing_control" msgid="5498639511586715253">"Cambiar la salida multimedia"</string>
<string name="permission_storage" msgid="6831099350839392343">"Fotos y contenido multimedia"</string>
diff --git a/packages/CredentialManager/tests/robotests/Android.bp b/packages/CredentialManager/tests/robotests/Android.bp
index 75a0dcc..27afaaa 100644
--- a/packages/CredentialManager/tests/robotests/Android.bp
+++ b/packages/CredentialManager/tests/robotests/Android.bp
@@ -48,9 +48,9 @@
"flag-junit-base",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
upstream: true,
diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
index 3409c29..defbc11 100644
--- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
+++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
@@ -16,8 +16,6 @@
package com.android.externalstorage;
-import static java.util.regex.Pattern.CASE_INSENSITIVE;
-
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.usage.StorageStatsManager;
@@ -61,12 +59,15 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.UUID;
-import java.util.regex.Pattern;
+import java.util.stream.Collectors;
/**
* Presents content of the shared (a.k.a. "external") storage.
@@ -89,12 +90,9 @@
private static final Uri BASE_URI =
new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT).authority(AUTHORITY).build();
- /**
- * Regex for detecting {@code /Android/data/}, {@code /Android/obb/} and
- * {@code /Android/sandbox/} along with all their subdirectories and content.
- */
- private static final Pattern PATTERN_RESTRICTED_ANDROID_SUBTREES =
- Pattern.compile("^Android/(?:data|obb|sandbox)(?:/.+)?", CASE_INSENSITIVE);
+ private static final String PRIMARY_EMULATED_STORAGE_PATH = "/storage/emulated/";
+
+ private static final String STORAGE_PATH = "/storage/";
private static final String[] DEFAULT_ROOT_PROJECTION = new String[] {
Root.COLUMN_ROOT_ID, Root.COLUMN_FLAGS, Root.COLUMN_ICON, Root.COLUMN_TITLE,
@@ -309,11 +307,70 @@
return false;
}
- final String path = getPathFromDocId(documentId);
- return PATTERN_RESTRICTED_ANDROID_SUBTREES.matcher(path).matches();
+ try {
+ final RootInfo root = getRootFromDocId(documentId);
+ final String canonicalPath = getPathFromDocId(documentId);
+ return isRestrictedPath(root.rootId, canonicalPath);
+ } catch (Exception e) {
+ return true;
+ }
}
/**
+ * Based on the given root id and path, we restrict path access if file is Android/data or
+ * Android/obb or Android/sandbox or one of their subdirectories.
+ *
+ * @param canonicalPath of the file
+ * @return true if path is restricted
+ */
+ private boolean isRestrictedPath(String rootId, String canonicalPath) {
+ if (rootId == null || canonicalPath == null) {
+ return true;
+ }
+
+ final String rootPath;
+ if (rootId.equalsIgnoreCase(ROOT_ID_PRIMARY_EMULATED)) {
+ // Creates "/storage/emulated/<user-id>"
+ rootPath = PRIMARY_EMULATED_STORAGE_PATH + UserHandle.myUserId();
+ } else {
+ // Creates "/storage/<volume-uuid>"
+ rootPath = STORAGE_PATH + rootId;
+ }
+ List<java.nio.file.Path> restrictedPathList = Arrays.asList(
+ Paths.get(rootPath, "Android", "data"),
+ Paths.get(rootPath, "Android", "obb"),
+ Paths.get(rootPath, "Android", "sandbox"));
+ // We need to identify restricted parent paths which actually exist on the device
+ List<java.nio.file.Path> validRestrictedPathsToCheck = restrictedPathList.stream().filter(
+ Files::exists).collect(Collectors.toList());
+
+ boolean isRestricted = false;
+ java.nio.file.Path filePathToCheck = Paths.get(rootPath, canonicalPath);
+ try {
+ while (filePathToCheck != null) {
+ for (java.nio.file.Path restrictedPath : validRestrictedPathsToCheck) {
+ if (Files.isSameFile(restrictedPath, filePathToCheck)) {
+ isRestricted = true;
+ Log.v(TAG, "Restricting access for path: " + filePathToCheck);
+ break;
+ }
+ }
+ if (isRestricted) {
+ break;
+ }
+
+ filePathToCheck = filePathToCheck.getParent();
+ }
+ } catch (Exception e) {
+ Log.w(TAG, "Error in checking file equality check.", e);
+ isRestricted = true;
+ }
+
+ return isRestricted;
+ }
+
+
+ /**
* Check that the directory is the root of storage or blocked file from tree.
* <p>
* Note, that this is different from hidden documents: blocked documents <b>WILL</b> appear
diff --git a/packages/ExternalStorageProvider/tests/Android.bp b/packages/ExternalStorageProvider/tests/Android.bp
index 097bb860..56348b7 100644
--- a/packages/ExternalStorageProvider/tests/Android.bp
+++ b/packages/ExternalStorageProvider/tests/Android.bp
@@ -21,9 +21,9 @@
],
libs: [
- "android.test.base",
- "android.test.mock",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
diff --git a/packages/FusedLocation/Android.bp b/packages/FusedLocation/Android.bp
index 61a8270..719aa28 100644
--- a/packages/FusedLocation/Android.bp
+++ b/packages/FusedLocation/Android.bp
@@ -35,7 +35,7 @@
name: "FusedLocation",
defaults: ["platform_app_defaults"],
srcs: ["src/**/*.java"],
- libs: ["com.android.location.provider"],
+ libs: ["com.android.location.provider.impl"],
platform_apis: true,
certificate: "platform",
privileged: true,
@@ -50,9 +50,9 @@
"src/**/*.java", // include real sources because we're forced to test this directly
],
libs: [
- "android.test.base",
- "android.test.runner",
- "com.android.location.provider",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
+ "com.android.location.provider.impl",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/PrintSpooler/res/values-or/strings.xml b/packages/PrintSpooler/res/values-or/strings.xml
index a29f320ca..4aca0a4 100644
--- a/packages/PrintSpooler/res/values-or/strings.xml
+++ b/packages/PrintSpooler/res/values-or/strings.xml
@@ -40,7 +40,7 @@
<string name="print_dialog" msgid="32628687461331979">"ପ୍ରିଣ୍ଟ ଡାୟଲଗ୍"</string>
<string name="current_page_template" msgid="5145005201131935302">"<xliff:g id="CURRENT_PAGE">%1$d</xliff:g>/<xliff:g id="PAGE_COUNT">%2$d</xliff:g>"</string>
<string name="page_description_template" msgid="6831239682256197161">"<xliff:g id="PAGE_COUNT">%2$d</xliff:g>ରୁ <xliff:g id="CURRENT_PAGE">%1$d</xliff:g> ପୃଷ୍ଠା"</string>
- <string name="summary_template" msgid="8899734908625669193">"ସାରାଂଶ, କପୀ <xliff:g id="COPIES">%1$s</xliff:g>, କାଗଜ ଆକାର <xliff:g id="PAPER_SIZE">%2$s</xliff:g>"</string>
+ <string name="summary_template" msgid="8899734908625669193">"ସାରାଂଶ, କପି <xliff:g id="COPIES">%1$s</xliff:g>, କାଗଜ ଆକାର <xliff:g id="PAPER_SIZE">%2$s</xliff:g>"</string>
<string name="expand_handle" msgid="7282974448109280522">"ହ୍ୟାଣ୍ଡେଲ୍ ବଡ଼ କରନ୍ତୁ"</string>
<string name="collapse_handle" msgid="6886637989442507451">"ହ୍ୟାଣ୍ଡେଲ୍ ଛୋଟ କରନ୍ତୁ"</string>
<string name="print_button" msgid="645164566271246268">"ପ୍ରିଣ୍ଟ କରନ୍ତୁ"</string>
diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java b/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java
index 81f7315..fe27cee 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java
@@ -654,52 +654,49 @@
public void renderPage(int pageIndex, RenderSpec renderSpec,
OnPageContentAvailableCallback callback) {
- // First, check if we have a rendered page for this index.
- RenderedPage renderedPage = mPageContentCache.getRenderedPage(pageIndex);
- if (renderedPage != null && renderedPage.state == RenderedPage.STATE_RENDERED) {
- // If we have rendered page with same constraints - done.
- if (renderedPage.renderSpec.equals(renderSpec)) {
- if (DEBUG) {
- Log.i(LOG_TAG, "Cache hit for page: " + pageIndex);
- }
-
- // Announce if needed.
- if (callback != null) {
- callback.onPageContentAvailable(renderedPage.content);
- }
- return;
- } else {
- // If the constraints changed, mark the page obsolete.
- renderedPage.state = RenderedPage.STATE_SCRAP;
- }
- }
-
- // Next, check if rendering this page is scheduled.
- RenderPageTask renderTask = mPageToRenderTaskMap.get(pageIndex);
- if (renderTask != null && !renderTask.isCancelled()) {
- // If not rendered and constraints same....
- if (renderTask.mRenderSpec.equals(renderSpec)) {
- if (renderTask.mCallback != null) {
- // If someone else is already waiting for this page - bad state.
- if (callback != null && renderTask.mCallback != callback) {
- throw new IllegalStateException("Page rendering not cancelled");
+ synchronized (mPageToRenderTaskMap) {
+ RenderedPage renderedPage = mPageContentCache.getRenderedPage(pageIndex);
+ if (renderedPage != null && renderedPage.state == RenderedPage.STATE_RENDERED) {
+ // If we have rendered page with same constraints - done.
+ if (renderedPage.renderSpec.equals(renderSpec)) {
+ if (DEBUG) {
+ Log.i(LOG_TAG, "Cache hit for page: " + pageIndex);
}
- } else {
- // No callback means we are preloading so just let the argument
- // callback be attached to our work in progress.
- renderTask.mCallback = callback;
- }
- return;
- } else {
- // If not rendered and constraints changed - cancel rendering.
- renderTask.cancel(true);
- }
- }
- // Oh well, we will have work to do...
- renderTask = new RenderPageTask(pageIndex, renderSpec, callback);
- mPageToRenderTaskMap.put(pageIndex, renderTask);
- renderTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
+ // Announce if needed.
+ if (callback != null) {
+ callback.onPageContentAvailable(renderedPage.content);
+ }
+ return;
+ } else {
+ // If the constraints changed, mark the page obsolete.
+ renderedPage.state = RenderedPage.STATE_SCRAP;
+ }
+ }
+
+ // Next, check if rendering this page is scheduled.
+ RenderPageTask renderTask = mPageToRenderTaskMap.get(pageIndex);
+ if (renderTask != null && !renderTask.isCancelled()) {
+ // If not rendered and constraints same....
+ if (renderTask.mRenderSpec.equals(renderSpec)) {
+ renderTask.mCallback = callback;
+ return;
+ } else {
+ // If not rendered and constraints changed - cancel rendering.
+ try {
+ renderTask.cancel(true);
+ mPageToRenderTaskMap.remove(pageIndex);
+ } catch (Exception e) {
+ Log.e(LOG_TAG, "Error cancelling RenderPageTask ", e);
+ }
+ }
+ }
+
+ // Oh well, we will have work to do...
+ renderTask = new RenderPageTask(pageIndex, renderSpec, callback);
+ mPageToRenderTaskMap.put(pageIndex, renderTask);
+ renderTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
+ }
}
public void cancelRendering(int pageIndex) {
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
index ff09084..c4173ed 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -460,7 +460,7 @@
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE) {
event.startTracking();
return true;
}
@@ -479,7 +479,7 @@
return true;
}
- if (keyCode == KeyEvent.KEYCODE_BACK
+ if ((keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE)
&& event.isTracking() && !event.isCanceled()) {
if (mPrintPreviewController != null && mPrintPreviewController.isOptionsOpened()
&& !hasErrors()) {
diff --git a/packages/SettingsLib/Android.bp b/packages/SettingsLib/Android.bp
index 0cb85d8..b997c35 100644
--- a/packages/SettingsLib/Android.bp
+++ b/packages/SettingsLib/Android.bp
@@ -42,6 +42,8 @@
"SettingsLibIllustrationPreference",
"SettingsLibLayoutPreference",
"SettingsLibMainSwitchPreference",
+ "SettingsLibMetadata",
+ "SettingsLibPreference",
"SettingsLibProfileSelector",
"SettingsLibProgressBar",
"SettingsLibRestrictedLockUtils",
diff --git a/packages/SettingsLib/DataStore/Android.bp b/packages/SettingsLib/DataStore/Android.bp
index 86c8f0da..6840e10 100644
--- a/packages/SettingsLib/DataStore/Android.bp
+++ b/packages/SettingsLib/DataStore/Android.bp
@@ -17,6 +17,7 @@
"androidx.annotation_annotation",
"androidx.collection_collection-ktx",
"androidx.core_core-ktx",
+ "error_prone_annotations",
"guava",
],
kotlincflags: ["-Xjvm-default=all"],
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/KeyValueStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/KeyValueStore.kt
new file mode 100644
index 0000000..3d41337
--- /dev/null
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/KeyValueStore.kt
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.datastore
+
+import android.content.SharedPreferences
+
+/** Interface of key-value store. */
+interface KeyValueStore : KeyedObservable<String> {
+
+ /** Returns if the storage contains persistent value of given key. */
+ fun contains(key: String): Boolean
+
+ /** Gets default value of given key. */
+ fun <T : Any> getDefaultValue(key: String, valueType: Class<T>): T? =
+ when (valueType) {
+ Boolean::class.javaObjectType -> false
+ Float::class.javaObjectType -> 0f
+ Int::class.javaObjectType -> 0
+ Long::class.javaObjectType -> 0
+ else -> null
+ }
+ as T?
+
+ /** Gets value of given key. */
+ fun <T : Any> getValue(key: String, valueType: Class<T>): T?
+
+ /**
+ * Sets value for given key.
+ *
+ * @param key key
+ * @param valueType value type
+ * @param value value to set, null means remove
+ */
+ fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?)
+}
+
+/** [SharedPreferences] based [KeyValueStore]. */
+interface SharedPreferencesKeyValueStore : KeyValueStore {
+
+ /** [SharedPreferences] of the key-value store. */
+ val sharedPreferences: SharedPreferences
+
+ override fun contains(key: String): Boolean = sharedPreferences.contains(key)
+
+ override fun <T : Any> getValue(key: String, valueType: Class<T>): T? =
+ when (valueType) {
+ Boolean::class.javaObjectType -> sharedPreferences.getBoolean(key, false)
+ Float::class.javaObjectType -> sharedPreferences.getFloat(key, 0f)
+ Int::class.javaObjectType -> sharedPreferences.getInt(key, 0)
+ Long::class.javaObjectType -> sharedPreferences.getLong(key, 0)
+ String::class.javaObjectType -> sharedPreferences.getString(key, null)
+ Set::class.javaObjectType -> sharedPreferences.getStringSet(key, null)
+ else -> null
+ }
+ as T?
+
+ override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) {
+ if (value == null) {
+ sharedPreferences.edit().remove(key).apply()
+ return
+ }
+ val edit = sharedPreferences.edit()
+ when (valueType) {
+ Boolean::class.javaObjectType -> edit.putBoolean(key, value as Boolean)
+ Float::class.javaObjectType -> edit.putFloat(key, value as Float)
+ Int::class.javaObjectType -> edit.putInt(key, value as Int)
+ Long::class.javaObjectType -> edit.putLong(key, value as Long)
+ String::class.javaObjectType -> edit.putString(key, value as String)
+ Set::class.javaObjectType -> edit.putStringSet(key, value as Set<String>)
+ else -> {}
+ }
+ edit.apply()
+ }
+}
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/KeyedObserver.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/KeyedObserver.kt
index 4ce1d37..ec90317 100644
--- a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/KeyedObserver.kt
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/KeyedObserver.kt
@@ -19,6 +19,7 @@
import androidx.annotation.AnyThread
import androidx.annotation.GuardedBy
import androidx.collection.MutableScatterMap
+import com.google.errorprone.annotations.CanIgnoreReturnValue
import java.util.WeakHashMap
import java.util.concurrent.Executor
@@ -62,8 +63,9 @@
*
* @param observer observer to be notified
* @param executor executor to run the callback
+ * @return if the observer is newly added
*/
- fun addObserver(observer: KeyedObserver<K?>, executor: Executor)
+ @CanIgnoreReturnValue fun addObserver(observer: KeyedObserver<K?>, executor: Executor): Boolean
/**
* Adds an observer on given key.
@@ -73,14 +75,24 @@
* @param key key to observe
* @param observer observer to be notified
* @param executor executor to run the callback
+ * @return if the observer is newly added
*/
- fun addObserver(key: K, observer: KeyedObserver<K>, executor: Executor)
+ @CanIgnoreReturnValue
+ fun addObserver(key: K, observer: KeyedObserver<K>, executor: Executor): Boolean
- /** Removes observer. */
- fun removeObserver(observer: KeyedObserver<K?>)
+ /**
+ * Removes observer.
+ *
+ * @return if the observer is found and removed
+ */
+ @CanIgnoreReturnValue fun removeObserver(observer: KeyedObserver<K?>): Boolean
- /** Removes observer on given key. */
- fun removeObserver(key: K, observer: KeyedObserver<K>)
+ /**
+ * Removes observer on given key.
+ *
+ * @return if the observer is found and removed
+ */
+ @CanIgnoreReturnValue fun removeObserver(key: K, observer: KeyedObserver<K>): Boolean
/**
* Notifies all observers that a change occurs.
@@ -111,14 +123,17 @@
@GuardedBy("itself")
private val keyedObservers = MutableScatterMap<K, WeakHashMap<KeyedObserver<K>, Executor>>()
- override fun addObserver(observer: KeyedObserver<K?>, executor: Executor) {
+ @CanIgnoreReturnValue
+ override fun addObserver(observer: KeyedObserver<K?>, executor: Executor): Boolean {
val oldExecutor = synchronized(observers) { observers.put(observer, executor) }
if (oldExecutor != null && oldExecutor != executor) {
throw IllegalStateException("Add $observer twice, old=$oldExecutor, new=$executor")
}
+ return oldExecutor == null
}
- override fun addObserver(key: K, observer: KeyedObserver<K>, executor: Executor) {
+ @CanIgnoreReturnValue
+ override fun addObserver(key: K, observer: KeyedObserver<K>, executor: Executor): Boolean {
val oldExecutor =
synchronized(keyedObservers) {
keyedObservers.getOrPut(key) { WeakHashMap() }.put(observer, executor)
@@ -126,20 +141,23 @@
if (oldExecutor != null && oldExecutor != executor) {
throw IllegalStateException("Add $observer twice, old=$oldExecutor, new=$executor")
}
+ return oldExecutor == null
}
- override fun removeObserver(observer: KeyedObserver<K?>) {
- synchronized(observers) { observers.remove(observer) }
- }
+ @CanIgnoreReturnValue
+ override fun removeObserver(observer: KeyedObserver<K?>) =
+ synchronized(observers) { observers.remove(observer) } != null
- override fun removeObserver(key: K, observer: KeyedObserver<K>) {
+ @CanIgnoreReturnValue
+ override fun removeObserver(key: K, observer: KeyedObserver<K>) =
synchronized(keyedObservers) {
- val observers = keyedObservers[key]
- if (observers?.remove(observer) != null && observers.isEmpty()) {
+ val observers = keyedObservers[key] ?: return false
+ val removed = observers.remove(observer) != null
+ if (removed && observers.isEmpty()) {
keyedObservers.remove(key)
}
+ removed
}
- }
override fun notifyChange(reason: Int) {
// make a copy to avoid potential ConcurrentModificationException
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt
new file mode 100644
index 0000000..4aef0fc
--- /dev/null
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.datastore
+
+import android.content.ContentResolver
+import android.content.Context
+import android.provider.Settings.Global
+import android.provider.Settings.SettingNotFoundException
+
+/**
+ * [KeyValueStore] for [Global] settings.
+ *
+ * By default, a boolean type `true` value is stored as `1` and `false` value is stored as `0`.
+ */
+class SettingsGlobalStore private constructor(contentResolver: ContentResolver) :
+ SettingsStore(contentResolver) {
+
+ override val tag: String
+ get() = "SettingsGlobalStore"
+
+ override fun contains(key: String): Boolean = Global.getString(contentResolver, key) != null
+
+ override fun <T : Any> getValue(key: String, valueType: Class<T>): T? =
+ try {
+ when (valueType) {
+ Boolean::class.javaObjectType -> Global.getInt(contentResolver, key) != 0
+ Float::class.javaObjectType -> Global.getFloat(contentResolver, key)
+ Int::class.javaObjectType -> Global.getInt(contentResolver, key)
+ Long::class.javaObjectType -> Global.getLong(contentResolver, key)
+ String::class.javaObjectType -> Global.getString(contentResolver, key)
+ else -> throw UnsupportedOperationException("Get $key $valueType")
+ }
+ as T?
+ } catch (e: SettingNotFoundException) {
+ null
+ }
+
+ override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) {
+ if (value == null) {
+ Global.putString(contentResolver, key, null)
+ return
+ }
+ when (valueType) {
+ Boolean::class.javaObjectType ->
+ Global.putInt(contentResolver, key, if (value == true) 1 else 0)
+ Float::class.javaObjectType -> Global.putFloat(contentResolver, key, value as Float)
+ Int::class.javaObjectType -> Global.putInt(contentResolver, key, value as Int)
+ Long::class.javaObjectType -> Global.putLong(contentResolver, key, value as Long)
+ String::class.javaObjectType -> Global.putString(contentResolver, key, value as String)
+ else -> throw UnsupportedOperationException("Set $key $valueType")
+ }
+ }
+
+ companion object {
+ @Volatile private var instance: SettingsGlobalStore? = null
+
+ @JvmStatic
+ fun get(context: Context): SettingsGlobalStore =
+ instance
+ ?: synchronized(this) {
+ instance
+ ?: SettingsGlobalStore(context.applicationContext.contentResolver).also {
+ instance = it
+ }
+ }
+ }
+}
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt
new file mode 100644
index 0000000..9f41ecb
--- /dev/null
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.datastore
+
+import android.content.ContentResolver
+import android.content.Context
+import android.provider.Settings.Secure
+import android.provider.Settings.SettingNotFoundException
+
+/**
+ * [KeyValueStore] for [Secure] settings.
+ *
+ * By default, a boolean type `true` value is stored as `1` and `false` value is stored as `0`.
+ */
+class SettingsSecureStore private constructor(contentResolver: ContentResolver) :
+ SettingsStore(contentResolver) {
+
+ override val tag: String
+ get() = "SettingsSecureStore"
+
+ override fun contains(key: String): Boolean = Secure.getString(contentResolver, key) != null
+
+ override fun <T : Any> getValue(key: String, valueType: Class<T>): T? =
+ try {
+ when (valueType) {
+ Boolean::class.javaObjectType -> Secure.getInt(contentResolver, key) != 0
+ Float::class.javaObjectType -> Secure.getFloat(contentResolver, key)
+ Int::class.javaObjectType -> Secure.getInt(contentResolver, key)
+ Long::class.javaObjectType -> Secure.getLong(contentResolver, key)
+ String::class.javaObjectType -> Secure.getString(contentResolver, key)
+ else -> throw UnsupportedOperationException("Get $key $valueType")
+ }
+ as T?
+ } catch (e: SettingNotFoundException) {
+ null
+ }
+
+ override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) {
+ if (value == null) {
+ Secure.putString(contentResolver, key, null)
+ return
+ }
+ when (valueType) {
+ Boolean::class.javaObjectType ->
+ Secure.putInt(contentResolver, key, if (value == true) 1 else 0)
+ Float::class.javaObjectType -> Secure.putFloat(contentResolver, key, value as Float)
+ Int::class.javaObjectType -> Secure.putInt(contentResolver, key, value as Int)
+ Long::class.javaObjectType -> Secure.putLong(contentResolver, key, value as Long)
+ String::class.javaObjectType -> Secure.putString(contentResolver, key, value as String)
+ else -> throw UnsupportedOperationException("Set $key $valueType")
+ }
+ }
+
+ companion object {
+ @Volatile private var instance: SettingsSecureStore? = null
+
+ @JvmStatic
+ fun get(context: Context): SettingsSecureStore =
+ instance
+ ?: synchronized(this) {
+ instance
+ ?: SettingsSecureStore(context.applicationContext.contentResolver).also {
+ instance = it
+ }
+ }
+ }
+}
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt
new file mode 100644
index 0000000..5981688
--- /dev/null
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.datastore
+
+import android.content.ContentResolver
+import android.database.ContentObserver
+import android.net.Uri
+import android.os.Handler
+import android.os.Looper
+import android.provider.Settings
+import android.util.Log
+import java.util.concurrent.Executor
+import java.util.concurrent.atomic.AtomicInteger
+
+/** Base class of the Settings provider data stores. */
+open abstract class SettingsStore(protected val contentResolver: ContentResolver) :
+ KeyedDataObservable<String>(), KeyValueStore {
+
+ /**
+ * Counter of observers.
+ *
+ * The value is accurate only when [addObserver] and [removeObserver] are called correctly. When
+ * an observer is not removed (and its weak reference is garbage collected), the content
+ * observer is not unregistered but this is not a big deal.
+ */
+ private val counter = AtomicInteger()
+
+ private val contentObserver =
+ object : ContentObserver(Handler(Looper.getMainLooper())) {
+ override fun onChange(selfChange: Boolean) {
+ super.onChange(selfChange, null)
+ }
+
+ override fun onChange(selfChange: Boolean, uri: Uri?) {
+ val key = uri?.lastPathSegment ?: return
+ notifyChange(key, DataChangeReason.UPDATE)
+ }
+ }
+
+ override fun addObserver(observer: KeyedObserver<String?>, executor: Executor) =
+ if (super.addObserver(observer, executor)) {
+ onObserverAdded()
+ true
+ } else {
+ false
+ }
+
+ override fun addObserver(key: String, observer: KeyedObserver<String>, executor: Executor) =
+ if (super.addObserver(key, observer, executor)) {
+ onObserverAdded()
+ true
+ } else {
+ false
+ }
+
+ private fun onObserverAdded() {
+ if (counter.getAndIncrement() != 0) return
+ Log.i(tag, "registerContentObserver")
+ contentResolver.registerContentObserver(
+ Settings.Global.getUriFor(""),
+ true,
+ contentObserver,
+ )
+ }
+
+ override fun removeObserver(observer: KeyedObserver<String?>) =
+ if (super.removeObserver(observer)) {
+ onObserverRemoved()
+ true
+ } else {
+ false
+ }
+
+ override fun removeObserver(key: String, observer: KeyedObserver<String>) =
+ if (super.removeObserver(key, observer)) {
+ onObserverRemoved()
+ true
+ } else {
+ false
+ }
+
+ private fun onObserverRemoved() {
+ if (counter.decrementAndGet() != 0) return
+ Log.i(tag, "unregisterContentObserver")
+ contentResolver.unregisterContentObserver(contentObserver)
+ }
+
+ /** Tag for logging. */
+ abstract val tag: String
+}
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt
new file mode 100644
index 0000000..6cca7ed
--- /dev/null
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.datastore
+
+import android.content.ContentResolver
+import android.content.Context
+import android.provider.Settings.SettingNotFoundException
+import android.provider.Settings.System
+
+/**
+ * [KeyValueStore] for [System] settings.
+ *
+ * By default, a boolean type `true` value is stored as `1` and `false` value is stored as `0`.
+ */
+class SettingsSystemStore private constructor(contentResolver: ContentResolver) :
+ SettingsStore(contentResolver) {
+
+ override val tag: String
+ get() = "SettingsSystemStore"
+
+ override fun contains(key: String): Boolean = System.getString(contentResolver, key) != null
+
+ override fun <T : Any> getValue(key: String, valueType: Class<T>): T? =
+ try {
+ when (valueType) {
+ Boolean::class.javaObjectType -> System.getInt(contentResolver, key) != 0
+ Float::class.javaObjectType -> System.getFloat(contentResolver, key)
+ Int::class.javaObjectType -> System.getInt(contentResolver, key)
+ Long::class.javaObjectType -> System.getLong(contentResolver, key)
+ String::class.javaObjectType -> System.getString(contentResolver, key)
+ else -> throw UnsupportedOperationException("Get $key $valueType")
+ }
+ as T?
+ } catch (e: SettingNotFoundException) {
+ null
+ }
+
+ override fun <T : Any> setValue(key: String, valueType: Class<T>, value: T?) {
+ if (value == null) {
+ System.putString(contentResolver, key, null)
+ return
+ }
+ when (valueType) {
+ Boolean::class.javaObjectType ->
+ System.putInt(contentResolver, key, if (value == true) 1 else 0)
+ Float::class.javaObjectType -> System.putFloat(contentResolver, key, value as Float)
+ Int::class.javaObjectType -> System.putInt(contentResolver, key, value as Int)
+ Long::class.javaObjectType -> System.putLong(contentResolver, key, value as Long)
+ String::class.javaObjectType -> System.putString(contentResolver, key, value as String)
+ else -> throw UnsupportedOperationException("Set $key $valueType")
+ }
+ }
+
+ companion object {
+ @Volatile private var instance: SettingsSystemStore? = null
+
+ @JvmStatic
+ fun get(context: Context): SettingsSystemStore =
+ instance
+ ?: synchronized(this) {
+ instance
+ ?: SettingsSystemStore(context.applicationContext.contentResolver).also {
+ instance = it
+ }
+ }
+ }
+}
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SharedPreferencesStorage.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SharedPreferencesStorage.kt
index 0ca91cd..ea17a56 100644
--- a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SharedPreferencesStorage.kt
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SharedPreferencesStorage.kt
@@ -40,8 +40,9 @@
* Note that existing entries in the SharedPreferences will NOT be deleted before restore.
*
* @param context Context to get SharedPreferences
- * @param name Name of the SharedPreferences
- * @param mode Operating mode, see [Context.getSharedPreferences]
+ * @param name Name of the backup restore storage
+ * @param sharedPreferences SharedPreferences object
+ * @param filePath shared preferences file path relative to data dir
* @param verbose Verbose logging on key/value pairs during backup/restore. Enable for dev only!
* @param filter Filter of key/value pairs for backup and restore.
*/
@@ -50,12 +51,14 @@
constructor(
context: Context,
override val name: String,
- @get:VisibleForTesting internal val sharedPreferences: SharedPreferences,
+ override val sharedPreferences: SharedPreferences,
+ filePath: String = getSharedPreferencesFilePath(context, name),
private val codec: BackupCodec? = null,
private val verbose: Boolean = defaultVerbose(),
private val filter: (String, Any?) -> Boolean = { _, _ -> true },
) :
- BackupRestoreFileStorage(context, context.getSharedPreferencesFilePath(name)),
+ BackupRestoreFileStorage(context, filePath),
+ SharedPreferencesKeyValueStore,
KeyedObservable<String> by KeyedDataObservable() {
@JvmOverloads
@@ -66,7 +69,15 @@
codec: BackupCodec? = null,
verbose: Boolean = defaultVerbose(),
filter: (String, Any?) -> Boolean = { _, _ -> true },
- ) : this(context, name, context.getSharedPreferences(name, mode), codec, verbose, filter)
+ ) : this(
+ context,
+ name,
+ context.getSharedPreferences(name, mode),
+ getSharedPreferencesFilePath(context, name),
+ codec,
+ verbose,
+ filter,
+ )
/** Name of the intermediate SharedPreferences. */
@VisibleForTesting
@@ -80,7 +91,15 @@
return context.getSharedPreferences(intermediateName, Context.MODE_MULTI_PROCESS)
}
- private val sharedPreferencesListener = createSharedPreferenceListener()
+ private val sharedPreferencesListener =
+ SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
+ if (key != null) {
+ notifyChange(key, DataChangeReason.UPDATE)
+ } else {
+ // On Android >= R, SharedPreferences.Editor.clear() will trigger this case
+ notifyChange(DataChangeReason.DELETE)
+ }
+ }
init {
// listener is weakly referenced, so unregister is optional
@@ -183,7 +202,8 @@
else -> {
Log.e(
LOG_TAG,
- "[$name] $operation $key=$value, unknown type: ${value?.javaClass}")
+ "[$name] $operation $key=$value, unknown type: ${value?.javaClass}",
+ )
}
}
}
@@ -191,14 +211,31 @@
}
companion object {
- private fun Context.getSharedPreferencesFilePath(name: String): String {
- val file = getSharedPreferencesFile(name)
- return file.relativeTo(dataDirCompat).toString()
+ /** Returns the storage object of default [SharedPreferences]. */
+ @JvmStatic
+ fun getDefault(context: Context, name: String): SharedPreferencesStorage {
+ val prefName = getDefaultSharedPreferencesName(context)
+ return SharedPreferencesStorage(
+ context,
+ name,
+ context.getSharedPreferences(prefName, Context.MODE_PRIVATE),
+ getSharedPreferencesFilePath(context, prefName),
+ )
+ }
+
+ /** Returns the name of default [SharedPreferences]. */
+ @JvmStatic
+ fun getDefaultSharedPreferencesName(context: Context) = context.packageName + "_preferences"
+
+ /** Returns the shared preferences file path relative to data dir. */
+ @JvmStatic
+ fun getSharedPreferencesFilePath(context: Context, name: String): String {
+ val file = context.getSharedPreferencesFile(name)
+ return file.relativeTo(context.dataDirCompat).toString()
}
/** Returns the absolute path of shared preferences file. */
- @JvmStatic
- fun Context.getSharedPreferencesFile(name: String): File {
+ private fun Context.getSharedPreferencesFile(name: String): File {
// ContextImpl.getSharedPreferencesPath is private
return File(getSharedPreferencesDir(), "$name.xml")
}
diff --git a/packages/SettingsLib/DataStore/tests/src/com/android/settingslib/datastore/KeyedObserverTest.kt b/packages/SettingsLib/DataStore/tests/src/com/android/settingslib/datastore/KeyedObserverTest.kt
index 0fdecb0..c99d4b3 100644
--- a/packages/SettingsLib/DataStore/tests/src/com/android/settingslib/datastore/KeyedObserverTest.kt
+++ b/packages/SettingsLib/DataStore/tests/src/com/android/settingslib/datastore/KeyedObserverTest.kt
@@ -45,14 +45,14 @@
@Test
fun addObserver_sameExecutor() {
- keyedObservable.addObserver(observer1, executor1)
- keyedObservable.addObserver(observer1, executor1)
+ assertThat(keyedObservable.addObserver(observer1, executor1)).isTrue()
+ assertThat(keyedObservable.addObserver(observer1, executor1)).isFalse()
}
@Test
fun addObserver_keyedObserver_sameExecutor() {
- keyedObservable.addObserver(key1, keyedObserver1, executor1)
- keyedObservable.addObserver(key1, keyedObserver1, executor1)
+ assertThat(keyedObservable.addObserver(key1, keyedObserver1, executor1)).isTrue()
+ assertThat(keyedObservable.addObserver(key1, keyedObserver1, executor1)).isFalse()
}
@Test
@@ -109,15 +109,15 @@
@Test
fun addObserver_notifyObservers_removeObserver() {
- keyedObservable.addObserver(observer1, executor1)
- keyedObservable.addObserver(observer2, executor2)
+ assertThat(keyedObservable.addObserver(observer1, executor1)).isTrue()
+ assertThat(keyedObservable.addObserver(observer2, executor2)).isTrue()
keyedObservable.notifyChange(DataChangeReason.UPDATE)
verify(observer1).onKeyChanged(null, DataChangeReason.UPDATE)
verify(observer2).onKeyChanged(null, DataChangeReason.UPDATE)
reset(observer1, observer2)
- keyedObservable.removeObserver(observer2)
+ assertThat(keyedObservable.removeObserver(observer2)).isTrue()
keyedObservable.notifyChange(DataChangeReason.DELETE)
verify(observer1).onKeyChanged(null, DataChangeReason.DELETE)
@@ -126,15 +126,15 @@
@Test
fun addObserver_keyedObserver_notifyObservers_removeObserver() {
- keyedObservable.addObserver(key1, keyedObserver1, executor1)
- keyedObservable.addObserver(key2, keyedObserver2, executor2)
+ assertThat(keyedObservable.addObserver(key1, keyedObserver1, executor1)).isTrue()
+ assertThat(keyedObservable.addObserver(key2, keyedObserver2, executor2)).isTrue()
keyedObservable.notifyChange(key1, DataChangeReason.UPDATE)
verify(keyedObserver1).onKeyChanged(key1, DataChangeReason.UPDATE)
verify(keyedObserver2, never()).onKeyChanged(key2, DataChangeReason.UPDATE)
reset(keyedObserver1, keyedObserver2)
- keyedObservable.removeObserver(key1, keyedObserver1)
+ assertThat(keyedObservable.removeObserver(key1, keyedObserver1)).isTrue()
keyedObservable.notifyChange(key1, DataChangeReason.DELETE)
verify(keyedObserver1, never()).onKeyChanged(key1, DataChangeReason.DELETE)
@@ -143,9 +143,9 @@
@Test
fun notifyChange_addMoreTypeObservers_checkOnKeyChanged() {
- keyedObservable.addObserver(observer1, executor1)
- keyedObservable.addObserver(key1, keyedObserver1, executor1)
- keyedObservable.addObserver(key2, keyedObserver2, executor1)
+ assertThat(keyedObservable.addObserver(observer1, executor1)).isTrue()
+ assertThat(keyedObservable.addObserver(key1, keyedObserver1, executor1)).isTrue()
+ assertThat(keyedObservable.addObserver(key2, keyedObserver2, executor1)).isTrue()
keyedObservable.notifyChange(DataChangeReason.UPDATE)
verify(observer1).onKeyChanged(null, DataChangeReason.UPDATE)
@@ -171,25 +171,25 @@
fun notifyChange_addObserverWithinCallback() {
// ConcurrentModificationException is raised if it is not implemented correctly
val observer: KeyedObserver<Any?> = KeyedObserver { _, _ ->
- keyedObservable.addObserver(observer1, executor1)
+ assertThat(keyedObservable.addObserver(observer1, executor1)).isTrue()
}
- keyedObservable.addObserver(observer, executor1)
+ assertThat(keyedObservable.addObserver(observer, executor1)).isTrue()
keyedObservable.notifyChange(DataChangeReason.UPDATE)
- keyedObservable.removeObserver(observer)
+ assertThat(keyedObservable.removeObserver(observer)).isTrue()
}
@Test
fun notifyChange_KeyedObserver_addObserverWithinCallback() {
// ConcurrentModificationException is raised if it is not implemented correctly
val keyObserver: KeyedObserver<Any?> = KeyedObserver { _, _ ->
- keyedObservable.addObserver(key1, keyedObserver1, executor1)
+ assertThat(keyedObservable.addObserver(key1, keyedObserver1, executor1)).isTrue()
}
- keyedObservable.addObserver(key1, keyObserver, executor1)
+ assertThat(keyedObservable.addObserver(key1, keyObserver, executor1)).isTrue()
keyedObservable.notifyChange(key1, DataChangeReason.UPDATE)
- keyedObservable.removeObserver(key1, keyObserver)
+ assertThat(keyedObservable.removeObserver(key1, keyObserver)).isTrue()
}
}
diff --git a/packages/SettingsLib/Metadata/Android.bp b/packages/SettingsLib/Metadata/Android.bp
new file mode 100644
index 0000000..207637f
--- /dev/null
+++ b/packages/SettingsLib/Metadata/Android.bp
@@ -0,0 +1,23 @@
+package {
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+filegroup {
+ name: "SettingsLibMetadata-srcs",
+ srcs: ["src/**/*.kt"],
+}
+
+android_library {
+ name: "SettingsLibMetadata",
+ defaults: [
+ "SettingsLintDefaults",
+ ],
+ srcs: [":SettingsLibMetadata-srcs"],
+ static_libs: [
+ "androidx.annotation_annotation",
+ "androidx.fragment_fragment",
+ "guava",
+ "SettingsLibDataStore",
+ ],
+ kotlincflags: ["-Xjvm-default=all"],
+}
diff --git a/packages/SettingsLib/Metadata/AndroidManifest.xml b/packages/SettingsLib/Metadata/AndroidManifest.xml
new file mode 100644
index 0000000..1c801e6
--- /dev/null
+++ b/packages/SettingsLib/Metadata/AndroidManifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.settingslib.metadata">
+
+ <uses-sdk android:minSdkVersion="21" />
+</manifest>
diff --git a/packages/SettingsLib/Metadata/processor/Android.bp b/packages/SettingsLib/Metadata/processor/Android.bp
new file mode 100644
index 0000000..d8acc76
--- /dev/null
+++ b/packages/SettingsLib/Metadata/processor/Android.bp
@@ -0,0 +1,11 @@
+package {
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+java_plugin {
+ name: "SettingsLibMetadata-processor",
+ srcs: ["src/**/*.kt"],
+ processor_class: "com.android.settingslib.metadata.PreferenceScreenAnnotationProcessor",
+ java_resource_dirs: ["resources"],
+ visibility: ["//visibility:public"],
+}
diff --git a/packages/SettingsLib/Metadata/processor/resources/META-INF/services/javax.annotation.processing.Processor b/packages/SettingsLib/Metadata/processor/resources/META-INF/services/javax.annotation.processing.Processor
new file mode 100644
index 0000000..762a01a
--- /dev/null
+++ b/packages/SettingsLib/Metadata/processor/resources/META-INF/services/javax.annotation.processing.Processor
@@ -0,0 +1 @@
+com.android.settingslib.metadata.PreferenceScreenAnnotationProcessor
\ No newline at end of file
diff --git a/packages/SettingsLib/Metadata/processor/src/com/android/settingslib/metadata/PreferenceScreenAnnotationProcessor.kt b/packages/SettingsLib/Metadata/processor/src/com/android/settingslib/metadata/PreferenceScreenAnnotationProcessor.kt
new file mode 100644
index 0000000..620d717
--- /dev/null
+++ b/packages/SettingsLib/Metadata/processor/src/com/android/settingslib/metadata/PreferenceScreenAnnotationProcessor.kt
@@ -0,0 +1,226 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import java.util.TreeMap
+import javax.annotation.processing.AbstractProcessor
+import javax.annotation.processing.ProcessingEnvironment
+import javax.annotation.processing.RoundEnvironment
+import javax.lang.model.SourceVersion
+import javax.lang.model.element.AnnotationMirror
+import javax.lang.model.element.AnnotationValue
+import javax.lang.model.element.Element
+import javax.lang.model.element.ElementKind
+import javax.lang.model.element.ExecutableElement
+import javax.lang.model.element.Modifier
+import javax.lang.model.element.TypeElement
+import javax.lang.model.type.TypeMirror
+import javax.tools.Diagnostic
+
+/** Processor to gather preference screens annotated with `@ProvidePreferenceScreen`. */
+class PreferenceScreenAnnotationProcessor : AbstractProcessor() {
+ private val screens = TreeMap<String, ConstructorType>()
+ private val overlays = mutableMapOf<String, String>()
+ private val contextType: TypeMirror by lazy {
+ processingEnv.elementUtils.getTypeElement("android.content.Context").asType()
+ }
+
+ private var options: Map<String, Any?>? = null
+ private lateinit var annotationElement: TypeElement
+ private lateinit var optionsElement: TypeElement
+ private lateinit var screenType: TypeMirror
+
+ override fun getSupportedAnnotationTypes() = setOf(ANNOTATION, OPTIONS)
+
+ override fun getSupportedSourceVersion(): SourceVersion = SourceVersion.latestSupported()
+
+ override fun init(processingEnv: ProcessingEnvironment) {
+ super.init(processingEnv)
+ val elementUtils = processingEnv.elementUtils
+ annotationElement = elementUtils.getTypeElement(ANNOTATION)
+ optionsElement = elementUtils.getTypeElement(OPTIONS)
+ screenType = elementUtils.getTypeElement("$PACKAGE.$PREFERENCE_SCREEN_METADATA").asType()
+ }
+
+ override fun process(
+ annotations: MutableSet<out TypeElement>,
+ roundEnv: RoundEnvironment,
+ ): Boolean {
+ roundEnv.getElementsAnnotatedWith(optionsElement).singleOrNull()?.run {
+ if (options != null) error("@$OPTIONS_NAME is already specified: $options", this)
+ options =
+ annotationMirrors
+ .single { it.isElement(optionsElement) }
+ .elementValues
+ .entries
+ .associate { it.key.simpleName.toString() to it.value.value }
+ }
+ for (element in roundEnv.getElementsAnnotatedWith(annotationElement)) {
+ (element as? TypeElement)?.process()
+ }
+ if (roundEnv.processingOver()) codegen()
+ return false
+ }
+
+ private fun TypeElement.process() {
+ if (kind != ElementKind.CLASS || modifiers.contains(Modifier.ABSTRACT)) {
+ error("@$ANNOTATION_NAME must be added to non abstract class", this)
+ return
+ }
+ if (!processingEnv.typeUtils.isAssignable(asType(), screenType)) {
+ error("@$ANNOTATION_NAME must be added to $PREFERENCE_SCREEN_METADATA subclass", this)
+ return
+ }
+ val constructorType = getConstructorType()
+ if (constructorType == null) {
+ error(
+ "Class must be an object, or has single public constructor that " +
+ "accepts no parameter or a Context parameter",
+ this,
+ )
+ return
+ }
+ val screenQualifiedName = qualifiedName.toString()
+ screens[screenQualifiedName] = constructorType
+ val annotation = annotationMirrors.single { it.isElement(annotationElement) }
+ val overlay = annotation.getOverlay()
+ if (overlay != null) {
+ overlays.put(overlay, screenQualifiedName)?.let {
+ error("$overlay has been overlaid by $it", this)
+ }
+ }
+ }
+
+ private fun codegen() {
+ val collector = (options?.get("codegenCollector") as? String) ?: DEFAULT_COLLECTOR
+ if (collector.isEmpty()) return
+ val parts = collector.split('/')
+ if (parts.size == 3) {
+ generateCode(parts[0], parts[1], parts[2])
+ } else {
+ throw IllegalArgumentException(
+ "Collector option '$collector' does not follow 'PKG/CLASS/METHOD' format"
+ )
+ }
+ }
+
+ private fun generateCode(outputPkg: String, outputClass: String, outputFun: String) {
+ for ((overlay, screen) in overlays) {
+ if (screens.remove(overlay) == null) {
+ warn("$overlay is overlaid by $screen but not annotated with @$ANNOTATION_NAME")
+ } else {
+ processingEnv.messager.printMessage(
+ Diagnostic.Kind.NOTE,
+ "$overlay is overlaid by $screen",
+ )
+ }
+ }
+ processingEnv.filer.createSourceFile("$outputPkg.$outputClass").openWriter().use {
+ it.write("package $outputPkg;\n\n")
+ it.write("import $PACKAGE.$PREFERENCE_SCREEN_METADATA;\n\n")
+ it.write("// Generated by annotation processor for @$ANNOTATION_NAME\n")
+ it.write("public final class $outputClass {\n")
+ it.write(" private $outputClass() {}\n\n")
+ it.write(
+ " public static java.util.List<$PREFERENCE_SCREEN_METADATA> " +
+ "$outputFun(android.content.Context context) {\n"
+ )
+ it.write(
+ " java.util.ArrayList<$PREFERENCE_SCREEN_METADATA> screens = " +
+ "new java.util.ArrayList<>(${screens.size});\n"
+ )
+ for ((screen, constructorType) in screens) {
+ when (constructorType) {
+ ConstructorType.DEFAULT -> it.write(" screens.add(new $screen());\n")
+ ConstructorType.CONTEXT -> it.write(" screens.add(new $screen(context));\n")
+ ConstructorType.SINGLETON -> it.write(" screens.add($screen.INSTANCE);\n")
+ }
+ }
+ for ((overlay, screen) in overlays) {
+ it.write(" // $overlay is overlaid by $screen\n")
+ }
+ it.write(" return screens;\n")
+ it.write(" }\n")
+ it.write("}")
+ }
+ }
+
+ private fun AnnotationMirror.isElement(element: TypeElement) =
+ processingEnv.typeUtils.isSameType(annotationType.asElement().asType(), element.asType())
+
+ private fun AnnotationMirror.getOverlay(): String? {
+ for ((key, value) in elementValues) {
+ if (key.simpleName.contentEquals("overlay")) {
+ return if (value.isDefaultClassValue(key)) null else value.value.toString()
+ }
+ }
+ return null
+ }
+
+ private fun AnnotationValue.isDefaultClassValue(key: ExecutableElement) =
+ processingEnv.typeUtils.isSameType(
+ value as TypeMirror,
+ key.defaultValue.value as TypeMirror,
+ )
+
+ private fun TypeElement.getConstructorType(): ConstructorType? {
+ var constructor: ExecutableElement? = null
+ for (element in enclosedElements) {
+ if (element.isKotlinObject()) return ConstructorType.SINGLETON
+ if (element.kind != ElementKind.CONSTRUCTOR) continue
+ if (!element.modifiers.contains(Modifier.PUBLIC)) continue
+ if (constructor != null) return null
+ constructor = element as ExecutableElement
+ }
+ return constructor?.parameters?.run {
+ when {
+ isEmpty() -> ConstructorType.DEFAULT
+ size == 1 && processingEnv.typeUtils.isSameType(this[0].asType(), contextType) ->
+ ConstructorType.CONTEXT
+ else -> null
+ }
+ }
+ }
+
+ private fun Element.isKotlinObject() =
+ kind == ElementKind.FIELD &&
+ modifiers.run { contains(Modifier.PUBLIC) && contains(Modifier.STATIC) } &&
+ simpleName.toString() == "INSTANCE"
+
+ private fun warn(msg: CharSequence) =
+ processingEnv.messager.printMessage(Diagnostic.Kind.WARNING, msg)
+
+ private fun error(msg: CharSequence, element: Element) =
+ processingEnv.messager.printMessage(Diagnostic.Kind.ERROR, msg, element)
+
+ private enum class ConstructorType {
+ DEFAULT, // default constructor with no parameter
+ CONTEXT, // constructor with a Context parameter
+ SINGLETON, // Kotlin object class
+ }
+
+ companion object {
+ private const val PACKAGE = "com.android.settingslib.metadata"
+ private const val ANNOTATION_NAME = "ProvidePreferenceScreen"
+ private const val ANNOTATION = "$PACKAGE.$ANNOTATION_NAME"
+ private const val PREFERENCE_SCREEN_METADATA = "PreferenceScreenMetadata"
+
+ private const val OPTIONS_NAME = "ProvidePreferenceScreenOptions"
+ private const val OPTIONS = "$PACKAGE.$OPTIONS_NAME"
+ private const val DEFAULT_COLLECTOR = "$PACKAGE/PreferenceScreenCollector/get"
+ }
+}
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/Annotations.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/Annotations.kt
new file mode 100644
index 0000000..ea20a74
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/Annotations.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import kotlin.reflect.KClass
+
+/**
+ * Annotation to provide preference screen.
+ *
+ * The annotated class must satisfy either condition:
+ * - the primary constructor has no parameter
+ * - the primary constructor has a single [android.content.Context] parameter
+ * - it is a Kotlin object class
+ *
+ * @param overlay if specified, current annotated screen will overlay the given screen
+ */
+@Retention(AnnotationRetention.SOURCE)
+@Target(AnnotationTarget.CLASS)
+@MustBeDocumented
+annotation class ProvidePreferenceScreen(
+ val overlay: KClass<out PreferenceScreenMetadata> = PreferenceScreenMetadata::class,
+)
+
+/**
+ * Provides options for [ProvidePreferenceScreen] annotation processor.
+ *
+ * @param codegenCollector generated collector class (format: "pkg/class/method"), an empty string
+ * means do not generate code
+ */
+@Retention(AnnotationRetention.SOURCE)
+@Target(AnnotationTarget.CLASS)
+@MustBeDocumented
+annotation class ProvidePreferenceScreenOptions(
+ val codegenCollector: String = "com.android.settingslib.metadata/PreferenceScreenCollector/get",
+)
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PersistentPreference.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PersistentPreference.kt
new file mode 100644
index 0000000..51a8580
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PersistentPreference.kt
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import android.content.Context
+import androidx.annotation.ArrayRes
+import androidx.annotation.IntDef
+import com.android.settingslib.datastore.KeyValueStore
+
+/** Permit of read and write request. */
+@IntDef(
+ ReadWritePermit.ALLOW,
+ ReadWritePermit.DISALLOW,
+ ReadWritePermit.REQUIRE_APP_PERMISSION,
+ ReadWritePermit.REQUIRE_USER_AGREEMENT,
+)
+@Retention(AnnotationRetention.SOURCE)
+annotation class ReadWritePermit {
+ companion object {
+ /** Allow to read/write value. */
+ const val ALLOW = 0
+ /** Disallow to read/write value (e.g. uid not allowed). */
+ const val DISALLOW = 1
+ /** Require (runtime/special) app permission from user explicitly. */
+ const val REQUIRE_APP_PERMISSION = 2
+ /** Require explicit user agreement (e.g. terms of service). */
+ const val REQUIRE_USER_AGREEMENT = 3
+ }
+}
+
+/** Preference interface that has a value persisted in datastore. */
+interface PersistentPreference<T> {
+
+ /**
+ * Returns the key-value storage of the preference.
+ *
+ * The default implementation returns the storage provided by
+ * [PreferenceScreenRegistry.getKeyValueStore].
+ */
+ fun storage(context: Context): KeyValueStore =
+ PreferenceScreenRegistry.getKeyValueStore(context, this as PreferenceMetadata)!!
+
+ /**
+ * Returns if the external application (identified by [callingUid]) has permission to read
+ * preference value.
+ *
+ * The underlying implementation does NOT need to check common states like isEnabled,
+ * isRestricted or isAvailable.
+ */
+ @ReadWritePermit
+ fun getReadPermit(context: Context, myUid: Int, callingUid: Int): Int =
+ PreferenceScreenRegistry.getReadPermit(
+ context,
+ myUid,
+ callingUid,
+ this as PreferenceMetadata,
+ )
+
+ /**
+ * Returns if the external application (identified by [callingUid]) has permission to write
+ * preference with given [value].
+ *
+ * The underlying implementation does NOT need to check common states like isEnabled,
+ * isRestricted or isAvailable.
+ */
+ @ReadWritePermit
+ fun getWritePermit(context: Context, value: T?, myUid: Int, callingUid: Int): Int =
+ PreferenceScreenRegistry.getWritePermit(
+ context,
+ value,
+ myUid,
+ callingUid,
+ this as PreferenceMetadata,
+ )
+}
+
+/** Descriptor of values. */
+sealed interface ValueDescriptor {
+
+ /** Returns if given value (represented by index) is valid. */
+ fun isValidValue(context: Context, index: Int): Boolean
+}
+
+/**
+ * A boolean type value.
+ *
+ * A zero value means `False`, otherwise it is `True`.
+ */
+interface BooleanValue : ValueDescriptor {
+ override fun isValidValue(context: Context, index: Int) = true
+}
+
+/** Value falls into a given array. */
+interface DiscreteValue<T> : ValueDescriptor {
+ @get:ArrayRes val values: Int
+
+ @get:ArrayRes val valuesDescription: Int
+
+ fun getValue(context: Context, index: Int): T
+}
+
+/**
+ * Value falls into a text array, whose element is [CharSequence] type.
+ *
+ * [values] resource is `<string-array>`.
+ */
+interface DiscreteTextValue : DiscreteValue<CharSequence> {
+ override fun isValidValue(context: Context, index: Int): Boolean {
+ if (index < 0) return false
+ return index < context.resources.getTextArray(values).size
+ }
+
+ override fun getValue(context: Context, index: Int): CharSequence =
+ context.resources.getTextArray(values)[index]
+}
+
+/**
+ * Value falls into a string array, whose element is [String] type.
+ *
+ * [values] resource is `<string-array>`.
+ */
+interface DiscreteStringValue : DiscreteValue<String> {
+ override fun isValidValue(context: Context, index: Int): Boolean {
+ if (index < 0) return false
+ return index < context.resources.getStringArray(values).size
+ }
+
+ override fun getValue(context: Context, index: Int): String =
+ context.resources.getStringArray(values)[index]
+}
+
+/**
+ * Value falls into an integer array.
+ *
+ * [values] resource is `<integer-array>`.
+ */
+interface DiscreteIntValue : DiscreteValue<Int> {
+ override fun isValidValue(context: Context, index: Int): Boolean {
+ if (index < 0) return false
+ return index < context.resources.getIntArray(values).size
+ }
+
+ override fun getValue(context: Context, index: Int): Int =
+ context.resources.getIntArray(values)[index]
+}
+
+/** Value is between a range. */
+interface RangeValue : ValueDescriptor {
+ /** The lower bound (inclusive) of the range. */
+ val minValue: Int
+
+ /** The upper bound (inclusive) of the range. */
+ val maxValue: Int
+
+ /** The increment step within the range. 0 means unset, which implies step size is 1. */
+ val incrementStep: Int
+ get() = 0
+
+ override fun isValidValue(context: Context, index: Int) = index in minValue..maxValue
+}
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceHierarchy.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceHierarchy.kt
new file mode 100644
index 0000000..4503738
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceHierarchy.kt
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+/** A node in preference hierarchy that is associated with [PreferenceMetadata]. */
+open class PreferenceHierarchyNode internal constructor(val metadata: PreferenceMetadata)
+
+/**
+ * Preference hierarchy describes the structure of preferences recursively.
+ *
+ * A root hierarchy represents a preference screen. A sub-hierarchy represents a preference group.
+ */
+class PreferenceHierarchy internal constructor(metadata: PreferenceMetadata) :
+ PreferenceHierarchyNode(metadata) {
+
+ private val children = mutableListOf<PreferenceHierarchyNode>()
+
+ /** Adds a preference to the hierarchy. */
+ operator fun PreferenceMetadata.unaryPlus() {
+ children.add(PreferenceHierarchyNode(this))
+ }
+
+ /**
+ * Adds preference screen with given key (as a placeholder) to the hierarchy.
+ *
+ * This is mainly to support Android Settings overlays. OEMs might want to custom some of the
+ * screens. In resource-based hierarchy, it leverages the resource overlay. In terms of DSL or
+ * programmatic hierarchy, it will be a problem to specify concrete screen metadata objects.
+ * Instead, use preference screen key as a placeholder in the hierarchy and screen metadata will
+ * be looked up from [PreferenceScreenRegistry] lazily at runtime.
+ *
+ * @throws NullPointerException if screen is not registered to [PreferenceScreenRegistry]
+ */
+ operator fun String.unaryPlus() {
+ children.add(PreferenceHierarchyNode(PreferenceScreenRegistry[this]!!))
+ }
+
+ /** Adds a preference to the hierarchy. */
+ fun add(metadata: PreferenceMetadata) {
+ children.add(PreferenceHierarchyNode(metadata))
+ }
+
+ /** Adds a preference group to the hierarchy. */
+ operator fun PreferenceGroup.unaryPlus() = PreferenceHierarchy(this).also { children.add(it) }
+
+ /** Adds a preference group and returns its preference hierarchy. */
+ fun addGroup(metadata: PreferenceGroup): PreferenceHierarchy =
+ PreferenceHierarchy(metadata).also { children.add(it) }
+
+ /**
+ * Adds preference screen with given key (as a placeholder) to the hierarchy.
+ *
+ * This is mainly to support Android Settings overlays. OEMs might want to custom some of the
+ * screens. In resource-based hierarchy, it leverages the resource overlay. In terms of DSL or
+ * programmatic hierarchy, it will be a problem to specify concrete screen metadata objects.
+ * Instead, use preference screen key as a placeholder in the hierarchy and screen metadata will
+ * be looked up from [PreferenceScreenRegistry] lazily at runtime.
+ *
+ * @throws NullPointerException if screen is not registered to [PreferenceScreenRegistry]
+ */
+ fun addPreferenceScreen(screenKey: String) {
+ children.add(PreferenceHierarchy(PreferenceScreenRegistry[screenKey]!!))
+ }
+
+ /** Extensions to add more preferences to the hierarchy. */
+ operator fun plusAssign(init: PreferenceHierarchy.() -> Unit) = init(this)
+
+ /** Traversals preference hierarchy and applies given action. */
+ fun forEach(action: (PreferenceHierarchyNode) -> Unit) {
+ for (it in children) action(it)
+ }
+
+ /** Traversals preference hierarchy and applies given action. */
+ suspend fun forEachAsync(action: suspend (PreferenceHierarchyNode) -> Unit) {
+ for (it in children) action(it)
+ }
+
+ /** Finds the [PreferenceMetadata] object associated with given key. */
+ fun find(key: String): PreferenceMetadata? {
+ if (metadata.key == key) return metadata
+ for (child in children) {
+ if (child is PreferenceHierarchy) {
+ val result = child.find(key)
+ if (result != null) return result
+ } else {
+ if (child.metadata.key == key) return child.metadata
+ }
+ }
+ return null
+ }
+
+ /** Returns all the [PreferenceMetadata]s appear in the hierarchy. */
+ fun getAllPreferences(): List<PreferenceMetadata> =
+ mutableListOf<PreferenceMetadata>().also { getAllPreferences(it) }
+
+ private fun getAllPreferences(result: MutableList<PreferenceMetadata>) {
+ result.add(metadata)
+ for (child in children) {
+ if (child is PreferenceHierarchy) {
+ child.getAllPreferences(result)
+ } else {
+ result.add(child.metadata)
+ }
+ }
+ }
+}
+
+/**
+ * Builder function to create [PreferenceHierarchy] in
+ * [DSL](https://kotlinlang.org/docs/type-safe-builders.html) manner.
+ */
+fun preferenceHierarchy(metadata: PreferenceMetadata, init: PreferenceHierarchy.() -> Unit) =
+ PreferenceHierarchy(metadata).also(init)
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceMetadata.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceMetadata.kt
new file mode 100644
index 0000000..f39f3a0
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceMetadata.kt
@@ -0,0 +1,204 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import androidx.annotation.AnyThread
+import androidx.annotation.DrawableRes
+import androidx.annotation.StringRes
+
+/**
+ * Interface provides preference metadata (title, summary, icon, etc.).
+ *
+ * Besides the existing APIs, subclass could integrate with following interface to provide more
+ * information:
+ * - [PreferenceTitleProvider]: provide dynamic title content
+ * - [PreferenceSummaryProvider]: provide dynamic summary content (e.g. based on preference value)
+ * - [PreferenceAvailabilityProvider]: provide preference availability (e.g. based on flag)
+ * - [PreferenceLifecycleProvider]: provide the lifecycle callbacks and notify state change
+ *
+ * Notes:
+ * - UI framework support:
+ * - This class does not involve any UI logic, it is the data layer.
+ * - Subclass could integrate with datastore and UI widget to provide UI layer. For instance,
+ * `PreferenceBinding` supports Jetpack Preference binding.
+ * - Datastore:
+ * - Subclass should implement the [PersistentPreference] to note that current preference is
+ * persistent in datastore.
+ * - It is always recommended to support back up preference value changed by user. Typically,
+ * the back up and restore happen within datastore, the [allowBackup] API is to mark if
+ * current preference value should be backed up (backup allowed by default).
+ * - Preference indexing for search:
+ * - Override [isIndexable] API to mark if preference is indexable (enabled by default).
+ * - If [isIndexable] returns true, preference title and summary will be indexed with cache.
+ * More indexing data could be provided through [keywords].
+ * - Settings search will cache the preference title/summary/keywords for indexing. The cache is
+ * invalidated when system locale changed, app upgraded, etc.
+ * - Dynamic content is not suitable to be cached for indexing. Subclass that implements
+ * [PreferenceTitleProvider] / [PreferenceSummaryProvider] will not have its title / summary
+ * indexed.
+ */
+@AnyThread
+interface PreferenceMetadata {
+
+ /** Preference key. */
+ val key: String
+
+ /**
+ * Preference title resource id.
+ *
+ * Implement [PreferenceTitleProvider] if title is generated dynamically.
+ */
+ val title: Int
+ @StringRes get() = 0
+
+ /**
+ * Preference summary resource id.
+ *
+ * Implement [PreferenceSummaryProvider] if summary is generated dynamically (e.g. summary is
+ * provided per preference value)
+ */
+ val summary: Int
+ @StringRes get() = 0
+
+ /** Icon of the preference. */
+ val icon: Int
+ @DrawableRes get() = 0
+
+ /** Additional keywords for indexing. */
+ val keywords: Int
+ @StringRes get() = 0
+
+ /**
+ * Return the extras Bundle object associated with this preference.
+ *
+ * It is used to provide more information for metadata.
+ */
+ fun extras(context: Context): Bundle? = null
+
+ /**
+ * Returns if preference is indexable, default value is `true`.
+ *
+ * Return `false` only when the preference is always unavailable on current device. If it is
+ * conditional available, override [PreferenceAvailabilityProvider].
+ */
+ fun isIndexable(context: Context): Boolean = true
+
+ /**
+ * Returns if preference is enabled.
+ *
+ * UI framework normally does not allow user to interact with the preference widget when it is
+ * disabled.
+ *
+ * [dependencyOfEnabledState] is provided to support dependency, the [shouldDisableDependents]
+ * value of dependent preference is used to decide enabled state.
+ */
+ fun isEnabled(context: Context): Boolean {
+ val dependency = dependencyOfEnabledState(context) ?: return true
+ return !dependency.shouldDisableDependents(context)
+ }
+
+ /** Returns the key of depended preference to decide the enabled state. */
+ fun dependencyOfEnabledState(context: Context): PreferenceMetadata? = null
+
+ /** Returns whether this preference's dependents should be disabled. */
+ fun shouldDisableDependents(context: Context): Boolean = !isEnabled(context)
+
+ /** Returns if the preference is persistent in datastore. */
+ fun isPersistent(context: Context): Boolean = this is PersistentPreference<*>
+
+ /**
+ * Returns if preference value backup is allowed (by default returns `true` if preference is
+ * persistent).
+ */
+ fun allowBackup(context: Context): Boolean = isPersistent(context)
+
+ /** Returns preference intent. */
+ fun intent(context: Context): Intent? = null
+
+ /** Returns preference order. */
+ fun order(context: Context): Int? = null
+
+ /**
+ * Returns the preference title.
+ *
+ * Implement [PreferenceTitleProvider] interface if title content is generated dynamically.
+ */
+ fun getPreferenceTitle(context: Context): CharSequence? =
+ when {
+ title != 0 -> context.getText(title)
+ this is PreferenceTitleProvider -> getTitle(context)
+ else -> null
+ }
+
+ /**
+ * Returns the preference summary.
+ *
+ * Implement [PreferenceSummaryProvider] interface if summary content is generated dynamically
+ * (e.g. summary is provided per preference value).
+ */
+ fun getPreferenceSummary(context: Context): CharSequence? =
+ when {
+ summary != 0 -> context.getText(summary)
+ this is PreferenceSummaryProvider -> getSummary(context)
+ else -> null
+ }
+}
+
+/** Metadata of preference group. */
+@AnyThread
+open class PreferenceGroup(override val key: String, override val title: Int) : PreferenceMetadata
+
+/** Metadata of preference screen. */
+@AnyThread
+interface PreferenceScreenMetadata : PreferenceMetadata {
+
+ /**
+ * The screen title resource, which precedes [getScreenTitle] if provided.
+ *
+ * By default, screen title is same with [title].
+ */
+ val screenTitle: Int
+ get() = title
+
+ /** Returns dynamic screen title, use [screenTitle] whenever possible. */
+ fun getScreenTitle(context: Context): CharSequence? = null
+
+ /** Returns the fragment class to show the preference screen. */
+ fun fragmentClass(): Class<out Fragment>?
+
+ /**
+ * Indicates if [getPreferenceHierarchy] returns a complete hierarchy of the preference screen.
+ *
+ * If `true`, the result of [getPreferenceHierarchy] will be used to inflate preference screen.
+ * Otherwise, it is an intermediate state called hybrid mode, preference hierarchy is
+ * represented by other ways (e.g. XML resource) and [PreferenceMetadata]s in
+ * [getPreferenceHierarchy] will only be used to bind UI widgets.
+ */
+ fun hasCompleteHierarchy(): Boolean = true
+
+ /**
+ * Returns the hierarchy of preference screen.
+ *
+ * The implementation MUST include all preferences into the hierarchy regardless of the runtime
+ * conditions. DO NOT check any condition (except compile time flag) before adding a preference.
+ */
+ fun getPreferenceHierarchy(context: Context): PreferenceHierarchy
+}
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceScreenBindingKeyProvider.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceScreenBindingKeyProvider.kt
new file mode 100644
index 0000000..84014f1
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceScreenBindingKeyProvider.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import android.content.Context
+
+/** Provides the associated preference screen key for binding. */
+interface PreferenceScreenBindingKeyProvider {
+
+ /** Returns the associated preference screen key. */
+ fun getPreferenceScreenBindingKey(context: Context): String?
+}
+
+/** Extra key to provide the preference screen key for binding. */
+const val EXTRA_BINDING_SCREEN_KEY = "settingslib:binding_screen_key"
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceScreenRegistry.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceScreenRegistry.kt
new file mode 100644
index 0000000..48798da
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceScreenRegistry.kt
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import android.content.Context
+import com.android.settingslib.datastore.KeyValueStore
+import com.google.common.base.Supplier
+import com.google.common.base.Suppliers
+import com.google.common.collect.ImmutableMap
+
+private typealias PreferenceScreenMap = ImmutableMap<String, PreferenceScreenMetadata>
+
+/** Registry of all available preference screens in the app. */
+object PreferenceScreenRegistry : ReadWritePermitProvider {
+
+ /** Provider of key-value store. */
+ private lateinit var keyValueStoreProvider: KeyValueStoreProvider
+
+ private var preferenceScreensSupplier: Supplier<PreferenceScreenMap> = Supplier {
+ ImmutableMap.of()
+ }
+
+ private val preferenceScreens: PreferenceScreenMap
+ get() = preferenceScreensSupplier.get()
+
+ private var readWritePermitProvider: ReadWritePermitProvider? = null
+
+ /** Sets the [KeyValueStoreProvider]. */
+ fun setKeyValueStoreProvider(keyValueStoreProvider: KeyValueStoreProvider) {
+ this.keyValueStoreProvider = keyValueStoreProvider
+ }
+
+ /**
+ * Returns the key-value store for given preference.
+ *
+ * Must call [setKeyValueStoreProvider] before invoking this method, otherwise
+ * [NullPointerException] is raised.
+ */
+ fun getKeyValueStore(context: Context, preference: PreferenceMetadata): KeyValueStore? =
+ keyValueStoreProvider.getKeyValueStore(context, preference)
+
+ /** Sets supplier to provide available preference screens. */
+ fun setPreferenceScreensSupplier(supplier: Supplier<List<PreferenceScreenMetadata>>) {
+ preferenceScreensSupplier =
+ Suppliers.memoize {
+ val screensBuilder = ImmutableMap.builder<String, PreferenceScreenMetadata>()
+ for (screen in supplier.get()) screensBuilder.put(screen.key, screen)
+ screensBuilder.buildOrThrow()
+ }
+ }
+
+ /** Sets available preference screens. */
+ fun setPreferenceScreens(vararg screens: PreferenceScreenMetadata) {
+ val screensBuilder = ImmutableMap.builder<String, PreferenceScreenMetadata>()
+ for (screen in screens) screensBuilder.put(screen.key, screen)
+ preferenceScreensSupplier = Suppliers.ofInstance(screensBuilder.buildOrThrow())
+ }
+
+ /** Returns [PreferenceScreenMetadata] of particular key. */
+ operator fun get(key: String?): PreferenceScreenMetadata? =
+ if (key != null) preferenceScreens[key] else null
+
+ /**
+ * Sets the provider to check read write permit. Read and write requests are denied by default.
+ */
+ fun setReadWritePermitProvider(readWritePermitProvider: ReadWritePermitProvider?) {
+ this.readWritePermitProvider = readWritePermitProvider
+ }
+
+ override fun getReadPermit(
+ context: Context,
+ myUid: Int,
+ callingUid: Int,
+ preference: PreferenceMetadata,
+ ) =
+ readWritePermitProvider?.getReadPermit(context, myUid, callingUid, preference)
+ ?: ReadWritePermit.DISALLOW
+
+ override fun getWritePermit(
+ context: Context,
+ value: Any?,
+ myUid: Int,
+ callingUid: Int,
+ preference: PreferenceMetadata,
+ ) =
+ readWritePermitProvider?.getWritePermit(context, value, myUid, callingUid, preference)
+ ?: ReadWritePermit.DISALLOW
+}
+
+/** Provider of [KeyValueStore]. */
+fun interface KeyValueStoreProvider {
+
+ /**
+ * Returns the key-value store for given preference.
+ *
+ * Here are some use cases:
+ * - provide the default storage for all preferences
+ * - determine the storage per preference keys or the interfaces implemented by the preference
+ */
+ fun getKeyValueStore(context: Context, preference: PreferenceMetadata): KeyValueStore?
+}
+
+/** Provider of read and write permit. */
+interface ReadWritePermitProvider {
+
+ @ReadWritePermit
+ fun getReadPermit(
+ context: Context,
+ myUid: Int,
+ callingUid: Int,
+ preference: PreferenceMetadata,
+ ): Int
+
+ @ReadWritePermit
+ fun getWritePermit(
+ context: Context,
+ value: Any?,
+ myUid: Int,
+ callingUid: Int,
+ preference: PreferenceMetadata,
+ ): Int
+
+ companion object {
+ @JvmField
+ val ALLOW_ALL_READ_WRITE =
+ object : ReadWritePermitProvider {
+ override fun getReadPermit(
+ context: Context,
+ myUid: Int,
+ callingUid: Int,
+ preference: PreferenceMetadata,
+ ) = ReadWritePermit.ALLOW
+
+ override fun getWritePermit(
+ context: Context,
+ value: Any?,
+ myUid: Int,
+ callingUid: Int,
+ preference: PreferenceMetadata,
+ ) = ReadWritePermit.ALLOW
+ }
+ }
+}
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceStateProviders.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceStateProviders.kt
new file mode 100644
index 0000000..a3aa85d
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceStateProviders.kt
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import android.content.Context
+
+/**
+ * Interface to provide dynamic preference title.
+ *
+ * Implement this interface implies that the preference title should not be cached for indexing.
+ */
+interface PreferenceTitleProvider {
+
+ /** Provides preference title. */
+ fun getTitle(context: Context): CharSequence?
+}
+
+/**
+ * Interface to provide dynamic preference summary.
+ *
+ * Implement this interface implies that the preference summary should not be cached for indexing.
+ */
+interface PreferenceSummaryProvider {
+
+ /** Provides preference summary. */
+ fun getSummary(context: Context): CharSequence?
+}
+
+/**
+ * Interface to provide the state of preference availability.
+ *
+ * UI framework normally does not show the preference widget if it is unavailable.
+ */
+interface PreferenceAvailabilityProvider {
+
+ /** Returns if the preference is available. */
+ fun isAvailable(context: Context): Boolean
+}
+
+/**
+ * Interface to provide the managed configuration state of the preference.
+ *
+ * See [Managed configurations](https://developer.android.com/work/managed-configurations) for the
+ * Android Enterprise support.
+ */
+interface PreferenceRestrictionProvider {
+
+ /** Returns if preference is restricted by managed configs. */
+ fun isRestricted(context: Context): Boolean
+}
+
+/**
+ * Preference lifecycle to deal with preference state.
+ *
+ * Implement this interface when preference depends on runtime conditions.
+ */
+interface PreferenceLifecycleProvider {
+
+ /**
+ * Called when preference is attached to UI.
+ *
+ * Subclass could override this API to register runtime condition listeners, and invoke
+ * `onPreferenceStateChanged(this)` on the given [preferenceStateObserver] to update UI when
+ * internal state (e.g. availability, enabled state, title, summary) is changed.
+ */
+ fun onAttach(context: Context, preferenceStateObserver: PreferenceStateObserver)
+
+ /**
+ * Called when preference is detached from UI.
+ *
+ * Clean up and release resource.
+ */
+ fun onDetach(context: Context)
+
+ /** Observer of preference state. */
+ interface PreferenceStateObserver {
+
+ /** Callbacks when preference state is changed. */
+ fun onPreferenceStateChanged(preference: PreferenceMetadata)
+ }
+}
diff --git a/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceTypes.kt b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceTypes.kt
new file mode 100644
index 0000000..ad996c7
--- /dev/null
+++ b/packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PreferenceTypes.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.metadata
+
+import android.content.Context
+import androidx.annotation.StringRes
+
+/**
+ * Common base class for preferences that have two selectable states, save a boolean value, and may
+ * have dependent preferences that are enabled/disabled based on the current state.
+ */
+interface TwoStatePreference : PreferenceMetadata, PersistentPreference<Boolean>, BooleanValue {
+
+ override fun shouldDisableDependents(context: Context) =
+ storage(context).getValue(key, Boolean::class.javaObjectType) != true ||
+ super.shouldDisableDependents(context)
+}
+
+/** A preference that provides a two-state toggleable option. */
+open class SwitchPreference
+@JvmOverloads
+constructor(
+ override val key: String,
+ @StringRes override val title: Int = 0,
+ @StringRes override val summary: Int = 0,
+) : TwoStatePreference
diff --git a/packages/SettingsLib/Preference/Android.bp b/packages/SettingsLib/Preference/Android.bp
new file mode 100644
index 0000000..17852e8
--- /dev/null
+++ b/packages/SettingsLib/Preference/Android.bp
@@ -0,0 +1,24 @@
+package {
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+filegroup {
+ name: "SettingsLibPreference-srcs",
+ srcs: ["src/**/*.kt"],
+}
+
+android_library {
+ name: "SettingsLibPreference",
+ defaults: [
+ "SettingsLintDefaults",
+ ],
+ srcs: [":SettingsLibPreference-srcs"],
+ static_libs: [
+ "SettingsLibDataStore",
+ "SettingsLibMetadata",
+ "androidx.annotation_annotation",
+ "androidx.preference_preference",
+ "guava",
+ ],
+ kotlincflags: ["-Xjvm-default=all"],
+}
diff --git a/packages/SettingsLib/Preference/AndroidManifest.xml b/packages/SettingsLib/Preference/AndroidManifest.xml
new file mode 100644
index 0000000..2d7f7ba
--- /dev/null
+++ b/packages/SettingsLib/Preference/AndroidManifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.settingslib.preference">
+
+ <uses-sdk android:minSdkVersion="21" />
+</manifest>
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBinding.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBinding.kt
new file mode 100644
index 0000000..9be0e71
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBinding.kt
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import android.content.Context
+import androidx.preference.DialogPreference
+import androidx.preference.ListPreference
+import androidx.preference.Preference
+import androidx.preference.PreferenceScreen
+import androidx.preference.SeekBarPreference
+import com.android.settingslib.metadata.DiscreteIntValue
+import com.android.settingslib.metadata.DiscreteValue
+import com.android.settingslib.metadata.PreferenceAvailabilityProvider
+import com.android.settingslib.metadata.PreferenceMetadata
+import com.android.settingslib.metadata.PreferenceScreenMetadata
+import com.android.settingslib.metadata.RangeValue
+
+/** Binding of preference widget and preference metadata. */
+interface PreferenceBinding {
+
+ /**
+ * Provides a new [Preference] widget instance.
+ *
+ * By default, it returns a new [Preference] object. Subclass could override this method to
+ * provide customized widget and do **one-off** initialization (e.g.
+ * [Preference.setOnPreferenceClickListener]). To update widget everytime when state is changed,
+ * override the [bind] method.
+ *
+ * Notes:
+ * - DO NOT set any properties defined in [PreferenceMetadata]. For example,
+ * title/summary/icon/extras/isEnabled/isVisible/isPersistent/dependency. These properties
+ * will be reset by [bind].
+ * - Override [bind] if needed to provide more information for customized widget.
+ */
+ fun createWidget(context: Context): Preference = Preference(context)
+
+ /**
+ * Binds preference widget with given metadata.
+ *
+ * Whenever metadata state is changed, this callback is invoked to update widget. By default,
+ * the common states like title, summary, enabled, etc. are already applied. Subclass should
+ * override this method to bind more data (e.g. read preference value from storage and apply it
+ * to widget).
+ *
+ * @param preference preference widget created by [createWidget]
+ * @param metadata metadata to apply
+ */
+ fun bind(preference: Preference, metadata: PreferenceMetadata) {
+ metadata.apply {
+ preference.key = key
+ if (icon != 0) {
+ preference.setIcon(icon)
+ } else {
+ preference.icon = null
+ }
+ val context = preference.context
+ preference.peekExtras()?.clear()
+ extras(context)?.let { preference.extras.putAll(it) }
+ preference.title = getPreferenceTitle(context)
+ preference.summary = getPreferenceSummary(context)
+ preference.isEnabled = isEnabled(context)
+ preference.isVisible =
+ (this as? PreferenceAvailabilityProvider)?.isAvailable(context) != false
+ preference.isPersistent = isPersistent(context)
+ metadata.order(context)?.let { preference.order = it }
+ // PreferenceRegistry will notify dependency change, so we do not need to set
+ // dependency here. This simplifies dependency management and avoid the
+ // IllegalStateException when call Preference.setDependency
+ preference.dependency = null
+ if (preference !is PreferenceScreen) { // avoid recursive loop when build graph
+ preference.fragment = (this as? PreferenceScreenCreator)?.fragmentClass()?.name
+ preference.intent = intent(context)
+ }
+ if (preference is DialogPreference) {
+ preference.dialogTitle = preference.title
+ }
+ if (preference is ListPreference && this is DiscreteValue<*>) {
+ preference.setEntries(valuesDescription)
+ if (this is DiscreteIntValue) {
+ val intValues = context.resources.getIntArray(values)
+ preference.entryValues = Array(intValues.size) { intValues[it].toString() }
+ } else {
+ preference.setEntryValues(values)
+ }
+ } else if (preference is SeekBarPreference && this is RangeValue) {
+ preference.min = minValue
+ preference.max = maxValue
+ preference.seekBarIncrement = incrementStep
+ }
+ }
+ }
+}
+
+/** Abstract preference screen to provide preference hierarchy and binding factory. */
+interface PreferenceScreenCreator : PreferenceScreenMetadata, PreferenceScreenProvider {
+
+ val preferenceBindingFactory: PreferenceBindingFactory
+ get() = DefaultPreferenceBindingFactory
+
+ override fun createPreferenceScreen(factory: PreferenceScreenFactory) =
+ factory.getOrCreatePreferenceScreen().apply {
+ inflatePreferenceHierarchy(preferenceBindingFactory, getPreferenceHierarchy(context))
+ }
+}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBindingFactory.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBindingFactory.kt
new file mode 100644
index 0000000..4c2e1ba
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBindingFactory.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import com.android.settingslib.metadata.PreferenceGroup
+import com.android.settingslib.metadata.PreferenceMetadata
+import com.android.settingslib.metadata.SwitchPreference
+
+/** Factory to map [PreferenceMetadata] to [PreferenceBinding]. */
+interface PreferenceBindingFactory {
+
+ /** Returns the [PreferenceBinding] associated with the [PreferenceMetadata]. */
+ fun getPreferenceBinding(metadata: PreferenceMetadata): PreferenceBinding?
+}
+
+/** Default [PreferenceBindingFactory]. */
+object DefaultPreferenceBindingFactory : PreferenceBindingFactory {
+
+ override fun getPreferenceBinding(metadata: PreferenceMetadata) =
+ metadata as? PreferenceBinding
+ ?: when (metadata) {
+ is SwitchPreference -> SwitchPreferenceBinding.INSTANCE
+ is PreferenceGroup -> PreferenceGroupBinding.INSTANCE
+ is PreferenceScreenCreator -> PreferenceScreenBinding.INSTANCE
+ else -> DefaultPreferenceBinding
+ }
+}
+
+/** A preference key based binding factory. */
+class KeyedPreferenceBindingFactory(private val bindings: Map<String, PreferenceBinding>) :
+ PreferenceBindingFactory {
+
+ override fun getPreferenceBinding(metadata: PreferenceMetadata) =
+ bindings[metadata.key] ?: DefaultPreferenceBindingFactory.getPreferenceBinding(metadata)
+}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBindings.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBindings.kt
new file mode 100644
index 0000000..ede970e
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceBindings.kt
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import android.content.Context
+import androidx.preference.Preference
+import androidx.preference.PreferenceCategory
+import androidx.preference.PreferenceScreen
+import androidx.preference.SwitchPreferenceCompat
+import com.android.settingslib.metadata.EXTRA_BINDING_SCREEN_KEY
+import com.android.settingslib.metadata.PersistentPreference
+import com.android.settingslib.metadata.PreferenceMetadata
+import com.android.settingslib.metadata.PreferenceScreenMetadata
+import com.android.settingslib.metadata.PreferenceTitleProvider
+
+/** Binding of preference group associated with [PreferenceCategory]. */
+interface PreferenceScreenBinding : PreferenceBinding {
+
+ override fun bind(preference: Preference, metadata: PreferenceMetadata) {
+ super.bind(preference, metadata)
+ val context = preference.context
+ val screenMetadata = metadata as PreferenceScreenMetadata
+ // Pass the preference key to fragment, so that the fragment could find associated
+ // preference screen registered in PreferenceScreenRegistry
+ preference.extras.putString(EXTRA_BINDING_SCREEN_KEY, preference.key)
+ if (preference is PreferenceScreen) {
+ val screenTitle = screenMetadata.screenTitle
+ preference.title =
+ if (screenTitle != 0) {
+ context.getString(screenTitle)
+ } else {
+ screenMetadata.getScreenTitle(context)
+ ?: (this as? PreferenceTitleProvider)?.getTitle(context)
+ }
+ }
+ }
+
+ companion object {
+ @JvmStatic val INSTANCE = object : PreferenceScreenBinding {}
+ }
+}
+
+/** Binding of preference group associated with [PreferenceCategory]. */
+interface PreferenceGroupBinding : PreferenceBinding {
+
+ override fun createWidget(context: Context) = PreferenceCategory(context)
+
+ companion object {
+ @JvmStatic val INSTANCE = object : PreferenceGroupBinding {}
+ }
+}
+
+/** A boolean value type preference associated with [SwitchPreferenceCompat]. */
+interface SwitchPreferenceBinding : PreferenceBinding {
+
+ override fun createWidget(context: Context): Preference = SwitchPreferenceCompat(context)
+
+ override fun bind(preference: Preference, metadata: PreferenceMetadata) {
+ super.bind(preference, metadata)
+ (metadata as? PersistentPreference<*>)
+ ?.storage(preference.context)
+ ?.getValue(metadata.key, Boolean::class.javaObjectType)
+ ?.let { (preference as SwitchPreferenceCompat).isChecked = it }
+ }
+
+ companion object {
+ @JvmStatic val INSTANCE = object : SwitchPreferenceBinding {}
+ }
+}
+
+/** Default [PreferenceBinding] for [Preference]. */
+object DefaultPreferenceBinding : PreferenceBinding
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceDataStoreAdapter.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceDataStoreAdapter.kt
new file mode 100644
index 0000000..02acfca
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceDataStoreAdapter.kt
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import androidx.preference.PreferenceDataStore
+import com.android.settingslib.datastore.KeyValueStore
+
+/** Adapter to translate [KeyValueStore] into [PreferenceDataStore]. */
+class PreferenceDataStoreAdapter(private val keyValueStore: KeyValueStore) : PreferenceDataStore() {
+
+ override fun getBoolean(key: String, defValue: Boolean): Boolean =
+ keyValueStore.getValue(key, Boolean::class.javaObjectType) ?: defValue
+
+ override fun getFloat(key: String, defValue: Float): Float =
+ keyValueStore.getValue(key, Float::class.javaObjectType) ?: defValue
+
+ override fun getInt(key: String, defValue: Int): Int =
+ keyValueStore.getValue(key, Int::class.javaObjectType) ?: defValue
+
+ override fun getLong(key: String, defValue: Long): Long =
+ keyValueStore.getValue(key, Long::class.javaObjectType) ?: defValue
+
+ override fun getString(key: String, defValue: String?): String? =
+ keyValueStore.getValue(key, String::class.javaObjectType) ?: defValue
+
+ override fun getStringSet(key: String, defValues: Set<String>?): Set<String>? =
+ (keyValueStore.getValue(key, Set::class.javaObjectType) as Set<String>?) ?: defValues
+
+ override fun putBoolean(key: String, value: Boolean) =
+ keyValueStore.setValue(key, Boolean::class.javaObjectType, value)
+
+ override fun putFloat(key: String, value: Float) =
+ keyValueStore.setValue(key, Float::class.javaObjectType, value)
+
+ override fun putInt(key: String, value: Int) =
+ keyValueStore.setValue(key, Int::class.javaObjectType, value)
+
+ override fun putLong(key: String, value: Long) =
+ keyValueStore.setValue(key, Long::class.javaObjectType, value)
+
+ override fun putString(key: String, value: String?) =
+ keyValueStore.setValue(key, String::class.javaObjectType, value)
+
+ override fun putStringSet(key: String, values: Set<String>?) =
+ keyValueStore.setValue(key, Set::class.javaObjectType, values)
+}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceFragment.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceFragment.kt
new file mode 100644
index 0000000..68f640b
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceFragment.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import android.content.Context
+import android.os.Bundle
+import androidx.annotation.XmlRes
+import androidx.preference.PreferenceFragmentCompat
+import androidx.preference.PreferenceScreen
+import com.android.settingslib.metadata.EXTRA_BINDING_SCREEN_KEY
+import com.android.settingslib.metadata.PreferenceScreenBindingKeyProvider
+import com.android.settingslib.metadata.PreferenceScreenRegistry
+import com.android.settingslib.preference.PreferenceScreenBindingHelper.Companion.bindRecursively
+
+/** Fragment to display a preference screen. */
+open class PreferenceFragment :
+ PreferenceFragmentCompat(), PreferenceScreenProvider, PreferenceScreenBindingKeyProvider {
+
+ private var preferenceScreenBindingHelper: PreferenceScreenBindingHelper? = null
+
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ preferenceScreen = createPreferenceScreen()
+ }
+
+ fun createPreferenceScreen(): PreferenceScreen? =
+ createPreferenceScreen(PreferenceScreenFactory(this))
+
+ override fun createPreferenceScreen(factory: PreferenceScreenFactory): PreferenceScreen? {
+ val context = factory.context
+ fun createPreferenceScreenFromResource() =
+ factory.inflate(getPreferenceScreenResId(context))
+
+ if (!usePreferenceScreenMetadata()) return createPreferenceScreenFromResource()
+
+ val screenKey = getPreferenceScreenBindingKey(context)
+ val screenCreator =
+ (PreferenceScreenRegistry[screenKey] as? PreferenceScreenCreator)
+ ?: return createPreferenceScreenFromResource()
+
+ val preferenceBindingFactory = screenCreator.preferenceBindingFactory
+ val preferenceHierarchy = screenCreator.getPreferenceHierarchy(context)
+ val preferenceScreen =
+ if (screenCreator.hasCompleteHierarchy()) {
+ factory.getOrCreatePreferenceScreen().apply {
+ inflatePreferenceHierarchy(preferenceBindingFactory, preferenceHierarchy)
+ }
+ } else {
+ createPreferenceScreenFromResource()?.also {
+ bindRecursively(it, preferenceBindingFactory, preferenceHierarchy)
+ } ?: return null
+ }
+ preferenceScreenBindingHelper =
+ PreferenceScreenBindingHelper(
+ context,
+ preferenceBindingFactory,
+ preferenceScreen,
+ preferenceHierarchy,
+ )
+ return preferenceScreen
+ }
+
+ /**
+ * Returns if preference screen metadata can be used to set up preference screen.
+ *
+ * This is for flagging purpose. If false (e.g. flag is disabled), xml resource is used to build
+ * preference screen.
+ */
+ protected open fun usePreferenceScreenMetadata(): Boolean = false
+
+ /** Returns the xml resource to create preference screen. */
+ @XmlRes protected open fun getPreferenceScreenResId(context: Context): Int = 0
+
+ override fun getPreferenceScreenBindingKey(context: Context): String? =
+ arguments?.getString(EXTRA_BINDING_SCREEN_KEY)
+
+ override fun onDestroy() {
+ preferenceScreenBindingHelper?.close()
+ super.onDestroy()
+ }
+
+ companion object {
+ /** Returns [PreferenceFragment] instance to display the preference screen of given key. */
+ fun of(screenKey: String): PreferenceFragment? {
+ val screenMetadata = PreferenceScreenRegistry[screenKey] ?: return null
+ if (
+ screenMetadata is PreferenceScreenCreator && screenMetadata.hasCompleteHierarchy()
+ ) {
+ return PreferenceFragment().apply {
+ arguments = Bundle().apply { putString(EXTRA_BINDING_SCREEN_KEY, screenKey) }
+ }
+ }
+ return null
+ }
+ }
+}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceHierarchyInflater.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceHierarchyInflater.kt
new file mode 100644
index 0000000..5ef7823
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceHierarchyInflater.kt
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import androidx.preference.PreferenceDataStore
+import androidx.preference.PreferenceGroup
+import com.android.settingslib.datastore.KeyValueStore
+import com.android.settingslib.metadata.PersistentPreference
+import com.android.settingslib.metadata.PreferenceHierarchy
+import com.android.settingslib.metadata.PreferenceMetadata
+
+/** Inflates [PreferenceHierarchy] into given [PreferenceGroup] recursively. */
+fun PreferenceGroup.inflatePreferenceHierarchy(
+ preferenceBindingFactory: PreferenceBindingFactory,
+ hierarchy: PreferenceHierarchy,
+ storages: MutableMap<KeyValueStore, PreferenceDataStore> = mutableMapOf(),
+) {
+ fun PreferenceMetadata.preferenceBinding() = preferenceBindingFactory.getPreferenceBinding(this)
+
+ hierarchy.metadata.let { it.preferenceBinding()?.bind(this, it) }
+ hierarchy.forEach {
+ val metadata = it.metadata
+ val preferenceBinding = metadata.preferenceBinding() ?: return@forEach
+ val widget = preferenceBinding.createWidget(context)
+ if (it is PreferenceHierarchy) {
+ val preferenceGroup = widget as PreferenceGroup
+ // MUST add preference before binding, otherwise exception is raised when add child
+ addPreference(preferenceGroup)
+ preferenceGroup.inflatePreferenceHierarchy(preferenceBindingFactory, it)
+ } else {
+ preferenceBinding.bind(widget, metadata)
+ (metadata as? PersistentPreference<*>)?.storage(context)?.let { storage ->
+ widget.preferenceDataStore =
+ storages.getOrPut(storage) { PreferenceDataStoreAdapter(storage) }
+ }
+ // MUST add preference after binding for persistent preference to get initial value
+ // (preference key is set within bind method)
+ addPreference(widget)
+ }
+ }
+}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt
new file mode 100644
index 0000000..3610894
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import android.content.Context
+import android.os.Handler
+import android.os.Looper
+import androidx.preference.Preference
+import androidx.preference.PreferenceGroup
+import androidx.preference.PreferenceScreen
+import com.android.settingslib.datastore.KeyedDataObservable
+import com.android.settingslib.datastore.KeyedObservable
+import com.android.settingslib.datastore.KeyedObserver
+import com.android.settingslib.metadata.PersistentPreference
+import com.android.settingslib.metadata.PreferenceHierarchy
+import com.android.settingslib.metadata.PreferenceLifecycleProvider
+import com.android.settingslib.metadata.PreferenceMetadata
+import com.android.settingslib.metadata.PreferenceScreenRegistry
+import com.google.common.collect.ImmutableMap
+import com.google.common.collect.ImmutableMultimap
+import java.util.concurrent.Executor
+
+/**
+ * Helper to bind preferences on given [preferenceScreen].
+ *
+ * When there is any preference change event detected (e.g. preference value changed, runtime
+ * states, dependency is updated), this helper class will re-bind [PreferenceMetadata] to update
+ * widget UI.
+ */
+class PreferenceScreenBindingHelper(
+ context: Context,
+ private val preferenceBindingFactory: PreferenceBindingFactory,
+ private val preferenceScreen: PreferenceScreen,
+ preferenceHierarchy: PreferenceHierarchy,
+) : KeyedDataObservable<String>(), AutoCloseable {
+
+ private val handler = Handler(Looper.getMainLooper())
+ private val executor =
+ object : Executor {
+ override fun execute(command: Runnable) {
+ handler.post(command)
+ }
+ }
+
+ private val preferences: ImmutableMap<String, PreferenceMetadata>
+ private val dependencies: ImmutableMultimap<String, String>
+ private val storages = mutableSetOf<KeyedObservable<String>>()
+
+ private val preferenceObserver: KeyedObserver<String?>
+
+ private val storageObserver =
+ KeyedObserver<String?> { key, _ ->
+ if (key != null) {
+ notifyChange(key, CHANGE_REASON_VALUE)
+ }
+ }
+
+ private val stateObserver =
+ object : PreferenceLifecycleProvider.PreferenceStateObserver {
+ override fun onPreferenceStateChanged(preference: PreferenceMetadata) {
+ notifyChange(preference.key, CHANGE_REASON_STATE)
+ }
+ }
+
+ init {
+ val preferencesBuilder = ImmutableMap.builder<String, PreferenceMetadata>()
+ val dependenciesBuilder = ImmutableMultimap.builder<String, String>()
+ fun PreferenceMetadata.addDependency(dependency: PreferenceMetadata) {
+ dependenciesBuilder.put(key, dependency.key)
+ }
+
+ fun PreferenceMetadata.add() {
+ preferencesBuilder.put(key, this)
+ dependencyOfEnabledState(context)?.addDependency(this)
+ if (this is PreferenceLifecycleProvider) onAttach(context, stateObserver)
+ if (this is PersistentPreference<*>) storages.add(storage(context))
+ }
+
+ fun PreferenceHierarchy.addPreferences() {
+ metadata.add()
+ forEach {
+ if (it is PreferenceHierarchy) {
+ it.addPreferences()
+ } else {
+ it.metadata.add()
+ }
+ }
+ }
+
+ preferenceHierarchy.addPreferences()
+ this.preferences = preferencesBuilder.buildOrThrow()
+ this.dependencies = dependenciesBuilder.build()
+
+ preferenceObserver = KeyedObserver { key, reason -> onPreferenceChange(key, reason) }
+ addObserver(preferenceObserver, executor)
+ for (storage in storages) storage.addObserver(storageObserver, executor)
+ }
+
+ private fun onPreferenceChange(key: String?, reason: Int) {
+ if (key == null) return
+
+ // bind preference to update UI
+ preferenceScreen.findPreference<Preference>(key)?.let {
+ preferenceBindingFactory.bind(it, preferences[key])
+ }
+
+ // check reason to avoid potential infinite loop
+ if (reason != CHANGE_REASON_DEPENDENT) {
+ notifyDependents(key, mutableSetOf())
+ }
+ }
+
+ /** Notifies dependents recursively. */
+ private fun notifyDependents(key: String, notifiedKeys: MutableSet<String>) {
+ if (!notifiedKeys.add(key)) return
+ for (dependency in dependencies[key]) {
+ notifyChange(dependency, CHANGE_REASON_DEPENDENT)
+ notifyDependents(dependency, notifiedKeys)
+ }
+ }
+
+ override fun close() {
+ removeObserver(preferenceObserver)
+ val context = preferenceScreen.context
+ for (preference in preferences.values) {
+ if (preference is PreferenceLifecycleProvider) preference.onDetach(context)
+ }
+ for (storage in storages) storage.removeObserver(storageObserver)
+ }
+
+ companion object {
+ /** Preference value is changed. */
+ private const val CHANGE_REASON_VALUE = 0
+ /** Preference state (title/summary, enable state, etc.) is changed. */
+ private const val CHANGE_REASON_STATE = 1
+ /** Dependent preference state is changed. */
+ private const val CHANGE_REASON_DEPENDENT = 2
+
+ /** Updates preference screen that has incomplete hierarchy. */
+ @JvmStatic
+ fun bind(preferenceScreen: PreferenceScreen) {
+ PreferenceScreenRegistry[preferenceScreen.key]?.run {
+ if (!hasCompleteHierarchy()) {
+ val preferenceBindingFactory =
+ (this as? PreferenceScreenCreator)?.preferenceBindingFactory ?: return
+ bindRecursively(
+ preferenceScreen,
+ preferenceBindingFactory,
+ getPreferenceHierarchy(preferenceScreen.context),
+ )
+ }
+ }
+ }
+
+ internal fun bindRecursively(
+ preferenceScreen: PreferenceScreen,
+ preferenceBindingFactory: PreferenceBindingFactory,
+ preferenceHierarchy: PreferenceHierarchy,
+ ) =
+ preferenceScreen.bindRecursively(
+ preferenceBindingFactory,
+ preferenceHierarchy.getAllPreferences().associateBy { it.key },
+ )
+
+ private fun PreferenceGroup.bindRecursively(
+ preferenceBindingFactory: PreferenceBindingFactory,
+ preferences: Map<String, PreferenceMetadata>,
+ ) {
+ preferenceBindingFactory.bind(this, preferences[key])
+ val count = preferenceCount
+ for (index in 0 until count) {
+ val preference = getPreference(index)
+ if (preference is PreferenceGroup) {
+ preference.bindRecursively(preferenceBindingFactory, preferences)
+ } else {
+ preferenceBindingFactory.bind(preference, preferences[preference.key])
+ }
+ }
+ }
+
+ private fun PreferenceBindingFactory.bind(
+ preference: Preference,
+ metadata: PreferenceMetadata?,
+ ) = metadata?.let { getPreferenceBinding(it)?.bind(preference, it) }
+ }
+}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenFactory.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenFactory.kt
new file mode 100644
index 0000000..7f99d7a
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenFactory.kt
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import android.content.Context
+import androidx.preference.Preference
+import androidx.preference.PreferenceFragmentCompat
+import androidx.preference.PreferenceManager
+import androidx.preference.PreferenceScreen
+import com.android.settingslib.metadata.PreferenceScreenRegistry
+
+/** Factory to create preference screen. */
+class PreferenceScreenFactory {
+ /** Preference manager to create/inflate preference screen. */
+ val preferenceManager: PreferenceManager
+
+ /**
+ * Optional existing hierarchy to merge the new hierarchies into.
+ *
+ * Provide existing hierarchy will preserve the internal state (e.g. scrollbar position) for
+ * [PreferenceFragmentCompat].
+ */
+ private val rootScreen: PreferenceScreen?
+
+ /**
+ * Factory constructor from preference fragment.
+ *
+ * The fragment must be within a valid lifecycle.
+ */
+ constructor(preferenceFragment: PreferenceFragmentCompat) {
+ preferenceManager = preferenceFragment.preferenceManager
+ rootScreen = preferenceFragment.preferenceScreen
+ }
+
+ /** Factory constructor from [Context]. */
+ constructor(context: Context) : this(PreferenceManager(context))
+
+ /** Factory constructor from [PreferenceManager]. */
+ constructor(preferenceManager: PreferenceManager) {
+ this.preferenceManager = preferenceManager
+ rootScreen = null
+ }
+
+ /** Context of the factory to create preference screen. */
+ val context: Context
+ get() = preferenceManager.context
+
+ /** Returns the existing hierarchy or create a new empty preference screen. */
+ fun getOrCreatePreferenceScreen(): PreferenceScreen =
+ rootScreen ?: preferenceManager.createPreferenceScreen(context)
+
+ /**
+ * Inflates [PreferenceScreen] from xml resource.
+ *
+ * @param xmlRes The resource ID of the XML to inflate
+ * @return The root hierarchy (if one was not provided, the new hierarchy's root)
+ */
+ fun inflate(xmlRes: Int): PreferenceScreen? =
+ if (xmlRes != 0) {
+ preferenceManager.inflateFromResource(preferenceManager.context, xmlRes, rootScreen)
+ } else {
+ rootScreen
+ }
+
+ /**
+ * Creates [PreferenceScreen] of given key.
+ *
+ * The screen must be registered in [PreferenceScreenFactory] and provide a complete hierarchy.
+ */
+ fun createBindingScreen(screenKey: String?): PreferenceScreen? {
+ val metadata = PreferenceScreenRegistry[screenKey] ?: return null
+ if (metadata is PreferenceScreenCreator && metadata.hasCompleteHierarchy()) {
+ return metadata.createPreferenceScreen(this)
+ }
+ return null
+ }
+
+ companion object {
+ /** Creates [PreferenceScreen] from [PreferenceScreenRegistry]. */
+ @JvmStatic
+ fun createBindingScreen(preference: Preference): PreferenceScreen? {
+ val preferenceScreenCreator =
+ (PreferenceScreenRegistry[preference.key] as? PreferenceScreenCreator)
+ ?: return null
+ if (!preferenceScreenCreator.hasCompleteHierarchy()) return null
+ val factory = PreferenceScreenFactory(preference.context)
+ val preferenceScreen = preferenceScreenCreator.createPreferenceScreen(factory)
+ factory.preferenceManager.setPreferences(preferenceScreen)
+ return preferenceScreen
+ }
+ }
+}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenProvider.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenProvider.kt
new file mode 100644
index 0000000..0573292
--- /dev/null
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenProvider.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.preference
+
+import android.content.Context
+import androidx.preference.PreferenceScreen
+
+/**
+ * Interface to provide [PreferenceScreen].
+ *
+ * When implemented by Activity/Fragment, the Activity/Fragment [Context] APIs (e.g. `getContext()`,
+ * `getActivity()`) MUST not be used: preference screen creation could happen in background service,
+ * where the Activity/Fragment lifecycle callbacks (`onCreate`, `onDestroy`, etc.) are not invoked
+ * and context APIs return null.
+ */
+interface PreferenceScreenProvider {
+
+ /**
+ * Creates [PreferenceScreen].
+ *
+ * Preference screen creation could happen in background service. The implementation MUST use
+ * [PreferenceScreenFactory.context] to obtain context.
+ */
+ fun createPreferenceScreen(factory: PreferenceScreenFactory): PreferenceScreen?
+}
diff --git a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt
index ffd2879..83d657e 100644
--- a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt
+++ b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt
@@ -22,7 +22,7 @@
import com.android.settingslib.spa.framework.common.SpaEnvironment
import com.android.settingslib.spa.framework.common.createSettingsPage
import com.android.settingslib.spa.gallery.button.ActionButtonPageProvider
-import com.android.settingslib.spa.gallery.card.CardPageProvider
+import com.android.settingslib.spa.gallery.banner.BannerPageProvider
import com.android.settingslib.spa.gallery.chart.ChartPageProvider
import com.android.settingslib.spa.gallery.dialog.DialogMainPageProvider
import com.android.settingslib.spa.gallery.dialog.NavDialogProvider
@@ -107,7 +107,7 @@
SettingsTextFieldPasswordPageProvider,
SearchScaffoldPageProvider,
SuwScaffoldPageProvider,
- CardPageProvider,
+ BannerPageProvider,
CopyablePageProvider,
),
rootPages = listOf(
diff --git a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/card/CardPageProvider.kt b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/banner/BannerPageProvider.kt
similarity index 77%
rename from packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/card/CardPageProvider.kt
rename to packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/banner/BannerPageProvider.kt
index 5dd7caf..6edd917 100644
--- a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/card/CardPageProvider.kt
+++ b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/banner/BannerPageProvider.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settingslib.spa.gallery.card
+package com.android.settingslib.spa.gallery.banner
import android.os.Bundle
import androidx.compose.foundation.clickable
@@ -46,39 +46,39 @@
import com.android.settingslib.spa.framework.theme.SettingsDimension
import com.android.settingslib.spa.framework.theme.SettingsTheme
import com.android.settingslib.spa.gallery.R
-import com.android.settingslib.spa.widget.card.CardButton
-import com.android.settingslib.spa.widget.card.CardModel
-import com.android.settingslib.spa.widget.card.SettingsCard
-import com.android.settingslib.spa.widget.card.SettingsCardContent
-import com.android.settingslib.spa.widget.card.SettingsCollapsibleCard
+import com.android.settingslib.spa.widget.banner.BannerButton
+import com.android.settingslib.spa.widget.banner.BannerModel
+import com.android.settingslib.spa.widget.banner.SettingsBanner
+import com.android.settingslib.spa.widget.banner.SettingsBannerContent
+import com.android.settingslib.spa.widget.banner.SettingsCollapsibleBanner
import com.android.settingslib.spa.widget.preference.Preference
import com.android.settingslib.spa.widget.preference.PreferenceModel
import com.android.settingslib.spa.widget.scaffold.RegularScaffold
-object CardPageProvider : SettingsPageProvider {
- override val name = "Card"
+object BannerPageProvider : SettingsPageProvider {
+ override val name = "Banner"
override fun getTitle(arguments: Bundle?) = TITLE
@Composable
override fun Page(arguments: Bundle?) {
RegularScaffold(title = TITLE) {
- SettingsCardWithIcon()
- SettingsCardWithoutIcon()
- SampleSettingsCollapsibleCard()
- SampleSettingsCardContent()
+ SettingsBannerWithIcon()
+ SettingsBannerWithoutIcon()
+ SampleSettingsCollapsibleBanner()
+ SampleSettingsBannerContent()
}
}
@Composable
- private fun SettingsCardWithIcon() {
- SettingsCard(
- CardModel(
+ private fun SettingsBannerWithIcon() {
+ SettingsBanner(
+ BannerModel(
title = stringResource(R.string.sample_title),
text = stringResource(R.string.sample_text),
imageVector = Icons.Outlined.WarningAmber,
buttons = listOf(
- CardButton(text = "Action") {},
+ BannerButton(text = "Action") {},
),
tintColor = MaterialTheme.colorScheme.error,
containerColor = MaterialTheme.colorScheme.errorContainer,
@@ -87,11 +87,11 @@
}
@Composable
- private fun SettingsCardWithoutIcon() {
+ private fun SettingsBannerWithoutIcon() {
val sampleTitle = stringResource(R.string.sample_title)
var title by remember { mutableStateOf(sampleTitle) }
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = title,
text = stringResource(R.string.sample_text),
) { title = "Clicked" }
@@ -99,46 +99,46 @@
}
@Composable
- fun SampleSettingsCollapsibleCard() {
+ fun SampleSettingsCollapsibleBanner() {
val context = LocalContext.current
var isVisible0 by rememberSaveable { mutableStateOf(true) }
var isVisible1 by rememberSaveable { mutableStateOf(true) }
- val cards = remember {
+ val banners = remember {
mutableStateListOf(
- CardModel(
+ BannerModel(
title = context.getString(R.string.sample_title),
text = context.getString(R.string.sample_text),
imageVector = Icons.Outlined.PowerOff,
isVisible = { isVisible0 },
onDismiss = { isVisible0 = false },
buttons = listOf(
- CardButton(text = "Override") {},
- CardButton(text = "Learn more") {},
+ BannerButton(text = "Override") {},
+ BannerButton(text = "Learn more") {},
),
),
- CardModel(
+ BannerModel(
title = context.getString(R.string.sample_title),
text = context.getString(R.string.sample_text),
imageVector = Icons.Outlined.Shield,
isVisible = { isVisible1 },
onDismiss = { isVisible1 = false },
buttons = listOf(
- CardButton(text = "Action") {},
+ BannerButton(text = "Action") {},
),
)
)
}
- SettingsCollapsibleCard(
+ SettingsCollapsibleBanner(
title = "More alerts",
imageVector = Icons.Outlined.Error,
- models = cards.toList()
+ models = banners.toList()
)
}
@Composable
- fun SampleSettingsCardContent() {
- SettingsCard {
- SettingsCardContent {
+ fun SampleSettingsBannerContent() {
+ SettingsBanner {
+ SettingsBannerContent {
Box(
Modifier
.fillMaxWidth()
@@ -148,7 +148,7 @@
Text(text = "Abc")
}
}
- SettingsCardContent {
+ SettingsBannerContent {
Box(
Modifier
.fillMaxWidth()
@@ -171,13 +171,13 @@
}
}
- private const val TITLE = "Sample Card"
+ private const val TITLE = "Sample Banner"
}
@Preview
@Composable
-private fun CardPagePreview() {
+private fun BannerPagePreview() {
SettingsTheme {
- CardPageProvider.Page(null)
+ BannerPageProvider.Page(null)
}
}
diff --git a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt
index 654719d..b1558cc 100644
--- a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt
+++ b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt
@@ -28,7 +28,7 @@
import com.android.settingslib.spa.gallery.R
import com.android.settingslib.spa.gallery.SettingsPageProviderEnum
import com.android.settingslib.spa.gallery.button.ActionButtonPageProvider
-import com.android.settingslib.spa.gallery.card.CardPageProvider
+import com.android.settingslib.spa.gallery.banner.BannerPageProvider
import com.android.settingslib.spa.gallery.chart.ChartPageProvider
import com.android.settingslib.spa.gallery.dialog.DialogMainPageProvider
import com.android.settingslib.spa.gallery.editor.EditorMainPageProvider
@@ -73,7 +73,7 @@
ChartPageProvider.buildInjectEntry().setLink(fromPage = owner).build(),
DialogMainPageProvider.buildInjectEntry().setLink(fromPage = owner).build(),
EditorMainPageProvider.buildInjectEntry().setLink(fromPage = owner).build(),
- CardPageProvider.buildInjectEntry().setLink(fromPage = owner).build(),
+ BannerPageProvider.buildInjectEntry().setLink(fromPage = owner).build(),
CopyablePageProvider.buildInjectEntry().setLink(fromPage = owner).build(),
)
}
diff --git a/packages/SettingsLib/Spa/screenshot/robotests/Android.bp b/packages/SettingsLib/Spa/screenshot/robotests/Android.bp
index c834c80..f6477e2 100644
--- a/packages/SettingsLib/Spa/screenshot/robotests/Android.bp
+++ b/packages/SettingsLib/Spa/screenshot/robotests/Android.bp
@@ -63,9 +63,9 @@
"uiautomator-helpers",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
upstream: true,
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt
index a3e68d8..1f3e2425 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt
@@ -28,6 +28,10 @@
val spinnerHorizontalPadding = paddingExtraLarge
val spinnerVerticalPadding = paddingLarge
+ val actionIconWidth = 32.dp
+ val actionIconHeight = 40.dp
+ val actionIconPadding = 4.dp
+
val itemIconSize = 24.dp
val itemIconContainerSize = 72.dp
val itemPaddingStart = paddingExtraLarge
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/BannerModel.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/BannerModel.kt
new file mode 100644
index 0000000..4ef258f
--- /dev/null
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/BannerModel.kt
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.spa.widget.banner
+
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.vector.ImageVector
+
+data class BannerButton(
+ val text: String,
+ val contentDescription: String? = null,
+ val onClick: () -> Unit,
+)
+
+data class BannerModel(
+ val title: String,
+ val text: String,
+ val imageVector: ImageVector? = null,
+ val isVisible: () -> Boolean = { true },
+
+ /**
+ * A dismiss button will be displayed if this is not null.
+ *
+ * And this callback will be called when user clicks the button.
+ */
+ val onDismiss: (() -> Unit)? = null,
+
+ val buttons: List<BannerButton> = emptyList(),
+
+ /** If specified, this color will be used to tint the icon and the buttons. */
+ val tintColor: Color = Color.Unspecified,
+
+ /** If specified, this color will be used to tint the icon and the buttons. */
+ val containerColor: Color = Color.Unspecified,
+
+ val onClick: (() -> Unit)? = null,
+)
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/SettingsBanner.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/SettingsBanner.kt
new file mode 100644
index 0000000..e3f4860
--- /dev/null
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/SettingsBanner.kt
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.spa.widget.banner
+
+import androidx.compose.animation.AnimatedVisibility
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ColumnScope
+import androidx.compose.foundation.layout.ExperimentalLayoutApi
+import androidx.compose.foundation.layout.FlowRow
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.shape.CircleShape
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.outlined.Close
+import androidx.compose.material.icons.outlined.WarningAmber
+import androidx.compose.material3.Card
+import androidx.compose.material3.CardDefaults
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.takeOrElse
+import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.unit.dp
+import com.android.settingslib.spa.debug.UiModePreviews
+import com.android.settingslib.spa.framework.compose.contentDescription
+import com.android.settingslib.spa.framework.theme.SettingsDimension
+import com.android.settingslib.spa.framework.theme.SettingsShape.CornerExtraLarge
+import com.android.settingslib.spa.framework.theme.SettingsShape.CornerExtraSmall
+import com.android.settingslib.spa.framework.theme.SettingsTheme
+import com.android.settingslib.spa.widget.ui.SettingsBody
+import com.android.settingslib.spa.widget.ui.SettingsTitle
+
+@Composable
+fun SettingsBanner(content: @Composable ColumnScope.() -> Unit) {
+ Card(
+ shape = CornerExtraLarge,
+ colors = CardDefaults.cardColors(
+ containerColor = Color.Transparent,
+ ),
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(
+ horizontal = SettingsDimension.itemPaddingEnd,
+ vertical = SettingsDimension.itemPaddingAround,
+ ),
+ content = content,
+ )
+}
+
+@Composable
+fun SettingsBannerContent(
+ containerColor: Color = Color.Unspecified,
+ content: @Composable ColumnScope.() -> Unit,
+) {
+ Card(
+ shape = CornerExtraSmall,
+ colors = CardDefaults.cardColors(
+ containerColor = containerColor.takeOrElse { MaterialTheme.colorScheme.surface },
+ ),
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(vertical = 1.dp),
+ content = content,
+ )
+}
+
+@Composable
+fun SettingsBanner(model: BannerModel) {
+ SettingsBanner {
+ SettingsBannerImpl(model)
+ }
+}
+
+@Composable
+internal fun SettingsBannerImpl(model: BannerModel) {
+ AnimatedVisibility(visible = model.isVisible()) {
+ SettingsBannerContent(containerColor = model.containerColor) {
+ Column(
+ modifier = (model.onClick?.let { Modifier.clickable(onClick = it) } ?: Modifier)
+ .padding(
+ horizontal = SettingsDimension.dialogItemPaddingHorizontal,
+ vertical = SettingsDimension.itemPaddingAround,
+ ),
+ verticalArrangement = Arrangement.spacedBy(SettingsDimension.itemPaddingAround)
+ ) {
+ BannerHeader(model.imageVector, model.tintColor, model.onDismiss)
+ SettingsTitle(model.title)
+ SettingsBody(model.text)
+ Buttons(model.buttons, model.tintColor)
+ }
+ }
+ }
+}
+
+@Composable
+fun BannerHeader(imageVector: ImageVector?, iconColor: Color, onDismiss: (() -> Unit)? = null) {
+ if (imageVector != null || onDismiss != null) {
+ Spacer(Modifier.height(SettingsDimension.buttonPaddingVertical))
+ }
+ Row(Modifier.fillMaxWidth()) {
+ BannerIcon(imageVector, iconColor)
+ Spacer(modifier = Modifier.weight(1f))
+ DismissButton(onDismiss)
+ }
+}
+
+@Composable
+private fun BannerIcon(imageVector: ImageVector?, color: Color) {
+ if (imageVector != null) {
+ Icon(
+ imageVector = imageVector,
+ contentDescription = null,
+ modifier = Modifier.size(SettingsDimension.itemIconSize),
+ tint = color.takeOrElse { MaterialTheme.colorScheme.primary },
+ )
+ }
+}
+
+@Composable
+private fun DismissButton(onDismiss: (() -> Unit)?) {
+ if (onDismiss == null) return
+ Surface(
+ shape = CircleShape,
+ color = MaterialTheme.colorScheme.secondaryContainer,
+ ) {
+ IconButton(
+ onClick = onDismiss,
+ modifier = Modifier.size(SettingsDimension.itemIconSize)
+ ) {
+ Icon(
+ imageVector = Icons.Outlined.Close,
+ contentDescription = stringResource(
+ androidx.compose.material3.R.string.m3c_snackbar_dismiss
+ ),
+ modifier = Modifier.padding(SettingsDimension.paddingSmall),
+ )
+ }
+ }
+}
+
+@OptIn(ExperimentalLayoutApi::class)
+@Composable
+private fun Buttons(buttons: List<BannerButton>, color: Color) {
+ if (buttons.isNotEmpty()) {
+ FlowRow(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.spacedBy(
+ space = SettingsDimension.itemPaddingEnd,
+ alignment = Alignment.End,
+ ),
+ ) {
+ for (button in buttons) {
+ Button(button, color)
+ }
+ }
+ } else {
+ Spacer(Modifier.height(SettingsDimension.itemPaddingAround))
+ }
+}
+
+@Composable
+private fun Button(button: BannerButton, color: Color) {
+ TextButton(
+ onClick = button.onClick,
+ modifier = Modifier.contentDescription(button.contentDescription),
+ ) {
+ Text(text = button.text, color = color)
+ }
+}
+
+@UiModePreviews
+@Composable
+private fun SettingsBannerPreview() {
+ SettingsTheme {
+ SettingsBanner(
+ BannerModel(
+ title = "Lorem ipsum",
+ text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
+ imageVector = Icons.Outlined.WarningAmber,
+ buttons = listOf(
+ BannerButton(text = "Action") {},
+ )
+ )
+ )
+ }
+}
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/SettingsCollapsibleBanner.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/SettingsCollapsibleBanner.kt
new file mode 100644
index 0000000..31a1e9c
--- /dev/null
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/banner/SettingsCollapsibleBanner.kt
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.spa.widget.banner
+
+import androidx.compose.animation.AnimatedVisibility
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.outlined.Error
+import androidx.compose.material.icons.outlined.PowerOff
+import androidx.compose.material.icons.outlined.Shield
+import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.vector.ImageVector
+import com.android.settingslib.spa.debug.UiModePreviews
+import com.android.settingslib.spa.framework.theme.SettingsDimension
+import com.android.settingslib.spa.framework.theme.SettingsShape
+import com.android.settingslib.spa.framework.theme.SettingsTheme
+import com.android.settingslib.spa.widget.ui.ExpandIcon
+import com.android.settingslib.spa.widget.ui.SettingsDialogItem
+import com.android.settingslib.spa.widget.ui.SettingsTitleSmall
+
+@Composable
+fun SettingsCollapsibleBanner(
+ title: String,
+ imageVector: ImageVector,
+ models: List<BannerModel>,
+) {
+ var expanded by rememberSaveable { mutableStateOf(false) }
+ SettingsBanner {
+ SettingsBannerContent {
+ Header(title, imageVector, models.count { it.isVisible() }, expanded) { expanded = it }
+ }
+ AnimatedVisibility(expanded) {
+ Column {
+ for (model in models) {
+ SettingsBannerImpl(model)
+ }
+ }
+ }
+ }
+}
+
+@Composable
+private fun Header(
+ title: String,
+ imageVector: ImageVector,
+ cardCount: Int,
+ expanded: Boolean,
+ setExpanded: (Boolean) -> Unit,
+) {
+ Row(
+ modifier = Modifier
+ .fillMaxWidth()
+ .clickable { setExpanded(!expanded) }
+ .padding(
+ horizontal = SettingsDimension.itemPaddingStart,
+ vertical = SettingsDimension.itemPaddingVertical,
+ ),
+ horizontalArrangement = Arrangement.spacedBy(SettingsDimension.itemPaddingStart),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Icon(
+ imageVector = imageVector,
+ contentDescription = null,
+ modifier = Modifier.size(SettingsDimension.itemIconSize),
+ tint = MaterialTheme.colorScheme.primary,
+ )
+ Box(modifier = Modifier.weight(1f)) {
+ SettingsTitleSmall(title, useMediumWeight = true)
+ }
+ BannerCount(cardCount, expanded)
+ }
+}
+
+@Composable
+private fun BannerCount(modelSize: Int, expanded: Boolean) {
+ Surface(
+ shape = SettingsShape.CornerExtraLarge,
+ color = MaterialTheme.colorScheme.secondaryContainer,
+ ) {
+ Row(
+ modifier = Modifier.padding(SettingsDimension.paddingSmall),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Spacer(modifier = Modifier.padding(SettingsDimension.paddingSmall))
+ SettingsDialogItem(modelSize.toString())
+ ExpandIcon(expanded)
+ }
+ }
+}
+
+@UiModePreviews
+@Composable
+private fun SettingsCollapsibleBannerPreview() {
+ SettingsTheme {
+ SettingsCollapsibleBanner(
+ title = "More alerts",
+ imageVector = Icons.Outlined.Error,
+ models = listOf(
+ BannerModel(
+ title = "Lorem ipsum",
+ text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
+ imageVector = Icons.Outlined.PowerOff,
+ buttons = listOf(
+ BannerButton(text = "Action") {},
+ )
+ ),
+ BannerModel(
+ title = "Lorem ipsum",
+ text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
+ imageVector = Icons.Outlined.Shield,
+ buttons = listOf(
+ BannerButton(text = "Action") {},
+ )
+ )
+ )
+ )
+ }
+}
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/preference/MainSwitchPreference.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/preference/MainSwitchPreference.kt
index 0a469b8..b28e88e 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/preference/MainSwitchPreference.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/preference/MainSwitchPreference.kt
@@ -18,6 +18,7 @@
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
@@ -27,6 +28,7 @@
import com.android.settingslib.spa.framework.theme.SettingsDimension
import com.android.settingslib.spa.framework.theme.SettingsShape
import com.android.settingslib.spa.framework.theme.SettingsTheme
+import com.android.settingslib.spa.framework.theme.isSpaExpressiveEnabled
import com.android.settingslib.spa.framework.util.EntryHighlight
@Composable
@@ -38,16 +40,17 @@
true -> MaterialTheme.colorScheme.primaryContainer
else -> MaterialTheme.colorScheme.secondaryContainer
},
- shape = SettingsShape.CornerExtraLarge,
+ shape = if (isSpaExpressiveEnabled) CircleShape
+ else SettingsShape.CornerExtraLarge,
) {
InternalSwitchPreference(
title = model.title,
checked = model.checked(),
changeable = model.changeable(),
onCheckedChange = model.onCheckedChange,
- paddingStart = 20.dp,
+ paddingStart = if (isSpaExpressiveEnabled) 32.dp else 20.dp,
paddingEnd = 20.dp,
- paddingVertical = 24.dp,
+ paddingVertical = if (isSpaExpressiveEnabled) 16.dp else 24.dp,
)
}
}
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/scaffold/Actions.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/scaffold/Actions.kt
index 5f320f7..9bbc16d 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/scaffold/Actions.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/scaffold/Actions.kt
@@ -17,15 +17,24 @@
package com.android.settingslib.spa.widget.scaffold
import androidx.appcompat.R
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
import androidx.compose.material.icons.outlined.Clear
import androidx.compose.material.icons.outlined.FindInPage
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
+import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import com.android.settingslib.spa.framework.compose.LocalNavController
+import com.android.settingslib.spa.framework.theme.SettingsDimension
+import com.android.settingslib.spa.framework.theme.SettingsShape
+import com.android.settingslib.spa.framework.theme.isSpaExpressiveEnabled
/** Action that navigates back to last page. */
@Composable
@@ -50,6 +59,11 @@
Icon(
imageVector = Icons.AutoMirrored.Outlined.ArrowBack,
contentDescription = contentDescription,
+ modifier = if (isSpaExpressiveEnabled) Modifier
+ .size(SettingsDimension.actionIconWidth, SettingsDimension.actionIconHeight)
+ .clip(SettingsShape.CornerExtraLarge)
+ .background(MaterialTheme.colorScheme.onSurfaceVariant)
+ .padding(SettingsDimension.actionIconPadding) else Modifier
)
}
}
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCardTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsBannerTest.kt
similarity index 79%
rename from packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCardTest.kt
rename to packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsBannerTest.kt
index ffc7e86..a8479b0 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCardTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsBannerTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settingslib.spa.widget.card
+package com.android.settingslib.spa.widget.banner
import android.content.Context
import androidx.compose.runtime.getValue
@@ -35,16 +35,16 @@
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-class SettingsCardTest {
+class SettingsBannerTest {
@get:Rule val composeTestRule = createComposeRule()
private val context: Context = ApplicationProvider.getApplicationContext()
@Test
- fun settingsCard_titleDisplayed() {
+ fun settingsBanner_titleDisplayed() {
composeTestRule.setContent {
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = TITLE,
text = "",
)
@@ -55,10 +55,10 @@
}
@Test
- fun settingsCard_textDisplayed() {
+ fun settingsBanner_textDisplayed() {
composeTestRule.setContent {
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = "",
text = TEXT,
)
@@ -69,13 +69,13 @@
}
@Test
- fun settingsCard_buttonDisplayed() {
+ fun settingsBanner_buttonDisplayed() {
composeTestRule.setContent {
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = "",
text = "",
- buttons = listOf(CardButton(text = TEXT) {}),
+ buttons = listOf(BannerButton(text = TEXT) {}),
)
)
}
@@ -84,14 +84,14 @@
}
@Test
- fun settingsCard_buttonCanBeClicked() {
+ fun settingsBanner_buttonCanBeClicked() {
var buttonClicked = false
composeTestRule.setContent {
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = "",
text = "",
- buttons = listOf(CardButton(text = TEXT) { buttonClicked = true }),
+ buttons = listOf(BannerButton(text = TEXT) { buttonClicked = true }),
)
)
}
@@ -102,13 +102,13 @@
}
@Test
- fun settingsCard_buttonHaveContentDescription() {
+ fun settingsBanner_buttonHaveContentDescription() {
composeTestRule.setContent {
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = "",
text = "",
- buttons = listOf(CardButton(
+ buttons = listOf(BannerButton(
text = TEXT,
contentDescription = CONTENT_DESCRIPTION,
) {}
@@ -121,11 +121,11 @@
}
@Test
- fun settingsCard_dismiss() {
+ fun settingsBanner_dismiss() {
composeTestRule.setContent {
var isVisible by remember { mutableStateOf(true) }
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = TITLE,
text = "",
isVisible = { isVisible },
@@ -142,11 +142,11 @@
}
@Test
- fun settingsCard_clickable() {
+ fun settingsBanner_clickable() {
var clicked by mutableStateOf(false)
composeTestRule.setContent {
- SettingsCard(
- CardModel(
+ SettingsBanner(
+ BannerModel(
title = TITLE,
text = "",
) { clicked = true }
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleCardTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleBannerTest.kt
similarity index 78%
rename from packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleCardTest.kt
rename to packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleBannerTest.kt
index aba9d7b..1080fde 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleCardTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleBannerTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settingslib.spa.widget.card
+package com.android.settingslib.spa.widget.banner
import android.content.Context
import androidx.compose.material.icons.Icons
@@ -36,44 +36,44 @@
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-class SettingsCollapsibleCardTest {
+class SettingsCollapsibleBannerTest {
@get:Rule
val composeTestRule = createComposeRule()
private val context: Context = ApplicationProvider.getApplicationContext()
@Test
- fun settingsCollapsibleCard_titleDisplayed() {
+ fun settingsCollapsibleBanner_titleDisplayed() {
setContent()
composeTestRule.onNodeWithText(TITLE).assertIsDisplayed()
}
@Test
- fun settingsCollapsibleCard_cardCountDisplayed() {
+ fun settingsCollapsibleBanner_BannerCountDisplayed() {
setContent()
composeTestRule.onNodeWithText("1").assertIsDisplayed()
}
@Test
- fun settingsCollapsibleCard_initial_cardTextNotExists() {
+ fun settingsCollapsibleBanner_initial_BannerTextNotExists() {
setContent()
- composeTestRule.onNodeWithText(CARD_TEXT).assertDoesNotExist()
+ composeTestRule.onNodeWithText(Banner_TEXT).assertDoesNotExist()
}
@Test
- fun settingsCollapsibleCard_afterExpand_cardTextDisplayed() {
+ fun settingsCollapsibleBanner_afterExpand_BannerTextDisplayed() {
setContent()
composeTestRule.onNodeWithText(TITLE).performClick()
- composeTestRule.onNodeWithText(CARD_TEXT).assertIsDisplayed()
+ composeTestRule.onNodeWithText(Banner_TEXT).assertIsDisplayed()
}
@Test
- fun settingsCollapsibleCard_dismiss() {
+ fun settingsCollapsibleBanner_dismiss() {
setContent()
composeTestRule.onNodeWithText(TITLE).performClick()
@@ -81,20 +81,20 @@
context.getString(androidx.compose.material3.R.string.m3c_snackbar_dismiss)
).performClick()
- composeTestRule.onNodeWithText(CARD_TEXT).isNotDisplayed()
+ composeTestRule.onNodeWithText(Banner_TEXT).isNotDisplayed()
composeTestRule.onNodeWithText("0").assertIsDisplayed()
}
private fun setContent() {
composeTestRule.setContent {
var isVisible by rememberSaveable { mutableStateOf(true) }
- SettingsCollapsibleCard(
+ SettingsCollapsibleBanner(
title = TITLE,
imageVector = Icons.Outlined.Error,
models = listOf(
- CardModel(
+ BannerModel(
title = "",
- text = CARD_TEXT,
+ text = Banner_TEXT,
isVisible = { isVisible },
onDismiss = { isVisible = false },
)
@@ -105,6 +105,6 @@
private companion object {
const val TITLE = "Title"
- const val CARD_TEXT = "Card Text"
+ const val Banner_TEXT = "Banner Text"
}
}
diff --git a/packages/SettingsLib/res/layout/zen_mode_condition.xml b/packages/SettingsLib/res/layout/zen_mode_condition.xml
index 3222174..805c81f 100644
--- a/packages/SettingsLib/res/layout/zen_mode_condition.xml
+++ b/packages/SettingsLib/res/layout/zen_mode_condition.xml
@@ -52,6 +52,7 @@
android:ellipsize="end"
android:textAlignment="viewStart"
android:maxLines="1"
+ android:scrollbars="none"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"/>
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index 9c75556..1963b15c 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Wekkers en onthounotas"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Laat hierdie app toe om wekkers te stel en tydsensitiewe handelinge te skeduleer. Dit laat die app op die agtergrond werk, wat meer batterykrag kan gebruik.\n\nAs hierdie toestemming af is, sal bestaande wekkers en tydgegronde geleenthede wat deur hierdie app geskeduleer is, nie werk nie."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"skedule, wekker, onthounota, horlosie"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Moenie Steur Nie"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Moenie Steur Nie"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Skakel aan"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Skakel Moenie steur nie aan"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index 093fbbb..002d3bc 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"ማንቂያዎች እና አስታዋሾች"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"ይህ መተግበሪያ ማንቂያዎችን እንዲያቀናብር እና የጊዜ ትብነት ያላቸው እርምጃዎችን መርሐግብር እንዲያስይዝ ይፍቀዱለት። ይህ መተግበሪያው ከበስተጀርባ ማሄድ እንዲችል ያስችለዋል፣ ይህም የበለጠ ባትሪ ሊጠቀም ይችላል።\n\nይህ ፈቃድ ከጠፋ በዚህ መተግበሪያ መርሐግብር የተያዘላቸው ነባር ማንቂያዎች እና ጊዜ-ተኮር ክስተቶች አይሰሩም።"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"የጊዜ መርሐግብር፣ ማንቂያ፣ አስታዋሽ ሰዓት"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"አትረብሽ"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"አይረብሹ"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"አብራ"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"አትረብሽን አብራ"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index a1f4109..a459a86 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"المنبّهات والتذكيرات"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"يمكنك السماح لهذا التطبيق بضبط المنبّهات وجدولة الإجراءات لتنفيذها في الوقت المناسب. ويسمح هذا الإذن بتشغيل التطبيق في الخلفية، ما قد يستهلك المزيد من البطارية.\n\nفي حال عدم تفعيل هذا الإذن، لن تعمل المنبهات المضبوطة والأحداث المستندة إلى الوقت المجدولة حاليًا في هذا التطبيق."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"جدول زمني، جدولة، منبّه، تذكير، ساعة"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"عدم الإزعاج"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"وضع \"عدم الإزعاج\""</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"تفعيل"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"تفعيل ميزة \"عدم الإزعاج\""</string>
diff --git a/packages/SettingsLib/res/values-as/strings.xml b/packages/SettingsLib/res/values-as/strings.xml
index 019fb86..6f6dce7 100644
--- a/packages/SettingsLib/res/values-as/strings.xml
+++ b/packages/SettingsLib/res/values-as/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"এলাৰ্ম আৰু ৰিমাইণ্ডাৰ"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"এই এপ্টোক এলাৰ্ম ছেট কৰিবলৈ আৰু সময় সংবেদনশীল কাৰ্যৰ সময়সূচী নিৰ্ধাৰণ কৰিবলৈ দিয়ক। ই এপ্টোক নেপথ্যত চলি থকাৰ অনুমতি দিয়ে যাৰ ফলত অধিক বেটাৰী ব্যৱহাৰ হয়।\n\nএই অনুমতিটো অফ কৰা থাকিলে, ইতিমধ্যে ছেট কৰা এলাৰ্ম আৰু এই এপ্টোৱে সময়সূচী নিৰ্ধাৰণ কৰা সময় ভিত্তিক অনুষ্ঠানসমূহে কাম নকৰা হ’ব।"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"সময়সূচী, এলাৰ্ম, ৰিমাইণ্ডাৰ, ঘড়ী"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"অসুবিধা নিদিব ম’ড"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"অসুবিধা নিদিব"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"অন কৰক"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"অসুবিধা নিদিব অন কৰক"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index 7f17e79..8cc67cb 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Siqnallar və xatırlatmalar"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Bu tətbiqə siqnallar ayarlamağa və vaxta əsaslanan əməliyyatları planlaşdırmağa icazə verin. Bu, tətbiqin arxa fonda işləməsinə imkan verir ki, nəticədə daha çox enerji istifadə edilə bilər.\n\nBu icazə deaktiv olsa, bu tətbiq tərəfindən planlaşdırılan mövcud siqnallar və vaxta əsaslanan tədbirlər işləməyəcəkdir."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"cədvəl, siqnal, xatırlatma, saat"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Narahat etməyin"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Narahat etməyin"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aktiv edin"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\"Narahat Etməyin\" rejimini aktiv 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 25bf587..3688d0c 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmi i podsetnici"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Omogućite ovoj aplikaciji da podešava alarme i zakazuje vremenski osetljive radnje. To omogućava da aplikacija bude pokrenuta u pozadini, što može da troši više baterije.\n\nAko je ova dozvola isključena, postojeći alarmi i događaji zasnovani na vremenu zakazani pomoću ove aplikacije neće raditi."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"zakazati, alarm, podsetnik, sat"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ne uznemiravaj"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ne uznemiravaj"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Uključi"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Uključite režim Ne uznemiravaj"</string>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 3a61980..f4f5331 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Будзільнікі і напаміны"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Дазвольце гэтай праграме ўключаць будзільнікі і задаваць час дзеянняў. З такім дазволам праграма можа працаваць у фонавым рэжыме і ў выніку хутчэй разраджаць акумулятар.\n\nКалі вы не ўключыце гэты дазвол, існуючыя будзільнікі і запланаваны праграмай час падзей не будуць працаваць."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"расклад, будзільнік, напамін, гадзіннік"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Не турбаваць"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Не турбаваць"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Уключыць"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Уключэнне рэжыму \"Не турбаваць\""</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index 5f0def5..dd16fc9 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Будилници и напомняния"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Разрешаване на това приложение да задава будилници и да насрочва действия, ограничени във времето. Това му позволява да работи на заден план, при което може да се използва повече батерия.\n\nАко разрешението е изключено, съществуващите будилници и събитията въз основа на времето, насрочени от приложението, няма да работят."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"график, будилник, напомняне, часовник"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Не безпокойте"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Не безпокойте"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Включване"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Включване на режима „Не безпокойте“"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index 0c0b569..6b37717 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"অ্যালার্ম এবং রিমাইন্ডার"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"অ্যালার্ম এবং সময়ের মধ্যে শেষ করতে হবে এমন অ্যাকশনের শিডিউল সেট করতে এই অ্যাপকে অনুমতি দিন। এর ফলে ব্যাকগ্রাউন্ডে অ্যাপ চলতে পারে, যার জন্য আরও ব্যাটারির চার্জ খরচ হতে পারে।\n\nএই অনুমতি বন্ধ করা থাকলে, আগে থেকে থাকা অ্যালার্ম এবং অ্যাপের মাধ্যমে শিডিউল করা সময় ভিত্তিক ইভেন্টের রিমাইন্ডার কাজ করবে না।"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"শিডিউল, অ্যালার্ম, রিমাইন্ডার, ঘড়ি"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"বিরক্ত করবে না"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"বিরক্ত করবে না"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"চালু করুন"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\'বিরক্ত করবে না\' মোড চালু করুন"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index ea4150f..cb71f25 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmi i podsjetnici"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Dozvolite ovoj aplikaciji da postavlja alarme i zakazuje vremenski osjetljive radnje. Ovim će se omogućiti aplikaciji da radi u pozadini, čime se može povećati potrošnja baterije.\n\nAko je ovo odobrenje isključeno, postojeći alarmi i događaji zasnovani na vremenu, a koje je ova aplikacija zakazala, neće funkcionirati."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"raspored, alarm, podsjetnik, sat"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ne ometaj"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ne ometaj"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Uključi"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Uključi način rada Ne ometaj"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index adfa6f2..84eb51f 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmes i recordatoris"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Permet que aquesta aplicació configuri alarmes i programi accions a una hora determinada. Això permet a l\'aplicació executar-se en segon pla i, per tant, és possible que consumeixi més bateria.\n\nSi aquest permís està desactivat, les alarmes i els esdeveniments que ja hagi programat l\'aplicació no funcionaran."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"programació, alarma, recordatori, rellotge"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"No molestis"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"No molestis"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Activa"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Activa el mode No molestis"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index 96d04a8..a8764b6 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Budíky a připomenutí"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Když tuto možnost povolíte, aplikace bude moci nastavovat budíky a plánovat akce závislé na čase. Aplikace poběží na pozadí, což může vést k vyšší spotřebě baterie.\n\nPokud toto oprávnění zůstane vypnuté, stávající budíky a události závislé na čase naplánované touto aplikací nebudou fungovat."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"plán, budík, připomenutí, hodiny"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Nerušit"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Nerušit"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Zapnout"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Zapněte funkci Nerušit"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index c6a5a43..697802e 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmer og påmindelser"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Tillad, at denne app indstiller alarmer og planlægger tidsbestemte handlinger. Appen vil køre i baggrunden, hvor den muligvis bruger mere batteri.\n\nHvis denne tilladelse er deaktiveret, vil eksisterende alarmer og tidsbestemte handlinger, der er planlagt af denne app, ikke fungere."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"planlæg, alarm, påmindelse, ur"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Forstyr ikke"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Forstyr ikke"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aktivér"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Aktivér Forstyr ikke"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index 88db823..cb745fc 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Wecker und Erinnerungen"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Dieser App erlauben, Wecker zu stellen und zeitgebundene Aktionen zu planen. Dadurch läuft die App im Hintergrund. Dies kann den Akkuverbrauch erhöhen. \n\nWenn diese Berechtigung deaktiviert ist, funktionieren bereits gestellte Wecker und zeitgebundene Ereignisse, die von dieser App geplant sind, nicht wie erwartet."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"planen, Wecker, Erinnerung, Uhr"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Bitte nicht stören"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Bitte nicht stören"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aktivieren"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"„Bitte nicht stören“ aktivieren"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index 35734a9..89817dd 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Ξυπνητήρια και υπενθυμίσεις"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Επιτρέψτε σε αυτή την εφαρμογή να ορίζει ξυπνητήρια και να προγραμματίζει ενέργειες που εξαρτώνται από τον χρόνο. Αυτό επιτρέπει στην εφαρμογή να εκτελείται στο παρασκήνιο και, ως εκ τούτου, μπορεί να καταναλώνει περισσότερη μπαταρία.\n\nΑν αυτή η άδεια δεν είναι ενεργή, τα υπάρχοντα ξυπνητήρια και συμβάντα βάσει χρόνου που έχουν προγραμματιστεί από αυτή την εφαρμογή δεν θα λειτουργούν."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"πρόγραμμα, ξυπνητήρι, υπενθύμιση, ρολόι"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Μην ενοχλείτε"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Μην ενοχλείτε"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Ενεργοποίηση"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Ενεργοποίηση λειτουργίας \"Μην ενοχλείτε\""</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index 2d03437..b6e41c4 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarms and reminders"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Allow this app to set alarms and schedule time-sensitive actions. This lets the app run in the background, which may use more battery.\n\nIf this permission is off, existing alarms and time-based events scheduled by this app won’t work."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"schedule, alarm, reminder, clock"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Do Not Disturb"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Do Not Disturb"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Turn on"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Turn on Do Not Disturb"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index 2d03437..b6e41c4 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarms and reminders"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Allow this app to set alarms and schedule time-sensitive actions. This lets the app run in the background, which may use more battery.\n\nIf this permission is off, existing alarms and time-based events scheduled by this app won’t work."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"schedule, alarm, reminder, clock"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Do Not Disturb"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Do Not Disturb"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Turn on"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Turn on Do Not Disturb"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index 2d03437..b6e41c4 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarms and reminders"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Allow this app to set alarms and schedule time-sensitive actions. This lets the app run in the background, which may use more battery.\n\nIf this permission is off, existing alarms and time-based events scheduled by this app won’t work."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"schedule, alarm, reminder, clock"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Do Not Disturb"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Do Not Disturb"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Turn on"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Turn on Do Not Disturb"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index e4490a3..8f7c4a7 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmid ja meeldetuletused"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Lubage sellel rakendusel määrata alarme ja ajastada ajakriitilisi toiminguid. See võimaldab rakendusel töötada taustal, mistõttu võib akukasutus olla suurem.\n\nKui see luba on välja lülitatud, siis olemasolevad alarmid ja selle rakenduse ajastatud ajapõhised sündmused ei tööta."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ajakava, äratus, meeldetuletus, kell"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Mitte segada"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Mitte segada"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Lülita sisse"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Valiku Mitte segada sisselülitamine"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index 828831e..7285547 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmak eta abisuak"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Eman alarmak ezartzeko eta denbora-muga duten ekintzak programatzeko baimena aplikazioari. Hala, aplikazioak atzeko planoan funtzionatuko du, eta litekeena da bateria gehiago kontsumitzea.\n\nBaimen hori ematen ez baduzu, ez dute funtzionatuko aplikazio honen bidez programatutako alarmek eta denbora-muga duten ekintzek."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"programazioa, alarma, abisua, erlojua"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ez molestatzeko modua"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ez molestatzeko modua"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aktibatu"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Aktibatu ez molestatzeko modua"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index 7858cc8..ff0ad1d 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"زنگهای ساعت و یادآوریها"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"به این برنامه اجازه میدهد زنگ ساعت تنظیم کند و کنشهای حساس به زمان را زمانبندی کند. این تنظیم به برنامه اجازه میدهد در پسزمینه اجرا شود که ممکن است باتری بیشتری مصرف کند.\n\nاگر این اجازه خاموش باشد، زنگهای ساعت موجود و رویدادهای زمانمحور که این برنامه زمانبندی کرده است کار نخواهند کرد."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"زمانبندی، زنگ ساعت، یادآوری، ساعت"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"مزاحم نشوید"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"مزاحم نشوید"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"روشن کردن"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"روشن کردن «مزاحم نشوید»"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index 8ad343a..800f327 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Herätykset ja muistutukset"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Anna sovelluksen lisätä herätyksiä ja ajoittaa kiireellisiä tapahtumia. Näin sovellus voi toimia taustalla, mikä voi kuluttaa enemmän virtaa.\n\nIlman tätä lupaa sovelluksen ajoittamat herätykset ja aikaan perustuvat tapahtumat eivät toimi."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ajoitus, herätys, muistutus, kello"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Älä häiritse"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Älä häiritse"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Ota käyttöön"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Laita Älä häiritse ‑tila päälle"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index 2e3a6a7..f36b5f0 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmes et rappels"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Autorisez cette appli à créer des alarmes et à programmer des actions urgentes. Cela permet à l’appli de s\'exécuter en arrière-plan, ce qui peut nécessiter plus de pile.\n\nSi cette autorisation est désactivée, les alarmes existantes et les événements en temps réel programmés par cette appli ne fonctionneront pas."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"horaire, alarme, rappel, horloge"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ne pas déranger"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ne pas déranger"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Activer"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Activer le mode Ne pas déranger"</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index 9bcdc97..bac62f2 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -81,7 +81,7 @@
<string name="speed_label_fast" msgid="2677719134596044051">"Rápida"</string>
<string name="speed_label_very_fast" msgid="8215718029533182439">"Moi rápida"</string>
<string name="wifi_passpoint_expired" msgid="6540867261754427561">"Caducou"</string>
- <string name="preference_summary_default_combination" msgid="2644094566845577901">"<xliff:g id="STATE">%1$s</xliff:g>/<xliff:g id="DESCRIPTION">%2$s</xliff:g>"</string>
+ <string name="preference_summary_default_combination" msgid="2644094566845577901">"<xliff:g id="STATE">%1$s</xliff:g> / <xliff:g id="DESCRIPTION">%2$s</xliff:g>"</string>
<string name="bluetooth_disconnected" msgid="7739366554710388701">"Desconectado"</string>
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Desconectando..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Conectando..."</string>
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmas e recordatorios"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Permite que esta aplicación defina alarmas e planifique accións que dependan da hora. Con este permiso, a aplicación pode executarse en segundo plano, o que pode provocar un maior consumo de batería.\n\nSe este permiso está desactivado, non funcionarán as alarmas que xa se definisen nin os eventos que dependan da hora planificados por esta aplicación."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"planificar, alarma, recordatorio, reloxo"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Modo Non molestar"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Non molestar"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Activar"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Activar modo Non molestar"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index e402ad3..9af8e48 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"અલાર્મ અને રિમાઇન્ડર"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"આ ઍપને અલાર્મ સેટ કરવા અને સમય પ્રતિ સંવેદનશીલ ક્રિયાઓ શેડ્યૂલ કરવા માટે મંજૂરી આપો. આ ઍપને બૅકગ્રાઉન્ડમાં ચાલવા દે છે, જેને કારણે બૅટરીનો વધુ વપરાશ થઈ શકે છે.\n\nજો આ પરવાનગી બંધ હોય, તો આ ઍપ દ્વારા શેડ્યૂલ કરવામાં આવેલા વર્તમાન અલાર્મ અને સમય આધારિત ઇવેન્ટ કામ કરશે નહીં."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"શેડ્યૂલ, અલાર્મ, રિમાઇન્ડર, ઘડિયાળ"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ખલેલ પાડશો નહીં"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ખલેલ પાડશો નહીં"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ચાલુ કરો"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"ખલેલ પાડશો નહીં ચાલુ કરો"</string>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index 2e484e4..785ef59 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"अलार्म और रिमाइंडर"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"इस ऐप्लिकेशन को अलार्म और तय समय पर होने वाली कार्रवाइयों के रिमाइंडर सेट करने की अनुमति दें. ऐसा करने से, ऐप्लिकेशन को बैकग्राउंड में चलने की अनुमति मिलती है. इससे बैटरी ज़्यादा खर्च होती है.\n\nऐप्लिकेशन को यह अनुमति न देने पर, इसकी मदद से सेट किए गए अलार्म और तय समय पर होने वाली कार्रवाइयों के रिमाइंडर काम नहीं करेंगे."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"शेड्यूल, अलार्म, रिमाइंडर, घड़ी"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"परेशान न करें"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"परेशान न करें"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"चालू करें"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\'परेशान न करें\' चालू करें"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index a1c9a61..107c561 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmi i podsjetnici"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Omogućite toj aplikaciji da postavlja alarme i zakazuje radnje u točno određeno vrijeme. To aplikaciji omogućuje da se izvodi u pozadini, pa je moguća dodatna potrošnja baterije.\n\nAko je to dopuštenje isključeno, postojeći alarmi i događaji zakazani putem te aplikacije neće funkcionirati."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"raspored, alarm, podsjetnik, sat"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ne uznemiravaj"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ne uznemiravaj"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Uključi"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Uključite opciju Ne uznemiravaj."</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index 5ea4fdb..dff22d9 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Ébresztések és emlékeztetők"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Lehetővé teszi ennek az alkalmazásnak, hogy ébresztéseket állítson be és időérzékeny feladatokat ütemezzen. Ezzel engedélyezi az alkalmazásnak, hogy a háttérben fusson, ami megnövekedett akkumulátorhasználattal járhat.\n\nHa ez az engedély ki van kapcsolva, az alkalmazás által beállított ébresztések és ütemezett időérzékeny események nem fognak működni."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ütemezés, ébresztés, emlékeztető, óra"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ne zavarjanak"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ne zavarjanak"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Bekapcsolás"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"A Ne zavarjanak mód bekapcsolása"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index f7b51a5..60e5adf 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Զարթուցիչներ և հիշեցումներ"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Թույլատրել այս հավելվածին զարթուցիչներ կարգավորել և որոշակի ժամանակի համար գործողություններ պլանավորել։ Այդ դեպքում հավելվածն աշխատում է ֆոնային ռեժիմում, և արդյունքում մարտկոցի լիցքն ավելի արագ է սպառվում։\n\nԵթե այս թույլտվությունն անջատված է, հավելվածի կողմից կարգավորված զարթուցիչները և գործողությունների ժամանակացույցները չեն աշխատի։"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ժամանակացույց, զարթուցիչ, հիշեցում, ժամացույց"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Չանհանգստացնել"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Չանհանգստացնել"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Միացնել"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Միացրեք «Չանհանգստացնել» ռեժիմը"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 070c161..f0b76ce 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarm & pengingat"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Mengizinkan aplikasi ini menyetel alarm dan menjadwalkan tindakan yang sensitif waktu. Hal ini memungkinkan aplikasi berjalan di latar belakang, sehingga mungkin menggunakan lebih banyak daya baterai.\n\nJika izin ini dinonaktifkan, alarm dan acara berbasis waktu yang dijadwalkan oleh aplikasi ini tidak akan berfungsi."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"jadwal, alarm, pengingat, jam"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Jangan Ganggu"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Jangan Ganggu"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aktifkan"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Aktifkan mode Jangan Ganggu"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index 5408b50..61813a3 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Vekjarar og áminningar"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Leyfa þessu forriti að stilla vekjara og áætla aðgerðir sem þurfa að eiga sér stað innan ákveðins tímaramma. Þetta leyfir forritinu að keyra í bakgrunninum sem getur notað meiri rafhlöðuorku.\n\nEf slökkt er á þessari heimild munu núverandi vekjarar og tímasettir viðburðir sem þetta forrit stillir ekki virka."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"áætlun, vekjari, áminning, klukka"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ónáðið ekki"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ónáðið ekki"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Kveikja"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Kveikja á „Ónáðið ekki“"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index fce947a..c0f1e87 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"שעונים מעוררים ותזכורות"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"ההרשאה הזו מתירה לאפליקציה להגדיר שעון מעורר ולתזמן פעולות דחופות. האפליקציה תוכל לפעול ברקע ובכך להגביר את צריכת הסוללה.\n\nאם ההרשאה מושבתת, ההתראות והאירועים מבוססי-הזמן שהוגדרו ותוזמנו על ידי האפליקציה לא יפעלו."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"תזמון, שעון מעורר, תזכורת, שעון"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"נא לא להפריע"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"נא לא להפריע"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"הפעלה"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"הפעלת מצב נא לא להפריע"</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index 41acfc0..71aae44 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -477,7 +477,7 @@
<string name="daltonizer_type_overridden" msgid="4509604753672535721">"<xliff:g id="TITLE">%1$s</xliff:g>によって上書き済み"</string>
<string name="power_remaining_settings_home_page" msgid="4885165789445462557">"<xliff:g id="PERCENTAGE">%1$s</xliff:g> - <xliff:g id="TIME_STRING">%2$s</xliff:g>"</string>
<string name="power_charging_on_hold_settings_home_page" msgid="7690464049464805856">"<xliff:g id="LEVEL">%1$s</xliff:g> - バッテリーを保護するため、充電を一時停止しています"</string>
- <string name="power_incompatible_charging_settings_home_page" msgid="1322050766135126880">"<xliff:g id="LEVEL">%1$s</xliff:g> - 充電用アクセサリを確認してください"</string>
+ <string name="power_incompatible_charging_settings_home_page" msgid="1322050766135126880">"<xliff:g id="LEVEL">%1$s</xliff:g> - 充電用アクセサリーを確認してください"</string>
<string name="power_remaining_duration_only" msgid="8264199158671531431">"残り時間: 約 <xliff:g id="TIME_REMAINING">%1$s</xliff:g>"</string>
<string name="power_discharging_duration" msgid="1076561255466053220">"残り時間: 約 <xliff:g id="TIME_REMAINING">%1$s</xliff:g>(<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
<string name="power_remaining_duration_only_enhanced" msgid="2527842780666073218">"残り時間: 約 <xliff:g id="TIME_REMAINING">%1$s</xliff:g>(使用状況に基づく)"</string>
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"アラームとリマインダー"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"アラームの設定や時間ベースのアクション設定を、このアプリに許可します。これによりアプリがバックグラウンドで実行できるようになるため、バッテリーの使用量が増えることがあります。\n\nこの権限が OFF の場合、このアプリで設定された既存のアラームと時間ベースのイベントは機能しなくなります。"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"スケジュール, アラーム, リマインダー, 時計"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"サイレント モード"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"サイレント モード"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ON にする"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"サイレント モードを ON にする"</string>
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index 58a01a4..7801417 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"მაღვიძარები და შეხსენებები"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"ნებას რთავს ამ აპს, დააყენოს მაღვიძარები და დაგეგმოს დროზე დამოკიდებული მოქმედებები. ეს საშუალებას აძლევს აპს, იმუშაოს ფონურად, რამაც შეიძლება ბატარეის ხარჯი გაზარდოს.\n\nთუ ეს ნებართვა გამორთულია, ამ აპით დაგეგმილი მაღვიძარები და დროზე დამოკიდებული მოვლენები არ იმუშავებს."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"განრიგი, მაღვიძარა, შეხსენება, საათი"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"არ შემაწუხოთ"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"არ შემაწუხოთ"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ჩართვა"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"„არ შემაწუხოთ“ რეჟიმის ჩართვა"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index 485120d..2ae8250 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Оятқыштар мен еске салғыштар"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Бұл қолданбаға оятқыштарды орнатуға және уақытқа байланысты әрекеттерді жоспарлауға рұқсат береді. Мұндайда қолданба фондық режимде жұмыс істейді, сондықтан батарея шығыны артуы мүмкін.\n\nБұл рұқсат өшірулі болса, осы қолданбада жоспарланған ағымдағы оятқыштар мен уақытқа байланысты іс-шаралар жұмыс істемейді."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"кесте, оятқыш, еске салғыш, сағат"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Мазаламау"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Мазаламау"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Қосу"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Мазаламау режимін қосу"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index 7fbc509..85801c9 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"ម៉ោងរោទ៍ និងការរំលឹក"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"អនុញ្ញាតឱ្យកម្មវិធីនេះកំណត់ម៉ោងរោទ៍ និងកំណត់កាលវិភាគសកម្មភាពដែលតម្រូវឱ្យទាន់ពេលវេលា។ ការធ្វើបែបនេះអនុញ្ញាតឱ្យកម្មវិធីនេះដំណើរការនៅផ្ទៃខាងក្រោយ ដែលអាចប្រើថ្មកាន់តែច្រើន។\n\nប្រសិនបើបិទការអនុញ្ញាតនេះ ម៉ោងរោទ៍ដែលមានស្រាប់ និងព្រឹត្តិការណ៍ផ្អែកលើពេលវេលាដែលកំណត់ដោយកម្មវិធីនេះនឹងមិនដំណើរការទេ។"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"កាលវិភាគ ម៉ោងរោទ៍ ការរំលឹក នាឡិកា"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"កុំរំខាន"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"កុំរំខាន"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"បើក"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"បើកមុខងារកុំរំខាន"</string>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index 85075c3..6dc3ae9 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"ಅಲಾರಂಗಳು ಮತ್ತು ರಿಮೈಂಡರ್ಗಳು"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"ಅಲಾರಂಗಳನ್ನು ಹೊಂದಿಸಲು ಮತ್ತು ಸಮಯ-ಸೂಕ್ಷ್ಮವಾದ ಕ್ರಿಯೆಗಳನ್ನು ನಿಗದಿಪಡಿಸಲು ಈ ಆ್ಯಪ್ಗೆ ಅನುಮತಿಸಿ. ಇದು ಹಿನ್ನೆಲೆಯಲ್ಲಿ ರನ್ ಆಗಲು ಆ್ಯಪ್ಗೆ ಅನುಮತಿಸುತ್ತದೆ, ಅದರಿಂದ ಹೆಚ್ಚು ಬ್ಯಾಟರಿ ಬಳಕೆಯಾಗಬಹುದು.\n\nಈ ಅನುಮತಿ ಆಫ್ ಆಗಿದ್ದರೆ, ಅಸ್ತಿತ್ವದಲ್ಲಿರುವ ಅಲಾರಂಗಳು ಮತ್ತು ಈ ಆ್ಯಪ್ ನಿಗದಿಪಡಿಸಿದ ಸಮಯ-ಸೂಕ್ಷ್ಮ ಈವೆಂಟ್ಗಳು ಕೆಲಸ ಮಾಡುವುದಿಲ್ಲ."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ವೇಳಾಪಟ್ಟಿ, ಅಲಾರಂ, ರಿಮೈಂಡರ್, ಗಡಿಯಾರ"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ಅಡಚಣೆ ಮಾಡಬೇಡಿ"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ಅಡಚಣೆ ಮಾಡಬೇಡಿ"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ಆನ್ ಮಾಡಿ"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"ಅಡಚಣೆ ಮಾಡಬೇಡಿ ಅನ್ನು ಆನ್ ಮಾಡಿ"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index 480d78f..14e8f4f 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"알람 및 리마인더"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"이 앱이 알람을 설정하고 시간 기반 작업을 예약할 수 있도록 허용합니다. 이렇게 하면 백그라운드에서 앱 실행이 허용되어 배터리 사용량이 증가할 수 있습니다.\n\n이 권한을 사용 중지하면 이 앱에서 예약한 기존의 알람 및 시간 기반 일정이 작동하지 않습니다."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"일정 예약, 알람, 리마인더, 시계"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"방해 금지 모드"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"방해 금지 모드"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"사용 설정"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"방해 금지 모드 사용 설정"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index 1667041..9ff62cf 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Ойготкучтар жана эстеткичтер"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Бул колдонмого ойготкучтарды коюуга жана башка аракеттерди графикке киргизүүгө уруксат бересиз. Ушуну менен колдонмо фондо иштеп, батареяны көбүрөөк сарпташы мүмкүн.\n\nЭгер бул уруксат өчүрүлсө, колдонмодогу ойготкучтар жана графикке киргизилген башка аракеттер иштебейт."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"график, ойготкуч, эстеткич, саат"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Тынчымды алба"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Тынчымды алба"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Күйгүзүү"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\"Тынчымды алба\" режимин күйгүзүү"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index 2c6d6ba..5d5a4c6 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"ໂມງປຸກ ແລະ ການແຈ້ງເຕືອນ"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"ອະນຸຍາດໃຫ້ແອັບນີ້ຕັ້ງໂມງປຸກ ແລະ ກຳນົດເວລາຄຳສັ່ງທີ່ເນັ້ນເລື່ອງເວລາເປັນສຳຄັນໄດ້. ນີ້ຈະເຮັດໃຫ້ແອັບເຮັດວຽກໄດ້ໃນພື້ນຫຼັງ, ເຊິ່ງອາດໃຊ້ແບັດເຕີຣີຫຼາຍຂຶ້ນ.\n\nຫາກປິດການອະນຸຍາດນີ້ໄວ້, ໂມງປຸກທີ່ມີຢູ່ກ່ອນແລ້ວ ແລະ ເຫດການທີ່ອ້າງອີງເວລາທີ່ກຳນົດໄວ້ໂດຍແອັບນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ກຳນົດເວລາ, ໂມງປຸກ, ການແຈ້ງເຕືອນ, ໂມງ"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ຫ້າມລົບກວນ"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ຫ້າມລົບກວນ"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ເປີດ"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"ເປີດໂໝດຫ້າມລົບກວນ"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index a6ef078..2b0b71d 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Signalai ir priminimai"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Leiskite šiai programai nustatyti signalus ir suplanuoti veiksmus, kuriems svarbus laiko veiksnys. Dėl to programa gali veikti fone ir sunaudoti daugiau akumuliatoriaus energijos.\n\nJei šis leidimas išjungtas, šios programos suplanuoti esami signalai ir laiku pagrįsti įvykiai neveiks."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"tvarkaraštis, signalas, priminimas, laikrodis"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Netrukdymo režimas"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Netrukdymo režimas"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Įjungti"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Netrukdymo režimo įjungimas"</string>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index a1fef64..a8a4ea0 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Signāli un atgādinājumi"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Atļaujiet šai lietotnei iestatīt signālus un ieplānot darbības, kas jāveic konkrētā laikā. Tādējādi lietotne darbosies fonā un, iespējams, patērēs vairāk akumulatora enerģijas.\n\nJa šī atļauja nav piešķirta, esošie signāli un šīs lietotnes ieplānotie notikumi, kas jāizpilda konkrētā laikā, nedarbosies."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ieplānot, signāls, atgādinājums, pulkstenis"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Netraucēt"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Netraucēt"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Ieslēgt"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Režīma “Netraucēt” ieslēgšana"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index e22f67c..923ea5c 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Аларми и потсетници"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Дозволете ѝ на апликацијава да поставува аларми и да закажува дејства со временски рокови. Ова овозможува апликацијата да работи во заднина и така може повеќе да ја троши батеријата.\n\nАко дозволава е исклучена, нема да функционираат постојните аларми и настаните според време закажани од апликацијава."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"закажување, аларм, потсетник, часовник"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Не вознемирувај"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Не вознемирувај"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Вклучи"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Исклучување на „Не вознемирувај“"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index 0b6d3fb..05579fe 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"അലാറങ്ങളും റിമെെൻഡറുകളും"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"അലാറങ്ങൾ സജ്ജീകരിക്കാനും സമയപ്രാധാന്യമുള്ള പ്രവർത്തനങ്ങൾ ഷെഡ്യൂൾ ചെയ്യാനും ഈ ആപ്പിനെ അനുവദിക്കുക. പശ്ചാത്തലത്തിൽ റൺ ചെയ്യാൻ ഇത് ഈ ആപ്പിന് അനുവാദം നൽകുന്നു, ഇതിന് കൂടുതൽ ബാറ്ററി ഉപയോഗിച്ചേക്കാം.\n\nഈ അനുമതി ഓഫാണെങ്കിൽ, ഈ ആപ്പ് നിലവിൽ ഷെഡ്യൂൾ ചെയ്ത അലാറങ്ങളും സമയാധിഷ്ഠിത ഇവന്റുകളും പ്രവർത്തിക്കില്ല."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ഷെഡ്യൂൾ, അലാറം, റിമെെൻഡർ, ക്ലോക്ക്"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ശല്യപ്പെടുത്തരുത്"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ശല്യപ്പെടുത്തരുത്"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ഓണാക്കുക"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\'ശല്യപ്പെടുത്തരുത്\' ഓണാക്കുക"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index 1ce8b0f..8957a2b 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Сэрүүлэг, сануулагч"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Энэ аппад сэрүүлэг тавих болон хугацаанд мэдрэг үйлдлийн хуваарь гаргахыг зөвшөөрнө үү. Энэ нь аппад ард ажиллахыг зөвшөөрөх бөгөөд ингэснээр илүү их батарей ашиглаж магадгүй.\n\nХэрэв энэ зөвшөөрөл унтраалттай бол энэ аппын аль хэдийн тавьсан сэрүүлэг болон хуваарь гаргасан хугацаанд мэдрэг үйл явдал ажиллахгүй."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"хуваарь, сэрүүлэг, сануулагч, цаг"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Бүү саад бол"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Бүү саад бол"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Асаах"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Бүү саад бол горимыг асаах"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index ad67ef2..36b967e 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"अलार्म आणि रिमाइंडर"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"या ॲपला अलार्म सेट करण्याची किंवा वेळेनुसार संवेदनशील असलेल्या कृती शेड्युल करण्याची अनुमती द्या. हे ॲपला बॅकग्राउंडमध्ये रन होऊ देते, ज्यामुळे जास्त बॅटरी वापरली जाऊ शकते.\n\nही परवानगी बंद असल्यास, सध्याचे अलार्म आणि या ॲपद्वारे शेड्युल केलेले वेळेवर आधारित इव्हेंट काम करणार नाहीत."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"शेड्युल, अलार्म, रिमाइंडर, घड्याळ"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"व्यत्यय आणू नका"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"व्यत्यय आणू नका"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"सुरू करा"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"व्यत्यय आणू नका सुरू करा"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index 5bb3ba0..2db04be 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Penggera & peringatan"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Benarkan apl ini menetapkan penggera dan menjadualkan tindakan yang sensitif masa. Hal ini membolehkan apl berjalan di latar, yang mungkin menggunakan lebih banyak bateri.\n\nJika kebenaran ini dimatikan, penggera sedia ada dan acara berdasarkan masa yang dijadualkan oleh apl ini tidak akan berfungsi."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"jadual, penggera, peringatan, jam"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Jangan Ganggu"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Jangan Ganggu"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Hidupkan"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Hidupkan Jangan Ganggu"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 7cce3d9..660fd14 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"နှိုးစက်နှင့် သတိပေးချက်များ"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"နှိုးစက်သတ်မှတ်ရန်နှင့် အချိန်တိကျရန် လိုအပ်သည့် လုပ်ဆောင်ချက်များအတွက် အစီအစဉ်ဆွဲရန် ဤအက်ပ်ကို ခွင့်ပြုသည်။ ၎င်းက အက်ပ်ကို နောက်ခံတွင် လုပ်ဆောင်ခွင့်ပေးပြီး ဘက်ထရီပိုသုံးနိုင်သည်။\n\nဤခွင့်ပြုချက်ကို ပိတ်ထားပါက ဤအက်ပ်ဖြင့် အစီအစဉ်ဆွဲထားသော လက်ရှိနှိုးစက်နှင့် အချိန်သတ်မှတ်ထားသည့် အစီအစဉ်များ အလုပ်လုပ်တော့မည် မဟုတ်ပါ။"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"အချိန်ဇယား၊ နှိုးစက်၊ သတိပေးချက်၊ နာရီ"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"မနှောင့်ယှက်ရ"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"မနှောင့်ယှက်ရ"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ဖွင့်ရန်"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\'မနှောင့်ယှက်ရ\' ဖွင့်ခြင်း"</string>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index c6fbea1..3e5d141 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmer og påminnelser"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Gi denne appen tillatelse til å angi alarmer og planlegge tidssensitive handlinger. Dette gir appen tillatelse til å kjøre i bakgrunnen, noe som kan bruke mer batteri.\n\nHvis denne tillatelsen er av, fungerer ikke eksisterende alarmer og tidsbaserte hendelser som er planlagt av denne appen."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"tidsplan, alarm, påminnelse, klokke"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ikke forstyrr"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ikke forstyrr"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Slå på"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Slå på Ikke forstyrr"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index 5d18fd3..ad28882 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"अलार्म तथा रिमाइन्डर"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"यो एपलाई अलार्म सेट गर्ने र समयमै पूरा गर्नु पर्ने कारबाहीहरूको रुटिन बनाउने अनुमति दिनुहोस्। यो अनुमति दिइएको छ भने यो एप ब्याकग्राउन्डमा चल्छ र धेरै ब्याट्री खपत हुन्छ।\n\nयो अनुमति दिइएको छैन भने सेट गरिएका अलार्म बज्दैनन् र यो एपले तय गरेका गतिविधि चल्दैनन्।"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"समयतालिका, अलार्म, रिमाइन्डर, घडी"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Do Not Disturb"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"बाधा नपुऱ्याउनुहोस्"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"अन गर्नुहोस्"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"बाधा नपुऱ्याउनुहोस् नामक मोडलाई अन गर्नुहोस्"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index e457376..0fcc6fe 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Wekkers en herinneringen"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Sta toe dat deze app wekkers zet en tijdgevoelige acties plant. De app kan hierdoor op de achtergrond worden uitgevoerd, waardoor je misschien meer batterijlading verbruikt.\n\nAls dit recht uitstaat, werken door deze app geplande bestaande wekkers en tijdgebaseerde afspraken niet."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"plannen, schema, wekker, alarm, herinnering, klok"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Niet storen"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Niet storen"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aanzetten"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Zet Niet storen aan."</string>
diff --git a/packages/SettingsLib/res/values-or/strings.xml b/packages/SettingsLib/res/values-or/strings.xml
index 2f25cde..694d034 100644
--- a/packages/SettingsLib/res/values-or/strings.xml
+++ b/packages/SettingsLib/res/values-or/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"ଆଲାରାମ୍ ଏବଂ ରିମାଇଣ୍ଡରଗୁଡ଼ିକ"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"ଏହି ଆପକୁ ଆଲାରାମ୍ ସେଟ୍ କରିବାକୁ ଏବଂ ସମୟ-ସମ୍ବେଦନଶୀଳ କାର୍ଯ୍ୟଗୁଡ଼ିକୁ ସିଡୁଲ୍ କରିବାକୁ ଅନୁମତି ଦିଅନ୍ତୁ। ଏହା ଆପକୁ ପୃଷ୍ଠପଟରେ ଚାଲିବାକୁ ଦେଇଥାଏ, ଯାହା ଅଧିକ ବ୍ୟାଟେରୀ ବ୍ୟବହାର କରିପାରେ।\n\nଯଦି ଏହି ଅନୁମତି ବନ୍ଦ ଅଛି, ତେବେ ଏହି ଆପ୍ ଦ୍ୱାରା ସିଡୁଲ୍ କରାଯାଇଥିବା ପୂର୍ବରୁ ଥିବା ଆଲାରାମ୍ ଏବଂ ସମୟ-ଆଧାରିତ ଇଭେଣ୍ଟଗୁଡ଼ିକ କାମ କରିବ ନାହିଁ।"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ସିଡୁଲ୍, ଆଲାରାମ୍, ରିମାଇଣ୍ଡର୍, ଘଣ୍ଟା"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ବିରକ୍ତ କରନ୍ତୁ ନାହିଁ"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ବିରକ୍ତ କରନ୍ତୁ ନାହିଁ"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ଚାଲୁ କରନ୍ତୁ"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\"ବିରକ୍ତ କରନ୍ତୁ ନାହିଁ\" ଅନ୍ କରନ୍ତୁ"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index b13ef1b..d0cf820 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"ਅਲਾਰਮ ਅਤੇ ਰਿਮਾਈਂਡਰ"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"ਇਸ ਐਪ ਨੂੰ ਅਲਾਰਮ ਸੈੱਟ ਕਰਨ ਜਾਂ ਹੋਰ ਸਮਾਂ-ਸੰਵੇਦਨਸ਼ੀਲ ਕਾਰਵਾਈਆਂ ਨੂੰ ਨਿਯਤ ਕਰਨ ਦਿਓ। ਇਸ ਨਾਲ ਐਪ ਨੂੰ ਬੈਕਗ੍ਰਾਊਂਡ ਵਿੱਚ ਚੱਲਣ ਦੀ ਇਜਾਜ਼ਤ ਮਿਲਦੀ ਹੈ, ਜਿਸ ਨਾਲ ਬੈਟਰੀ ਦੀ ਵਰਤੋਂ ਵੱਧ ਸਕਦੀ ਹੈ।\n\nਜੇ ਇਹ ਇਜਾਜ਼ਤ ਬੰਦ ਹੈ, ਤਾਂ ਇਸ ਐਪ ਰਾਹੀਂ ਨਿਯਤ ਕੀਤੇ ਮੌਜੂਦਾ ਅਲਾਰਮ ਅਤੇ ਸਮਾਂ-ਆਧਾਰਿਤ ਇਵੈਂਟ ਕੰਮ ਨਹੀਂ ਕਰਨਗੇ।"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ਸਮਾਂ-ਸੂਚੀ, ਅਲਾਰਮ, ਰਿਮਾਈਂਡਰ, ਘੜੀ"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ਪਰੇਸ਼ਾਨ ਨਾ ਕਰੋ"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ਪਰੇਸ਼ਾਨ ਨਾ ਕਰੋ"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ਚਾਲੂ ਕਰੋ"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\'ਪਰੇਸ਼ਾਨ ਨਾ ਕਰੋ\' ਨੂੰ ਚਾਲੂ ਕਰੋ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index 3f90774..c6d78f6 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmy i przypomnienia"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Zezwalaj tej aplikacji na ustawianie alarmów i planowanie działań, w przypadku których czas jest istotny. Aplikacja będzie mogła działać w tle, co może zwiększyć wykorzystanie baterii.\n\nJeśli nie włączysz tego uprawnienia, istniejące alarmy i zaplanowane wydarzenia z tej aplikacji nie będą działać."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"harmonogram, alarm, przypomnienie, zegar"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Nie przeszkadzać"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Nie przeszkadzać"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Włącz"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Włącz tryb Nie przeszkadzać"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index 00375b0..98bda85 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmes e lembretes"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Permitir que o app defina alarmes e programe ações com hora marcada. Essa opção autoriza o app a ser executado em segundo plano, o que pode consumir mais bateria.\n\nSe a permissão for desativada, os alarmes e eventos programados pelo app não funcionarão."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"programar, alarme, lembrete, relógio"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Não perturbe"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Não perturbe"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Ativar"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Ativar o Não perturbe"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index 97d2848..20acb00 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmes e lembretes"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Permita que a app defina alarmes e agende ações com um horário específico. Esta ação permite que a app seja executada em segundo plano, o que pode usar mais bateria.\n\nSe esta autorização estiver desativada, os alarmes existentes e os eventos com base no tempo agendados por esta app não funcionam."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"agendar, alarme, lembrete, relógio"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Não incomodar"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Não incomodar"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Ativar"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Ativar o modo Não incomodar"</string>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index 00375b0..98bda85 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmes e lembretes"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Permitir que o app defina alarmes e programe ações com hora marcada. Essa opção autoriza o app a ser executado em segundo plano, o que pode consumir mais bateria.\n\nSe a permissão for desativada, os alarmes e eventos programados pelo app não funcionarão."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"programar, alarme, lembrete, relógio"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Não perturbe"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Não perturbe"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Ativar"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Ativar o Não perturbe"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 900851e..a6d17c1 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarme și mementouri"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Permite acestei aplicații să seteze alarme și să planifice acțiuni care trebuie realizate în timp scurt. Astfel, aplicația poate să ruleze în fundal, ceea ce ar putea crește consumul de baterie.\n\nDacă permisiunea este dezactivată, alarmele și evenimentele dependente de timp planificate de aplicație nu vor funcționa."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"programare, alarmă, memento, ceas"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Nu deranja"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Nu deranja"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Activează"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Activează Nu deranja"</string>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index db4be66..838b5ed 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -81,7 +81,7 @@
<string name="speed_label_fast" msgid="2677719134596044051">"Быстрая"</string>
<string name="speed_label_very_fast" msgid="8215718029533182439">"Очень быстрая"</string>
<string name="wifi_passpoint_expired" msgid="6540867261754427561">"Срок действия истек"</string>
- <string name="preference_summary_default_combination" msgid="2644094566845577901">"<xliff:g id="STATE">%1$s</xliff:g> / <xliff:g id="DESCRIPTION">%2$s</xliff:g>"</string>
+ <string name="preference_summary_default_combination" msgid="2644094566845577901">"<xliff:g id="STATE">%1$s</xliff:g>/<xliff:g id="DESCRIPTION">%2$s</xliff:g>"</string>
<string name="bluetooth_disconnected" msgid="7739366554710388701">"Нет подключения"</string>
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Отключение..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Подключение..."</string>
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Будильники и напоминания"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Вы можете разрешить этому приложению устанавливать будильники и планировать запуск действий в определенное время. В этом случае оно будет работать в фоновом режиме и быстрее расходовать заряд батареи.\n\nЕсли отключить это разрешение, текущие будильники и созданные приложением события перестанут запускаться."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"установить, будильник, напоминание, часы"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Не беспокоить"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Не беспокоить"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Включить"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Включите режим \"Не беспокоить\""</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index d9df5eb..cc7a45e 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"එලාම සහ සිහිකැඳවීම්"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"එලාම සැකසීමට සහ කාල සංවේදී ක්රියා කාලසටහන්ගත කිරීමට මෙම යෙදුමට ඉඩ දෙන්න. මෙය පසුබිමේ ධාවනය වීමට යෙදුමට ඉඩ දෙයි, එය වැඩි බැටරිය වැඩියෙන් භාවිත කළ හැකිය.\n\nමෙම අවසරය ක්රියාවිරහිත නම්, මෙම යෙදුම මඟින් සැලසුම් කර ඇති තිබෙන එලාම සහ වේලාව පදනම් කර ගත් සිදුවීම් ක්රියා නොකරනු ඇත."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"කාල සටහන, එලාමය, සිහිකැඳවීම, ඔරලෝසුව"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"බාධා නොකිරීම"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"බාධා නොකරන්න"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ක්රියාත්මක කරන්න"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"බාධා නොකරන්න ක්රියාත්මක කරන්න"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index c690a19..43db02b 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Budíky a pripomenutia"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Povoľte tejto aplikácii nastavovať budíky a plánovať akcie s časovým obmedzením. Aplikácii to umožní pracovať na pozadí, čo môže zvýšiť spotrebu batérie.\n\nAk je toto povolenie vypnuté, existujúce budíky a udalosti s časovým obmedzením naplánované touto aplikáciou nebudú fungovať."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"plán, budík, pripomenutie, hodiny"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Režim bez vyrušení"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Režim bez vyrušení"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Zapnúť"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Zapnite režim bez vyrušení"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index 7fa5ed1..ddd0fb2 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmi in opomniki"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Tej aplikaciji dovolite nastavljanje alarmov in načrtovanje časovno občutljivih dejanj. S tem aplikaciji omogočite izvajanje v ozadju, kar bo morda povečalo porabo energije baterije.\n\nČe je to dovoljenje izklopljeno, obstoječi alarmi in časovno občutljivi dogodki, ki jih nastavi ta aplikacija, ne bodo delovali."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"načrtovanje, urnik, alarm, opomnik, ura"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ne moti"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ne moti"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Vklopi"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Vklop načina »Ne moti«"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index b64c8fd..3831cf4 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmet dhe alarmet rikujtuese"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Lejo që ky aplikacion të caktojë alarmet dhe të planifikojë veprime që kanë një afat të caktuar. Kjo mundëson që aplikacioni të ekzekutohet në sfond, gjë që mund të përdorë më shumë bateri.\n\nNëse kjo leje është caktuar si joaktive, alarmet ekzistuese dhe ngjarjet në bazë kohore të planifikuara nga ky aplikacion nuk do të funksionojnë."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"planifiko, alarm, alarm rikujtues, ora"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Mos shqetëso"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Mos shqetëso"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aktivizo"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Aktivizo \"Mos shqetëso\""</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index f9001a8..73794bd 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Аларми и подсетници"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Омогућите овој апликацији да подешава аларме и заказује временски осетљиве радње. То омогућава да апликација буде покренута у позадини, што може да троши више батерије.\n\nАко је ова дозвола искључена, постојећи аларми и догађаји засновани на времену заказани помоћу ове апликације неће радити."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"заказати, аларм, подсетник, сат"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Не узнемиравај"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Не узнемиравај"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Укључи"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Укључите режим Не узнемиравај"</string>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index 4ca4835..f47bdab 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarm och påminnelser"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Tillåt att den här appen ställer in alarm och schemalägger tidskänsliga åtgärder. Om du tillåter detta kan appen köras i bakgrunden, vilket kan dra mer batteri.\n\nOm behörigheten är inaktiverad fungerar inte befintliga alarm och tidsbaserade händelser som schemalagts av den här appen."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"schema, alarm, påminnelse, klocka"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Stör ej"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Stör ej"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aktivera"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Aktivera Stör ej."</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index 3198d0a..02db3e1 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Kengele na vikumbusho"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Ruhusu programu hii iweke kengele na ratiba za vitendo vingine vinavyotegemea wakati. Hatua hii inairuhusu programu itumike chinichini, hali inayoweza kutumia chaji nyingi ya betri.\n\nIkiwa ruhusa hii itazimwa, kengele zilizopo na ratiba za vitendo vinavyotegemea wakati zilizowekwa na programu hii hazitafanya kazi."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ratiba, kengele, kikumbusho, saa"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Usinisumbue"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Usinisumbue"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Washa"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Washa kipengele cha Usinisumbue"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index 108ddce..a5a96f2 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"அலாரங்கள் & நினைவூட்டல்கள்"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"அலாரங்களை அமைக்கவும் குறிப்பிட்ட கால இடைவெளியில் செயல்களைத் திட்டமிடவும் இந்த ஆப்ஸை அனுமதிக்கும். இது ஆப்ஸ் பின்னணியில் இயங்குவதை அனுமதிக்கும், இதற்காக அதிக பேட்டரியைப் பயன்படுத்தக்கூடும்.\n\nஇந்த அனுமதி முடக்கப்பட்டிருந்தால் இந்த ஆப்ஸ் மூலம் திட்டமிடப்பட்ட ஏற்கெனவே அமைத்த அலாரங்களும் நேர அடிப்படையிலான நிகழ்வுகளும் வேலை செய்யாது."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"திட்டமிடல், அலாரம், நினைவூட்டல், கடிகாரம்"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"தொந்தரவு செய்ய வேண்டாம்"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"தொந்தரவு செய்யாதே"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ஆன் செய்"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"தொந்தரவு செய்ய வேண்டாம் என்பதை ஆன் செய்யும்"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 4811594..5577389 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"అలారాలు & రిమైండర్లు"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"అలారాలను సెట్ చేయడానికి, టైమ్-సెన్సిటివ్ చర్యలను షెడ్యూల్ చేయడానికి ఈ యాప్ను అనుమతించండి. ఇది యాప్ను బ్యాక్గ్రౌండ్లో రన్ అవడానికి అనుమతిస్తుంది, ఇది ఎక్కువ బ్యాటరీని ఉపయోగించవచ్చు.\n\nఈ అనుమతిని ఆఫ్ చేస్తే, ఈ యాప్ ద్వారా షెడ్యూల్ చేసినటువంటి ఇప్పటికే ఉన్న అలారాలు, టైమ్-ఆధారిత ఈవెంట్లు పనిచేయవు."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"షెడ్యూల్, అలారం, రిమైండర్, గడియారం"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"అంతరాయం కలిగించవద్దు"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"అంతరాయం కలిగించవద్దు"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"ఆన్ చేయండి"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"అంతరాయం కలిగించవద్దును ఆన్ చేయండి"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index b332154..48087c2 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"การปลุกและการช่วยเตือน"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"อนุญาตให้แอปนี้ตั้งปลุกและกำหนดเวลาการดำเนินการที่ต้องคำนึงถึงเวลาเป็นสำคัญ สิทธิ์นี้ช่วยให้แอปทำงานในเบื้องหลังได้ จึงอาจทำให้ใช้แบตเตอรี่มากขึ้น\n\nหากปิดใช้สิทธิ์นี้ การปลุกที่มีอยู่และกิจกรรมที่ต้องคำนึงถึงเวลาเป็นสำคัญซึ่งแอปนี้กำหนดเวลาไว้จะไม่ทำงาน"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"กำหนดเวลา การปลุก การช่วยเตือน นาฬิกา"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ห้ามรบกวน"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ห้ามรบกวน"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"เปิด"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"เปิด \"ห้ามรบกวน\""</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index cf88980..34d51d44 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Mga alarm at paalala"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Payagan ang app na ito na magtakda ng mga alarm at mag-iskedyul ng mga pagkilos na may limitadong oras. Papayagan nitong tumakbo ang app sa background, na posibleng gumamit ng mas maraming baterya.\n\nKung naka-off ang pahintulot na ito, hindi gagana ang mga kasalukuyang alarm at event na nakabatay sa oras na naiskedyul ng app na ito."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"iskedyul, alarm, paalala, orasan"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Huwag Istorbohin"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Huwag Istorbohin"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"I-on"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"I-on ang Huwag Istorbohin"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index 6cdfa2e..9b5cc292 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Alarmlar ve hatırlatıcılar"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Bu uygulamanın alarm kurmasına ve zamana bağlı işlemler programlamasına izin verin. Bu izin, uygulamanın arka planda çalışmasına olanak sağlayarak daha fazla pil harcanmasına neden olabilir.\n\nBu izin verilmezse bu uygulama tarafından programlanmış mevcut alarmlar ve zamana bağlı etkinlikler çalışmaz."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"program, alarm, hatırlatıcı, saat"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Rahatsız Etmeyin"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Rahatsız Etmeyin"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Aç"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Rahatsız Etmeyin\'i açın"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index 7abd4a8..a396798 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Будильники й нагадування"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Дозволити цьому додатку налаштовувати будильники й створювати розклад дій. Додаток зможе працювати у фоновому режимі й використовувати більше заряду акумулятора.\n\nЯкщо вимкнути такий дозвіл, наявні будильники й дії, створені цим додатком, не працюватимуть."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"запланувати, будильник, нагадування, годинник"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Не турбувати"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Не турбувати"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Увімкнути"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Увімкнути режим \"Не турбувати\""</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index bf7ac58..c60a58b 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"الارمز اور یاد دہانیاں"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"اس ایپ کو الارمز سیٹ کرنے اور وقت کے لحاظ سے حساس کارروائیوں کو شیڈول کرنے کی اجازت دیں۔ اس سے ایپ کو پس منظر میں چلنے کی اجازت ملتی ہے، جس میں زیادہ بیٹری استعمال ہو سکتی ہے۔\n\n اگر یہ اجازت آف ہے تو موجودہ الارمز اور اس ایپ کے ذریعے شیڈول کردہ وقت پر مبنی ایونٹس کام نہیں کریں گے۔"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"شیڈول، الارم، یاد دہانی، گھڑی"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"ڈسٹرب نہ کریں"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"ڈسٹرب نہ کریں"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"آن کریں"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"\'ڈسٹرب نہ کریں\' کو آن کریں"</string>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index 2418053..3beb514 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Signal va eslatmalar"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Bu ilovaga signal oʻrnatish va vaqtga asoslangan amallarni rejalashtirishga ruxsat berish. Bunda ilovaga orqa fonda ishlashiga imkon beriladi, shu sababli batareya ortiqcha sarflanishi mumkin.\n\nAgar bu ruxsat oʻchirilsa, ushbu ilova tomonidan rejalashtirilgan mavjud signallar va vaqtga asoslangan tadbirlar ishlamaydi."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"reja, signal, eslatma, soat"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Bezovta qilinmasin"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Bezovta qilinmasin"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Yoqish"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Bezovta qilinmasin rejimini yoqing"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index 15839b8..d3152f4 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Chuông báo và lời nhắc"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Cho phép ứng dụng này đặt chuông báo và lên lịch các hành động cần chính xác về thời gian. Tùy chọn này cho phép ứng dụng chạy ở chế độ nền và có thể làm tiêu hao nhiều pin.\n\nNếu không cấp quyền này, các chuông báo và sự kiện theo thời gian do ứng dụng này lên lịch sẽ không hoạt động."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"lịch biểu, chuông báo, lời nhắc, đồng hồ"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Không làm phiền"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Không làm phiền"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Bật"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Bật chế độ Không làm phiền"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index a2fd4ea..964c3da 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"闹钟和提醒"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"允许该应用设置闹钟以及安排在特定时间执行某些操作。这项权限开启后,该应用将在后台运行,可能会消耗更多电池电量。\n\n如果您关闭此权限,该应用设置的现有闹钟将不会响起,而且该应用安排在特定时间执行的现有活动也不会执行。"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"设置, 闹钟, 提醒, 时钟, schedule, alarm, reminder, clock"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"勿扰"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"勿扰模式"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"开启"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"开启勿扰模式"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index bcf624e4..a35b9f2 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"鬧鐘和提醒"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"允許此應用程式設定鬧鐘及安排具時效性的操作。這讓應用程式在背景中執行,因此可能會較耗電。\n\n如果關閉此權限,此應用程式將不會在預定時間響起已設定的鬧鐘,亦不會就特定時間的活動傳送通知。"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"日程表, 鬧鐘, 提醒, 時鐘"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"請勿騷擾"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"請勿騷擾"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"開啟"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"開啟「請勿騷擾」模式"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index 58a19793..274767b 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"鬧鐘和提醒"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"允許這個應用程式設定鬧鐘及安排有時效性的動作。之後應用程式可以在背景執行,並可能耗用較多電量。\n\n如果關閉這項權限,這個應用程式設定的現有鬧鐘將不會響起,系統也無法在預定的時間發出活動提醒。"</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"時間表, 鬧鐘, 提醒, 時鐘"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"零打擾"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"零打擾"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"開啟"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"開啟「零打擾」模式"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index 28b9b05..9ccb261 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -564,8 +564,7 @@
<string name="alarms_and_reminders_title" msgid="8819933264635406032">"Ama-alamu nezikhumbuzi"</string>
<string name="alarms_and_reminders_footer_title" msgid="6302587438389079695">"Vumela le app isethe ama-alamu futhi ushejule izenzo zesikhathi esizwelayo. Lokhu kuvumela i-app iqhubeke ngemuva okungasebenzisa ibhethri lakho eliningi.\n\nUma le mvume ivaliwe, ama-alamu asele nemicimbi esekelwe esikhathini ehlelwe yile app ngeke kusebenze."</string>
<string name="keywords_alarms_and_reminders" msgid="6633360095891110611">"ishejuli, i-alamu, isikhumbuzi, iwashi"</string>
- <!-- no translation found for zen_mode_do_not_disturb_name (6798711401734798283) -->
- <skip />
+ <string name="zen_mode_do_not_disturb_name" msgid="6798711401734798283">"Ungaphazamisi"</string>
<string name="zen_mode_settings_title" msgid="7374070457626419755">"Ungaphazamisi"</string>
<string name="zen_mode_enable_dialog_turn_on" msgid="6418297231575050426">"Vula"</string>
<string name="zen_mode_settings_turn_on_dialog_title" msgid="2760567063190790696">"Vula ukungaphazamisi"</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/DeviceSettingContract.kt b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/DeviceSettingContract.kt
new file mode 100644
index 0000000..65adec4
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/DeviceSettingContract.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.bluetooth.devicesettings
+
+/** The contract between the device settings provider services and Settings. */
+object DeviceSettingContract {
+ const val INVISIBLE_PROFILES = "INVISIBLE_PROFILES"
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepository.kt b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepository.kt
index 457d6a3..769b6e6 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepository.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepository.kt
@@ -22,6 +22,7 @@
import com.android.settingslib.bluetooth.CachedBluetoothDevice
import com.android.settingslib.bluetooth.devicesettings.ActionSwitchPreference
import com.android.settingslib.bluetooth.devicesettings.DeviceSetting
+import com.android.settingslib.bluetooth.devicesettings.DeviceSettingContract
import com.android.settingslib.bluetooth.devicesettings.DeviceSettingId
import com.android.settingslib.bluetooth.devicesettings.DeviceSettingItem
import com.android.settingslib.bluetooth.devicesettings.DeviceSettingsConfig
@@ -30,6 +31,9 @@
import com.android.settingslib.bluetooth.devicesettings.MultiTogglePreference
import com.android.settingslib.bluetooth.devicesettings.ToggleInfo
import com.android.settingslib.bluetooth.devicesettings.shared.model.DeviceSettingConfigItemModel
+import com.android.settingslib.bluetooth.devicesettings.shared.model.DeviceSettingConfigItemModel.AppProvidedItem
+import com.android.settingslib.bluetooth.devicesettings.shared.model.DeviceSettingConfigItemModel.BuiltinItem.BluetoothProfilesItem
+import com.android.settingslib.bluetooth.devicesettings.shared.model.DeviceSettingConfigItemModel.BuiltinItem.CommonBuiltinItem
import com.android.settingslib.bluetooth.devicesettings.shared.model.DeviceSettingConfigModel
import com.android.settingslib.bluetooth.devicesettings.shared.model.DeviceSettingIcon
import com.android.settingslib.bluetooth.devicesettings.shared.model.DeviceSettingModel
@@ -103,9 +107,18 @@
private fun DeviceSettingItem.toModel(): DeviceSettingConfigItemModel {
return if (!TextUtils.isEmpty(preferenceKey)) {
- DeviceSettingConfigItemModel.BuiltinItem(settingId, preferenceKey!!)
+ if (settingId == DeviceSettingId.DEVICE_SETTING_ID_BLUETOOTH_PROFILES) {
+ BluetoothProfilesItem(
+ settingId,
+ preferenceKey!!,
+ extras.getStringArrayList(DeviceSettingContract.INVISIBLE_PROFILES)
+ ?: emptyList()
+ )
+ } else {
+ CommonBuiltinItem(settingId, preferenceKey!!)
+ }
} else {
- DeviceSettingConfigItemModel.AppProvidedItem(settingId)
+ AppProvidedItem(settingId)
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingServiceConnection.kt b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingServiceConnection.kt
index 33beb06..7eae5b2 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingServiceConnection.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingServiceConnection.kt
@@ -23,6 +23,7 @@
import android.content.ServiceConnection
import android.os.IBinder
import android.os.IInterface
+import android.text.TextUtils
import android.util.Log
import com.android.settingslib.bluetooth.BluetoothUtils
import com.android.settingslib.bluetooth.CachedBluetoothDevice
@@ -84,6 +85,10 @@
}
setAction(intentAction)
}
+
+ fun isValid(): Boolean {
+ return !TextUtils.isEmpty(packageName) && !TextUtils.isEmpty(intentAction)
+ }
}
private var isServiceEnabled =
@@ -96,7 +101,8 @@
} else if (allStatus.all { it is ServiceConnectionStatus.Connected }) {
allStatus
.filterIsInstance<
- ServiceConnectionStatus.Connected<IDeviceSettingsProviderService>
+ ServiceConnectionStatus.Connected<
+ IDeviceSettingsProviderService>
>()
.all { it.service.serviceStatus?.enabled == true }
} else {
@@ -215,6 +221,7 @@
)
}
}
+ ?.filter { it.isValid() }
?.distinct()
?.associateBy(
{ it },
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/shared/model/DeviceSettingConfigModel.kt b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/shared/model/DeviceSettingConfigModel.kt
index c1ac763..08fb3fb 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/shared/model/DeviceSettingConfigModel.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/shared/model/DeviceSettingConfigModel.kt
@@ -36,10 +36,23 @@
@DeviceSettingId val settingId: Int
/** A built-in item in Settings. */
- data class BuiltinItem(
- @DeviceSettingId override val settingId: Int,
- val preferenceKey: String?
- ) : DeviceSettingConfigItemModel
+ sealed interface BuiltinItem : DeviceSettingConfigItemModel {
+ @DeviceSettingId override val settingId: Int
+ val preferenceKey: String
+
+ /** A general built-in item in Settings. */
+ data class CommonBuiltinItem(
+ @DeviceSettingId override val settingId: Int,
+ override val preferenceKey: String,
+ ) : BuiltinItem
+
+ /** A bluetooth profiles in Settings. */
+ data class BluetoothProfilesItem(
+ @DeviceSettingId override val settingId: Int,
+ override val preferenceKey: String,
+ val invisibleProfiles: List<String>,
+ ) : BuiltinItem
+ }
/** A remote item provided by other apps. */
data class AppProvidedItem(@DeviceSettingId override val settingId: Int) :
diff --git a/packages/SettingsLib/src/com/android/settingslib/core/lifecycle/ObservablePreferenceFragment.java b/packages/SettingsLib/src/com/android/settingslib/core/lifecycle/ObservablePreferenceFragment.java
index bd1e5a5..7994924 100644
--- a/packages/SettingsLib/src/com/android/settingslib/core/lifecycle/ObservablePreferenceFragment.java
+++ b/packages/SettingsLib/src/com/android/settingslib/core/lifecycle/ObservablePreferenceFragment.java
@@ -31,13 +31,14 @@
import android.view.MenuItem;
import androidx.lifecycle.LifecycleOwner;
-import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceScreen;
+import com.android.settingslib.preference.PreferenceFragment;
+
/**
- * {@link PreferenceFragmentCompat} that has hooks to observe fragment lifecycle events.
+ * Preference fragment that has hooks to observe fragment lifecycle events.
*/
-public abstract class ObservablePreferenceFragment extends PreferenceFragmentCompat
+public abstract class ObservablePreferenceFragment extends PreferenceFragment
implements LifecycleOwner {
private final Lifecycle mLifecycle = new Lifecycle(this);
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/OWNERS b/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
index 7467ee1..d58add4 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
+++ b/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
@@ -2,7 +2,6 @@
ethibodeau@google.com
michaelmikhil@google.com
apotapov@google.com
-shaoweishen@google.com
#Android Media - For minor changes and renames only.
aquilescanta@google.com #{LAST_RESORT_SUGGESTION}
diff --git a/packages/SettingsLib/src/com/android/settingslib/notification/data/repository/FakeZenModeRepository.kt b/packages/SettingsLib/src/com/android/settingslib/notification/data/repository/FakeZenModeRepository.kt
index 043219a..c686708 100644
--- a/packages/SettingsLib/src/com/android/settingslib/notification/data/repository/FakeZenModeRepository.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/notification/data/repository/FakeZenModeRepository.kt
@@ -61,6 +61,10 @@
mutableModesFlow.value += zenModes
}
+ fun addMode(mode: ZenMode) {
+ mutableModesFlow.value += mode
+ }
+
fun addMode(id: String, @AutomaticZenRule.Type type: Int = AutomaticZenRule.TYPE_UNKNOWN,
active: Boolean = false) {
mutableModesFlow.value += newMode(id, type, active)
diff --git a/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java b/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java
index 8e0cdf8..712ddc8 100644
--- a/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java
+++ b/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java
@@ -85,7 +85,7 @@
public TestModeBuilder(ZenMode previous) {
mId = previous.getId();
- mRule = previous.getRule();
+ mRule = new AutomaticZenRule.Builder(previous.getRule()).build();
mConfigZenRule = new ZenModeConfig.ZenRule();
mConfigZenRule.enabled = previous.getRule().isEnabled();
diff --git a/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt b/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt
index 3e2d832..d3c345d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt
@@ -98,7 +98,7 @@
*/
suspend fun setMuted(audioStream: AudioStream, isMuted: Boolean): Boolean
- suspend fun setRingerMode(audioStream: AudioStream, mode: RingerMode)
+ suspend fun setRingerModeInternal(audioStream: AudioStream, mode: RingerMode)
/** Gets audio device category. */
@AudioDeviceCategory suspend fun getBluetoothAudioDeviceCategory(bluetoothAddress: String): Int
@@ -248,8 +248,8 @@
}
}
- override suspend fun setRingerMode(audioStream: AudioStream, mode: RingerMode) {
- withContext(backgroundCoroutineContext) { audioManager.ringerMode = mode.value }
+ override suspend fun setRingerModeInternal(audioStream: AudioStream, mode: RingerMode) {
+ withContext(backgroundCoroutineContext) { audioManager.ringerModeInternal = mode.value }
}
@AudioDeviceCategory
diff --git a/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt b/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt
index 08863b5..dca890d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt
@@ -68,7 +68,7 @@
if (audioStream.value == AudioManager.STREAM_RING) {
val mode =
if (isMuted) AudioManager.RINGER_MODE_VIBRATE else AudioManager.RINGER_MODE_NORMAL
- audioRepository.setRingerMode(audioStream, RingerMode(mode))
+ audioRepository.setRingerModeInternal(audioStream, RingerMode(mode))
}
val mutedChanged = audioRepository.setMuted(audioStream, isMuted)
if (mutedChanged && !isMuted) {
diff --git a/packages/SettingsLib/tests/integ/Android.bp b/packages/SettingsLib/tests/integ/Android.bp
index 48a1af6..03dd712 100644
--- a/packages/SettingsLib/tests/integ/Android.bp
+++ b/packages/SettingsLib/tests/integ/Android.bp
@@ -37,10 +37,10 @@
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs",
"telephony-common",
- "android.test.base",
- "android.test.mock",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
"truth",
],
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt b/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt
index 52e6391..8a3b1df 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt
@@ -74,6 +74,8 @@
private lateinit var underTest: AudioRepository
+ private var ringerModeInternal: RingerMode = RingerMode(AudioManager.RINGER_MODE_NORMAL)
+
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
@@ -82,7 +84,7 @@
`when`(audioManager.communicationDevice).thenReturn(communicationDevice)
`when`(audioManager.getStreamMinVolume(anyInt())).thenReturn(MIN_VOLUME)
`when`(audioManager.getStreamMaxVolume(anyInt())).thenReturn(MAX_VOLUME)
- `when`(audioManager.ringerModeInternal).thenReturn(AudioManager.RINGER_MODE_NORMAL)
+ `when`(audioManager.ringerModeInternal).then { ringerModeInternal.value }
`when`(audioManager.setStreamVolume(anyInt(), anyInt(), anyInt())).then {
val streamType = it.arguments[0] as Int
volumeByStream[it.arguments[0] as Int] = it.arguments[1] as Int
@@ -103,6 +105,10 @@
`when`(audioManager.isStreamMute(anyInt())).thenAnswer {
isMuteByStream.getOrDefault(it.arguments[0] as Int, false)
}
+ `when`(audioManager.setRingerModeInternal(anyInt())).then {
+ ringerModeInternal = RingerMode(it.arguments[0] as Int)
+ Unit
+ }
underTest =
AudioRepositoryImpl(
@@ -137,7 +143,7 @@
underTest.ringerMode.onEach { modes.add(it) }.launchIn(backgroundScope)
runCurrent()
- `when`(audioManager.ringerModeInternal).thenReturn(AudioManager.RINGER_MODE_SILENT)
+ ringerModeInternal = RingerMode(AudioManager.RINGER_MODE_SILENT)
triggerEvent(AudioManagerEvent.InternalRingerModeChanged)
runCurrent()
@@ -150,6 +156,19 @@
}
@Test
+ fun changingRingerMode_changesRingerModeInternal() {
+ testScope.runTest {
+ underTest.setRingerModeInternal(
+ AudioStream(AudioManager.STREAM_SYSTEM),
+ RingerMode(AudioManager.RINGER_MODE_SILENT),
+ )
+ runCurrent()
+
+ assertThat(ringerModeInternal).isEqualTo(RingerMode(AudioManager.RINGER_MODE_SILENT))
+ }
+ }
+
+ @Test
fun communicationDeviceChanges_repositoryEmits() {
testScope.runTest {
var device: AudioDeviceInfo? = null
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepositoryTest.kt b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepositoryTest.kt
index ce155b5..81b5634 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepositoryTest.kt
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/devicesettings/data/repository/DeviceSettingRepositoryTest.kt
@@ -91,7 +91,9 @@
`when`(cachedDevice.address).thenReturn(BLUETOOTH_ADDRESS)
`when`(
bluetoothDevice.getMetadata(
- DeviceSettingServiceConnection.METADATA_FAST_PAIR_CUSTOMIZED_FIELDS))
+ DeviceSettingServiceConnection.METADATA_FAST_PAIR_CUSTOMIZED_FIELDS
+ )
+ )
.thenReturn(BLUETOOTH_DEVICE_METADATA.toByteArray())
`when`(configService.queryLocalInterface(anyString())).thenReturn(configService)
@@ -114,7 +116,8 @@
connection.onServiceConnected(
ComponentName(
SETTING_PROVIDER_SERVICE_PACKAGE_NAME_1,
- SETTING_PROVIDER_SERVICE_CLASS_NAME_1),
+ SETTING_PROVIDER_SERVICE_CLASS_NAME_1,
+ ),
settingProviderService1,
)
SETTING_PROVIDER_SERVICE_INTENT_ACTION_2 ->
@@ -146,16 +149,24 @@
fun getDeviceSettingsConfig_withMetadata_success() {
testScope.runTest {
`when`(configService.getDeviceSettingsConfig(any())).thenReturn(DEVICE_SETTING_CONFIG)
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
val config = underTest.getDeviceSettingsConfig(cachedDevice)
assertConfig(config!!, DEVICE_SETTING_CONFIG)
+ assertThat(config.mainItems[0])
+ .isInstanceOf(DeviceSettingConfigItemModel.AppProvidedItem::class.java)
+ assertThat(config.mainItems[1])
+ .isInstanceOf(
+ DeviceSettingConfigItemModel.BuiltinItem.CommonBuiltinItem::class.java
+ )
+ assertThat(config.mainItems[2])
+ .isInstanceOf(
+ DeviceSettingConfigItemModel.BuiltinItem.BluetoothProfilesItem::class.java
+ )
}
}
@@ -163,16 +174,16 @@
fun getDeviceSettingsConfig_noMetadata_returnNull() {
testScope.runTest {
`when`(
- bluetoothDevice.getMetadata(
- DeviceSettingServiceConnection.METADATA_FAST_PAIR_CUSTOMIZED_FIELDS))
+ bluetoothDevice.getMetadata(
+ DeviceSettingServiceConnection.METADATA_FAST_PAIR_CUSTOMIZED_FIELDS
+ )
+ )
.thenReturn("".toByteArray())
`when`(configService.getDeviceSettingsConfig(any())).thenReturn(DEVICE_SETTING_CONFIG)
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
val config = underTest.getDeviceSettingsConfig(cachedDevice)
@@ -184,12 +195,10 @@
fun getDeviceSettingsConfig_providerServiceNotEnabled_returnNull() {
testScope.runTest {
`when`(configService.getDeviceSettingsConfig(any())).thenReturn(DEVICE_SETTING_CONFIG)
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(false)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(false))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
val config = underTest.getDeviceSettingsConfig(cachedDevice)
@@ -219,12 +228,10 @@
.getArgument<IDeviceSettingsListener>(1)
.onDeviceSettingsChanged(listOf(DEVICE_SETTING_1))
}
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
var setting: DeviceSettingModel? = null
underTest
@@ -247,12 +254,10 @@
.getArgument<IDeviceSettingsListener>(1)
.onDeviceSettingsChanged(listOf(DEVICE_SETTING_2))
}
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
var setting: DeviceSettingModel? = null
underTest
@@ -270,17 +275,15 @@
testScope.runTest {
`when`(configService.getDeviceSettingsConfig(any())).thenReturn(DEVICE_SETTING_CONFIG)
`when`(settingProviderService2.registerDeviceSettingsListener(any(), any())).then {
- input ->
+ input ->
input
.getArgument<IDeviceSettingsListener>(1)
.onDeviceSettingsChanged(listOf(DEVICE_SETTING_HELP))
}
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
var setting: DeviceSettingModel? = null
underTest
@@ -324,12 +327,10 @@
.getArgument<IDeviceSettingsListener>(1)
.onDeviceSettingsChanged(listOf(DEVICE_SETTING_1))
}
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
var setting: DeviceSettingModel? = null
underTest
@@ -347,8 +348,10 @@
DeviceSettingState.Builder()
.setSettingId(DeviceSettingId.DEVICE_SETTING_ID_HEADER)
.setPreferenceState(
- ActionSwitchPreferenceState.Builder().setChecked(false).build())
- .build())
+ ActionSwitchPreferenceState.Builder().setChecked(false).build()
+ )
+ .build(),
+ )
}
}
@@ -362,12 +365,10 @@
.getArgument<IDeviceSettingsListener>(1)
.onDeviceSettingsChanged(listOf(DEVICE_SETTING_2))
}
- `when`(settingProviderService1.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
- `when`(settingProviderService2.serviceStatus).thenReturn(
- DeviceSettingsProviderServiceStatus(true)
- )
+ `when`(settingProviderService1.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
+ `when`(settingProviderService2.serviceStatus)
+ .thenReturn(DeviceSettingsProviderServiceStatus(true))
var setting: DeviceSettingModel? = null
underTest
@@ -385,8 +386,10 @@
DeviceSettingState.Builder()
.setSettingId(DeviceSettingId.DEVICE_SETTING_ID_ANC)
.setPreferenceState(
- MultiTogglePreferenceState.Builder().setState(2).build())
- .build())
+ MultiTogglePreferenceState.Builder().setState(2).build()
+ )
+ .build(),
+ )
}
}
@@ -437,7 +440,7 @@
private fun assertConfig(
actual: DeviceSettingConfigModel,
- serviceResponse: DeviceSettingsConfig
+ serviceResponse: DeviceSettingsConfig,
) {
assertThat(actual.mainItems.size).isEqualTo(serviceResponse.mainContentItems.size)
for (i in 0..<actual.mainItems.size) {
@@ -451,7 +454,7 @@
private fun assertConfigItem(
actual: DeviceSettingConfigItemModel,
- serviceResponse: DeviceSettingItem
+ serviceResponse: DeviceSettingItem,
) {
assertThat(actual.settingId).isEqualTo(serviceResponse.settingId)
}
@@ -485,24 +488,43 @@
"</DEVICE_SETTINGS_CONFIG_ACTION>"
val DEVICE_INFO = DeviceInfo.Builder().setBluetoothAddress(BLUETOOTH_ADDRESS).build()
const val DEVICE_SETTING_ID_HELP = 12345
- val DEVICE_SETTING_ITEM_1 =
+ val DEVICE_SETTING_APP_PROVIDED_ITEM_1 =
DeviceSettingItem(
DeviceSettingId.DEVICE_SETTING_ID_HEADER,
SETTING_PROVIDER_SERVICE_PACKAGE_NAME_1,
SETTING_PROVIDER_SERVICE_CLASS_NAME_1,
- SETTING_PROVIDER_SERVICE_INTENT_ACTION_1)
- val DEVICE_SETTING_ITEM_2 =
+ SETTING_PROVIDER_SERVICE_INTENT_ACTION_1,
+ )
+ val DEVICE_SETTING_APP_PROVIDED_ITEM_2 =
DeviceSettingItem(
DeviceSettingId.DEVICE_SETTING_ID_ANC,
SETTING_PROVIDER_SERVICE_PACKAGE_NAME_2,
SETTING_PROVIDER_SERVICE_CLASS_NAME_2,
- SETTING_PROVIDER_SERVICE_INTENT_ACTION_2)
+ SETTING_PROVIDER_SERVICE_INTENT_ACTION_2,
+ )
+ val DEVICE_SETTING_BUILT_IN_ITEM =
+ DeviceSettingItem(
+ DeviceSettingId.DEVICE_SETTING_ID_BLUETOOTH_AUDIO_DEVICE_TYPE_GROUP,
+ "",
+ "",
+ "",
+ "device_type",
+ )
+ val DEVICE_SETTING_BUILT_IN_BT_PROFILES_ITEM =
+ DeviceSettingItem(
+ DeviceSettingId.DEVICE_SETTING_ID_BLUETOOTH_PROFILES,
+ "",
+ "",
+ "",
+ "bluetooth_profiles",
+ )
val DEVICE_SETTING_HELP_ITEM =
DeviceSettingItem(
DEVICE_SETTING_ID_HELP,
SETTING_PROVIDER_SERVICE_PACKAGE_NAME_2,
SETTING_PROVIDER_SERVICE_CLASS_NAME_2,
- SETTING_PROVIDER_SERVICE_INTENT_ACTION_2)
+ SETTING_PROVIDER_SERVICE_INTENT_ACTION_2,
+ )
val DEVICE_SETTING_1 =
DeviceSetting.Builder()
.setSettingId(DeviceSettingId.DEVICE_SETTING_ID_HEADER)
@@ -511,7 +533,8 @@
.setTitle("title1")
.setHasSwitch(true)
.setAllowedChangingState(true)
- .build())
+ .build()
+ )
.build()
val DEVICE_SETTING_2 =
DeviceSetting.Builder()
@@ -524,22 +547,30 @@
ToggleInfo.Builder()
.setLabel("label1")
.setIcon(Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888))
- .build())
+ .build()
+ )
.addToggleInfo(
ToggleInfo.Builder()
.setLabel("label2")
.setIcon(Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888))
- .build())
- .build())
+ .build()
+ )
+ .build()
+ )
.build()
- val DEVICE_SETTING_HELP = DeviceSetting.Builder()
- .setSettingId(DEVICE_SETTING_ID_HELP)
- .setPreference(DeviceSettingHelpPreference.Builder().setIntent(Intent()).build())
- .build()
+ val DEVICE_SETTING_HELP =
+ DeviceSetting.Builder()
+ .setSettingId(DEVICE_SETTING_ID_HELP)
+ .setPreference(DeviceSettingHelpPreference.Builder().setIntent(Intent()).build())
+ .build()
val DEVICE_SETTING_CONFIG =
DeviceSettingsConfig(
- listOf(DEVICE_SETTING_ITEM_1),
- listOf(DEVICE_SETTING_ITEM_2),
+ listOf(
+ DEVICE_SETTING_APP_PROVIDED_ITEM_1,
+ DEVICE_SETTING_BUILT_IN_ITEM,
+ DEVICE_SETTING_BUILT_IN_BT_PROFILES_ITEM,
+ ),
+ listOf(DEVICE_SETTING_APP_PROVIDED_ITEM_2),
DEVICE_SETTING_HELP_ITEM,
)
}
diff --git a/packages/SettingsProvider/Android.bp b/packages/SettingsProvider/Android.bp
index 3e62b7b..c107ff5 100644
--- a/packages/SettingsProvider/Android.bp
+++ b/packages/SettingsProvider/Android.bp
@@ -76,8 +76,8 @@
"Harrier",
],
libs: [
- "android.test.base",
- "android.test.mock",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"unsupportedappusage",
],
resource_dirs: [],
diff --git a/packages/Shell/tests/Android.bp b/packages/Shell/tests/Android.bp
index 0dc3314..082a589 100644
--- a/packages/Shell/tests/Android.bp
+++ b/packages/Shell/tests/Android.bp
@@ -11,9 +11,9 @@
name: "ShellTests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.test.rules",
@@ -26,3 +26,10 @@
instrumentation_for: "Shell",
certificate: "platform",
}
+
+test_module_config {
+ name: "ShellTests_android_server_os",
+ base: "ShellTests",
+ test_suites: ["device-tests"],
+ exclude_annotations: ["androidx.test.filters.LargeTest"],
+}
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index d26a906..be4e9a1 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -756,6 +756,7 @@
"notification_flags_lib",
"PlatformComposeCore",
"PlatformComposeSceneTransitionLayout",
+ "PlatformComposeSceneTransitionLayoutTestsUtils",
"androidx.compose.runtime_runtime",
"androidx.compose.material3_material3",
"androidx.compose.material_material-icons-extended",
@@ -804,9 +805,9 @@
"androidx.test.rules",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"keepanno-annotations",
],
kotlincflags: [
@@ -896,9 +897,9 @@
"androidx.compose.runtime_runtime",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
@@ -971,9 +972,9 @@
"androidx.compose.runtime_runtime",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
auto_gen_config: true,
plugins: [
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_assistant_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_assistant.xml
similarity index 89%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_assistant_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_assistant.xml
index 9c3417f..6408a12 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_assistant_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_assistant.xml
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_down_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_down.xml
similarity index 92%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_down_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_down.xml
index a64a0d1..f13239c 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_down_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_down.xml
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_up_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_up.xml
similarity index 95%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_up_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_up.xml
index 40423c7..a5d15f9 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_up_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_brightness_up.xml
@@ -15,8 +15,8 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_lock_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_lock.xml
similarity index 90%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_lock_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_lock.xml
index a0f7b5d..2127632 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_lock_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_lock.xml
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_notifications_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_notifications.xml
similarity index 90%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_notifications_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_notifications.xml
index 8757f22..62c8d1d 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_notifications_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_notifications.xml
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_power_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_power.xml
similarity index 90%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_power_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_power.xml
index 049013a..ed11b44 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_power_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_power.xml
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_quick_settings_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_quick_settings.xml
similarity index 97%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_quick_settings_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_quick_settings.xml
index 4f25e7d..2da63a6 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_quick_settings_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_quick_settings.xml
@@ -15,8 +15,8 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_recent_apps_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_recent_apps.xml
similarity index 94%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_recent_apps_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_recent_apps.xml
index 38234c0..9763b8e 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_recent_apps_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_recent_apps.xml
@@ -15,8 +15,8 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_screenshot_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_screenshot.xml
similarity index 95%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_screenshot_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_screenshot.xml
index 6d7f49c..2bfbd5b 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_screenshot_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_screenshot.xml
@@ -15,8 +15,8 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_settings_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_settings.xml
similarity index 95%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_settings_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_settings.xml
index 5ed6f19..4ca9bfc 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_settings_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_settings.xml
@@ -15,8 +15,8 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_down_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_down.xml
similarity index 94%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_down_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_down.xml
index 16653e8..f924e5e 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_down_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_down.xml
@@ -15,8 +15,8 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_up_24dp.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_up.xml
similarity index 95%
rename from packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_up_24dp.xml
rename to packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_up.xml
index e572c6a..41fe351 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_up_24dp.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/ic_logo_a11y_volume_up.xml
@@ -15,8 +15,8 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
+ android:width="108dp"
+ android:height="108dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="@color/colorControlNormal">
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/menuitem_background_ripple.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/menuitem_background_ripple.xml
new file mode 100644
index 0000000..6cab464
--- /dev/null
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/drawable/menuitem_background_ripple.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="@color/ripple_material_color" />
\ No newline at end of file
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/layout/grid_item.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/layout/grid_item.xml
index 3c73eca..a1130e6 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/layout/grid_item.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/layout/grid_item.xml
@@ -12,7 +12,8 @@
android:layout_height="@dimen/image_button_height"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
- android:scaleType="fitCenter"/>
+ android:scaleType="fitCenter"
+ android:background="@drawable/menuitem_background_ripple" />
<TextView
android:id="@+id/shortcutLabel"
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/model/A11yMenuShortcut.java b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/model/A11yMenuShortcut.java
index c698d18..11ce41e 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/model/A11yMenuShortcut.java
+++ b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/model/A11yMenuShortcut.java
@@ -53,73 +53,73 @@
/** Map stores all shortcut resource IDs that is in matching order of defined shortcut. */
private static final Map<ShortcutId, int[]> sShortcutResource = Map.ofEntries(
Map.entry(ShortcutId.ID_ASSISTANT_VALUE, new int[] {
- R.drawable.ic_logo_a11y_assistant_24dp,
+ R.drawable.ic_logo_a11y_assistant,
R.color.assistant_color,
R.string.assistant_utterance,
R.string.assistant_label,
}),
Map.entry(ShortcutId.ID_A11YSETTING_VALUE, new int[] {
- R.drawable.ic_logo_a11y_settings_24dp,
+ R.drawable.ic_logo_a11y_settings,
R.color.a11y_settings_color,
R.string.a11y_settings_label,
R.string.a11y_settings_label,
}),
Map.entry(ShortcutId.ID_POWER_VALUE, new int[] {
- R.drawable.ic_logo_a11y_power_24dp,
+ R.drawable.ic_logo_a11y_power,
R.color.power_color,
R.string.power_utterance,
R.string.power_label,
}),
Map.entry(ShortcutId.ID_RECENT_VALUE, new int[] {
- R.drawable.ic_logo_a11y_recent_apps_24dp,
+ R.drawable.ic_logo_a11y_recent_apps,
R.color.recent_apps_color,
R.string.recent_apps_label,
R.string.recent_apps_label,
}),
Map.entry(ShortcutId.ID_LOCKSCREEN_VALUE, new int[] {
- R.drawable.ic_logo_a11y_lock_24dp,
+ R.drawable.ic_logo_a11y_lock,
R.color.lockscreen_color,
R.string.lockscreen_label,
R.string.lockscreen_label,
}),
Map.entry(ShortcutId.ID_QUICKSETTING_VALUE, new int[] {
- R.drawable.ic_logo_a11y_quick_settings_24dp,
+ R.drawable.ic_logo_a11y_quick_settings,
R.color.quick_settings_color,
R.string.quick_settings_label,
R.string.quick_settings_label,
}),
Map.entry(ShortcutId.ID_NOTIFICATION_VALUE, new int[] {
- R.drawable.ic_logo_a11y_notifications_24dp,
+ R.drawable.ic_logo_a11y_notifications,
R.color.notifications_color,
R.string.notifications_label,
R.string.notifications_label,
}),
Map.entry(ShortcutId.ID_SCREENSHOT_VALUE, new int[] {
- R.drawable.ic_logo_a11y_screenshot_24dp,
+ R.drawable.ic_logo_a11y_screenshot,
R.color.screenshot_color,
R.string.screenshot_utterance,
R.string.screenshot_label,
}),
Map.entry(ShortcutId.ID_BRIGHTNESS_UP_VALUE, new int[] {
- R.drawable.ic_logo_a11y_brightness_up_24dp,
+ R.drawable.ic_logo_a11y_brightness_up,
R.color.brightness_color,
R.string.brightness_up_label,
R.string.brightness_up_label,
}),
Map.entry(ShortcutId.ID_BRIGHTNESS_DOWN_VALUE, new int[] {
- R.drawable.ic_logo_a11y_brightness_down_24dp,
+ R.drawable.ic_logo_a11y_brightness_down,
R.color.brightness_color,
R.string.brightness_down_label,
R.string.brightness_down_label,
}),
Map.entry(ShortcutId.ID_VOLUME_UP_VALUE, new int[] {
- R.drawable.ic_logo_a11y_volume_up_24dp,
+ R.drawable.ic_logo_a11y_volume_up,
R.color.volume_color,
R.string.volume_up_label,
R.string.volume_up_label,
}),
Map.entry(ShortcutId.ID_VOLUME_DOWN_VALUE, new int[] {
- R.drawable.ic_logo_a11y_volume_down_24dp,
+ R.drawable.ic_logo_a11y_volume_down,
R.color.volume_color,
R.string.volume_down_label,
R.string.volume_down_label,
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/utils/ShortcutDrawableUtils.java b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/utils/ShortcutDrawableUtils.java
deleted file mode 100644
index 28ba4b5..0000000
--- a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/utils/ShortcutDrawableUtils.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.systemui.accessibility.accessibilitymenu.utils;
-
-import android.content.Context;
-import android.content.res.ColorStateList;
-import android.graphics.Bitmap;
-import android.graphics.Bitmap.Config;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Paint.Style;
-import android.graphics.drawable.AdaptiveIconDrawable;
-import android.graphics.drawable.BitmapDrawable;
-import android.graphics.drawable.ColorDrawable;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.LayerDrawable;
-import android.graphics.drawable.RippleDrawable;
-
-import com.android.systemui.accessibility.accessibilitymenu.R;
-
-/** Creates background drawable for a11y menu shortcut. */
-public class ShortcutDrawableUtils {
-
- /**
- * To make the circular background of shortcut icons have higher resolution. The higher value of
- * LENGTH is, the higher resolution of the circular background are.
- */
- private static final int LENGTH = 480;
-
- private static final int RADIUS = LENGTH / 2;
- private static final int COORDINATE = LENGTH / 2;
- private static final int RIPPLE_COLOR_ID = R.color.ripple_material_color;
-
- private final Context mContext;
- private final ColorStateList mRippleColorStateList;
-
- // Placeholder of drawable to prevent NullPointerException
- private final ColorDrawable mTransparentDrawable = new ColorDrawable(Color.TRANSPARENT);
-
- public ShortcutDrawableUtils(Context context) {
- this.mContext = context;
-
- int rippleColor = context.getColor(RIPPLE_COLOR_ID);
- mRippleColorStateList = ColorStateList.valueOf(rippleColor);
- }
-
- /**
- * Creates a circular drawable in specific color for shortcut.
- *
- * @param colorResId color resource ID
- * @return drawable circular drawable
- */
- public Drawable createCircularDrawable(int colorResId) {
- Bitmap output = Bitmap.createBitmap(LENGTH, LENGTH, Config.ARGB_8888);
- Canvas canvas = new Canvas(output);
- int color = mContext.getColor(colorResId);
- Paint paint = new Paint();
- paint.setColor(color);
- paint.setStrokeCap(Paint.Cap.ROUND);
- paint.setStyle(Style.FILL);
- canvas.drawCircle(COORDINATE, COORDINATE, RADIUS, paint);
-
- BitmapDrawable drawable = new BitmapDrawable(mContext.getResources(), output);
- return drawable;
- }
-
- /**
- * Creates an adaptive icon drawable in specific color for shortcut.
- *
- * @param colorResId color resource ID
- * @return drawable for adaptive icon
- */
- public Drawable createAdaptiveIconDrawable(int colorResId) {
- Drawable circleLayer = createCircularDrawable(colorResId);
- RippleDrawable rippleLayer = new RippleDrawable(mRippleColorStateList, null, null);
-
- AdaptiveIconDrawable adaptiveIconDrawable =
- new AdaptiveIconDrawable(circleLayer, mTransparentDrawable);
-
- Drawable[] layers = {adaptiveIconDrawable, rippleLayer};
- LayerDrawable drawable = new LayerDrawable(layers);
- return drawable;
- }
-}
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuAdapter.java b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuAdapter.java
index c333a7a..aa1bbbd 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuAdapter.java
+++ b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuAdapter.java
@@ -16,7 +16,12 @@
package com.android.systemui.accessibility.accessibilitymenu.view;
+import android.content.res.Resources;
import android.graphics.Rect;
+import android.graphics.drawable.AdaptiveIconDrawable;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.InsetDrawable;
import android.view.LayoutInflater;
import android.view.TouchDelegate;
import android.view.View;
@@ -26,11 +31,12 @@
import android.widget.ImageButton;
import android.widget.TextView;
+import androidx.annotation.NonNull;
+
import com.android.systemui.accessibility.accessibilitymenu.AccessibilityMenuService;
import com.android.systemui.accessibility.accessibilitymenu.R;
import com.android.systemui.accessibility.accessibilitymenu.activity.A11yMenuSettingsActivity.A11yMenuPreferenceFragment;
import com.android.systemui.accessibility.accessibilitymenu.model.A11yMenuShortcut;
-import com.android.systemui.accessibility.accessibilitymenu.utils.ShortcutDrawableUtils;
import java.util.List;
@@ -43,16 +49,12 @@
private final AccessibilityMenuService mService;
private final List<A11yMenuShortcut> mShortcutDataList;
- private final ShortcutDrawableUtils mShortcutDrawableUtils;
public A11yMenuAdapter(
AccessibilityMenuService service,
List<A11yMenuShortcut> shortcutDataList) {
this.mService = service;
this.mShortcutDataList = shortcutDataList;
-
- mShortcutDrawableUtils = new ShortcutDrawableUtils(service);
-
mLargeTextSize =
service.getResources().getDimensionPixelOffset(R.dimen.large_label_text_size);
}
@@ -152,10 +154,10 @@
shortcutIconButton.setContentDescription(
mService.getString(shortcutItem.imgContentDescription));
shortcutLabel.setText(shortcutItem.labelText);
- shortcutIconButton.setImageResource(shortcutItem.imageSrc);
- shortcutIconButton.setBackground(
- mShortcutDrawableUtils.createAdaptiveIconDrawable(shortcutItem.imageColor));
+ AdaptiveIconDrawable iconDrawable = getAdaptiveIconDrawable(convertView,
+ shortcutItem);
+ shortcutIconButton.setImageDrawable(iconDrawable);
shortcutIconButton.setAccessibilityDelegate(new View.AccessibilityDelegate() {
@Override
@@ -167,4 +169,18 @@
});
}
}
+
+ @NonNull
+ private static AdaptiveIconDrawable getAdaptiveIconDrawable(@NonNull View convertView,
+ @NonNull A11yMenuShortcut shortcutItem) {
+ Resources resources = convertView.getResources();
+ // Note: from the official guide, the foreground image of the adaptive icon should be
+ // sized at 108 x 108 dp
+ Drawable icon = resources.getDrawable(shortcutItem.imageSrc);
+ float inset = AdaptiveIconDrawable.getExtraInsetFraction();
+ AdaptiveIconDrawable iconDrawable = new AdaptiveIconDrawable(
+ new ColorDrawable(resources.getColor(shortcutItem.imageColor)),
+ new InsetDrawable(icon, inset));
+ return iconDrawable;
+ }
}
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuViewPager.java b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuViewPager.java
index 35f1248..b899c45 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuViewPager.java
+++ b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuViewPager.java
@@ -306,6 +306,10 @@
(viewPagerHeight - topMargin - defaultMargin
- (rowsInGridView * gridItemHeight))
/ (rowsInGridView + 1);
+ // The interval is negative number when the viewPagerHeight is not able to fit
+ // the grid items, which result in text overlapping.
+ // Adjust the interval to 0 could solve the issue.
+ interval = Math.max(interval, 0);
mViewPagerAdapter.setVerticalSpacing(interval);
// Sets padding to view pager.
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp b/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp
index 9d5a2e0..a484767 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp
+++ b/packages/SystemUI/accessibility/accessibilitymenu/tests/Android.bp
@@ -24,8 +24,8 @@
use_resource_processor: true,
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index d1a59af..02e8cd6 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -247,13 +247,6 @@
}
flag {
- name: "haptic_brightness_slider"
- namespace: "systemui"
- description: "Adds haptic feedback to the brightness slider."
- bug: "296467915"
-}
-
-flag {
name: "unfold_animation_background_progress"
namespace: "systemui"
description: "Moves unfold animation progress calculation to a background thread"
@@ -288,6 +281,16 @@
}
flag {
+ name: "qs_quick_rebind_active_tiles"
+ namespace: "systemui"
+ description: "Rebind active custom tiles quickly."
+ bug: "362526228"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "coroutine_tracing"
namespace: "systemui"
description: "Adds thread-local data to System UI's global coroutine scopes to "
@@ -606,16 +609,6 @@
}
flag {
- name: "screenshot_save_image_exporter"
- namespace: "systemui"
- description: "Save all screenshots using ImageExporter"
- bug: "352308052"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
-
-flag {
name: "screenshot_ui_controller_refactor"
namespace: "systemui"
description: "Simplify and refactor ScreenshotController"
@@ -1396,3 +1389,9 @@
}
}
+flag {
+ name: "non_touchscreen_devices_bypass_falsing"
+ namespace: "systemui"
+ description: "Allow non-touchscreen devices to bypass falsing"
+ bug: "319809270"
+}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerScene.kt b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerScene.kt
index 7fb88e8..ae92d259 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerScene.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerScene.kt
@@ -99,8 +99,8 @@
BouncerContent(
viewModel,
dialogFactory,
- Modifier.sysuiResTag(Bouncer.TestTags.Root)
- .element(Bouncer.Elements.Content)
+ Modifier.element(Bouncer.Elements.Content)
+ .sysuiResTag(Bouncer.TestTags.Root)
.fillMaxSize()
)
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt
index 480e4e4..1287993 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt
@@ -17,6 +17,7 @@
package com.android.systemui.bouncer.ui.composable
import android.view.HapticFeedbackConstants
+import android.view.MotionEvent
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationSpec
@@ -49,6 +50,7 @@
import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.input.pointer.pointerInteropFilter
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
@@ -110,6 +112,7 @@
onClicked = viewModel::onPinButtonClicked,
scaling = buttonScaleAnimatables[index]::value,
isAnimationEnabled = isDigitButtonAnimationEnabled,
+ onPointerDown = viewModel::onDigitButtonDown,
)
}
@@ -133,6 +136,7 @@
onClicked = viewModel::onPinButtonClicked,
scaling = buttonScaleAnimatables[10]::value,
isAnimationEnabled = isDigitButtonAnimationEnabled,
+ onPointerDown = viewModel::onDigitButtonDown
)
ActionButton(
@@ -155,6 +159,7 @@
digit: Int,
isInputEnabled: Boolean,
onClicked: (Int) -> Unit,
+ onPointerDown: () -> Unit,
scaling: () -> Float,
isAnimationEnabled: Boolean,
) {
@@ -164,6 +169,7 @@
backgroundColor = MaterialTheme.colorScheme.surfaceVariant,
foregroundColor = MaterialTheme.colorScheme.onSurfaceVariant,
isAnimationEnabled = isAnimationEnabled,
+ onPointerDown = onPointerDown,
modifier =
Modifier.graphicsLayer {
val scale = if (isAnimationEnabled) scaling() else 1f
@@ -235,6 +241,7 @@
isAnimationEnabled: Boolean,
modifier: Modifier = Modifier,
onLongPressed: (() -> Unit)? = null,
+ onPointerDown: (() -> Unit)? = null,
content: @Composable (contentColor: () -> Color) -> Unit,
) {
val interactionSource = remember { MutableInteractionSource() }
@@ -303,11 +310,17 @@
.clip(CircleShape)
.thenIf(isEnabled) {
Modifier.combinedClickable(
- interactionSource = interactionSource,
- indication = indication,
- onClick = onClicked,
- onLongClick = onLongPressed
- )
+ interactionSource = interactionSource,
+ indication = indication,
+ onClick = onClicked,
+ onLongClick = onLongPressed
+ )
+ .pointerInteropFilter { motionEvent ->
+ if (motionEvent.action == MotionEvent.ACTION_DOWN) {
+ onPointerDown?.let { it() }
+ }
+ false
+ }
},
) {
content(contentColor::value)
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinInputDisplay.kt b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinInputDisplay.kt
index ba885f7..1f98cd8 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinInputDisplay.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinInputDisplay.kt
@@ -65,7 +65,6 @@
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
-import androidx.compose.ui.window.Dialog
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.PlatformOutlinedButton
import com.android.compose.animation.Easings
@@ -355,7 +354,10 @@
fun Content(modifier: Modifier) {
// Wrap PIN entry in a Box so it is visible to accessibility (even if empty).
- Box(modifier = modifier.fillMaxWidth().wrapContentHeight()) {
+ Box(
+ modifier = modifier.fillMaxWidth().wrapContentHeight(),
+ contentAlignment = Alignment.Center,
+ ) {
Row(
modifier
.heightIn(min = shapeAnimations.shapeSize)
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/common/ui/compose/TextExt.kt b/packages/SystemUI/compose/features/src/com/android/systemui/common/ui/compose/TextExt.kt
index e1f73e3..4e8121f 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/common/ui/compose/TextExt.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/common/ui/compose/TextExt.kt
@@ -17,9 +17,12 @@
package com.android.systemui.common.ui.compose
+import android.content.Context
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.text.AnnotatedString
import com.android.systemui.common.shared.model.Text
+import com.android.systemui.common.shared.model.Text.Companion.loadText
/** Returns the loaded [String] or `null` if there isn't one. */
@Composable
@@ -29,3 +32,7 @@
is Text.Resource -> stringResource(res)
}
}
+
+fun Text.toAnnotatedString(context: Context): AnnotatedString? {
+ return loadText(context)?.let { AnnotatedString(it) }
+}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
index bcbf933..efe0f2e 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
@@ -19,7 +19,9 @@
import android.content.Context
import android.content.res.Configuration
import android.graphics.drawable.Icon
+import android.os.SystemClock
import android.util.SizeF
+import android.view.MotionEvent
import android.widget.FrameLayout
import android.widget.RemoteViews
import androidx.annotation.VisibleForTesting
@@ -40,6 +42,7 @@
import androidx.compose.foundation.clickable
import androidx.compose.foundation.focusable
import androidx.compose.foundation.gestures.awaitFirstDown
+import androidx.compose.foundation.gestures.detectHorizontalDragGestures
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@@ -137,6 +140,7 @@
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.onClick
+import androidx.compose.ui.semantics.paneTitle
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTagsAsResourceId
import androidx.compose.ui.text.style.TextAlign
@@ -241,10 +245,15 @@
}
}
+ val paneTitle = stringResource(R.string.accessibility_content_description_for_communal_hub)
+
Box(
modifier =
modifier
- .semantics { testTagsAsResourceId = true }
+ .semantics {
+ testTagsAsResourceId = true
+ this.paneTitle = paneTitle
+ }
.testTag(COMMUNAL_HUB_TEST_TAG)
.fillMaxSize()
// Observe taps for selecting items
@@ -1383,17 +1392,35 @@
@Composable
private fun Umo(viewModel: BaseCommunalViewModel, modifier: Modifier = Modifier) {
AndroidView(
- modifier = modifier,
- factory = {
- viewModel.mediaHost.hostView.layoutParams =
- FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT
- )
+ modifier =
+ modifier.pointerInput(Unit) {
+ detectHorizontalDragGestures { change, _ ->
+ change.consume()
+ val upTime = SystemClock.uptimeMillis()
+ val event =
+ MotionEvent.obtain(
+ upTime,
+ upTime,
+ MotionEvent.ACTION_MOVE,
+ change.position.x,
+ change.position.y,
+ 0
+ )
+ viewModel.mediaHost.hostView.dispatchTouchEvent(event)
+ event.recycle()
+ }
+ },
+ factory = { _ ->
+ viewModel.mediaHost.hostView.apply {
+ layoutParams =
+ FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT
+ )
+ }
viewModel.mediaHost.hostView
},
- // For reusing composition in lazy lists.
- onReset = {},
+ onReset = {}
)
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/AlternateBouncer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/AlternateBouncer.kt
index ecb3d8c..c25a45d 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/AlternateBouncer.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/AlternateBouncer.kt
@@ -52,6 +52,7 @@
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerDependencies
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerMessageAreaViewModel
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerUdfpsIconViewModel
+import com.android.systemui.log.LongPressHandlingViewLogger
import com.android.systemui.res.R
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -97,6 +98,7 @@
Box {
DeviceEntryIcon(
viewModel = alternateBouncerDependencies.udfpsIconViewModel,
+ logger = alternateBouncerDependencies.logger,
modifier =
Modifier.width { udfpsLocation.width }
.height { udfpsLocation.height }
@@ -151,13 +153,14 @@
@Composable
private fun DeviceEntryIcon(
viewModel: AlternateBouncerUdfpsIconViewModel,
+ logger: LongPressHandlingViewLogger,
modifier: Modifier = Modifier,
) {
AndroidView(
modifier = modifier,
factory = { context ->
val view =
- DeviceEntryIconView(context, null).apply {
+ DeviceEntryIconView(context, null, logger = logger).apply {
id = R.id.alternate_bouncer_udfps_icon_view
contentDescription =
context.resources.getString(R.string.accessibility_fingerprint_label)
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt
index 8d5189e..2a2c2fc 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt
@@ -21,12 +21,16 @@
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.Layout
+import androidx.compose.ui.res.dimensionResource
+import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntRect
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.animation.scene.SceneScope
@@ -42,6 +46,7 @@
import com.android.systemui.keyguard.ui.composable.section.StatusBarSection
import com.android.systemui.keyguard.ui.composable.section.TopAreaSection
import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel
+import com.android.systemui.res.R
import java.util.Optional
import javax.inject.Inject
import kotlin.math.roundToInt
@@ -117,7 +122,7 @@
with(notificationSection) {
Notifications(
areNotificationsVisible = areNotificationsVisible,
- isShadeLayoutWide = isShadeLayoutWide,
+ isShadeLayoutWide = true,
burnInParams = null,
modifier =
Modifier.fillMaxWidth(0.5f)
@@ -127,13 +132,27 @@
}
}
}
- if (!isShadeLayoutWide && !isBypassEnabled) {
- with(notificationSection) {
- Notifications(
- areNotificationsVisible = areNotificationsVisible,
- isShadeLayoutWide = isShadeLayoutWide,
- burnInParams = null,
- modifier = Modifier.weight(weight = 1f)
+
+ val aodIconPadding: Dp =
+ dimensionResource(R.dimen.below_clock_padding_start_icons)
+
+ with(notificationSection) {
+ if (!isShadeLayoutWide && !isBypassEnabled) {
+ Box(modifier = Modifier.weight(weight = 1f)) {
+ AodNotificationIcons(
+ modifier =
+ Modifier.align(alignment = Alignment.TopStart)
+ .padding(start = aodIconPadding),
+ )
+ Notifications(
+ areNotificationsVisible = areNotificationsVisible,
+ isShadeLayoutWide = false,
+ burnInParams = null,
+ )
+ }
+ } else {
+ AodNotificationIcons(
+ modifier = Modifier.padding(start = aodIconPadding),
)
}
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/LockSection.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/LockSection.kt
index 46cd58c..a525f36 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/LockSection.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/LockSection.kt
@@ -44,6 +44,9 @@
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryBackgroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryForegroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryIconViewModel
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.LongPressHandlingViewLogger
+import com.android.systemui.log.dagger.LongPressTouchLog
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.res.R
import com.android.systemui.statusbar.VibratorHelper
@@ -64,6 +67,7 @@
private val deviceEntryBackgroundViewModel: Lazy<DeviceEntryBackgroundViewModel>,
private val falsingManager: Lazy<FalsingManager>,
private val vibratorHelper: Lazy<VibratorHelper>,
+ @LongPressTouchLog private val logBuffer: LogBuffer,
) {
@Composable
fun SceneScope.LockIcon(overrideColor: Color? = null, modifier: Modifier = Modifier) {
@@ -77,19 +81,24 @@
factory = { context ->
val view =
if (DeviceEntryUdfpsRefactor.isEnabled) {
- DeviceEntryIconView(context, null).apply {
- id = R.id.device_entry_icon_view
- DeviceEntryIconViewBinder.bind(
- applicationScope,
- this,
- deviceEntryIconViewModel.get(),
- deviceEntryForegroundViewModel.get(),
- deviceEntryBackgroundViewModel.get(),
- falsingManager.get(),
- vibratorHelper.get(),
- overrideColor,
+ DeviceEntryIconView(
+ context,
+ null,
+ logger = LongPressHandlingViewLogger(logBuffer, tag = TAG)
)
- }
+ .apply {
+ id = R.id.device_entry_icon_view
+ DeviceEntryIconViewBinder.bind(
+ applicationScope,
+ this,
+ deviceEntryIconViewModel.get(),
+ deviceEntryForegroundViewModel.get(),
+ deviceEntryBackgroundViewModel.get(),
+ falsingManager.get(),
+ vibratorHelper.get(),
+ overrideColor,
+ )
+ }
} else {
// KeyguardBottomAreaRefactor.isEnabled
LockIconView(context, null).apply {
@@ -178,6 +187,10 @@
return IntRect(center, radius)
}
+
+ companion object {
+ private const val TAG = "LockSection"
+ }
}
private val LockIconElementKey = ElementKey("LockIcon")
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt
index 18e1092..6fc51e4 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt
@@ -17,32 +17,60 @@
package com.android.systemui.keyguard.ui.composable.section
import android.view.ViewGroup
+import androidx.compose.animation.AnimatedVisibility
+import androidx.compose.animation.core.MutableTransitionState
+import androidx.compose.animation.fadeIn
+import androidx.compose.animation.fadeOut
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.animation.scene.SceneScope
import com.android.compose.modifiers.thenIf
+import com.android.systemui.common.ui.ConfigurationState
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.MigrateClocksToBlueprint
+import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
+import com.android.systemui.keyguard.ui.composable.blueprint.rememberBurnIn
import com.android.systemui.keyguard.ui.composable.modifier.burnInAware
import com.android.systemui.keyguard.ui.viewmodel.AodBurnInViewModel
import com.android.systemui.keyguard.ui.viewmodel.BurnInParameters
+import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel
import com.android.systemui.lifecycle.rememberViewModel
import com.android.systemui.notifications.ui.composable.ConstrainedNotificationStack
import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotificationSpace
+import com.android.systemui.res.R
import com.android.systemui.shade.LargeScreenHeaderHelper
+import com.android.systemui.statusbar.notification.icon.ui.viewbinder.AlwaysOnDisplayNotificationIconViewStore
+import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder
+import com.android.systemui.statusbar.notification.icon.ui.viewbinder.StatusBarIconViewBindingFailureTracker
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerAlwaysOnDisplayViewModel
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView
import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer
import com.android.systemui.statusbar.notification.stack.ui.viewbinder.SharedNotificationContainerBinder
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel
+import com.android.systemui.statusbar.phone.NotificationIconContainer
+import com.android.systemui.statusbar.ui.SystemBarUtilsState
+import com.android.systemui.util.ui.isAnimating
+import com.android.systemui.util.ui.stopAnimating
+import com.android.systemui.util.ui.value
import dagger.Lazy
import javax.inject.Inject
+import kotlinx.coroutines.launch
@SysUISingleton
class NotificationSection
@@ -55,6 +83,13 @@
sharedNotificationContainerViewModel: SharedNotificationContainerViewModel,
stackScrollLayout: NotificationStackScrollLayout,
sharedNotificationContainerBinder: SharedNotificationContainerBinder,
+ private val keyguardRootViewModel: KeyguardRootViewModel,
+ private val configurationState: ConfigurationState,
+ private val iconBindingFailureTracker: StatusBarIconViewBindingFailureTracker,
+ private val nicAodViewModel: NotificationIconContainerAlwaysOnDisplayViewModel,
+ private val nicAodIconViewStore: AlwaysOnDisplayNotificationIconViewStore,
+ private val systemBarUtilsState: SystemBarUtilsState,
+ private val clockInteractor: KeyguardClockInteractor,
) {
init {
@@ -80,6 +115,47 @@
}
@Composable
+ fun AodNotificationIcons(modifier: Modifier = Modifier) {
+ val isVisible by
+ keyguardRootViewModel.isNotifIconContainerVisible.collectAsStateWithLifecycle()
+ val transitionState = remember { MutableTransitionState(isVisible.value) }
+ LaunchedEffect(key1 = isVisible, key2 = transitionState.isIdle) {
+ transitionState.targetState = isVisible.value
+ if (isVisible.isAnimating && transitionState.isIdle) {
+ isVisible.stopAnimating()
+ }
+ }
+ val burnIn = rememberBurnIn(clockInteractor)
+ AnimatedVisibility(
+ visibleState = transitionState,
+ enter = fadeIn(),
+ exit = fadeOut(),
+ modifier =
+ modifier
+ .height(dimensionResource(R.dimen.notification_shelf_height))
+ .burnInAware(aodBurnInViewModel, burnIn.parameters),
+ ) {
+ val scope = rememberCoroutineScope()
+ AndroidView(
+ factory = { context ->
+ NotificationIconContainer(context, null).also { nic ->
+ scope.launch {
+ NotificationIconContainerViewBinder.bind(
+ nic,
+ nicAodViewModel,
+ configurationState,
+ systemBarUtilsState,
+ iconBindingFailureTracker,
+ nicAodIconViewStore,
+ )
+ }
+ }
+ },
+ )
+ }
+ }
+
+ @Composable
fun SceneScope.HeadsUpNotifications() {
SnoozeableHeadsUpNotificationSpace(
stackScrollView = stackScrollView.get(),
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaContentPicker.kt b/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaContentPicker.kt
index 5dccb68..d523232 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaContentPicker.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/media/controls/ui/composable/MediaContentPicker.kt
@@ -22,29 +22,32 @@
import com.android.compose.animation.scene.SceneTransitionLayoutState
import com.android.compose.animation.scene.StaticElementContentPicker
import com.android.compose.animation.scene.content.state.TransitionState
+import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.shade.shared.flag.DualShade
/** [ElementContentPicker] implementation for the media carousel object. */
object MediaContentPicker : StaticElementContentPicker {
override val contents =
setOf(
+ Overlays.NotificationsShade,
+ Overlays.QuickSettingsShade,
Scenes.Lockscreen,
Scenes.Shade,
Scenes.QuickSettings,
- Scenes.QuickSettingsShade,
- Scenes.Communal
+ Scenes.Communal,
)
override fun contentDuringTransition(
element: ElementKey,
transition: TransitionState.Transition,
fromContentZIndex: Float,
- toContentZIndex: Float
+ toContentZIndex: Float,
): ContentKey {
return when {
shouldElevateMedia(transition) -> {
- Scenes.Shade
+ if (DualShade.isEnabled) Overlays.NotificationsShade else Scenes.Shade
}
transition.isTransitioningBetween(Scenes.Lockscreen, Scenes.Communal) -> {
Scenes.Lockscreen
@@ -52,6 +55,12 @@
transition.isTransitioningBetween(Scenes.QuickSettings, Scenes.Shade) -> {
Scenes.QuickSettings
}
+ transition.isTransitioningBetween(
+ Overlays.QuickSettingsShade,
+ Overlays.NotificationsShade,
+ ) -> {
+ Overlays.QuickSettingsShade
+ }
transition.toContent in contents -> transition.toContent
else -> {
check(transition.fromContent in contents) {
@@ -65,7 +74,8 @@
/** Returns true when the media should be laid on top of the rest for the given [transition]. */
fun shouldElevateMedia(transition: TransitionState.Transition): Boolean {
- return transition.isTransitioningBetween(Scenes.Lockscreen, Scenes.Shade)
+ return transition.isTransitioningBetween(Scenes.Lockscreen, Scenes.Shade) ||
+ transition.isTransitioningBetween(Scenes.Lockscreen, Overlays.NotificationsShade)
}
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt
index 3cb0d8a..df101c5 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainer.kt
@@ -128,7 +128,11 @@
}
},
) {
- SceneTransitionLayout(state = state, modifier = modifier.fillMaxSize()) {
+ SceneTransitionLayout(
+ state = state,
+ modifier = modifier.fillMaxSize(),
+ swipeSourceDetector = viewModel.edgeDetector,
+ ) {
sceneByKey.forEach { (sceneKey, scene) ->
scene(
key = sceneKey,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt
index 5a350a6..f660808 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt
@@ -11,21 +11,16 @@
import com.android.systemui.scene.shared.model.TransitionKeys.ToSplitShade
import com.android.systemui.scene.ui.composable.transitions.bouncerToGoneTransition
import com.android.systemui.scene.ui.composable.transitions.bouncerToLockscreenPreview
-import com.android.systemui.scene.ui.composable.transitions.goneToNotificationsShadeTransition
-import com.android.systemui.scene.ui.composable.transitions.goneToQuickSettingsShadeTransition
import com.android.systemui.scene.ui.composable.transitions.goneToQuickSettingsTransition
import com.android.systemui.scene.ui.composable.transitions.goneToShadeTransition
import com.android.systemui.scene.ui.composable.transitions.goneToSplitShadeTransition
import com.android.systemui.scene.ui.composable.transitions.lockscreenToBouncerTransition
import com.android.systemui.scene.ui.composable.transitions.lockscreenToCommunalTransition
import com.android.systemui.scene.ui.composable.transitions.lockscreenToGoneTransition
-import com.android.systemui.scene.ui.composable.transitions.lockscreenToNotificationsShadeTransition
-import com.android.systemui.scene.ui.composable.transitions.lockscreenToQuickSettingsShadeTransition
import com.android.systemui.scene.ui.composable.transitions.lockscreenToQuickSettingsTransition
import com.android.systemui.scene.ui.composable.transitions.lockscreenToShadeTransition
import com.android.systemui.scene.ui.composable.transitions.lockscreenToSplitShadeTransition
import com.android.systemui.scene.ui.composable.transitions.shadeToQuickSettingsTransition
-import com.android.systemui.shade.ui.composable.OverlayShade
import com.android.systemui.shade.ui.composable.Shade
/**
@@ -48,8 +43,6 @@
// Scene transitions
from(Scenes.Bouncer, to = Scenes.Gone) { bouncerToGoneTransition() }
- from(Scenes.Gone, to = Scenes.NotificationsShade) { goneToNotificationsShadeTransition() }
- from(Scenes.Gone, to = Scenes.QuickSettingsShade) { goneToQuickSettingsShadeTransition() }
from(Scenes.Gone, to = Scenes.Shade) { goneToShadeTransition() }
from(Scenes.Gone, to = Scenes.Shade, key = ToSplitShade) { goneToSplitShadeTransition() }
from(Scenes.Gone, to = Scenes.Shade, key = SlightlyFasterShadeCollapse) {
@@ -65,17 +58,11 @@
Scenes.Lockscreen,
to = Scenes.Bouncer,
key = TransitionKey.PredictiveBack,
- reversePreview = { bouncerToLockscreenPreview() }
+ reversePreview = { bouncerToLockscreenPreview() },
) {
lockscreenToBouncerTransition()
}
from(Scenes.Lockscreen, to = Scenes.Communal) { lockscreenToCommunalTransition() }
- from(Scenes.Lockscreen, to = Scenes.NotificationsShade) {
- lockscreenToNotificationsShadeTransition()
- }
- from(Scenes.Lockscreen, to = Scenes.QuickSettingsShade) {
- lockscreenToQuickSettingsShadeTransition()
- }
from(Scenes.Lockscreen, to = Scenes.Shade) { lockscreenToShadeTransition() }
from(Scenes.Lockscreen, to = Scenes.Shade, key = ToSplitShade) {
lockscreenToSplitShadeTransition()
@@ -96,7 +83,7 @@
overscroll(Scenes.Shade, Orientation.Vertical) {
translate(
Notifications.Elements.NotificationScrim,
- y = Shade.Dimensions.ScrimOverscrollLimit
+ y = Shade.Dimensions.ScrimOverscrollLimit,
)
translate(Shade.Elements.SplitShadeStartColumn, y = Shade.Dimensions.ScrimOverscrollLimit)
translate(
@@ -104,10 +91,4 @@
y = Shade.Dimensions.ScrimOverscrollLimit,
)
}
- overscroll(Scenes.NotificationsShade, Orientation.Vertical) {
- translate(OverlayShade.Elements.Panel, y = OverlayShade.Dimensions.OverscrollLimit)
- }
- overscroll(Scenes.QuickSettingsShade, Orientation.Vertical) {
- translate(OverlayShade.Elements.Panel, y = OverlayShade.Dimensions.OverscrollLimit)
- }
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateSharedAsState.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateSharedAsState.kt
index b30f2b7..0fc88b2 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateSharedAsState.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateSharedAsState.kt
@@ -121,7 +121,7 @@
@Deprecated(
"Use animateContentFloatAsState() instead",
- replaceWith = ReplaceWith("animateContentFloatAsState(value, key, canOverflow)")
+ replaceWith = ReplaceWith("animateContentFloatAsState(value, key, canOverflow)"),
)
@Composable
fun ContentScope.animateSceneFloatAsState(
@@ -172,14 +172,11 @@
@Deprecated(
"Use animateContentDpAsState() instead",
- replaceWith = ReplaceWith("animateContentDpAsState(value, key, canOverflow)")
+ replaceWith = ReplaceWith("animateContentDpAsState(value, key, canOverflow)"),
)
@Composable
-fun ContentScope.animateSceneDpAsState(
- value: Dp,
- key: ValueKey,
- canOverflow: Boolean = true,
-) = animateContentDpAsState(value, key, canOverflow)
+fun ContentScope.animateSceneDpAsState(value: Dp, key: ValueKey, canOverflow: Boolean = true) =
+ animateContentDpAsState(value, key, canOverflow)
/**
* Animate a shared element Dp value.
@@ -214,10 +211,7 @@
* @see ContentScope.animateContentValueAsState
*/
@Composable
-fun ContentScope.animateContentColorAsState(
- value: Color,
- key: ValueKey,
-): AnimatedState<Color> {
+fun ContentScope.animateContentColorAsState(value: Color, key: ValueKey): AnimatedState<Color> {
return animateContentValueAsState(value, key, SharedColorType, canOverflow = false)
}
@@ -227,10 +221,7 @@
* @see ElementScope.animateElementValueAsState
*/
@Composable
-fun ElementScope<*>.animateElementColorAsState(
- value: Color,
- key: ValueKey,
-): AnimatedState<Color> {
+fun ElementScope<*>.animateElementColorAsState(value: Color, key: ValueKey): AnimatedState<Color> {
return animateElementValueAsState(value, key, SharedColorType, canOverflow = false)
}
@@ -274,12 +265,7 @@
* Note: This class is necessary because Color() checks the bounds of its values and UncheckedColor
* is internal.
*/
-private class ColorDelta(
- val red: Float,
- val green: Float,
- val blue: Float,
- val alpha: Float,
-)
+private class ColorDelta(val red: Float, val green: Float, val blue: Float, val alpha: Float)
@Composable
internal fun <T> animateSharedValueAsState(
@@ -331,7 +317,7 @@
private fun <T, Delta> sharedValue(
layoutImpl: SceneTransitionLayoutImpl,
key: ValueKey,
- element: ElementKey?
+ element: ElementKey?,
): SharedValue<T, Delta> {
return layoutImpl.sharedValues[key]?.get(element)?.let { it as SharedValue<T, Delta> }
?: error(valueReadTooEarlyMessage(key))
@@ -342,9 +328,7 @@
"means that you are reading it during composition, which you should not do. See the " +
"documentation of AnimatedState for more information."
-internal class SharedValue<T, Delta>(
- val type: SharedValueType<T, Delta>,
-) {
+internal class SharedValue<T, Delta>(val type: SharedValueType<T, Delta>) {
/** The target value of this shared value for each content. */
val targetValues = SnapshotStateMap<ContentKey, T>()
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
index 24fef71..f38a310 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
@@ -109,12 +109,12 @@
return (upOrLeft != null &&
contentTransition.isTransitioningBetween(
fromContent.key,
- upOrLeft.toContent(currentScene)
+ upOrLeft.toContent(currentScene),
)) ||
(downOrRight != null &&
contentTransition.isTransitioningBetween(
fromContent.key,
- downOrRight.toContent(currentScene)
+ downOrRight.toContent(currentScene),
))
}
@@ -163,7 +163,7 @@
private fun updateDragController(
swipes: Swipes,
- swipeAnimation: SwipeAnimation<*>
+ swipeAnimation: SwipeAnimation<*>,
): DragControllerImpl {
val newDragController = DragControllerImpl(this, swipes, swipeAnimation)
newDragController.updateTransition(swipeAnimation, force = true)
@@ -171,10 +171,7 @@
return newDragController
}
- internal fun createSwipeAnimation(
- swipes: Swipes,
- result: UserActionResult,
- ): SwipeAnimation<*> {
+ internal fun createSwipeAnimation(swipes: Swipes, result: UserActionResult): SwipeAnimation<*> {
val upOrLeftResult = swipes.upOrLeftResult
val downOrRightResult = swipes.downOrRightResult
val isUpOrLeft =
@@ -190,14 +187,12 @@
private fun computeSwipes(startedPosition: Offset?, pointersDown: Int): Swipes {
val fromSource =
startedPosition?.let { position ->
- layoutImpl.swipeSourceDetector
- .source(
- layoutImpl.lastSize,
- position.round(),
- layoutImpl.density,
- orientation,
- )
- ?.resolve(layoutImpl.layoutDirection)
+ layoutImpl.swipeSourceDetector.source(
+ layoutImpl.lastSize,
+ position.round(),
+ layoutImpl.density,
+ orientation,
+ )
}
val upOrLeft =
@@ -268,7 +263,7 @@
layoutState.startTransitionImmediately(
animationScope = draggableHandler.layoutImpl.animationScope,
newTransition.contentTransition,
- true
+ true,
)
}
@@ -397,14 +392,8 @@
return 0f
}
- fun animateTo(targetContent: T) {
- swipeAnimation.animateOffset(
- initialVelocity = velocity,
- targetContent = targetContent,
- )
- }
-
val fromContent = swipeAnimation.fromContent
+ val consumedVelocity: Float
if (canChangeContent) {
// If we are halfway between two contents, we check what the target will be based on the
// velocity and offset of the transition, then we launch the animation.
@@ -429,18 +418,16 @@
} else {
fromContent
}
-
- animateTo(targetContent = targetContent)
+ consumedVelocity = swipeAnimation.animateOffset(velocity, targetContent = targetContent)
} else {
// We are doing an overscroll preview animation between scenes.
check(fromContent == swipeAnimation.currentContent) {
"canChangeContent is false but currentContent != fromContent"
}
- animateTo(targetContent = fromContent)
+ consumedVelocity = swipeAnimation.animateOffset(velocity, targetContent = fromContent)
}
- // The onStop animation consumes any remaining velocity.
- return velocity
+ return consumedVelocity
}
/**
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/EdgeDetector.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/EdgeDetector.kt
index 97c0cef..edd697b 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/EdgeDetector.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/EdgeDetector.kt
@@ -54,23 +54,23 @@
position: IntOffset,
density: Density,
orientation: Orientation,
- ): Edge? {
+ ): Edge.Resolved? {
val axisSize: Int
val axisPosition: Int
- val topOrLeft: Edge
- val bottomOrRight: Edge
+ val topOrLeft: Edge.Resolved
+ val bottomOrRight: Edge.Resolved
when (orientation) {
Orientation.Horizontal -> {
axisSize = layoutSize.width
axisPosition = position.x
- topOrLeft = Edge.Left
- bottomOrRight = Edge.Right
+ topOrLeft = Edge.Resolved.Left
+ bottomOrRight = Edge.Resolved.Right
}
Orientation.Vertical -> {
axisSize = layoutSize.height
axisPosition = position.y
- topOrLeft = Edge.Top
- bottomOrRight = Edge.Bottom
+ topOrLeft = Edge.Resolved.Top
+ bottomOrRight = Edge.Resolved.Bottom
}
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
index a076f22..5a084db 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
@@ -263,7 +263,7 @@
@ExperimentalComposeUiApi
override fun MeasureScope.measure(
measurable: Measurable,
- constraints: Constraints
+ constraints: Constraints,
): MeasureResult {
check(isLookingAhead)
@@ -344,7 +344,7 @@
private fun ApproachMeasureScope.doNotPlace(
measurable: Measurable,
- constraints: Constraints
+ constraints: Constraints,
): MeasureResult {
recursivelyClearPlacementValues()
stateInContent.lastSize = Element.SizeUnspecified
@@ -355,7 +355,7 @@
private fun ApproachMeasureScope.placeNormally(
measurable: Measurable,
- constraints: Constraints
+ constraints: Constraints,
): MeasureResult {
val placeable = measurable.measure(constraints)
stateInContent.lastSize = placeable.size()
@@ -670,10 +670,7 @@
* Reconcile the state of [element] in the formContent and toContent of [transition] so that the
* values before interruption have their expected values, taking shared transitions into account.
*/
-private fun reconcileStates(
- element: Element,
- transition: TransitionState.Transition,
-) {
+private fun reconcileStates(element: Element, transition: TransitionState.Transition) {
val fromContentState = element.stateByContent[transition.fromContent] ?: return
val toContentState = element.stateByContent[transition.toContent] ?: return
if (!isSharedElementEnabled(element.key, transition)) {
@@ -831,15 +828,21 @@
// Don't place the element in this content if this content is not part of the current element
// transition.
- if (content != transition.fromContent && content != transition.toContent) {
+ val isReplacingOverlay = transition is TransitionState.Transition.ReplaceOverlay
+ if (
+ content != transition.fromContent &&
+ content != transition.toContent &&
+ (!isReplacingOverlay || content != transition.currentScene)
+ ) {
return false
}
// Place the element if it is not shared.
- if (
- transition.fromContent !in element.stateByContent ||
- transition.toContent !in element.stateByContent
- ) {
+ var copies = 0
+ if (transition.fromContent in element.stateByContent) copies++
+ if (transition.toContent in element.stateByContent) copies++
+ if (isReplacingOverlay && transition.currentScene in element.stateByContent) copies++
+ if (copies <= 1) {
return true
}
@@ -1139,7 +1142,7 @@
Offset.Unspecified
} else {
a.pivot.specifiedOrCenter() - b.pivot.specifiedOrCenter()
- }
+ },
)
},
add = { a, b, bProgress ->
@@ -1151,9 +1154,9 @@
Offset.Unspecified
} else {
a.pivot.specifiedOrCenter() + b.pivot.specifiedOrCenter() * bProgress
- }
+ },
)
- }
+ },
)
stateInContent.lastScale = interruptedScale
@@ -1272,9 +1275,10 @@
// If we are replacing an overlay and the element is both in a single overlay and in the current
// scene, interpolate the state of the element using the current scene as the other scene.
+ var currentSceneState: Element.State? = null
if (!isSharedElement && transition is TransitionState.Transition.ReplaceOverlay) {
- val currentSceneState = element.stateByContent[transition.currentScene]
- if (currentSceneState != null) {
+ currentSceneState = element.stateByContent[transition.currentScene]
+ if (currentSceneState != null && isSharedElementEnabled(element.key, transition)) {
return interpolateSharedElement(
transition = transition,
contentValue = contentValue,
@@ -1293,6 +1297,8 @@
when {
isSharedElement && currentContent == fromContent -> fromState
isSharedElement -> toState
+ currentSceneState != null && currentContent == transition.currentScene ->
+ currentSceneState
else -> fromState ?: toState
}
)
@@ -1371,7 +1377,7 @@
lerp(
lerp(previewTargetValue, targetValueOrNull ?: idleValue, previewRangeProgress),
idleValue,
- transformation?.range?.progress(transition.progress) ?: transition.progress
+ transformation?.range?.progress(transition.progress) ?: transition.progress,
)
} else {
if (targetValueOrNull == null) {
@@ -1384,7 +1390,7 @@
lerp(
lerp(idleValue, previewTargetValue, previewRangeProgress),
targetValueOrNull,
- transformation.range?.progress(transition.progress) ?: transition.progress
+ transformation.range?.progress(transition.progress) ?: transition.progress,
)
}
}
@@ -1399,14 +1405,7 @@
val idleValue = contentValue(contentState)
val targetValue =
- transformation.transform(
- layoutImpl,
- content,
- element,
- contentState,
- transition,
- idleValue,
- )
+ transformation.transform(layoutImpl, content, element, contentState, transition, idleValue)
// Make sure we don't read progress if values are the same and we don't need to interpolate, so
// we don't invalidate the phase where this is read.
@@ -1419,7 +1418,13 @@
val rangeProgress = transformation.range?.progress(progress) ?: progress
// Interpolate between the value at rest and the value before entering/after leaving.
- val isEntering = content == toContent
+ val isEntering =
+ when {
+ content == toContent -> true
+ content == fromContent -> false
+ content == transition.currentScene -> toState == null
+ else -> content == toContent
+ }
return if (isEntering) {
lerp(targetValue, idleValue, rangeProgress)
} else {
@@ -1433,7 +1438,7 @@
fromState: Element.State,
toState: Element.State,
isSpecified: (T) -> Boolean,
- lerp: (T, T, Float) -> T
+ lerp: (T, T, Float) -> T,
): T {
val start = contentValue(fromState)
val end = contentValue(toState)
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/InterruptionHandler.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/InterruptionHandler.kt
index cb18c67..2057146 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/InterruptionHandler.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/InterruptionHandler.kt
@@ -79,9 +79,6 @@
interrupted: TransitionState.Transition.ChangeScene,
newTargetScene: SceneKey,
): InterruptionResult {
- return InterruptionResult(
- animateFrom = interrupted.currentScene,
- chain = true,
- )
+ return InterruptionResult(animateFrom = interrupted.currentScene, chain = true)
}
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Key.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Key.kt
index ced177c..f9a9eeb 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Key.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Key.kt
@@ -49,10 +49,7 @@
}
/** Key for a scene. */
-class SceneKey(
- debugName: String,
- identity: Any = Object(),
-) : ContentKey(debugName, identity) {
+class SceneKey(debugName: String, identity: Any = Object()) : ContentKey(debugName, identity) {
override val testTag: String = "scene:$debugName"
/** The unique [ElementKey] identifying this scene's root element. */
@@ -64,10 +61,7 @@
}
/** Key for an overlay. */
-class OverlayKey(
- debugName: String,
- identity: Any = Object(),
-) : ContentKey(debugName, identity) {
+class OverlayKey(debugName: String, identity: Any = Object()) : ContentKey(debugName, identity) {
override val testTag: String = "overlay:$debugName"
override fun toString(): String {
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MovableElement.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MovableElement.kt
index 471ad3f..1f26b71 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MovableElement.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MovableElement.kt
@@ -86,7 +86,7 @@
value: T,
key: ValueKey,
type: SharedValueType<T, *>,
- canOverflow: Boolean
+ canOverflow: Boolean,
): AnimatedState<T> {
return animateSharedValueAsState(
layoutImpl,
@@ -200,7 +200,7 @@
content,
element,
elementState,
- isInContent = { contents.contains(it) }
+ isInContent = { contents.contains(it) },
)
}
}
@@ -220,11 +220,7 @@
elementState: TransitionState.Idle,
): ContentKey {
val contents = element.contentPicker.contents
- return elementContentWhenIdle(
- layoutImpl,
- elementState,
- isInContent = { contents.contains(it) },
- )
+ return elementContentWhenIdle(layoutImpl, elementState, isInContent = { contents.contains(it) })
}
/**
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt
index 0d05f4e..fb9dde3 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt
@@ -200,7 +200,7 @@
override fun onPointerEvent(
pointerEvent: PointerEvent,
pass: PointerEventPass,
- bounds: IntSize
+ bounds: IntSize,
) {
// The order is important here: the tracker is always called first.
pointerTracker.onPointerEvent(pointerEvent, pass, bounds)
@@ -234,8 +234,8 @@
pointersDown == 0 -> {
startedPosition = null
- // This is the last pointer up
- velocityTracker.addPointerInputChange(changes.single())
+ val lastPointerUp = changes.single { it.id == velocityPointerId }
+ velocityTracker.addPointerInputChange(lastPointerUp)
}
// The first pointer down, startedPosition was not set.
@@ -271,7 +271,12 @@
// If the previous pointer has been removed, we use the first available
// change to keep tracking the velocity.
- velocityPointerId = pointerChange.id
+ velocityPointerId =
+ if (pointerChange.pressed) {
+ pointerChange.id
+ } else {
+ changes.first { it.pressed }.id
+ }
velocityTracker.addPointerInputChange(pointerChange)
}
@@ -312,13 +317,13 @@
velocityTracker.calculateVelocity(maxVelocity)
}
.toFloat(),
- onFling = { controller.onStop(it, canChangeContent = true) }
+ onFling = { controller.onStop(it, canChangeContent = true) },
)
},
onDragCancel = { controller ->
startFlingGesture(
initialVelocity = 0f,
- onFling = { controller.onStop(it, canChangeContent = true) }
+ onFling = { controller.onStop(it, canChangeContent = true) },
)
},
swipeDetector = swipeDetector,
@@ -369,10 +374,7 @@
// PreScroll phase
val consumedByPreScroll =
dispatcher
- .dispatchPreScroll(
- available = availableOnPreScroll.toOffset(),
- source = source,
- )
+ .dispatchPreScroll(available = availableOnPreScroll.toOffset(), source = source)
.toFloat()
// Scroll phase
@@ -484,12 +486,12 @@
Orientation.Horizontal ->
awaitHorizontalTouchSlopOrCancellation(
consumablePointer.id,
- onSlopReached
+ onSlopReached,
)
Orientation.Vertical ->
awaitVerticalTouchSlopOrCancellation(
consumablePointer.id,
- onSlopReached
+ onSlopReached,
)
}
@@ -553,7 +555,7 @@
}
private suspend fun AwaitPointerEventScope.awaitConsumableEvent(
- pass: () -> PointerEventPass,
+ pass: () -> PointerEventPass
): PointerEvent {
fun canBeConsumed(changes: List<PointerInputChange>): Boolean {
// At least one pointer down AND
@@ -661,7 +663,4 @@
fun pointersInfo(): PointersInfo
}
-internal data class PointersInfo(
- val startedPosition: Offset?,
- val pointersDown: Int,
-)
+internal data class PointersInfo(val startedPosition: Offset?, val pointersDown: Int)
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt
index 8ae3a11..30eb302 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt
@@ -57,10 +57,8 @@
/** No transition/animation is currently running. */
data class Idle
@JvmOverloads
- constructor(
- val currentScene: SceneKey,
- val currentOverlays: Set<OverlayKey> = emptySet(),
- ) : ObservableTransitionState
+ constructor(val currentScene: SceneKey, val currentOverlays: Set<OverlayKey> = emptySet()) :
+ ObservableTransitionState
/** There is a transition animating between two scenes. */
sealed class Transition(
@@ -208,6 +206,17 @@
(from == null || this.fromContent == from) &&
(to == null || this.toContent == to)
}
+
+ /** Whether we are transitioning from [content] to [other], or from [other] to [content]. */
+ fun isTransitioningBetween(content: ContentKey, other: ContentKey): Boolean {
+ return isTransitioning(from = content, to = other) ||
+ isTransitioning(from = other, to = content)
+ }
+
+ /** Whether we are transitioning from or to [content]. */
+ fun isTransitioningFromOrTo(content: ContentKey): Boolean {
+ return isTransitioning(from = content) || isTransitioning(to = content)
+ }
}
/**
@@ -219,10 +228,7 @@
return snapshotFlow {
when (val state = transitionState) {
is TransitionState.Idle ->
- ObservableTransitionState.Idle(
- state.currentScene,
- state.currentOverlays,
- )
+ ObservableTransitionState.Idle(state.currentScene, state.currentOverlays)
is TransitionState.Transition.ChangeScene -> {
ObservableTransitionState.Transition.ChangeScene(
fromScene = state.fromScene,
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/PredictiveBackHandler.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/PredictiveBackHandler.kt
index 8480d3a..b00c8ad 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/PredictiveBackHandler.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/PredictiveBackHandler.kt
@@ -35,9 +35,7 @@
layoutImpl: SceneTransitionLayoutImpl,
result: UserActionResult?,
) {
- PredictiveBackHandler(
- enabled = result != null,
- ) { events: Flow<BackEventCompat> ->
+ PredictiveBackHandler(enabled = result != null) { events: Flow<BackEventCompat> ->
if (result == null) {
// Note: We have to collect progress otherwise PredictiveBackHandler will throw.
events.first()
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt
index 061613f..f20548b 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt
@@ -379,6 +379,10 @@
return this to UserActionResult(toScene = scene)
}
+ infix fun to(overlay: OverlayKey): Pair<UserAction, UserActionResult> {
+ return this to UserActionResult(toOverlay = overlay)
+ }
+
/** Resolve this into a [Resolved] user action given [layoutDirection]. */
internal abstract fun resolve(layoutDirection: LayoutDirection): Resolved
@@ -475,7 +479,7 @@
position: IntOffset,
density: Density,
orientation: Orientation,
- ): SwipeSource?
+ ): SwipeSource.Resolved?
}
/** The result of performing a [UserAction]. */
@@ -581,7 +585,7 @@
*/
fun UserActionDistanceScope.absoluteDistance(
fromSceneSize: IntSize,
- orientation: Orientation
+ orientation: Orientation,
): Float
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
index f36c0fa..fe05234 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
@@ -253,7 +253,7 @@
key: OverlayKey,
userActions: Map<UserAction, UserActionResult>,
alignment: Alignment,
- content: @Composable (ContentScope.() -> Unit)
+ content: @Composable (ContentScope.() -> Unit),
) {
overlaysDefined = true
overlaysToRemove.remove(key)
@@ -291,7 +291,7 @@
private fun resolveUserActions(
key: ContentKey,
userActions: Map<UserAction, UserActionResult>,
- layoutDirection: LayoutDirection
+ layoutDirection: LayoutDirection,
): Map<UserAction.Resolved, UserActionResult> {
return userActions
.mapKeys { it.key.resolve(layoutDirection) }
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt
index c2d5dd05..dbff8a4 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt
@@ -328,9 +328,7 @@
): Job {
// Note that we start with UNDISPATCHED so that startTransition() is called directly and
// transition becomes the current [transitionState] right after this call.
- return animationScope.launch(
- start = CoroutineStart.UNDISPATCHED,
- ) {
+ return animationScope.launch(start = CoroutineStart.UNDISPATCHED) {
startTransition(transition, chain)
}
}
@@ -461,7 +459,7 @@
val indicator = if (finishedTransitions.contains(transition)) "x" else " "
appendLine(" [$indicator] $from => $to ($transition)")
}
- }
+ },
)
}
@@ -621,7 +619,7 @@
override fun showOverlay(
overlay: OverlayKey,
animationScope: CoroutineScope,
- transitionKey: TransitionKey?
+ transitionKey: TransitionKey?,
) {
checkThread()
@@ -654,7 +652,7 @@
) {
animate(
replacedTransition = currentState,
- reversed = overlay == currentState.fromContent
+ reversed = overlay == currentState.fromContent,
)
} else {
animate()
@@ -664,7 +662,7 @@
override fun hideOverlay(
overlay: OverlayKey,
animationScope: CoroutineScope,
- transitionKey: TransitionKey?
+ transitionKey: TransitionKey?,
) {
checkThread()
@@ -705,7 +703,7 @@
from: OverlayKey,
to: OverlayKey,
animationScope: CoroutineScope,
- transitionKey: TransitionKey?
+ transitionKey: TransitionKey?,
) {
checkThread()
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt
index e65ed9b..b358faf 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt
@@ -50,7 +50,7 @@
private val transitionCache =
mutableMapOf<
ContentKey,
- MutableMap<ContentKey, MutableMap<TransitionKey?, TransitionSpecImpl>>
+ MutableMap<ContentKey, MutableMap<TransitionKey?, TransitionSpecImpl>>,
>()
private val overscrollCache =
@@ -70,7 +70,7 @@
private fun findSpec(
from: ContentKey,
to: ContentKey,
- key: TransitionKey?
+ key: TransitionKey?,
): TransitionSpecImpl {
val spec = transition(from, to, key) { it.from == from && it.to == to }
if (spec != null) {
@@ -250,7 +250,7 @@
override val to: ContentKey?,
private val previewTransformationSpec: (() -> TransformationSpecImpl)? = null,
private val reversePreviewTransformationSpec: (() -> TransformationSpecImpl)? = null,
- private val transformationSpec: () -> TransformationSpecImpl
+ private val transformationSpec: () -> TransformationSpecImpl,
) : TransitionSpec {
override fun reversed(): TransitionSpecImpl {
return TransitionSpecImpl(
@@ -265,9 +265,9 @@
progressSpec = reverse.progressSpec,
swipeSpec = reverse.swipeSpec,
distance = reverse.distance,
- transformations = reverse.transformations.map { it.reversed() }
+ transformations = reverse.transformations.map { it.reversed() },
)
- }
+ },
)
}
@@ -382,11 +382,7 @@
return ElementTransformations(shared, offset, size, drawScale, alpha)
}
- private fun throwIfNotNull(
- previous: Transformation?,
- element: ElementKey,
- name: String,
- ) {
+ private fun throwIfNotNull(previous: Transformation?, element: ElementKey, name: String) {
if (previous != null) {
error("$element has multiple $name transformations")
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt
index 2a09a77..84dce0d 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt
@@ -54,7 +54,7 @@
result: UserActionResult,
isUpOrLeft: Boolean,
orientation: Orientation,
- distance: Float = DistanceUnspecified
+ distance: Float = DistanceUnspecified,
): SwipeAnimation<*> {
var lastDistance = distance
@@ -312,11 +312,16 @@
fun isAnimatingOffset(): Boolean = offsetAnimation != null
+ /**
+ * Animate the offset to a [targetContent], using the [initialVelocity] and an optional [spec]
+ *
+ * @return the velocity consumed
+ */
fun animateOffset(
initialVelocity: Float,
targetContent: T,
spec: AnimationSpec<Float>? = null,
- ) {
+ ): Float {
check(!isAnimatingOffset()) { "SwipeAnimation.animateOffset() can only be called once" }
val initialProgress = progress
@@ -374,7 +379,7 @@
if (skipAnimation) {
// Unblock the job.
offsetAnimationRunnable.complete(null)
- return
+ return 0f
}
val isTargetGreater = targetOffset > animatable.value
@@ -424,6 +429,9 @@
/* Ignore. */
}
}
+
+ // This animation always consumes the whole available velocity
+ return initialVelocity
}
/** An exception thrown during the animation to stop it immediately. */
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeToScene.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeToScene.kt
index dc7eda5..98d4aaa 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeToScene.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeToScene.kt
@@ -39,14 +39,14 @@
@Stable
internal fun Modifier.swipeToScene(
draggableHandler: DraggableHandlerImpl,
- swipeDetector: SwipeDetector
+ swipeDetector: SwipeDetector,
): Modifier {
return this.then(SwipeToSceneElement(draggableHandler, swipeDetector))
}
private data class SwipeToSceneElement(
val draggableHandler: DraggableHandlerImpl,
- val swipeDetector: SwipeDetector
+ val swipeDetector: SwipeDetector,
) : ModifierNodeElement<SwipeToSceneNode>() {
override fun create(): SwipeToSceneNode = SwipeToSceneNode(draggableHandler, swipeDetector)
@@ -183,12 +183,12 @@
*/
private class ScrollBehaviorOwnerNode(
override val traverseKey: Any,
- val nestedScrollHandlerImpl: NestedScrollHandlerImpl
+ val nestedScrollHandlerImpl: NestedScrollHandlerImpl,
) : Modifier.Node(), TraversableNode, ScrollBehaviorOwner {
override fun updateScrollBehaviors(
topOrLeftBehavior: NestedScrollBehavior,
bottomOrRightBehavior: NestedScrollBehavior,
- isExternalOverscrollGesture: () -> Boolean
+ isExternalOverscrollGesture: () -> Boolean,
) {
nestedScrollHandlerImpl.topOrLeftBehavior = topOrLeftBehavior
nestedScrollHandlerImpl.bottomOrRightBehavior = bottomOrRightBehavior
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt
index 1f82e0b..763dc6b 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt
@@ -333,7 +333,7 @@
element: ElementKey,
transition: TransitionState.Transition,
fromContentZIndex: Float,
- toContentZIndex: Float
+ toContentZIndex: Float,
): ContentKey {
return if (fromContentZIndex > toContentZIndex) {
transition.fromContent
@@ -354,7 +354,7 @@
element: ElementKey,
transition: TransitionState.Transition,
fromContentZIndex: Float,
- toContentZIndex: Float
+ toContentZIndex: Float,
): ContentKey {
return HighestZIndexContentPicker.contentDuringTransition(
element,
@@ -375,7 +375,7 @@
element: ElementKey,
transition: TransitionState.Transition,
fromContentZIndex: Float,
- toContentZIndex: Float
+ toContentZIndex: Float,
): ContentKey {
return if (fromContentZIndex < toContentZIndex) {
transition.fromContent
@@ -396,7 +396,7 @@
element: ElementKey,
transition: TransitionState.Transition,
fromContentZIndex: Float,
- toContentZIndex: Float
+ toContentZIndex: Float,
): ContentKey {
return LowestZIndexContentPicker.contentDuringTransition(
element,
@@ -423,9 +423,8 @@
* is not the same as when going from scene B to scene A, so it's not usable in situations where
* z-ordering during the transition matters.
*/
-class MovableElementContentPicker(
- override val contents: Set<ContentKey>,
-) : StaticElementContentPicker {
+class MovableElementContentPicker(override val contents: Set<ContentKey>) :
+ StaticElementContentPicker {
override fun contentDuringTransition(
element: ElementKey,
transition: TransitionState.Transition,
@@ -501,7 +500,7 @@
matcher: ElementMatcher,
scaleX: Float = 1f,
scaleY: Float = 1f,
- pivot: Offset = Offset.Unspecified
+ pivot: Offset = Offset.Unspecified,
)
/**
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt
index da4c8d8..7ec5e4f 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt
@@ -41,9 +41,7 @@
import com.android.compose.animation.scene.transformation.TransformationRange
import com.android.compose.animation.scene.transformation.Translate
-internal fun transitionsImpl(
- builder: SceneTransitionsBuilder.() -> Unit,
-): SceneTransitions {
+internal fun transitionsImpl(builder: SceneTransitionsBuilder.() -> Unit): SceneTransitions {
val impl = SceneTransitionsBuilderImpl().apply(builder)
return SceneTransitions(
impl.defaultSwipeSpec,
@@ -67,7 +65,7 @@
key: TransitionKey?,
preview: (TransitionBuilder.() -> Unit)?,
reversePreview: (TransitionBuilder.() -> Unit)?,
- builder: TransitionBuilder.() -> Unit
+ builder: TransitionBuilder.() -> Unit,
): TransitionSpec {
return transition(from = null, to = to, key = key, preview, reversePreview, builder)
}
@@ -78,7 +76,7 @@
key: TransitionKey?,
preview: (TransitionBuilder.() -> Unit)?,
reversePreview: (TransitionBuilder.() -> Unit)?,
- builder: TransitionBuilder.() -> Unit
+ builder: TransitionBuilder.() -> Unit,
): TransitionSpec {
return transition(from = from, to = to, key = key, preview, reversePreview, builder)
}
@@ -86,7 +84,7 @@
override fun overscroll(
content: ContentKey,
orientation: Orientation,
- builder: OverscrollBuilder.() -> Unit
+ builder: OverscrollBuilder.() -> Unit,
): OverscrollSpec {
val impl = OverscrollBuilderImpl().apply(builder)
check(impl.transformations.isNotEmpty()) {
@@ -150,7 +148,7 @@
to,
previewTransformationSpec,
reversePreviewTransformationSpec,
- transformationSpec
+ transformationSpec,
)
transitionSpecs.add(spec)
return spec
@@ -167,7 +165,7 @@
start: Float?,
end: Float?,
easing: Easing,
- builder: PropertyTransformationBuilder.() -> Unit
+ builder: PropertyTransformationBuilder.() -> Unit,
) {
range = TransformationRange(start, end, easing)
builder()
@@ -202,7 +200,7 @@
override fun translate(
matcher: ElementMatcher,
edge: Edge,
- startsOutsideLayoutBounds: Boolean
+ startsOutsideLayoutBounds: Boolean,
) {
transformation(EdgeTranslate(matcher, edge, startsOutsideLayoutBounds))
}
@@ -256,7 +254,7 @@
startMillis: Int?,
endMillis: Int?,
easing: Easing,
- builder: PropertyTransformationBuilder.() -> Unit
+ builder: PropertyTransformationBuilder.() -> Unit,
) {
if (startMillis != null && (startMillis < 0 || startMillis > durationMillis)) {
error("invalid start value: startMillis=$startMillis durationMillis=$durationMillis")
@@ -278,7 +276,7 @@
override fun translate(
matcher: ElementMatcher,
x: OverscrollScope.() -> Float,
- y: OverscrollScope.() -> Float
+ y: OverscrollScope.() -> Float,
) {
transformation(OverscrollTranslate(matcher, x, y))
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/UserActionDistanceScopeImpl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/UserActionDistanceScopeImpl.kt
index 9851b32..b7fa0d4 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/UserActionDistanceScopeImpl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/UserActionDistanceScopeImpl.kt
@@ -19,9 +19,8 @@
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.unit.IntSize
-internal class ElementStateScopeImpl(
- private val layoutImpl: SceneTransitionLayoutImpl,
-) : ElementStateScope {
+internal class ElementStateScopeImpl(private val layoutImpl: SceneTransitionLayoutImpl) :
+ ElementStateScope {
override fun ElementKey.targetSize(scene: SceneKey): IntSize? {
return layoutImpl.elements[this]?.stateByContent?.get(scene)?.targetSize.takeIf {
it != Element.SizeUnspecified
@@ -39,9 +38,8 @@
}
}
-internal class UserActionDistanceScopeImpl(
- private val layoutImpl: SceneTransitionLayoutImpl,
-) : UserActionDistanceScope, ElementStateScope by layoutImpl.elementStateScope {
+internal class UserActionDistanceScopeImpl(private val layoutImpl: SceneTransitionLayoutImpl) :
+ UserActionDistanceScope, ElementStateScope by layoutImpl.elementStateScope {
override val density: Float
get() = layoutImpl.density.density
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt
index 59dd896..c8407b1 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt
@@ -106,7 +106,7 @@
override fun Element(
key: ElementKey,
modifier: Modifier,
- content: @Composable (ElementScope<ElementContentScope>.() -> Unit)
+ content: @Composable (ElementScope<ElementContentScope>.() -> Unit),
) {
Element(layoutImpl, this@ContentScopeImpl.content, key, modifier, content)
}
@@ -115,7 +115,7 @@
override fun MovableElement(
key: MovableElementKey,
modifier: Modifier,
- content: @Composable (ElementScope<MovableElementContentScope>.() -> Unit)
+ content: @Composable (ElementScope<MovableElementContentScope>.() -> Unit),
) {
MovableElement(layoutImpl, this@ContentScopeImpl.content, key, modifier, content)
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/state/TransitionState.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/state/TransitionState.kt
index a47caaa..364c203 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/state/TransitionState.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/state/TransitionState.kt
@@ -184,7 +184,7 @@
private fun computeCurrentOverlays(
include: OverlayKey,
- exclude: OverlayKey
+ exclude: OverlayKey,
): Set<OverlayKey> {
return buildSet {
addAll(currentOverlaysWhenTransitionStarted)
@@ -336,9 +336,7 @@
return specForCurrentScene.transformationSpec.transformations.isNotEmpty()
}
- internal open fun interruptionProgress(
- layoutImpl: SceneTransitionLayoutImpl,
- ): Float {
+ internal open fun interruptionProgress(layoutImpl: SceneTransitionLayoutImpl): Float {
if (!layoutImpl.state.enableInterruptions) {
return 0f
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/modifiers/SizeMatcher.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/modifiers/SizeMatcher.kt
index a4bd2be..4698e58 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/modifiers/SizeMatcher.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/modifiers/SizeMatcher.kt
@@ -119,9 +119,8 @@
return this.then(SizeMatcherDestinationElement(matcher))
}
-private data class SizeMatcherSourceNodeElement(
- private val matcher: SizeMatcher,
-) : ModifierNodeElement<SizeMatcherSourceNode>() {
+private data class SizeMatcherSourceNodeElement(private val matcher: SizeMatcher) :
+ ModifierNodeElement<SizeMatcherSourceNode>() {
override fun create(): SizeMatcherSourceNode = SizeMatcherSourceNode(matcher)
override fun update(node: SizeMatcherSourceNode) {
@@ -129,9 +128,8 @@
}
}
-private class SizeMatcherSourceNode(
- private var matcher: SizeMatcher,
-) : Modifier.Node(), LayoutModifierNode {
+private class SizeMatcherSourceNode(private var matcher: SizeMatcher) :
+ Modifier.Node(), LayoutModifierNode {
override fun onAttach() {
matcher.source = this
}
@@ -150,7 +148,7 @@
override fun MeasureScope.measure(
measurable: Measurable,
- constraints: Constraints
+ constraints: Constraints,
): MeasureResult {
return measurable.measure(constraints).run {
matcher.sourceSize = IntSize(width, height)
@@ -159,9 +157,8 @@
}
}
-private data class SizeMatcherDestinationElement(
- private val matcher: SizeMatcher,
-) : ModifierNodeElement<SizeMatcherDestinationNode>() {
+private data class SizeMatcherDestinationElement(private val matcher: SizeMatcher) :
+ ModifierNodeElement<SizeMatcherDestinationNode>() {
override fun create(): SizeMatcherDestinationNode = SizeMatcherDestinationNode(matcher)
override fun update(node: SizeMatcherDestinationNode) {
@@ -169,9 +166,8 @@
}
}
-private class SizeMatcherDestinationNode(
- private var matcher: SizeMatcher,
-) : Modifier.Node(), LayoutModifierNode {
+private class SizeMatcherDestinationNode(private var matcher: SizeMatcher) :
+ Modifier.Node(), LayoutModifierNode {
override fun onAttach() {
this.matcher.destinations.add(this)
}
@@ -190,7 +186,7 @@
override fun MeasureScope.measure(
measurable: Measurable,
- constraints: Constraints
+ constraints: Constraints,
): MeasureResult {
val preferredSize = matcher.sourceSize
val preferredConstraints = Constraints.fixed(preferredSize.width, preferredSize.height)
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/AnchoredTranslate.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/AnchoredTranslate.kt
index 05878c2..86e06ab 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/AnchoredTranslate.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/AnchoredTranslate.kt
@@ -61,15 +61,9 @@
val offset = anchorToOffset - anchorFromOffset
return if (content == transition.toContent) {
- Offset(
- value.x - offset.x,
- value.y - offset.y,
- )
+ Offset(value.x - offset.x, value.y - offset.y)
} else {
- Offset(
- value.x + offset.x,
- value.y + offset.y,
- )
+ Offset(value.x + offset.x, value.y + offset.y)
}
}
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/EdgeTranslate.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/EdgeTranslate.kt
index a32c7dd..031f50e 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/EdgeTranslate.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/EdgeTranslate.kt
@@ -36,7 +36,7 @@
element: Element,
stateInContent: Element.State,
transition: TransitionState.Transition,
- value: Offset
+ value: Offset,
): Offset {
val sceneSize = layoutImpl.content(content).targetSize
val elementSize = stateInContent.targetSize
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Fade.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Fade.kt
index 4528eef..078aa0f 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Fade.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Fade.kt
@@ -23,16 +23,14 @@
import com.android.compose.animation.scene.content.state.TransitionState
/** Fade an element in or out. */
-internal class Fade(
- override val matcher: ElementMatcher,
-) : PropertyTransformation<Float> {
+internal class Fade(override val matcher: ElementMatcher) : PropertyTransformation<Float> {
override fun transform(
layoutImpl: SceneTransitionLayoutImpl,
content: ContentKey,
element: Element,
stateInContent: Element.State,
transition: TransitionState.Transition,
- value: Float
+ value: Float,
): Float {
// Return the alpha value of [element] either when it starts fading in or when it finished
// fading out, which is `0` in both cases.
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Transformation.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Transformation.kt
index 505ad04..9bb3023 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Transformation.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Transformation.kt
@@ -83,17 +83,13 @@
override fun reversed(): Transformation {
return RangedPropertyTransformation(
delegate.reversed() as PropertyTransformation<T>,
- range.reversed()
+ range.reversed(),
)
}
}
/** The progress-based range of a [PropertyTransformation]. */
-data class TransformationRange(
- val start: Float,
- val end: Float,
- val easing: Easing,
-) {
+data class TransformationRange(val start: Float, val end: Float, val easing: Easing) {
constructor(
start: Float? = null,
end: Float? = null,
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Translate.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Translate.kt
index 8f84586..7014271 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Translate.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transformation/Translate.kt
@@ -40,12 +40,7 @@
transition: TransitionState.Transition,
value: Offset,
): Offset {
- return with(layoutImpl.density) {
- Offset(
- value.x + x.toPx(),
- value.y + y.toPx(),
- )
- }
+ return with(layoutImpl.density) { Offset(value.x + x.toPx(), value.y + y.toPx()) }
}
}
@@ -71,10 +66,7 @@
val overscrollScope =
cachedOverscrollScope.getFromCacheOrCompute(layoutImpl.density, overscrollProperties)
- return Offset(
- x = value.x + overscrollScope.x(),
- y = value.y + overscrollScope.y(),
- )
+ return Offset(x = value.x + overscrollScope.x(), y = value.y + overscrollScope.y())
}
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transition/link/StateLink.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transition/link/StateLink.kt
index c830ca4..2aec509 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transition/link/StateLink.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/transition/link/StateLink.kt
@@ -50,9 +50,7 @@
error("From and To can't be the same")
}
- internal fun isMatchingLink(
- transition: TransitionState.Transition,
- ): Boolean {
+ internal fun isMatchingLink(transition: TransitionState.Transition): Boolean {
return (sourceFrom == null || sourceFrom == transition.fromContent) &&
(sourceTo == null || sourceTo == transition.toContent)
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt b/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt
index 790665a..f49939b 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt
@@ -99,10 +99,7 @@
}
}
- Layout(
- modifier = modifier,
- content = content,
- ) { measurables, constraints ->
+ Layout(modifier = modifier, content = content) { measurables, constraints ->
val cells = measurables.size
val columns: Int
val rows: Int
@@ -142,7 +139,7 @@
(constraints.maxHeight - totalVerticalSpacingBetweenChildren) / rows
} else {
Constraints.Infinity
- }
+ },
)
val placeables = buildList {
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/MathHelpers.kt b/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/MathHelpers.kt
index e78ab29..0447c36 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/MathHelpers.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/MathHelpers.kt
@@ -27,7 +27,7 @@
fun lerp(start: IntSize, stop: IntSize, fraction: Float): IntSize {
return IntSize(
lerp(start.width, stop.width, fraction),
- lerp(start.height, stop.height, fraction)
+ lerp(start.height, stop.height, fraction),
)
}
@@ -43,6 +43,6 @@
return Scale(
lerp(start.scaleX, stop.scaleX, fraction),
lerp(start.scaleY, stop.scaleY, fraction),
- pivot
+ pivot,
)
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/SpaceVectorConverter.kt b/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/SpaceVectorConverter.kt
index a13e944..f08a180 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/SpaceVectorConverter.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/ui/util/SpaceVectorConverter.kt
@@ -22,8 +22,11 @@
interface SpaceVectorConverter {
fun Offset.toFloat(): Float
+
fun Velocity.toFloat(): Float
+
fun Float.toOffset(): Offset
+
fun Float.toVelocity(): Velocity
}
@@ -36,15 +39,21 @@
private val HorizontalConverter =
object : SpaceVectorConverter {
override fun Offset.toFloat() = x
+
override fun Velocity.toFloat() = x
+
override fun Float.toOffset() = Offset(this, 0f)
+
override fun Float.toVelocity() = Velocity(this, 0f)
}
private val VerticalConverter =
object : SpaceVectorConverter {
override fun Offset.toFloat() = y
+
override fun Velocity.toFloat() = y
+
override fun Float.toOffset() = Offset(0f, this)
+
override fun Float.toVelocity() = Velocity(0f, this)
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/systemui/communal/ui/compose/CommunalSwipeDetector.kt b/packages/SystemUI/compose/scene/src/com/android/systemui/communal/ui/compose/CommunalSwipeDetector.kt
index 3fda9b8..00e5405 100644
--- a/packages/SystemUI/compose/scene/src/com/android/systemui/communal/ui/compose/CommunalSwipeDetector.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/systemui/communal/ui/compose/CommunalSwipeDetector.kt
@@ -33,7 +33,7 @@
* SwipeSourceDetector} to enable fullscreen swipe handling to transition to and from the glanceable
* hub.
*/
-class CommunalSwipeDetector(private var lastDirection: SwipeSource? = null) :
+class CommunalSwipeDetector(private var lastDirection: SwipeSource.Resolved? = null) :
SwipeSourceDetector, SwipeDetector {
companion object {
private const val TRAVEL_RATIO_THRESHOLD = .5f
@@ -43,16 +43,16 @@
layoutSize: IntSize,
position: IntOffset,
density: Density,
- orientation: Orientation
- ): SwipeSource? {
+ orientation: Orientation,
+ ): SwipeSource.Resolved? {
return lastDirection
}
override fun detectSwipe(change: PointerInputChange): Boolean {
if (change.positionChange().x > 0) {
- lastDirection = Edge.Left
+ lastDirection = Edge.Resolved.Left
} else {
- lastDirection = Edge.Right
+ lastDirection = Edge.Resolved.Right
}
// Determine whether the ratio of the distance traveled horizontally to the distance
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/AnimatedSharedAsStateTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/AnimatedSharedAsStateTest.kt
index a491349..3644b30 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/AnimatedSharedAsStateTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/AnimatedSharedAsStateTest.kt
@@ -53,12 +53,7 @@
class AnimatedSharedAsStateTest {
@get:Rule val rule = createComposeRule()
- private data class Values(
- val int: Int,
- val float: Float,
- val dp: Dp,
- val color: Color,
- )
+ private data class Values(val int: Int, val float: Float, val dp: Dp, val color: Color)
private fun lerp(start: Values, stop: Values, fraction: Float): Values {
return Values(
@@ -70,10 +65,7 @@
}
@Composable
- private fun ContentScope.Foo(
- targetValues: Values,
- onCurrentValueChanged: (Values) -> Unit,
- ) {
+ private fun ContentScope.Foo(targetValues: Values, onCurrentValueChanged: (Values) -> Unit) {
val key = TestElements.Foo
Element(key, Modifier) {
val int by animateElementIntAsState(targetValues.int, key = TestValues.Value1)
@@ -245,7 +237,7 @@
fromSceneContent = {
SceneValues(
targetValues = fromValues,
- onCurrentValueChanged = { lastValueInFrom = it }
+ onCurrentValueChanged = { lastValueInFrom = it },
)
},
toSceneContent = {
@@ -457,7 +449,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutStateImpl(
SceneA,
- transitions { overscrollDisabled(SceneB, Orientation.Horizontal) }
+ transitions { overscrollDisabled(SceneB, Orientation.Horizontal) },
)
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/DraggableHandlerTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/DraggableHandlerTest.kt
index 79f82c9..fca92ca 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/DraggableHandlerTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/DraggableHandlerTest.kt
@@ -53,9 +53,7 @@
@RunWith(AndroidJUnit4::class)
class DraggableHandlerTest {
- private class TestGestureScope(
- val testScope: MonotonicClockTestScope,
- ) {
+ private class TestGestureScope(val testScope: MonotonicClockTestScope) {
var canChangeScene: (SceneKey) -> Boolean = { true }
val layoutState =
MutableSceneTransitionLayoutStateImpl(
@@ -83,24 +81,14 @@
}
private val scenesBuilder: SceneTransitionLayoutScope.() -> Unit = {
- scene(
- key = SceneA,
- userActions = mutableUserActionsA,
- ) {
- Text("SceneA")
- }
- scene(
- key = SceneB,
- userActions = mutableUserActionsB,
- ) {
- Text("SceneB")
- }
+ scene(key = SceneA, userActions = mutableUserActionsA) { Text("SceneA") }
+ scene(key = SceneB, userActions = mutableUserActionsB) { Text("SceneB") }
scene(
key = SceneC,
userActions =
mapOf(
Swipe.Up to SceneB,
- Swipe(SwipeDirection.Up, fromSource = Edge.Bottom) to SceneA
+ Swipe(SwipeDirection.Up, fromSource = Edge.Bottom) to SceneA,
),
) {
Text("SceneC")
@@ -110,16 +98,12 @@
userActions =
mapOf(
Swipe.Up to UserActionResult.HideOverlay(OverlayA),
- Swipe.Down to UserActionResult.ReplaceByOverlay(OverlayB)
+ Swipe.Down to UserActionResult.ReplaceByOverlay(OverlayB),
),
) {
Text("OverlayA")
}
- overlay(
- key = OverlayB,
- ) {
- Text("OverlayB")
- }
+ overlay(key = OverlayB) { Text("OverlayB") }
}
val transitionInterceptionThreshold = 0.05f
@@ -144,7 +128,7 @@
fun nestedScrollConnection(
nestedScrollBehavior: NestedScrollBehavior,
- isExternalOverscrollGesture: Boolean = false
+ isExternalOverscrollGesture: Boolean = false,
) =
NestedScrollHandlerImpl(
layoutImpl = layoutImpl,
@@ -154,7 +138,7 @@
isExternalOverscrollGesture = { isExternalOverscrollGesture },
pointersInfoOwner = {
PointersInfo(startedPosition = Offset.Zero, pointersDown = 1)
- }
+ },
)
.connection
@@ -202,7 +186,7 @@
progress: Float? = null,
previewProgress: Float? = null,
isInPreviewStage: Boolean? = null,
- isUserInputOngoing: Boolean? = null
+ isUserInputOngoing: Boolean? = null,
): Transition {
val transition = assertThat(transitionState).isSceneTransition()
currentScene?.let { assertThat(transition).hasCurrentScene(it) }
@@ -269,7 +253,7 @@
fun DragController.onDragStopped(
velocity: Float,
canChangeScene: Boolean = true,
- expectedConsumed: Boolean = true
+ expectedConsumed: Boolean = true,
) {
val consumed = onStop(velocity, canChangeScene)
assertThat(consumed).isEqualTo(if (expectedConsumed) velocity else 0f)
@@ -280,16 +264,13 @@
consumedByScroll: Offset = Offset.Zero,
) {
val consumedByPreScroll =
- onPreScroll(
- available = available,
- source = NestedScrollSource.Drag,
- )
+ onPreScroll(available = available, source = NestedScrollSource.Drag)
val consumed = consumedByPreScroll + consumedByScroll
onPostScroll(
consumed = consumed,
available = available - consumed,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
}
@@ -376,7 +357,7 @@
currentScene = SceneA,
isInPreviewStage = true,
previewProgress = 0.1f,
- progress = 0f
+ progress = 0f,
)
// wait for the stop animation
@@ -415,7 +396,7 @@
currentScene = SceneA,
fromScene = SceneA,
toScene = SceneB,
- progress = 0.6f
+ progress = 0.6f,
)
// Reverse direction such that A -> C now with 0.4
@@ -424,7 +405,7 @@
currentScene = SceneA,
fromScene = SceneA,
toScene = SceneC,
- progress = 0.4f
+ progress = 0.4f,
)
// After the drag stopped scene C should be committed
@@ -463,7 +444,7 @@
currentScene = SceneC,
fromScene = SceneC,
toScene = SceneB,
- progress = -0.1f
+ progress = -0.1f,
)
// Reverse drag direction, it will consume the previous drag
@@ -472,7 +453,7 @@
currentScene = SceneC,
fromScene = SceneC,
toScene = SceneB,
- progress = 0.0f
+ progress = 0.0f,
)
// Continue reverse drag direction, it should record progress to Scene B
@@ -481,7 +462,7 @@
currentScene = SceneC,
fromScene = SceneC,
toScene = SceneB,
- progress = 0.1f
+ progress = 0.1f,
)
}
@@ -492,13 +473,13 @@
// Start dragging from the bottom
onDragStarted(
startedPosition = Offset(SCREEN_SIZE * 0.5f, SCREEN_SIZE),
- overSlop = up(fractionOfScreen = 0.1f)
+ overSlop = up(fractionOfScreen = 0.1f),
)
assertTransition(
currentScene = SceneC,
fromScene = SceneC,
toScene = SceneA,
- progress = 0.1f
+ progress = 0.1f,
)
}
@@ -509,14 +490,14 @@
currentScene = SceneA,
fromScene = SceneA,
toScene = SceneC,
- progress = 0.3f
+ progress = 0.3f,
)
dragController.onDragDelta(pixels = up(fractionOfScreen = 0.3f))
assertTransition(
currentScene = SceneA,
fromScene = SceneA,
toScene = SceneC,
- progress = 0.0f
+ progress = 0.0f,
)
}
@@ -537,7 +518,7 @@
currentScene = SceneA,
fromScene = SceneA,
toScene = SceneB,
- progress = 0.2f
+ progress = 0.2f,
)
// Start animation A -> B with progress 0.2 -> 1.0
@@ -552,7 +533,7 @@
currentScene = SceneB,
fromScene = SceneB,
toScene = SceneC,
- progress = 0.2f
+ progress = 0.2f,
)
// After the drag stopped scene C should be committed
@@ -646,7 +627,7 @@
val nestedScroll = nestedScrollConnection(nestedScrollBehavior = EdgeWithPreview)
nestedScroll.onPreScroll(
available = downOffset(fractionOfScreen = 0.1f),
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertIdle(currentScene = SceneA)
}
@@ -658,7 +639,7 @@
nestedScroll.onPostScroll(
consumed = Offset.Zero,
available = Offset.Zero,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertIdle(currentScene = SceneA)
@@ -672,7 +653,7 @@
nestedScroll.onPostScroll(
consumed = Offset.Zero,
available = downOffset(fractionOfScreen = 0.1f),
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertTransition(currentScene = SceneA)
@@ -692,7 +673,7 @@
val consumed =
nestedScroll.onPreScroll(
available = downOffset(fractionOfScreen = 0.1f),
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertThat(progress).isEqualTo(0.2f)
@@ -700,7 +681,7 @@
nestedScroll.onPostScroll(
consumed = consumed,
available = Offset.Zero,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertThat(progress).isEqualTo(0.2f)
@@ -711,7 +692,7 @@
private fun TestGestureScope.preScrollAfterSceneTransition(
firstScroll: Float,
- secondScroll: Float
+ secondScroll: Float,
) {
val nestedScroll = nestedScrollConnection(nestedScrollBehavior = EdgeWithPreview)
// start scene transition
@@ -723,7 +704,7 @@
// a pre scroll event, that could be intercepted by DraggableHandlerImpl
nestedScroll.onPreScroll(
available = Offset(0f, secondScroll),
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
}
@@ -835,7 +816,7 @@
// scroll consumed in child
nestedScroll.scroll(
available = downOffset(fractionOfScreen = 0.1f),
- consumedByScroll = downOffset(fractionOfScreen = 0.1f)
+ consumedByScroll = downOffset(fractionOfScreen = 0.1f),
)
// scroll offsetY10 is all available for parents
@@ -879,13 +860,11 @@
val nestedScroll =
nestedScrollConnection(
nestedScrollBehavior = EdgeWithPreview,
- isExternalOverscrollGesture = true
+ isExternalOverscrollGesture = true,
)
// scroll not consumed in child
- nestedScroll.scroll(
- available = downOffset(fractionOfScreen = 0.1f),
- )
+ nestedScroll.scroll(available = downOffset(fractionOfScreen = 0.1f))
// scroll offsetY10 is all available for parents
nestedScroll.scroll(available = downOffset(fractionOfScreen = 0.1f))
@@ -1015,7 +994,7 @@
layoutState.startTransitionImmediately(
animationScope = testScope.backgroundScope,
- transition(SceneA, SceneB)
+ transition(SceneA, SceneB),
)
assertThat(draggableHandler.shouldImmediatelyIntercept(startedPosition = null)).isFalse()
}
@@ -1111,7 +1090,7 @@
assertTransition(fromScene = SceneA, toScene = SceneB, progress = 1f)
// Release the finger.
- dragController.onDragStopped(velocity = -velocityThreshold)
+ dragController.onDragStopped(velocity = -velocityThreshold, expectedConsumed = false)
// Exhaust all coroutines *without advancing the clock*. Given that we are at progress >=
// 100% and that the overscroll on scene B is doing nothing, we are already idle.
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
index 60596de..20a1e3c 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
@@ -229,11 +229,7 @@
scene(SceneA) {
Box(Modifier.size(layoutSize)) {
// Transformed element
- Element(
- TestElements.Bar,
- elementSize,
- elementOffset,
- )
+ Element(TestElements.Bar, elementSize, elementOffset)
}
}
scene(SceneB) { Box(Modifier.size(layoutSize)) }
@@ -534,10 +530,7 @@
scene(SceneA) {
// The pages are full-size and beyondBoundsPageCount is 0, so at rest only one
// page should be composed.
- HorizontalPager(
- pagerState,
- beyondViewportPageCount = 0,
- ) { page ->
+ HorizontalPager(pagerState, beyondViewportPageCount = 0) { page ->
when (page) {
0 -> Box(Modifier.element(TestElements.Foo).fillMaxSize())
1 -> Box(Modifier.fillMaxSize())
@@ -606,7 +599,7 @@
scaleSize(TestElements.Foo, width = 2f, height = 0.5f)
translate(TestElements.Foo, x = 10.dp, y = 10.dp)
fade(TestElements.Foo)
- }
+ },
) {
before { assertThat(fooCompositions).isEqualTo(1) }
at(16) { assertThat(fooCompositions).isEqualTo(1) }
@@ -627,7 +620,7 @@
from(SceneA, to = SceneB) {
scaleSize(TestElements.Foo, width = 2f, height = 2f)
}
- }
+ },
)
}
@@ -676,13 +669,13 @@
touchSlop = LocalViewConfiguration.current.touchSlop
SceneTransitionLayout(
state = state,
- modifier = Modifier.size(layoutWidth, layoutHeight)
+ modifier = Modifier.size(layoutWidth, layoutHeight),
) {
scene(key = SceneA, userActions = mapOf(Swipe.Down to SceneB)) {
animateContentFloatAsState(
value = animatedFloatRange.start,
key = TestValues.Value1,
- false
+ false,
)
Spacer(Modifier.fillMaxSize())
}
@@ -691,7 +684,7 @@
animateContentFloatAsState(
value = animatedFloatRange.endInclusive,
key = TestValues.Value1,
- canOverflow = false
+ canOverflow = false,
)
Spacer(Modifier.element(TestElements.Foo).fillMaxSize())
LaunchedEffect(Unit) {
@@ -786,7 +779,7 @@
progressConverter = ProgressConverter.linear()
translate(TestElements.Foo, y = overscrollTranslateY)
}
- }
+ },
)
as MutableSceneTransitionLayoutStateImpl
}
@@ -795,7 +788,7 @@
touchSlop = LocalViewConfiguration.current.touchSlop
SceneTransitionLayout(
state = state,
- modifier = Modifier.size(layoutWidth, layoutHeight)
+ modifier = Modifier.size(layoutWidth, layoutHeight),
) {
scene(SceneA) { Spacer(Modifier.fillMaxSize()) }
scene(SceneB, userActions = mapOf(Swipe.Up to SceneA)) {
@@ -804,7 +797,7 @@
// A scrollable that does not consume the scroll gesture
.scrollable(
rememberScrollableState(consumeScrollDelta = { 0f }),
- Orientation.Vertical
+ Orientation.Vertical,
)
.fillMaxSize()
) {
@@ -869,18 +862,18 @@
touchSlop = LocalViewConfiguration.current.touchSlop
SceneTransitionLayout(
state = state,
- modifier = Modifier.size(layoutWidth, layoutHeight)
+ modifier = Modifier.size(layoutWidth, layoutHeight),
) {
scene(
SceneA,
- userActions = mapOf(Swipe(SwipeDirection.Down, pointerCount = 2) to SceneB)
+ userActions = mapOf(Swipe(SwipeDirection.Down, pointerCount = 2) to SceneB),
) {
Box(
Modifier
// A scrollable that does not consume the scroll gesture
.scrollable(
rememberScrollableState(consumeScrollDelta = { 0f }),
- Orientation.Vertical
+ Orientation.Vertical,
)
.fillMaxSize()
) {
@@ -1203,7 +1196,7 @@
startsOutsideLayoutBounds = false,
)
}
- }
+ },
)
}
@@ -1621,7 +1614,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutStateImpl(
SceneA,
- transitions { overscrollDisabled(SceneA, Orientation.Horizontal) }
+ transitions { overscrollDisabled(SceneA, Orientation.Horizontal) },
)
}
@@ -1644,7 +1637,7 @@
from = SceneA,
to = SceneB,
progress = { -1f },
- orientation = Orientation.Horizontal
+ orientation = Orientation.Horizontal,
)
)
}
@@ -1666,7 +1659,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutStateImpl(
SceneA,
- transitions { from(SceneA, to = SceneB) { fade(TestElements.Foo) } }
+ transitions { from(SceneA, to = SceneB) { fade(TestElements.Foo) } },
)
}
@@ -1730,7 +1723,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutStateImpl(
SceneA,
- transitions { from(SceneA, to = SceneB) { fade(TestElements.Foo) } }
+ transitions { from(SceneA, to = SceneB) { fade(TestElements.Foo) } },
)
}
@@ -1781,7 +1774,7 @@
transitions {
overscrollDisabled(SceneA, Orientation.Horizontal)
overscrollDisabled(SceneB, Orientation.Horizontal)
- }
+ },
)
}
@@ -1830,7 +1823,7 @@
transitions {
overscrollDisabled(SceneA, Orientation.Horizontal)
overscrollDisabled(SceneB, Orientation.Horizontal)
- }
+ },
)
}
@@ -1886,7 +1879,7 @@
progressConverter = ProgressConverter.linear()
translate(TestElements.Foo, y = 15.dp)
}
- }
+ },
)
}
@@ -2053,7 +2046,7 @@
from(SceneB, to = SceneC) {
scaleSize(TestElements.Foo, width = 2f, height = 3f)
}
- }
+ },
)
}
@@ -2171,7 +2164,7 @@
rule.runOnIdle {
MutableSceneTransitionLayoutStateImpl(
SceneA,
- transitions { overscrollDisabled(SceneA, Orientation.Horizontal) }
+ transitions { overscrollDisabled(SceneA, Orientation.Horizontal) },
)
}
@@ -2231,7 +2224,7 @@
// In B => A, Foo is shared.
sharedElement(TestElements.Foo, enabled = true)
}
- }
+ },
)
}
@@ -2363,7 +2356,7 @@
},
previewProgress = 0.5f,
progress = 0f,
- isInPreviewStage = true
+ isInPreviewStage = true,
)
// verify that preview transition for exiting elements is halfway played from
@@ -2419,7 +2412,7 @@
},
previewProgress = 0.5f,
progress = 0.5f,
- isInPreviewStage = false
+ isInPreviewStage = false,
)
// verify that exiting elements remain in the preview-end state if no further transition is
@@ -2459,13 +2452,13 @@
transition: TransitionBuilder.() -> Unit,
progress: Float = 0f,
previewProgress: Float = 0.5f,
- isInPreviewStage: Boolean = true
+ isInPreviewStage: Boolean = true,
): SceneTransitionLayoutImpl {
val state =
rule.runOnIdle {
MutableSceneTransitionLayoutStateImpl(
from,
- transitions { from(from, to = to, preview = preview, builder = transition) }
+ transitions { from(from, to = to, preview = preview, builder = transition) },
)
}
@@ -2489,7 +2482,7 @@
to = to,
progress = { progress },
previewProgress = { previewProgress },
- isInPreviewStage = { isInPreviewStage }
+ isInPreviewStage = { isInPreviewStage },
)
scope.launch { state.startTransition(bToA) }
rule.waitForIdle()
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/FixedSizeEdgeDetectorTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/FixedSizeEdgeDetectorTest.kt
index cceaf57..dea9283 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/FixedSizeEdgeDetectorTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/FixedSizeEdgeDetectorTest.kt
@@ -34,7 +34,7 @@
@Test
fun horizontalEdges() {
- fun horizontalEdge(position: Int): Edge? =
+ fun horizontalEdge(position: Int): Edge.Resolved? =
detector.source(
layoutSize,
position = IntOffset(position, 0),
@@ -42,17 +42,17 @@
Orientation.Horizontal,
)
- assertThat(horizontalEdge(0)).isEqualTo(Edge.Left)
- assertThat(horizontalEdge(30)).isEqualTo(Edge.Left)
+ assertThat(horizontalEdge(0)).isEqualTo(Edge.Resolved.Left)
+ assertThat(horizontalEdge(30)).isEqualTo(Edge.Resolved.Left)
assertThat(horizontalEdge(31)).isEqualTo(null)
assertThat(horizontalEdge(69)).isEqualTo(null)
- assertThat(horizontalEdge(70)).isEqualTo(Edge.Right)
- assertThat(horizontalEdge(100)).isEqualTo(Edge.Right)
+ assertThat(horizontalEdge(70)).isEqualTo(Edge.Resolved.Right)
+ assertThat(horizontalEdge(100)).isEqualTo(Edge.Resolved.Right)
}
@Test
fun verticalEdges() {
- fun verticalEdge(position: Int): Edge? =
+ fun verticalEdge(position: Int): Edge.Resolved? =
detector.source(
layoutSize,
position = IntOffset(0, position),
@@ -60,11 +60,11 @@
Orientation.Vertical,
)
- assertThat(verticalEdge(0)).isEqualTo(Edge.Top)
- assertThat(verticalEdge(30)).isEqualTo(Edge.Top)
+ assertThat(verticalEdge(0)).isEqualTo(Edge.Resolved.Top)
+ assertThat(verticalEdge(30)).isEqualTo(Edge.Resolved.Top)
assertThat(verticalEdge(31)).isEqualTo(null)
assertThat(verticalEdge(69)).isEqualTo(null)
- assertThat(verticalEdge(70)).isEqualTo(Edge.Bottom)
- assertThat(verticalEdge(100)).isEqualTo(Edge.Bottom)
+ assertThat(verticalEdge(70)).isEqualTo(Edge.Resolved.Bottom)
+ assertThat(verticalEdge(100)).isEqualTo(Edge.Resolved.Bottom)
}
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/InterruptionHandlerTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/InterruptionHandlerTest.kt
index bc929bd..b87cc5c 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/InterruptionHandlerTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/InterruptionHandlerTest.kt
@@ -70,7 +70,7 @@
object : InterruptionHandler {
override fun onInterruption(
interrupted: TransitionState.Transition.ChangeScene,
- newTargetScene: SceneKey
+ newTargetScene: SceneKey,
): InterruptionResult {
return InterruptionResult(
animateFrom = interrupted.currentScene,
@@ -88,7 +88,7 @@
.comparingElementsUsing(FromToCurrentTriple)
.containsExactly(
// B to C.
- Triple(SceneB, SceneC, SceneC),
+ Triple(SceneB, SceneC, SceneC)
)
.inOrder()
}
@@ -105,7 +105,7 @@
object : InterruptionHandler {
override fun onInterruption(
interrupted: TransitionState.Transition.ChangeScene,
- newTargetScene: SceneKey
+ newTargetScene: SceneKey,
): InterruptionResult {
return InterruptionResult(
animateFrom =
@@ -217,7 +217,7 @@
{ transition: TransitionState.Transition.ChangeScene? ->
Triple(transition?.fromScene, transition?.toScene, transition?.currentScene)
},
- "(from, to, current) triple"
+ "(from, to, current) triple",
)
}
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MovableElementTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MovableElementTest.kt
index e4879d9..7c9e9ce 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MovableElementTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MovableElementTest.kt
@@ -161,7 +161,7 @@
element: ElementKey,
transition: TransitionState.Transition,
fromContentZIndex: Float,
- toContentZIndex: Float
+ toContentZIndex: Float,
): ContentKey {
transition as TransitionState.Transition.ChangeScene
assertThat(transition).hasFromScene(SceneA)
@@ -177,7 +177,7 @@
SceneB
}
}
- }
+ },
)
rule.testTransition(
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt
index bf192e7..af717ac 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/MultiPointerDraggableTest.kt
@@ -259,7 +259,7 @@
it
}
),
- Orientation.Vertical
+ Orientation.Vertical,
)
.fillMaxSize()
)
@@ -438,6 +438,9 @@
continueDraggingDown()
assertThat(stopped).isTrue()
+
+ // Complete the gesture
+ rule.onRoot().performTouchInput { up() }
}
@Test
@@ -640,7 +643,7 @@
override fun onPostScroll(
consumed: Offset,
available: Offset,
- source: NestedScrollSource
+ source: NestedScrollSource,
): Offset {
availableOnPostScroll = available.y
return Offset.Zero
@@ -653,7 +656,7 @@
override suspend fun onPostFling(
consumed: Velocity,
- available: Velocity
+ available: Velocity,
): Velocity {
availableOnPostFling = available.y
return Velocity.Zero
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/NestedScrollToSceneTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/NestedScrollToSceneTest.kt
index d58a0a3..5edb99e 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/NestedScrollToSceneTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/NestedScrollToSceneTest.kt
@@ -51,7 +51,7 @@
private val layoutHeight = 400.dp
private fun setup2ScenesAndScrollTouchSlop(
- modifierSceneA: @Composable ContentScope.() -> Modifier = { Modifier },
+ modifierSceneA: @Composable ContentScope.() -> Modifier = { Modifier }
): MutableSceneTransitionLayoutState {
val state =
rule.runOnUiThread {
@@ -62,7 +62,7 @@
touchSlop = LocalViewConfiguration.current.touchSlop
SceneTransitionLayout(
state = state,
- modifier = Modifier.size(layoutWidth, layoutHeight)
+ modifier = Modifier.size(layoutWidth, layoutHeight),
) {
scene(SceneA, userActions = mapOf(Swipe.Up to SceneB)) {
Spacer(modifierSceneA().fillMaxSize())
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ObservableTransitionStateTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ObservableTransitionStateTest.kt
index f3161f3..596e2cd 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ObservableTransitionStateTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ObservableTransitionStateTest.kt
@@ -47,12 +47,7 @@
@Test
fun testObservableTransitionState() = runTest {
val state =
- rule.runOnUiThread {
- MutableSceneTransitionLayoutState(
- SceneA,
- EmptyTestTransitions,
- )
- }
+ rule.runOnUiThread { MutableSceneTransitionLayoutState(SceneA, EmptyTestTransitions) }
// Collect the current observable state into [observableState].
// TODO(b/290184746): Use collectValues {} once it is extracted into a library that can be
@@ -82,7 +77,7 @@
scene(SceneA) {}
scene(SceneB) {}
}
- }
+ },
) {
before {
assertThat(observableState()).isEqualTo(ObservableTransitionState.Idle(SceneA))
@@ -157,7 +152,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutState(
SceneA,
- transitions = transitions { from(SceneA, to = SceneB, preview = {}) }
+ transitions = transitions { from(SceneA, to = SceneB, preview = {}) },
)
}
rule.setContent {
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt
index 471362b..ffed15b 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt
@@ -654,6 +654,85 @@
}
@Test
+ fun replaceAnimation_elementInCurrentSceneAndOneOverlay_sharedElementDisabled() {
+ rule.testReplaceOverlayTransition(
+ currentSceneContent = {
+ Box(Modifier.size(width = 180.dp, height = 120.dp)) {
+ Foo(width = 60.dp, height = 40.dp)
+ }
+ },
+ fromContent = {},
+ fromAlignment = Alignment.TopStart,
+ toContent = { Foo(width = 100.dp, height = 80.dp) },
+ transition = {
+ // 4 frames of animation
+ spec = tween(4 * 16, easing = LinearEasing)
+
+ // Scale Foo to/from size 0 in each content instead of sharing it.
+ sharedElement(TestElements.Foo, enabled = false)
+ scaleSize(TestElements.Foo, width = 0f, height = 0f)
+ },
+ ) {
+ before {
+ rule
+ .onNode(isElement(TestElements.Foo, content = SceneA))
+ .assertSizeIsEqualTo(60.dp, 40.dp)
+ .assertPositionInRootIsEqualTo(0.dp, 0.dp)
+ rule.onNode(isElement(TestElements.Foo, content = OverlayA)).assertDoesNotExist()
+ rule.onNode(isElement(TestElements.Foo, content = OverlayB)).assertDoesNotExist()
+ }
+
+ at(16) {
+ rule
+ .onNode(isElement(TestElements.Foo, content = SceneA))
+ .assertSizeIsEqualTo(45.dp, 30.dp)
+ .assertPositionInRootIsEqualTo(0.dp, 0.dp)
+ rule.onNode(isElement(TestElements.Foo, content = OverlayA)).assertDoesNotExist()
+ rule
+ .onNode(isElement(TestElements.Foo, content = OverlayB))
+ .assertSizeIsEqualTo(25.dp, 20.dp)
+ .assertPositionInRootIsEqualTo(((180 - 25) / 2f).dp, ((120 - 20) / 2f).dp)
+ }
+
+ at(32) {
+ rule
+ .onNode(isElement(TestElements.Foo, content = SceneA))
+ .assertSizeIsEqualTo(30.dp, 20.dp)
+ .assertPositionInRootIsEqualTo(0.dp, 0.dp)
+ rule.onNode(isElement(TestElements.Foo, content = OverlayA)).assertDoesNotExist()
+ rule
+ .onNode(isElement(TestElements.Foo, content = OverlayB))
+ .assertSizeIsEqualTo(50.dp, 40.dp)
+ .assertPositionInRootIsEqualTo(((180 - 50) / 2f).dp, ((120 - 40) / 2f).dp)
+ }
+
+ at(48) {
+ rule
+ .onNode(isElement(TestElements.Foo, content = SceneA))
+ .assertSizeIsEqualTo(15.dp, 10.dp)
+ .assertPositionInRootIsEqualTo(0.dp, 0.dp)
+ rule.onNode(isElement(TestElements.Foo, content = OverlayA)).assertDoesNotExist()
+ rule
+ .onNode(isElement(TestElements.Foo, content = OverlayB))
+ .assertSizeIsEqualTo(75.dp, 60.dp)
+ .assertPositionInRootIsEqualTo(((180 - 75) / 2f).dp, ((120 - 60) / 2f).dp)
+ }
+
+ after {
+ rule
+ .onNode(isElement(TestElements.Foo, content = SceneA))
+ .assertExists()
+ .assertIsNotDisplayed()
+ rule.onNode(isElement(TestElements.Foo, content = OverlayA)).assertDoesNotExist()
+ rule
+ .onNode(isElement(TestElements.Foo, content = OverlayB))
+ .assertSizeIsEqualTo(100.dp, 80.dp)
+ .assertPositionInRootIsEqualTo(40.dp, 20.dp)
+ }
+ }
+ }
+
+ @Test
fun overscrollingOverlay_movableElementNotInOverlay() {
val state =
rule.runOnUiThread {
@@ -664,7 +743,7 @@
overscroll(OverlayA, orientation = Orientation.Horizontal) {
translate(ElementKey("elementThatDoesNotExist"), x = 10.dp)
}
- }
+ },
)
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/PredictiveBackHandlerTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/PredictiveBackHandlerTest.kt
index 9284ffd..4224a0c 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/PredictiveBackHandlerTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/PredictiveBackHandlerTest.kt
@@ -78,10 +78,10 @@
spec =
tween(
durationMillis = transitionFrames * 16,
- easing = LinearEasing
+ easing = LinearEasing,
)
}
- }
+ },
)
}
rule.setContent {
@@ -144,7 +144,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutState(
SceneA,
- transitions = transitions { from(SceneA, to = SceneB, preview = {}) }
+ transitions = transitions { from(SceneA, to = SceneB, preview = {}) },
)
}
rule.setContent {
@@ -243,7 +243,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutState(
SceneA,
- initialOverlays = setOf(OverlayA, OverlayB)
+ initialOverlays = setOf(OverlayA, OverlayB),
)
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutStateTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutStateTest.kt
index d356c25..f3a3488 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutStateTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutStateTest.kt
@@ -66,7 +66,7 @@
val state = MutableSceneTransitionLayoutStateImpl(SceneA, SceneTransitions.Empty)
state.startTransitionImmediately(
animationScope = backgroundScope,
- transition(from = SceneA, to = SceneB)
+ transition(from = SceneA, to = SceneB),
)
assertThat(state.isTransitioning()).isTrue()
@@ -137,20 +137,20 @@
sourceFrom: SceneKey? = SceneA,
sourceTo: SceneKey? = SceneB,
targetFrom: SceneKey? = SceneC,
- targetTo: SceneKey = SceneD
+ targetTo: SceneKey = SceneD,
): Pair<MutableSceneTransitionLayoutStateImpl, MutableSceneTransitionLayoutStateImpl> {
val parentState = MutableSceneTransitionLayoutState(parentInitialScene)
val link =
listOf(
StateLink(
parentState,
- listOf(StateLink.TransitionLink(sourceFrom, sourceTo, targetFrom, targetTo))
+ listOf(StateLink.TransitionLink(sourceFrom, sourceTo, targetFrom, targetTo)),
)
)
val childState = MutableSceneTransitionLayoutState(childInitialScene, stateLinks = link)
return Pair(
parentState as MutableSceneTransitionLayoutStateImpl,
- childState as MutableSceneTransitionLayoutStateImpl
+ childState as MutableSceneTransitionLayoutStateImpl,
)
}
@@ -179,7 +179,7 @@
listOf(
StateLink(
parentParentState,
- listOf(StateLink.TransitionLink(SceneC, SceneD, SceneB, SceneC))
+ listOf(StateLink.TransitionLink(SceneC, SceneD, SceneB, SceneC)),
)
)
val parentState =
@@ -189,7 +189,7 @@
listOf(
StateLink(
parentState,
- listOf(StateLink.TransitionLink(SceneA, SceneB, SceneC, SceneD))
+ listOf(StateLink.TransitionLink(SceneA, SceneB, SceneC, SceneD)),
)
)
val childState =
@@ -300,11 +300,7 @@
// Specific transition from A to B.
assertThat(
- state.setTargetScene(
- SceneB,
- animationScope = this,
- transitionKey = transitionkey,
- )
+ state.setTargetScene(SceneB, animationScope = this, transitionKey = transitionkey)
)
.isNotNull()
assertThat(state.currentTransition?.transformationSpec?.transformations).hasSize(2)
@@ -315,7 +311,7 @@
val state = MutableSceneTransitionLayoutStateImpl(SceneA, SceneTransitions.Empty)
state.startTransitionImmediately(
animationScope = backgroundScope,
- transition(from = SceneA, to = SceneB, current = { SceneA }, progress = { 0.2f })
+ transition(from = SceneA, to = SceneB, current = { SceneA }, progress = { 0.2f }),
)
assertThat(state.isTransitioning()).isTrue()
@@ -334,7 +330,7 @@
val state = MutableSceneTransitionLayoutStateImpl(SceneA, SceneTransitions.Empty)
state.startTransitionImmediately(
animationScope = backgroundScope,
- transition(from = SceneA, to = SceneB, progress = { 0.8f })
+ transition(from = SceneA, to = SceneB, progress = { 0.8f }),
)
assertThat(state.isTransitioning()).isTrue()
@@ -381,8 +377,8 @@
from = SceneA,
to = SceneB,
current = { currentScene },
- progress = { progress }
- )
+ progress = { progress },
+ ),
)
assertThat(state.isTransitioning()).isTrue()
@@ -445,11 +441,7 @@
progress: () -> Float,
sceneTransitions: SceneTransitions,
): MutableSceneTransitionLayoutStateImpl {
- val state =
- MutableSceneTransitionLayoutStateImpl(
- SceneA,
- sceneTransitions,
- )
+ val state = MutableSceneTransitionLayoutStateImpl(SceneA, sceneTransitions)
state.startTransitionImmediately(
animationScope = backgroundScope,
transition(
@@ -457,7 +449,7 @@
to = SceneB,
progress = progress,
orientation = Orientation.Vertical,
- )
+ ),
)
assertThat(state.isTransitioning()).isTrue()
return state
@@ -472,7 +464,7 @@
sceneTransitions =
transitions {
overscroll(SceneB, Orientation.Vertical) { fade(TestElements.Foo) }
- }
+ },
)
val transition = assertThat(state.transitionState).isSceneTransition()
assertThat(transition).hasNoOverscrollSpec()
@@ -503,7 +495,7 @@
sceneTransitions =
transitions {
overscroll(SceneA, Orientation.Vertical) { fade(TestElements.Foo) }
- }
+ },
)
val transition = assertThat(state.transitionState).isSceneTransition()
@@ -532,7 +524,7 @@
val state =
startOverscrollableTransistionFromAtoB(
progress = { progress.value },
- sceneTransitions = transitions {}
+ sceneTransitions = transitions {},
)
val transition = assertThat(state.transitionState).isSceneTransition()
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt
index 63ab04f..400f0b3 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt
@@ -95,14 +95,8 @@
)
}
- SceneTransitionLayout(
- state = layoutState,
- modifier = Modifier.size(LayoutSize),
- ) {
- scene(
- SceneA,
- userActions = mapOf(Back to SceneB),
- ) {
+ SceneTransitionLayout(state = layoutState, modifier = Modifier.size(LayoutSize)) {
+ scene(SceneA, userActions = mapOf(Back to SceneB)) {
Box(Modifier.fillMaxSize()) {
SharedFoo(size = 50.dp, childOffset = 0.dp, Modifier.align(Alignment.TopEnd))
Text("SceneA")
@@ -250,7 +244,7 @@
sharedFoo.assertHeightIsEqualTo(75.dp)
sharedFoo.assertPositionInRootIsEqualTo(
expectedTop = 0.dp,
- expectedLeft = (LayoutSize - 50.dp) / 2
+ expectedLeft = (LayoutSize - 50.dp) / 2,
)
// The shared offset of the single child of SharedFoo() is 50dp in scene B and 0dp in Scene
@@ -325,7 +319,7 @@
rule.runOnUiThread {
MutableSceneTransitionLayoutStateImpl(
SceneA,
- transitions { overscrollDisabled(SceneB, Orientation.Horizontal) }
+ transitions { overscrollDisabled(SceneB, Orientation.Horizontal) },
)
}
@@ -371,7 +365,7 @@
from(SceneB, to = SceneC) {
spec = tween(duration.toInt(), easing = LinearEasing)
}
- }
+ },
)
}
@@ -447,7 +441,7 @@
}
private fun SemanticsNodeInteraction.offsetRelativeTo(
- other: SemanticsNodeInteraction,
+ other: SemanticsNodeInteraction
): DpOffset {
val node = fetchSemanticsNode()
val bounds = node.boundsInRoot
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt
index e48cd817..25e8713 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt
@@ -385,12 +385,9 @@
SceneTransitionLayout(
state = layoutState,
- modifier = Modifier.size(LayoutWidth, LayoutHeight)
+ modifier = Modifier.size(LayoutWidth, LayoutHeight),
) {
- scene(
- SceneA,
- userActions = mapOf(Swipe.Down to SceneB),
- ) {
+ scene(SceneA, userActions = mapOf(Swipe.Down to SceneB)) {
Spacer(Modifier.fillMaxSize())
}
scene(SceneB) { Spacer(Modifier.fillMaxSize()) }
@@ -507,7 +504,7 @@
fade(TestElements.Foo)
fade(TestElements.Bar)
}
- }
+ },
)
var touchSlop = 0f
@@ -519,8 +516,8 @@
userActions =
mapOf(
Swipe.Down to SceneB,
- Swipe.Up to UserActionResult(SceneB, transitionKey = transitionkey)
- )
+ Swipe.Up to UserActionResult(SceneB, transitionKey = transitionkey),
+ ),
) {
Box(Modifier.fillMaxSize())
}
@@ -565,7 +562,7 @@
val state =
layoutState(
SceneA,
- transitions { from(SceneA, to = SceneB) { distance = swipeDistance } }
+ transitions { from(SceneA, to = SceneB) { distance = swipeDistance } },
)
val layoutSize = 200.dp
@@ -617,7 +614,7 @@
progressConverter = ProgressConverter.linear()
translate(TestElements.Foo, x = { 20.dp.toPx() }, y = { 30.dp.toPx() })
}
- }
+ },
)
}
val layoutSize = 200.dp
@@ -801,7 +798,7 @@
override fun onPostScroll(
consumed: Offset,
available: Offset,
- source: NestedScrollSource
+ source: NestedScrollSource,
): Offset {
availableOnPostScroll = available.y
return super.onPostScroll(consumed, available, source)
@@ -814,7 +811,7 @@
transitions {
from(SceneA, to = SceneB) { distance = FixedDistance(swipeDistance) }
overscrollDisabled(SceneB, Orientation.Vertical)
- }
+ },
)
}
val layoutSize = 200.dp
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt
index f8068e6..223af80 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt
@@ -62,7 +62,7 @@
.comparingElementsUsing(
Correspondence.transforming<TransitionSpecImpl, Pair<ContentKey?, ContentKey?>>(
{ it?.from to it?.to },
- "has (from, to) equal to"
+ "has (from, to) equal to",
)
)
.containsExactly(
@@ -111,7 +111,7 @@
fractionRange(
start = 0.1f,
end = 0.8f,
- easing = CubicBezierEasing(0.1f, 0.1f, 0f, 1f)
+ easing = CubicBezierEasing(0.1f, 0.1f, 0f, 1f),
) {
fade(TestElements.Foo)
}
@@ -126,11 +126,7 @@
TransformationRange(start = 0.1f, end = 0.8f),
TransformationRange(start = 0.2f, end = TransformationRange.BoundUnspecified),
TransformationRange(start = TransformationRange.BoundUnspecified, end = 0.9f),
- TransformationRange(
- start = 0.1f,
- end = 0.8f,
- CubicBezierEasing(0.1f, 0.1f, 0f, 1f)
- ),
+ TransformationRange(start = 0.1f, end = 0.8f, CubicBezierEasing(0.1f, 0.1f, 0f, 1f)),
)
}
@@ -146,7 +142,7 @@
timestampRange(
startMillis = 100,
endMillis = 300,
- easing = CubicBezierEasing(0.1f, 0.1f, 0f, 1f)
+ easing = CubicBezierEasing(0.1f, 0.1f, 0f, 1f),
) {
fade(TestElements.Foo)
}
@@ -164,7 +160,7 @@
TransformationRange(
start = 100 / 500f,
end = 300 / 500f,
- easing = CubicBezierEasing(0.1f, 0.1f, 0f, 1f)
+ easing = CubicBezierEasing(0.1f, 0.1f, 0f, 1f),
),
)
}
@@ -200,7 +196,7 @@
preview = { fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) } },
reversePreview = {
fractionRange(start = 0.5f, end = 0.6f) { fade(TestElements.Foo) }
- }
+ },
) {
spec = tween(500)
fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) }
@@ -226,9 +222,7 @@
assertThat(previewTransformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
- .containsExactly(
- TransformationRange(start = 0.5f, end = 0.6f),
- )
+ .containsExactly(TransformationRange(start = 0.5f, end = 0.6f))
}
@Test
@@ -237,7 +231,7 @@
from(
TestScenes.SceneA,
to = TestScenes.SceneB,
- preview = { fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) } }
+ preview = { fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) } },
) {
spec = tween(500)
fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) }
@@ -251,7 +245,7 @@
transitions.transitionSpec(
from = TestScenes.SceneA,
to = TestScenes.SceneB,
- key = TransitionKey.PredictiveBack
+ key = TransitionKey.PredictiveBack,
)
val transformations = transitionSpec.transformationSpec().transformations
@@ -267,9 +261,7 @@
assertThat(previewTransformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
- .containsExactly(
- TransformationRange(start = 0.1f, end = 0.8f),
- )
+ .containsExactly(TransformationRange(start = 0.1f, end = 0.8f))
}
@Test
@@ -339,7 +331,7 @@
private val TRANSFORMATION_RANGE =
Correspondence.transforming<Transformation, TransformationRange?>(
{ it?.range },
- "has range equal to"
+ "has range equal to",
)
}
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/subjects/TransitionStateSubject.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/subjects/TransitionStateSubject.kt
index 44e0ba5..313379f 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/subjects/TransitionStateSubject.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/subjects/TransitionStateSubject.kt
@@ -39,7 +39,7 @@
/** Assert on a [TransitionState.Transition.ShowOrHideOverlay]. */
fun assertThat(
- transition: TransitionState.Transition.ShowOrHideOverlay,
+ transition: TransitionState.Transition.ShowOrHideOverlay
): ShowOrHideOverlayTransitionSubject {
return Truth.assertAbout(ShowOrHideOverlayTransitionSubject.showOrHideOverlayTransitions())
.that(transition)
@@ -47,17 +47,15 @@
/** Assert on a [TransitionState.Transition.ReplaceOverlay]. */
fun assertThat(
- transition: TransitionState.Transition.ReplaceOverlay,
+ transition: TransitionState.Transition.ReplaceOverlay
): ReplaceOverlayTransitionSubject {
return Truth.assertAbout(ReplaceOverlayTransitionSubject.replaceOverlayTransitions())
.that(transition)
}
class TransitionStateSubject
-private constructor(
- metadata: FailureMetadata,
- private val actual: TransitionState,
-) : Subject(metadata, actual) {
+private constructor(metadata: FailureMetadata, private val actual: TransitionState) :
+ Subject(metadata, actual) {
fun hasCurrentScene(sceneKey: SceneKey) {
check("currentScene").that(actual.currentScene).isEqualTo(sceneKey)
}
@@ -181,10 +179,8 @@
}
class SceneTransitionSubject
-private constructor(
- metadata: FailureMetadata,
- actual: TransitionState.Transition.ChangeScene,
-) : BaseTransitionSubject<TransitionState.Transition.ChangeScene>(metadata, actual) {
+private constructor(metadata: FailureMetadata, actual: TransitionState.Transition.ChangeScene) :
+ BaseTransitionSubject<TransitionState.Transition.ChangeScene>(metadata, actual) {
fun hasFromScene(sceneKey: SceneKey) {
check("fromScene").that(actual.fromScene).isEqualTo(sceneKey)
}
@@ -223,10 +219,8 @@
}
class ReplaceOverlayTransitionSubject
-private constructor(
- metadata: FailureMetadata,
- actual: TransitionState.Transition.ReplaceOverlay,
-) : BaseTransitionSubject<TransitionState.Transition.ReplaceOverlay>(metadata, actual) {
+private constructor(metadata: FailureMetadata, actual: TransitionState.Transition.ReplaceOverlay) :
+ BaseTransitionSubject<TransitionState.Transition.ReplaceOverlay>(metadata, actual) {
fun hasFromOverlay(fromOverlay: OverlayKey) {
check("fromOverlay").that(actual.fromOverlay).isEqualTo(fromOverlay)
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt
index c9f71da..de55e2f 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt
@@ -57,7 +57,7 @@
transition = {
spec = tween(16 * 4, easing = LinearEasing)
anchoredSize(TestElements.Bar, TestElements.Foo)
- }
+ },
)
}
@@ -73,7 +73,7 @@
// Scale during 4 frames.
spec = tween(16 * 4, easing = LinearEasing)
anchoredSize(TestElements.Bar, TestElements.Foo)
- }
+ },
)
}
@@ -103,7 +103,7 @@
transition = {
spec = tween(16 * 4, easing = LinearEasing)
anchoredSize(TestElements.Bar, TestElements.Foo, anchorWidth = false)
- }
+ },
)
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt
index 00acb13..4877cd6 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt
@@ -56,7 +56,7 @@
transition = {
spec = tween(16 * 4, easing = LinearEasing)
// Elements should be shared by default.
- }
+ },
) {
before {
onElement(TestElements.Foo).assertPositionInRootIsEqualTo(10.dp, 50.dp)
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt
index ce4c5275..a406e13 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt
@@ -117,7 +117,7 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset(x = 0f, y = -1f),
- source = scrollSource
+ source = scrollSource,
)
// It should ignore all onPostScroll events
@@ -147,7 +147,7 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset(x = 0f, y = 1f),
- source = scrollSource
+ source = scrollSource,
)
// It can increase by 1 the height
@@ -162,13 +162,13 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset(x = 0f, y = 0.5f),
- source = scrollSource
+ source = scrollSource,
)
val offsetConsumed =
scrollConnection.onPreScroll(
available = Offset(x = 0f, y = 0.5f),
- source = scrollSource
+ source = scrollSource,
)
assertThat(offsetConsumed).isEqualTo(Offset(0f, 0.5f))
@@ -185,7 +185,7 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset(x = 0f, y = 1f),
- source = scrollSource
+ source = scrollSource,
)
// It should not change the height (already at max)
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/PriorityNestedScrollConnectionTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/PriorityNestedScrollConnectionTest.kt
index 8a9a92e..7f1af05 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/PriorityNestedScrollConnectionTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/PriorityNestedScrollConnectionTest.kt
@@ -70,7 +70,7 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset.Zero,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertThat(isStarted).isEqualTo(false)
@@ -89,7 +89,7 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset.Zero,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
}
@@ -115,7 +115,7 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset.Zero,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertThat(isStarted).isEqualTo(false)
@@ -130,7 +130,7 @@
scrollConnection.onPostScroll(
consumed = offset1,
available = offset2,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertThat(lastScroll).isEqualTo(offset2)
@@ -184,10 +184,7 @@
fun receive_onPostFling() = runTest {
canStartPostFling = true
- scrollConnection.onPostFling(
- consumed = velocity1,
- available = velocity2,
- )
+ scrollConnection.onPostFling(consumed = velocity1, available = velocity2)
assertThat(lastStop).isEqualTo(velocity2)
}
@@ -202,7 +199,7 @@
scrollConnection.onPostScroll(
consumed = Offset.Zero,
available = Offset.Zero,
- source = NestedScrollSource.Drag
+ source = NestedScrollSource.Drag,
)
assertThat(isStarted).isEqualTo(false)
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SetContentAndCreateScope.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SetContentAndCreateScope.kt
index 28a864f..0819dd9 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SetContentAndCreateScope.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SetContentAndCreateScope.kt
@@ -27,7 +27,7 @@
* and scoped to this rule.
*/
fun ComposeContentTestRule.setContentAndCreateMainScope(
- content: @Composable () -> Unit,
+ content: @Composable () -> Unit
): CoroutineScope {
lateinit var coroutineScope: CoroutineScope
setContent {
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/subjects/DpOffsetSubject.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/subjects/DpOffsetSubject.kt
index bf7bf98..ab31038 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/subjects/DpOffsetSubject.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/subjects/DpOffsetSubject.kt
@@ -30,10 +30,8 @@
}
/** A Truth subject to assert on [DpOffset] with some tolerance. Inspired by FloatSubject. */
-class DpOffsetSubject(
- metadata: FailureMetadata,
- private val actual: DpOffset,
-) : Subject(metadata, actual) {
+class DpOffsetSubject(metadata: FailureMetadata, private val actual: DpOffset) :
+ Subject(metadata, actual) {
fun isWithin(tolerance: Dp): TolerantDpOffsetComparison {
return object : TolerantDpOffsetComparison {
override fun of(expected: DpOffset) {
diff --git a/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt b/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt
index 25f9564..0d2fcfc 100644
--- a/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt
+++ b/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt
@@ -101,15 +101,12 @@
runOnUiThread {
MutableSceneTransitionLayoutState(
fromScene,
- transitions { from(fromScene, to = toScene, builder = transition) }
+ transitions { from(fromScene, to = toScene, builder = transition) },
)
},
to = toScene,
transitionLayout = { state ->
- SceneTransitionLayout(
- state,
- layoutModifier,
- ) {
+ SceneTransitionLayout(state, layoutModifier) {
scene(fromScene, content = fromSceneContent)
scene(toScene, content = toSceneContent)
}
@@ -212,14 +209,14 @@
data class TransitionRecordingSpec(
val recordBefore: Boolean = true,
val recordAfter: Boolean = true,
- val timeSeriesCapture: TimeSeriesCaptureScope<SemanticsNodeInteractionsProvider>.() -> Unit
+ val timeSeriesCapture: TimeSeriesCaptureScope<SemanticsNodeInteractionsProvider>.() -> Unit,
)
/** Captures the feature using [capture] on the [element]. */
fun TimeSeriesCaptureScope<SemanticsNodeInteractionsProvider>.featureOfElement(
element: ElementKey,
capture: FeatureCapture<SemanticsNode, *>,
- name: String = "${element.debugName}_${capture.name}"
+ name: String = "${element.debugName}_${capture.name}",
) {
feature(isElement(element), capture, name)
}
@@ -238,7 +235,7 @@
toolkit.composeContentTestRule.runOnUiThread {
MutableSceneTransitionLayoutState(
fromScene,
- transitions { from(fromScene, to = toScene, builder = transition) }
+ transitions { from(fromScene, to = toScene, builder = transition) },
)
}
@@ -250,10 +247,7 @@
}
}
- SceneTransitionLayout(
- state,
- layoutModifier,
- ) {
+ SceneTransitionLayout(state, layoutModifier) {
scene(fromScene, content = fromSceneContent)
scene(toScene, content = toSceneContent)
}
@@ -264,8 +258,8 @@
},
recordBefore = recordingSpec.recordBefore,
recordAfter = recordingSpec.recordAfter,
- timeSeriesCapture = recordingSpec.timeSeriesCapture
- )
+ timeSeriesCapture = recordingSpec.timeSeriesCapture,
+ ),
)
}
@@ -302,7 +296,7 @@
object : TransitionTestAssertionScope {
override fun onElement(
element: ElementKey,
- scene: SceneKey?
+ scene: SceneKey?,
): SemanticsNodeInteraction {
return onNode(isElement(element, scene))
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt
index 062d351..a1d944b 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt
@@ -34,9 +34,11 @@
import com.android.systemui.classifier.FalsingCollector
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.haptics.msdl.bouncerHapticPlayer
import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository
import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.DevicePostureController
+import com.android.systemui.testKosmos
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.mockito.mock
@@ -86,6 +88,7 @@
@Mock private lateinit var postureController: DevicePostureController
@Mock private lateinit var mUserActivityNotifier: UserActivityNotifier
@Captor private lateinit var keyListenerArgumentCaptor: ArgumentCaptor<View.OnKeyListener>
+ private val kosmos = testKosmos()
private lateinit var keyguardPasswordViewController: KeyguardPasswordViewController
@@ -132,8 +135,8 @@
fakeFeatureFlags,
mSelectedUserInteractor,
keyguardKeyboardInteractor,
- null,
- mUserActivityNotifier
+ kosmos.bouncerHapticPlayer,
+ mUserActivityNotifier,
)
}
@@ -194,7 +197,7 @@
keyListenerArgumentCaptor.value.onKey(
keyguardPasswordView,
KeyEvent.KEYCODE_SPACE,
- KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SPACE)
+ KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SPACE),
)
assertFalse("Unlock attempted.", eventHandled)
@@ -213,7 +216,7 @@
keyListenerArgumentCaptor.value.onKey(
keyguardPasswordView,
KeyEvent.KEYCODE_ENTER,
- KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER)
+ KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER),
)
assertTrue("Unlock not attempted.", eventHandled)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt
index e2bdc49..d63e728 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt
@@ -30,10 +30,12 @@
import com.android.systemui.classifier.FalsingCollectorFake
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.haptics.msdl.bouncerHapticPlayer
import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.DevicePostureController
import com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_HALF_OPENED
import com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_OPENED
+import com.android.systemui.testKosmos
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.whenever
@@ -89,6 +91,9 @@
@Captor lateinit var postureCallbackCaptor: ArgumentCaptor<DevicePostureController.Callback>
+ private val kosmos = testKosmos()
+ private val bouncerHapticHelper = kosmos.bouncerHapticPlayer
+
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
@@ -112,7 +117,8 @@
mKeyguardMessageAreaControllerFactory,
mPostureController,
fakeFeatureFlags,
- mSelectedUserInteractor
+ mSelectedUserInteractor,
+ bouncerHapticHelper,
)
mKeyguardPatternView.onAttachedToWindow()
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java
index 1076d90..4d1660e 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java
@@ -34,10 +34,12 @@
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.domain.interactor.KeyguardKeyboardInteractor;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.classifier.FalsingCollectorFake;
import com.android.systemui.flags.FakeFeatureFlags;
import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository;
+import com.android.systemui.kosmos.KosmosJavaAdapter;
import com.android.systemui.res.R;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
@@ -93,6 +95,9 @@
private KeyguardPinBasedInputViewController mKeyguardPinViewController;
+ private KosmosJavaAdapter mKosmosJavaAdapter = new KosmosJavaAdapter(this);
+ private BouncerHapticPlayer mBouncerHapticPlayer = mKosmosJavaAdapter.getBouncerHapticHelper();
+
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
@@ -119,7 +124,8 @@
mKeyguardUpdateMonitor, mSecurityMode, mLockPatternUtils, mKeyguardSecurityCallback,
mKeyguardMessageAreaControllerFactory, mLatencyTracker, mLiftToactivateListener,
mEmergencyButtonController, mFalsingCollector, featureFlags,
- mSelectedUserInteractor, keyguardKeyboardInteractor, null, mUserActivityNotifier) {
+ mSelectedUserInteractor, keyguardKeyboardInteractor, mBouncerHapticPlayer,
+ mUserActivityNotifier) {
@Override
public void onResume(int reason) {
super.onResume(reason);
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/MirrorWindowControlTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/MirrorWindowControlTest.java
index 8f9b7c8..12c866f 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/MirrorWindowControlTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/MirrorWindowControlTest.java
@@ -30,11 +30,11 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.WindowManager;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
+import com.android.app.viewcapture.ViewCaptureAwareWindowManager;
import com.android.systemui.SysuiTestCase;
import org.junit.Before;
@@ -48,7 +48,7 @@
@RunWith(AndroidJUnit4.class)
public class MirrorWindowControlTest extends SysuiTestCase {
- @Mock WindowManager mWindowManager;
+ @Mock ViewCaptureAwareWindowManager mWindowManager;
View mView;
int mViewWidth;
int mViewHeight;
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/CaptioningRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/CaptioningRepositoryTest.kt
index dd85d9b..fc57757 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/CaptioningRepositoryTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/CaptioningRepositoryTest.kt
@@ -20,11 +20,15 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
+import com.android.systemui.coroutines.collectValues
+import com.android.systemui.kosmos.applicationCoroutineScope
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.testKosmos
+import com.android.systemui.user.data.repository.userRepository
+import com.android.systemui.user.utils.FakeUserScopedService
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.flow.launchIn
-import kotlinx.coroutines.flow.onEach
-import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Before
@@ -39,10 +43,11 @@
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
-@Suppress("UnspecifiedRegisterReceiverFlag")
@RunWith(AndroidJUnit4::class)
class CaptioningRepositoryTest : SysuiTestCase() {
+ private val kosmos = testKosmos()
+
@Captor
private lateinit var listenerCaptor: ArgumentCaptor<CaptioningManager.CaptioningChangeListener>
@@ -50,34 +55,33 @@
private lateinit var underTest: CaptioningRepository
- private val testScope = TestScope()
-
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
underTest =
- CaptioningRepositoryImpl(
- captioningManager,
- testScope.testScheduler,
- testScope.backgroundScope
- )
+ with(kosmos) {
+ CaptioningRepositoryImpl(
+ FakeUserScopedService(captioningManager),
+ userRepository,
+ testScope.testScheduler,
+ applicationCoroutineScope,
+ )
+ }
}
@Test
fun isSystemAudioCaptioningEnabled_change_repositoryEmits() {
- testScope.runTest {
- `when`(captioningManager.isEnabled).thenReturn(false)
- val isSystemAudioCaptioningEnabled = mutableListOf<Boolean>()
- underTest.isSystemAudioCaptioningEnabled
- .onEach { isSystemAudioCaptioningEnabled.add(it) }
- .launchIn(backgroundScope)
+ kosmos.testScope.runTest {
+ `when`(captioningManager.isSystemAudioCaptioningEnabled).thenReturn(false)
+ val models by collectValues(underTest.captioningModel.filterNotNull())
runCurrent()
+ `when`(captioningManager.isSystemAudioCaptioningEnabled).thenReturn(true)
triggerOnSystemAudioCaptioningChange()
runCurrent()
- assertThat(isSystemAudioCaptioningEnabled)
+ assertThat(models.map { it.isSystemAudioCaptioningEnabled })
.containsExactlyElementsIn(listOf(false, true))
.inOrder()
}
@@ -85,18 +89,16 @@
@Test
fun isSystemAudioCaptioningUiEnabled_change_repositoryEmits() {
- testScope.runTest {
- `when`(captioningManager.isSystemAudioCaptioningUiEnabled).thenReturn(false)
- val isSystemAudioCaptioningUiEnabled = mutableListOf<Boolean>()
- underTest.isSystemAudioCaptioningUiEnabled
- .onEach { isSystemAudioCaptioningUiEnabled.add(it) }
- .launchIn(backgroundScope)
+ kosmos.testScope.runTest {
+ `when`(captioningManager.isEnabled).thenReturn(false)
+ val models by collectValues(underTest.captioningModel.filterNotNull())
runCurrent()
+ `when`(captioningManager.isSystemAudioCaptioningUiEnabled).thenReturn(true)
triggerSystemAudioCaptioningUiChange()
runCurrent()
- assertThat(isSystemAudioCaptioningUiEnabled)
+ assertThat(models.map { it.isSystemAudioCaptioningUiEnabled })
.containsExactlyElementsIn(listOf(false, true))
.inOrder()
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManagerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManagerTest.kt
index 1386092..b7b98d4 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManagerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManagerTest.kt
@@ -18,6 +18,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
+import com.android.systemui.animation.DialogTransitionAnimator
import com.android.systemui.plugins.ActivityStarter
import javax.inject.Provider
import org.junit.Before
@@ -41,10 +42,12 @@
@Mock private lateinit var activityStarter: ActivityStarter
@Mock private lateinit var dialogProvider: Provider<ExtraDimDialogDelegate>
+ @Mock private lateinit var dialogTransitionAnimator: DialogTransitionAnimator
@Before
fun setUp() {
- extraDimDialogManager = ExtraDimDialogManager(dialogProvider, activityStarter)
+ extraDimDialogManager =
+ ExtraDimDialogManager(dialogProvider, activityStarter, dialogTransitionAnimator)
}
@Test
@@ -56,7 +59,7 @@
/* cancelAction= */ eq(null),
/* dismissShade= */ eq(false),
/* afterKeyguardGone= */ eq(true),
- /* deferred= */ eq(false)
+ /* deferred= */ eq(false),
)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManagerTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManagerTest.java
index 09aa2868..ca23228 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManagerTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManagerTest.java
@@ -17,11 +17,11 @@
package com.android.systemui.accessibility.hearingaid;
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.when;
-import android.bluetooth.BluetoothDevice;
import android.testing.TestableLooper;
import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -51,6 +51,8 @@
@Rule
public MockitoRule mockito = MockitoJUnit.rule();
+ private static final int TEST_LAUNCH_SOURCE_ID = 1;
+
private final FakeExecutor mMainExecutor = new FakeExecutor(new FakeSystemClock());
private final FakeExecutor mBackgroundExecutor = new FakeExecutor(new FakeSystemClock());
@Mock
@@ -70,7 +72,7 @@
@Before
public void setUp() {
- when(mDialogFactory.create(anyBoolean())).thenReturn(mDialogDelegate);
+ when(mDialogFactory.create(anyBoolean(), anyInt())).thenReturn(mDialogDelegate);
when(mDialogDelegate.createDialog()).thenReturn(mDialog);
mManager = new HearingDevicesDialogManager(
@@ -86,21 +88,22 @@
public void showDialog_existHearingDevice_showPairNewDeviceFalse() {
when(mDevicesChecker.isAnyPairedHearingDevice()).thenReturn(true);
- mManager.showDialog(mExpandable);
+ mManager.showDialog(mExpandable, TEST_LAUNCH_SOURCE_ID);
mBackgroundExecutor.runAllReady();
mMainExecutor.runAllReady();
- verify(mDialogFactory).create(eq(/* showPairNewDevice= */ false));
+ verify(mDialogFactory).create(eq(/* showPairNewDevice= */ false),
+ eq(TEST_LAUNCH_SOURCE_ID));
}
@Test
public void showDialog_noHearingDevice_showPairNewDeviceTrue() {
when(mDevicesChecker.isAnyPairedHearingDevice()).thenReturn(false);
- mManager.showDialog(mExpandable);
+ mManager.showDialog(mExpandable, TEST_LAUNCH_SOURCE_ID);
mBackgroundExecutor.runAllReady();
mMainExecutor.runAllReady();
- verify(mDialogFactory).create(eq(/* showPairNewDevice= */ true));
+ verify(mDialogFactory).create(eq(/* showPairNewDevice= */ true), eq(TEST_LAUNCH_SOURCE_ID));
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/BiometricTestExtensions.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/BiometricTestExtensions.kt
index 75a77cf..4bc71fd 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/BiometricTestExtensions.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/BiometricTestExtensions.kt
@@ -27,6 +27,17 @@
import android.hardware.face.FaceSensorPropertiesInternal
import android.hardware.fingerprint.FingerprintSensorProperties
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
+import com.android.keyguard.keyguardUpdateMonitor
+import com.android.systemui.SysuiTestableContext
+import com.android.systemui.biometrics.data.repository.biometricStatusRepository
+import com.android.systemui.biometrics.shared.model.AuthenticationReason
+import com.android.systemui.bouncer.data.repository.keyguardBouncerRepository
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.res.R
+import com.android.systemui.util.mockito.whenever
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.test.runCurrent
/** Create [FingerprintSensorPropertiesInternal] for a test. */
internal fun fingerprintSensorPropertiesInternal(
@@ -145,3 +156,67 @@
info.negativeButtonText = negativeButton
return info
}
+
+@OptIn(ExperimentalCoroutinesApi::class)
+internal fun TestScope.updateSfpsIndicatorRequests(
+ kosmos: Kosmos,
+ mContext: SysuiTestableContext,
+ primaryBouncerRequest: Boolean? = null,
+ alternateBouncerRequest: Boolean? = null,
+ biometricPromptRequest: Boolean? = null,
+ // TODO(b/365182034): update when rest to unlock feature is implemented
+ // progressBarShowing: Boolean? = null
+) {
+ biometricPromptRequest?.let { hasBiometricPromptRequest ->
+ if (hasBiometricPromptRequest) {
+ kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
+ AuthenticationReason.BiometricPromptAuthentication
+ )
+ } else {
+ kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
+ AuthenticationReason.NotRunning
+ )
+ }
+ }
+
+ primaryBouncerRequest?.let { hasPrimaryBouncerRequest ->
+ updatePrimaryBouncer(
+ kosmos,
+ mContext,
+ isShowing = hasPrimaryBouncerRequest,
+ isAnimatingAway = false,
+ fpsDetectionRunning = true,
+ isUnlockingWithFpAllowed = true
+ )
+ }
+
+ alternateBouncerRequest?.let { hasAlternateBouncerRequest ->
+ kosmos.keyguardBouncerRepository.setAlternateVisible(hasAlternateBouncerRequest)
+ }
+
+ // TODO(b/365182034): set progress bar visibility when rest to unlock feature is implemented
+
+ runCurrent()
+}
+
+internal fun updatePrimaryBouncer(
+ kosmos: Kosmos,
+ mContext: SysuiTestableContext,
+ isShowing: Boolean,
+ isAnimatingAway: Boolean,
+ fpsDetectionRunning: Boolean,
+ isUnlockingWithFpAllowed: Boolean,
+) {
+ kosmos.keyguardBouncerRepository.setPrimaryShow(isShowing)
+ kosmos.keyguardBouncerRepository.setPrimaryStartingToHide(false)
+ val primaryStartDisappearAnimation = if (isAnimatingAway) Runnable {} else null
+ kosmos.keyguardBouncerRepository.setPrimaryStartDisappearAnimation(
+ primaryStartDisappearAnimation
+ )
+
+ whenever(kosmos.keyguardUpdateMonitor.isFingerprintDetectionRunning)
+ .thenReturn(fpsDetectionRunning)
+ whenever(kosmos.keyguardUpdateMonitor.isUnlockingWithFingerprintAllowed)
+ .thenReturn(isUnlockingWithFpAllowed)
+ mContext.orCreateTestableResources.addOverride(R.bool.config_show_sidefps_hint_on_bouncer, true)
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractorTest.kt
new file mode 100644
index 0000000..298b54a
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractorTest.kt
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.biometrics.domain.interactor
+
+import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.biometrics.data.repository.biometricStatusRepository
+import com.android.systemui.biometrics.data.repository.fingerprintPropertyRepository
+import com.android.systemui.biometrics.shared.model.AuthenticationReason
+import com.android.systemui.biometrics.shared.model.FingerprintSensorType
+import com.android.systemui.biometrics.shared.model.SensorStrength
+import com.android.systemui.biometrics.updateSfpsIndicatorRequests
+import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.display.data.repository.displayRepository
+import com.android.systemui.display.data.repository.displayStateRepository
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.testKosmos
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.test.runCurrent
+import kotlinx.coroutines.test.runTest
+import org.junit.Ignore
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@OptIn(ExperimentalCoroutinesApi::class)
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+@TestableLooper.RunWithLooper(setAsMainLooper = true)
+class SideFpsOverlayInteractorTest : SysuiTestCase() {
+ private val kosmos = testKosmos()
+ private val underTest = kosmos.sideFpsOverlayInteractor
+
+ @Test
+ fun verifyIsShowingFalse_whenInRearDisplayMode() {
+ kosmos.testScope.runTest {
+ val isShowing by collectLastValue(underTest.isShowing)
+ setupTestConfiguration(isInRearDisplayMode = true)
+
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = true)
+ runCurrent()
+
+ assertThat(isShowing).isFalse()
+ }
+ }
+
+ @Test
+ fun verifyIsShowingUpdates_onPrimaryBouncerShowAndHide() {
+ kosmos.testScope.runTest {
+ val isShowing by collectLastValue(underTest.isShowing)
+ setupTestConfiguration(isInRearDisplayMode = false)
+
+ // Show primary bouncer
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = true)
+ runCurrent()
+
+ assertThat(isShowing).isTrue()
+
+ // Hide primary bouncer
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = false)
+ runCurrent()
+
+ assertThat(isShowing).isFalse()
+ }
+ }
+
+ @Test
+ fun verifyIsShowingUpdates_onAlternateBouncerShowAndHide() {
+ kosmos.testScope.runTest {
+ val isShowing by collectLastValue(underTest.isShowing)
+ setupTestConfiguration(isInRearDisplayMode = false)
+
+ updateSfpsIndicatorRequests(kosmos, mContext, alternateBouncerRequest = true)
+ runCurrent()
+
+ assertThat(isShowing).isTrue()
+
+ // Hide alternate bouncer
+ updateSfpsIndicatorRequests(kosmos, mContext, alternateBouncerRequest = false)
+ runCurrent()
+
+ assertThat(isShowing).isFalse()
+ }
+ }
+
+ @Test
+ fun verifyIsShowingUpdates_onSystemServerAuthenticationStartedAndStopped() {
+ kosmos.testScope.runTest {
+ val isShowing by collectLastValue(underTest.isShowing)
+ setupTestConfiguration(isInRearDisplayMode = false)
+
+ updateSfpsIndicatorRequests(kosmos, mContext, biometricPromptRequest = true)
+ runCurrent()
+
+ assertThat(isShowing).isTrue()
+
+ // System server authentication stopped
+ updateSfpsIndicatorRequests(kosmos, mContext, biometricPromptRequest = false)
+ runCurrent()
+
+ assertThat(isShowing).isFalse()
+ }
+ }
+
+ // On progress bar shown - hide indicator
+ // On progress bar hidden - show indicator
+ // TODO(b/365182034): update + enable when rest to unlock feature is implemented
+ @Ignore("b/365182034")
+ @Test
+ fun verifyIsShowingUpdates_onProgressBarInteraction() {
+ kosmos.testScope.runTest {
+ val isShowing by collectLastValue(underTest.isShowing)
+ setupTestConfiguration(isInRearDisplayMode = false)
+
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = true)
+ runCurrent()
+
+ assertThat(isShowing).isTrue()
+
+ // updateSfpsIndicatorRequests(
+ // kosmos, mContext, primaryBouncerRequest = true, progressBarShowing =
+ // true
+ // )
+ runCurrent()
+
+ assertThat(isShowing).isFalse()
+
+ // Set progress bar invisible
+ // updateSfpsIndicatorRequests(
+ // kosmos, mContext, primaryBouncerRequest = true, progressBarShowing =
+ // false
+ // )
+ runCurrent()
+
+ // Verify indicator shown
+ assertThat(isShowing).isTrue()
+ }
+ }
+
+ private suspend fun TestScope.setupTestConfiguration(isInRearDisplayMode: Boolean) {
+ kosmos.fingerprintPropertyRepository.setProperties(
+ sensorId = 1,
+ strength = SensorStrength.STRONG,
+ sensorType = FingerprintSensorType.POWER_BUTTON,
+ sensorLocations = emptyMap()
+ )
+
+ kosmos.displayStateRepository.setIsInRearDisplayMode(isInRearDisplayMode)
+ kosmos.displayRepository.emitDisplayChangeEvent(0)
+ runCurrent()
+
+ kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
+ AuthenticationReason.NotRunning
+ )
+ // TODO(b/365182034): set progress bar visibility once rest to unlock feature is implemented
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderTest.kt
index 7fa165c..2eea668 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderTest.kt
@@ -16,64 +16,48 @@
package com.android.systemui.biometrics.ui.binder
-import android.animation.Animator
-import android.graphics.Rect
-import android.hardware.biometrics.SensorLocationInternal
-import android.hardware.display.DisplayManager
-import android.hardware.display.DisplayManagerGlobal
import android.testing.TestableLooper
-import android.view.Display
-import android.view.DisplayInfo
import android.view.LayoutInflater
import android.view.View
-import android.view.ViewPropertyAnimator
-import android.view.WindowInsets
import android.view.WindowManager
-import android.view.WindowMetrics
import android.view.layoutInflater
import android.view.windowManager
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.airbnb.lottie.LottieAnimationView
-import com.android.keyguard.keyguardUpdateMonitor
import com.android.systemui.SysuiTestCase
-import com.android.systemui.biometrics.FingerprintInteractiveToAuthProvider
-import com.android.systemui.biometrics.data.repository.biometricStatusRepository
import com.android.systemui.biometrics.data.repository.fingerprintPropertyRepository
-import com.android.systemui.biometrics.shared.model.AuthenticationReason
import com.android.systemui.biometrics.shared.model.DisplayRotation
import com.android.systemui.biometrics.shared.model.FingerprintSensorType
import com.android.systemui.biometrics.shared.model.SensorStrength
-import com.android.systemui.bouncer.data.repository.keyguardBouncerRepository
+import com.android.systemui.biometrics.updateSfpsIndicatorRequests
import com.android.systemui.display.data.repository.displayRepository
import com.android.systemui.display.data.repository.displayStateRepository
-import com.android.systemui.keyguard.ui.viewmodel.sideFpsProgressBarViewModel
import com.android.systemui.kosmos.testScope
import com.android.systemui.res.R
import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.eq
-import com.android.systemui.util.mockito.whenever
import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.Captor
import org.mockito.Mock
-import org.mockito.Mockito
import org.mockito.Mockito.any
import org.mockito.Mockito.inOrder
import org.mockito.Mockito.mock
import org.mockito.Mockito.never
-import org.mockito.Mockito.spy
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
-import org.mockito.kotlin.argumentCaptor
+import org.mockito.kotlin.firstValue
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@@ -83,84 +67,25 @@
private val kosmos = testKosmos()
@JvmField @Rule var mockitoRule: MockitoRule = MockitoJUnit.rule()
- @Mock private lateinit var displayManager: DisplayManager
- @Mock
- private lateinit var fingerprintInteractiveToAuthProvider: FingerprintInteractiveToAuthProvider
@Mock private lateinit var layoutInflater: LayoutInflater
@Mock private lateinit var sideFpsView: View
-
- private val contextDisplayInfo = DisplayInfo()
-
- private var displayWidth: Int = 0
- private var displayHeight: Int = 0
- private var boundsWidth: Int = 0
- private var boundsHeight: Int = 0
-
- private lateinit var deviceConfig: DeviceConfig
- private lateinit var sensorLocation: SensorLocationInternal
-
- enum class DeviceConfig {
- X_ALIGNED,
- Y_ALIGNED,
- }
+ @Captor private lateinit var viewCaptor: ArgumentCaptor<View>
@Before
fun setup() {
allowTestableLooperAsMainThread() // repeatWhenAttached requires the main thread
-
- mContext = spy(mContext)
-
- val resources = mContext.resources
- whenever(mContext.display)
- .thenReturn(
- Display(mock(DisplayManagerGlobal::class.java), 1, contextDisplayInfo, resources)
- )
-
kosmos.layoutInflater = layoutInflater
-
- whenever(fingerprintInteractiveToAuthProvider.enabledForCurrentUser)
- .thenReturn(MutableStateFlow(false))
-
- context.addMockSystemService(DisplayManager::class.java, displayManager)
context.addMockSystemService(WindowManager::class.java, kosmos.windowManager)
-
`when`(layoutInflater.inflate(R.layout.sidefps_view, null, false)).thenReturn(sideFpsView)
`when`(sideFpsView.requireViewById<LottieAnimationView>(eq(R.id.sidefps_animation)))
.thenReturn(mock(LottieAnimationView::class.java))
- with(mock(ViewPropertyAnimator::class.java)) {
- `when`(sideFpsView.animate()).thenReturn(this)
- `when`(alpha(Mockito.anyFloat())).thenReturn(this)
- `when`(setStartDelay(Mockito.anyLong())).thenReturn(this)
- `when`(setDuration(Mockito.anyLong())).thenReturn(this)
- `when`(setListener(any())).thenAnswer {
- (it.arguments[0] as Animator.AnimatorListener).onAnimationEnd(
- mock(Animator::class.java)
- )
- this
- }
- }
}
@Test
fun verifyIndicatorNotAdded_whenInRearDisplayMode() {
kosmos.testScope.runTest {
- setupTestConfiguration(
- DeviceConfig.X_ALIGNED,
- rotation = DisplayRotation.ROTATION_0,
- isInRearDisplayMode = true
- )
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.NotRunning
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
- updatePrimaryBouncer(
- isShowing = true,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
- runCurrent()
-
+ setupTestConfiguration(isInRearDisplayMode = true)
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = true)
verify(kosmos.windowManager, never()).addView(any(), any())
}
}
@@ -168,33 +93,14 @@
@Test
fun verifyIndicatorShowAndHide_onPrimaryBouncerShowAndHide() {
kosmos.testScope.runTest {
- setupTestConfiguration(
- DeviceConfig.X_ALIGNED,
- rotation = DisplayRotation.ROTATION_0,
- isInRearDisplayMode = false
- )
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.NotRunning
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
- // Show primary bouncer
- updatePrimaryBouncer(
- isShowing = true,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
+ setupTestConfiguration(isInRearDisplayMode = false)
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = true)
runCurrent()
verify(kosmos.windowManager).addView(any(), any())
// Hide primary bouncer
- updatePrimaryBouncer(
- isShowing = false,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = false)
runCurrent()
verify(kosmos.windowManager).removeView(any())
@@ -204,30 +110,19 @@
@Test
fun verifyIndicatorShowAndHide_onAlternateBouncerShowAndHide() {
kosmos.testScope.runTest {
- setupTestConfiguration(
- DeviceConfig.X_ALIGNED,
- rotation = DisplayRotation.ROTATION_0,
- isInRearDisplayMode = false
- )
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.NotRunning
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
- // Show alternate bouncer
- kosmos.keyguardBouncerRepository.setAlternateVisible(true)
+ setupTestConfiguration(isInRearDisplayMode = false)
+ updateSfpsIndicatorRequests(kosmos, mContext, alternateBouncerRequest = true)
runCurrent()
verify(kosmos.windowManager).addView(any(), any())
- var viewCaptor = argumentCaptor<View>()
verify(kosmos.windowManager).addView(viewCaptor.capture(), any())
verify(viewCaptor.firstValue)
.announceForAccessibility(
mContext.getText(R.string.accessibility_side_fingerprint_indicator_label)
)
- // Hide alternate bouncer
- kosmos.keyguardBouncerRepository.setAlternateVisible(false)
+ updateSfpsIndicatorRequests(kosmos, mContext, alternateBouncerRequest = false)
runCurrent()
verify(kosmos.windowManager).removeView(any())
@@ -237,30 +132,14 @@
@Test
fun verifyIndicatorShownAndHidden_onSystemServerAuthenticationStartedAndStopped() {
kosmos.testScope.runTest {
- setupTestConfiguration(
- DeviceConfig.X_ALIGNED,
- rotation = DisplayRotation.ROTATION_0,
- isInRearDisplayMode = false
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
- updatePrimaryBouncer(
- isShowing = false,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
- // System server authentication started
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.BiometricPromptAuthentication
- )
+ setupTestConfiguration(isInRearDisplayMode = false)
+ updateSfpsIndicatorRequests(kosmos, mContext, biometricPromptRequest = true)
runCurrent()
verify(kosmos.windowManager).addView(any(), any())
// System server authentication stopped
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.NotRunning
- )
+ updateSfpsIndicatorRequests(kosmos, mContext, biometricPromptRequest = false)
runCurrent()
verify(kosmos.windowManager).removeView(any())
@@ -269,45 +148,35 @@
// On progress bar shown - hide indicator
// On progress bar hidden - show indicator
+ // TODO(b/365182034): update + enable when rest to unlock feature is implemented
+ @Ignore("b/365182034")
@Test
fun verifyIndicatorProgressBarInteraction() {
kosmos.testScope.runTest {
// Pre-auth conditions
- setupTestConfiguration(
- DeviceConfig.X_ALIGNED,
- rotation = DisplayRotation.ROTATION_0,
- isInRearDisplayMode = false
- )
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.NotRunning
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
-
- // Show primary bouncer
- updatePrimaryBouncer(
- isShowing = true,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
+ setupTestConfiguration(isInRearDisplayMode = false)
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = true)
runCurrent()
val inOrder = inOrder(kosmos.windowManager)
-
// Verify indicator shown
inOrder.verify(kosmos.windowManager).addView(any(), any())
// Set progress bar visible
- kosmos.sideFpsProgressBarViewModel.setVisible(true)
-
+ // updateSfpsIndicatorRequests(
+ // kosmos, mContext, primaryBouncerRequest = true, progressBarShowing =
+ // true
+ // )
runCurrent()
// Verify indicator hidden
inOrder.verify(kosmos.windowManager).removeView(any())
// Set progress bar invisible
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
-
+ // updateSfpsIndicatorRequests(
+ // kosmos, mContext, primaryBouncerRequest = true, progressBarShowing =
+ // false
+ // )
runCurrent()
// Verify indicator shown
@@ -315,78 +184,18 @@
}
}
- private fun updatePrimaryBouncer(
- isShowing: Boolean,
- isAnimatingAway: Boolean,
- fpsDetectionRunning: Boolean,
- isUnlockingWithFpAllowed: Boolean,
- ) {
- kosmos.keyguardBouncerRepository.setPrimaryShow(isShowing)
- kosmos.keyguardBouncerRepository.setPrimaryStartingToHide(false)
- val primaryStartDisappearAnimation = if (isAnimatingAway) Runnable {} else null
- kosmos.keyguardBouncerRepository.setPrimaryStartDisappearAnimation(
- primaryStartDisappearAnimation
- )
-
- whenever(kosmos.keyguardUpdateMonitor.isFingerprintDetectionRunning)
- .thenReturn(fpsDetectionRunning)
- whenever(kosmos.keyguardUpdateMonitor.isUnlockingWithFingerprintAllowed)
- .thenReturn(isUnlockingWithFpAllowed)
- mContext.orCreateTestableResources.addOverride(
- R.bool.config_show_sidefps_hint_on_bouncer,
- true
- )
- }
-
- private suspend fun TestScope.setupTestConfiguration(
- deviceConfig: DeviceConfig,
- rotation: DisplayRotation = DisplayRotation.ROTATION_0,
- isInRearDisplayMode: Boolean,
- ) {
- this@SideFpsOverlayViewBinderTest.deviceConfig = deviceConfig
-
- when (deviceConfig) {
- DeviceConfig.X_ALIGNED -> {
- displayWidth = 3000
- displayHeight = 1500
- boundsWidth = 200
- boundsHeight = 100
- sensorLocation = SensorLocationInternal("", 2500, 0, boundsWidth / 2)
- }
- DeviceConfig.Y_ALIGNED -> {
- displayWidth = 2500
- displayHeight = 2000
- boundsWidth = 100
- boundsHeight = 200
- sensorLocation = SensorLocationInternal("", displayWidth, 300, boundsHeight / 2)
- }
- }
-
- whenever(kosmos.windowManager.maximumWindowMetrics)
- .thenReturn(
- WindowMetrics(
- Rect(0, 0, displayWidth, displayHeight),
- mock(WindowInsets::class.java),
- )
- )
-
- contextDisplayInfo.uniqueId = DISPLAY_ID
-
+ private suspend fun TestScope.setupTestConfiguration(isInRearDisplayMode: Boolean) {
kosmos.fingerprintPropertyRepository.setProperties(
sensorId = 1,
strength = SensorStrength.STRONG,
sensorType = FingerprintSensorType.POWER_BUTTON,
- sensorLocations = mapOf(DISPLAY_ID to sensorLocation)
+ sensorLocations = emptyMap()
)
kosmos.displayStateRepository.setIsInRearDisplayMode(isInRearDisplayMode)
- kosmos.displayStateRepository.setCurrentRotation(rotation)
+ kosmos.displayStateRepository.setCurrentRotation(DisplayRotation.ROTATION_0)
kosmos.displayRepository.emitDisplayChangeEvent(0)
kosmos.sideFpsOverlayViewBinder.start()
runCurrent()
}
-
- companion object {
- private const val DISPLAY_ID = "displayId"
- }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelTest.kt
index 0db7b62..27b1371 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelTest.kt
@@ -30,23 +30,19 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.airbnb.lottie.model.KeyPath
-import com.android.keyguard.keyguardUpdateMonitor
import com.android.settingslib.Utils
import com.android.systemui.SysuiTestCase
import com.android.systemui.biometrics.FingerprintInteractiveToAuthProvider
-import com.android.systemui.biometrics.data.repository.biometricStatusRepository
import com.android.systemui.biometrics.data.repository.fingerprintPropertyRepository
import com.android.systemui.biometrics.domain.interactor.displayStateInteractor
-import com.android.systemui.biometrics.shared.model.AuthenticationReason
import com.android.systemui.biometrics.shared.model.DisplayRotation
import com.android.systemui.biometrics.shared.model.FingerprintSensorType
import com.android.systemui.biometrics.shared.model.LottieCallback
import com.android.systemui.biometrics.shared.model.SensorStrength
-import com.android.systemui.bouncer.data.repository.keyguardBouncerRepository
+import com.android.systemui.biometrics.updateSfpsIndicatorRequests
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.display.data.repository.displayRepository
import com.android.systemui.display.data.repository.displayStateRepository
-import com.android.systemui.keyguard.ui.viewmodel.sideFpsProgressBarViewModel
import com.android.systemui.kosmos.testScope
import com.android.systemui.res.R
import com.android.systemui.testKosmos
@@ -284,17 +280,7 @@
kosmos.testScope.runTest {
val lottieCallbacks by collectLastValue(kosmos.sideFpsOverlayViewModel.lottieCallbacks)
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.NotRunning
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
-
- updatePrimaryBouncer(
- isShowing = true,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
+ updateSfpsIndicatorRequests(kosmos, mContext, primaryBouncerRequest = true)
runCurrent()
assertThat(lottieCallbacks)
@@ -312,17 +298,7 @@
val lottieCallbacks by collectLastValue(kosmos.sideFpsOverlayViewModel.lottieCallbacks)
setDarkMode(true)
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.BiometricPromptAuthentication
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
-
- updatePrimaryBouncer(
- isShowing = false,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
+ updateSfpsIndicatorRequests(kosmos, mContext, biometricPromptRequest = true)
runCurrent()
assertThat(lottieCallbacks)
@@ -338,17 +314,7 @@
val lottieCallbacks by collectLastValue(kosmos.sideFpsOverlayViewModel.lottieCallbacks)
setDarkMode(false)
- kosmos.biometricStatusRepository.setFingerprintAuthenticationReason(
- AuthenticationReason.BiometricPromptAuthentication
- )
- kosmos.sideFpsProgressBarViewModel.setVisible(false)
-
- updatePrimaryBouncer(
- isShowing = false,
- isAnimatingAway = false,
- fpsDetectionRunning = true,
- isUnlockingWithFpAllowed = true
- )
+ updateSfpsIndicatorRequests(kosmos, mContext, biometricPromptRequest = true)
runCurrent()
assertThat(lottieCallbacks)
@@ -371,29 +337,6 @@
mContext.resources.configuration.uiMode = uiMode
}
- private fun updatePrimaryBouncer(
- isShowing: Boolean,
- isAnimatingAway: Boolean,
- fpsDetectionRunning: Boolean,
- isUnlockingWithFpAllowed: Boolean,
- ) {
- kosmos.keyguardBouncerRepository.setPrimaryShow(isShowing)
- kosmos.keyguardBouncerRepository.setPrimaryStartingToHide(false)
- val primaryStartDisappearAnimation = if (isAnimatingAway) Runnable {} else null
- kosmos.keyguardBouncerRepository.setPrimaryStartDisappearAnimation(
- primaryStartDisappearAnimation
- )
-
- whenever(kosmos.keyguardUpdateMonitor.isFingerprintDetectionRunning)
- .thenReturn(fpsDetectionRunning)
- whenever(kosmos.keyguardUpdateMonitor.isUnlockingWithFingerprintAllowed)
- .thenReturn(isUnlockingWithFpAllowed)
- mContext.orCreateTestableResources.addOverride(
- R.bool.config_show_sidefps_hint_on_bouncer,
- true
- )
- }
-
private suspend fun TestScope.setupTestConfiguration(
deviceConfig: DeviceConfig,
rotation: DisplayRotation = DisplayRotation.ROTATION_0,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorTest.kt
index 65236f0..e3b5f34 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorTest.kt
@@ -31,6 +31,8 @@
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.kosmos.testScope
+import com.android.systemui.scene.domain.interactor.sceneInteractor
+import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeMobileConnectionsRepository
import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository
import com.android.systemui.telephony.data.repository.fakeTelephonyRepository
@@ -91,6 +93,8 @@
kosmos.fakeTelephonyRepository.setHasTelephonyRadio(true)
kosmos.telecomManager = telecomManager
+
+ kosmos.sceneInteractor.changeScene(Scenes.Bouncer, "")
}
@Test
@@ -130,6 +134,7 @@
assertThat(metricsLogger.logs.element().category)
.isEqualTo(MetricsProto.MetricsEvent.ACTION_EMERGENCY_CALL)
verify(activityTaskManager).stopSystemLockTaskMode()
+ assertThat(kosmos.sceneInteractor.currentScene.value).isEqualTo(Scenes.Lockscreen)
verify(telecomManager).showInCallScreen(eq(false))
}
@@ -156,6 +161,7 @@
assertThat(metricsLogger.logs.element().category)
.isEqualTo(MetricsProto.MetricsEvent.ACTION_EMERGENCY_CALL)
verify(activityTaskManager).stopSystemLockTaskMode()
+ assertThat(kosmos.sceneInteractor.currentScene.value).isEqualTo(Scenes.Lockscreen)
// TODO(b/25189994): Test the activity has been started once we switch to the
// ActivityStarter interface here.
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModelTest.kt
index 8d82e97..2ee4aee 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModelTest.kt
@@ -16,6 +16,8 @@
package com.android.systemui.bouncer.ui.viewmodel
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
import android.view.KeyEvent.KEYCODE_0
import android.view.KeyEvent.KEYCODE_4
import android.view.KeyEvent.KEYCODE_A
@@ -31,6 +33,7 @@
import com.android.systemui.authentication.domain.interactor.authenticationInteractor
import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
import com.android.systemui.bouncer.data.repository.fakeSimBouncerRepository
+import com.android.systemui.classifier.fakeFalsingCollector
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.testScope
import com.android.systemui.lifecycle.activateIn
@@ -41,6 +44,7 @@
import com.google.common.truth.Truth.assertThat
import kotlin.random.Random
import kotlin.random.nextInt
+import kotlin.test.assertTrue
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.map
@@ -60,12 +64,13 @@
private val testScope = kosmos.testScope
private val sceneInteractor by lazy { kosmos.sceneInteractor }
private val authenticationInteractor by lazy { kosmos.authenticationInteractor }
- private val underTest =
+ private val underTest by lazy {
kosmos.pinBouncerViewModelFactory.create(
isInputEnabled = MutableStateFlow(true),
onIntentionalUserInput = {},
authenticationMethod = AuthenticationMethodModel.Pin,
)
+ }
@Before
fun setUp() {
@@ -475,6 +480,18 @@
assertThat(pin).containsExactly(*expectedPin)
}
+ @Test
+ @EnableFlags(com.android.systemui.Flags.FLAG_COMPOSE_BOUNCER)
+ @DisableFlags(com.android.systemui.Flags.FLAG_SCENE_CONTAINER)
+ fun onDigitButtonDown_avoidGesture_invoked() =
+ testScope.runTest {
+ lockDeviceAndOpenPinBouncer()
+
+ underTest.onDigitButtonDown()
+
+ assertTrue(kosmos.fakeFalsingCollector.wasLastGestureAvoided())
+ }
+
private fun TestScope.switchToScene(toScene: SceneKey) {
val currentScene by collectLastValue(sceneInteractor.currentScene)
val bouncerHidden = currentScene == Scenes.Bouncer && toScene != Scenes.Bouncer
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/classifier/BrightLineFalsingManagerTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/classifier/BrightLineFalsingManagerTest.java
index 53d82d7..956c129 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/classifier/BrightLineFalsingManagerTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/classifier/BrightLineFalsingManagerTest.java
@@ -95,6 +95,7 @@
when(mFalsingDataProvider.getRecentMotionEvents()).thenReturn(mMotionEventList);
when(mKeyguardStateController.isShowing()).thenReturn(true);
when(mFalsingDataProvider.isUnfolded()).thenReturn(false);
+ when(mFalsingDataProvider.isTouchScreenSource()).thenReturn(true);
mBrightLineFalsingManager = new BrightLineFalsingManager(mFalsingDataProvider,
mMetricsLogger, mClassifiers, mSingleTapClassifier, mLongTapClassifier,
mDoubleTapClassifier, mHistoryTracker, mKeyguardStateController,
@@ -193,6 +194,13 @@
}
@Test
+ public void testSkipNonTouchscreenDevices() {
+ assertThat(mBrightLineFalsingManager.isFalseTouch(Classifier.GENERIC)).isTrue();
+ when(mFalsingDataProvider.isTouchScreenSource()).thenReturn(false);
+ assertThat(mBrightLineFalsingManager.isFalseTouch(Classifier.GENERIC)).isFalse();
+ }
+
+ @Test
public void testTrackpadGesture() {
assertThat(mBrightLineFalsingManager.isFalseTouch(Classifier.GENERIC)).isTrue();
when(mFalsingDataProvider.isFromTrackpad()).thenReturn(true);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/FalsingDataProviderTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/classifier/FalsingDataProviderTest.java
similarity index 81%
rename from packages/SystemUI/tests/src/com/android/systemui/classifier/FalsingDataProviderTest.java
rename to packages/SystemUI/multivalentTests/src/com/android/systemui/classifier/FalsingDataProviderTest.java
index 49c6239..df4b048 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/FalsingDataProviderTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/classifier/FalsingDataProviderTest.java
@@ -18,6 +18,7 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
@@ -25,13 +26,20 @@
import static org.mockito.Mockito.when;
import android.hardware.devicestate.DeviceStateManager.FoldStateListener;
+import android.hardware.input.IInputManager;
+import android.hardware.input.InputManagerGlobal;
+import android.os.RemoteException;
+import android.platform.test.annotations.DisableFlags;
+import android.platform.test.annotations.EnableFlags;
import android.util.DisplayMetrics;
+import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
+import com.android.systemui.Flags;
import com.android.systemui.classifier.FalsingDataProvider.GestureFinalizedListener;
import com.android.systemui.dock.DockManagerFake;
import com.android.systemui.statusbar.policy.BatteryController;
@@ -56,11 +64,15 @@
private FoldStateListener mFoldStateListener;
private final DockManagerFake mDockManager = new DockManagerFake();
private DisplayMetrics mDisplayMetrics;
+ private IInputManager mIInputManager;
+ private InputManagerGlobal.TestSession inputManagerGlobalTestSession;
@Before
public void setup() {
super.setup();
MockitoAnnotations.initMocks(this);
+ mIInputManager = mock(IInputManager.Stub.class);
+ inputManagerGlobalTestSession = InputManagerGlobal.createTestSession(mIInputManager);
mDisplayMetrics = new DisplayMetrics();
mDisplayMetrics.xdpi = 100;
mDisplayMetrics.ydpi = 100;
@@ -73,6 +85,7 @@
public void tearDown() {
super.tearDown();
mDataProvider.onSessionEnd();
+ inputManagerGlobalTestSession.close();
}
@Test
@@ -378,6 +391,79 @@
}
@Test
+ @DisableFlags(Flags.FLAG_NON_TOUCHSCREEN_DEVICES_BYPASS_FALSING)
+ public void test_isTouchscreenSource_flagOff_alwaysTrue() {
+ assertThat(mDataProvider.isTouchScreenSource()).isTrue();
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_NON_TOUCHSCREEN_DEVICES_BYPASS_FALSING)
+ public void test_isTouchscreenSource_recentEventsEmpty_true() {
+ //send no events into the data provider
+ assertThat(mDataProvider.isTouchScreenSource()).isTrue();
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_NON_TOUCHSCREEN_DEVICES_BYPASS_FALSING)
+ public void test_isTouchscreenSource_latestDeviceTouchscreen_true() throws RemoteException {
+ int deviceId = 999;
+
+ InputDevice device = new InputDevice.Builder()
+ .setSources(InputDevice.SOURCE_CLASS_TRACKBALL | InputDevice.SOURCE_TOUCHSCREEN)
+ .setId(deviceId)
+ .build();
+ when(mIInputManager.getInputDeviceIds()).thenReturn(new int[]{deviceId});
+ when(mIInputManager.getInputDevice(anyInt())).thenReturn(device);
+
+ MotionEvent event = MotionEvent.obtain(1, 0, MotionEvent.ACTION_UP, 1,
+ MotionEvent.PointerProperties.createArray(1),
+ MotionEvent.PointerCoords.createArray(1), 0, 0, 1.0f, 1.0f, deviceId, 0,
+ InputDevice.SOURCE_CLASS_NONE, 0, 0, 0);
+
+ mDataProvider.onMotionEvent(event);
+ boolean result = mDataProvider.isTouchScreenSource();
+ assertThat(result).isTrue();
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_NON_TOUCHSCREEN_DEVICES_BYPASS_FALSING)
+ public void test_isTouchscreenSource_latestDeviceNonTouchscreen_false() throws RemoteException {
+ int deviceId = 9999;
+
+ InputDevice device = new InputDevice.Builder()
+ .setSources(InputDevice.SOURCE_CLASS_TRACKBALL)
+ .setId(deviceId)
+ .build();
+ when(mIInputManager.getInputDeviceIds()).thenReturn(new int[]{deviceId});
+ when(mIInputManager.getInputDevice(anyInt())).thenReturn(device);
+
+ MotionEvent event = MotionEvent.obtain(1, 0, MotionEvent.ACTION_UP, 1,
+ MotionEvent.PointerProperties.createArray(1),
+ MotionEvent.PointerCoords.createArray(1), 0, 0, 1.0f, 1.0f, deviceId, 0,
+ InputDevice.SOURCE_CLASS_NONE, 0, 0, 0);
+
+ mDataProvider.onMotionEvent(event);
+ boolean result = mDataProvider.isTouchScreenSource();
+ assertThat(result).isFalse();
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_NON_TOUCHSCREEN_DEVICES_BYPASS_FALSING)
+ public void test_isTouchscreenSource_latestDeviceNull_true() {
+ // Do not mock InputManager for this test
+ inputManagerGlobalTestSession.close();
+
+ int nonExistentDeviceId = 9997;
+ MotionEvent event = MotionEvent.obtain(1, 0, MotionEvent.ACTION_UP, 1,
+ MotionEvent.PointerProperties.createArray(1),
+ MotionEvent.PointerCoords.createArray(1), 0, 0, 1.0f, 1.0f, nonExistentDeviceId, 0,
+ InputDevice.SOURCE_CLASS_NONE, 0, 0, 0);
+
+ mDataProvider.onMotionEvent(event);
+ assertThat(mDataProvider.isTouchScreenSource()).isTrue();
+ }
+
+ @Test
public void test_UnfoldedState_Folded() {
FalsingDataProvider falsingDataProvider = createWithFoldCapability(true);
when(mFoldStateListener.getFolded()).thenReturn(true);
@@ -413,7 +499,7 @@
}
private FalsingDataProvider createWithFoldCapability(boolean foldable) {
- return new FalsingDataProvider(
- mDisplayMetrics, mBatteryController, mFoldStateListener, mDockManager, foldable);
+ return new FalsingDataProvider(mDisplayMetrics, mBatteryController, mFoldStateListener,
+ mDockManager, foldable);
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandlerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandlerTest.kt
index bb400f2..f06cd6a 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandlerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandlerTest.kt
@@ -67,7 +67,8 @@
isAttachedToWindow = { isAttachedToWindow },
onLongPressDetected = onLongPressDetected,
onSingleTapDetected = onSingleTapDetected,
- longPressDuration = { ViewConfiguration.getLongPressTimeout().toLong() }
+ longPressDuration = { ViewConfiguration.getLongPressTimeout().toLong() },
+ allowedTouchSlop = ViewConfiguration.getTouchSlop(),
)
underTest.isLongPressHandlingEnabled = true
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalDreamStartableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalDreamStartableTest.kt
index 3b0057d..e531e65 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalDreamStartableTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalDreamStartableTest.kt
@@ -22,6 +22,7 @@
import androidx.test.filters.SmallTest
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
+import com.android.systemui.communal.domain.interactor.communalSceneInteractor
import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
import com.android.systemui.flags.Flags.COMMUNAL_SERVICE_ENABLED
import com.android.systemui.flags.fakeFeatureFlagsClassic
@@ -73,6 +74,7 @@
keyguardInteractor = kosmos.keyguardInteractor,
keyguardTransitionInteractor = kosmos.keyguardTransitionInteractor,
dreamManager = dreamManager,
+ communalSceneInteractor = kosmos.communalSceneInteractor,
bgScope = kosmos.applicationCoroutineScope,
)
.apply { start() }
@@ -158,6 +160,36 @@
}
}
+ @Test
+ fun shouldNotStartDreamWhenLaunchingWidget() =
+ testScope.runTest {
+ keyguardRepository.setKeyguardShowing(true)
+ keyguardRepository.setDreaming(false)
+ powerRepository.setScreenPowerState(ScreenPowerState.SCREEN_ON)
+ kosmos.communalSceneInteractor.setIsLaunchingWidget(true)
+ whenever(dreamManager.canStartDreaming(/* isScreenOn= */ true)).thenReturn(true)
+ runCurrent()
+
+ transition(from = KeyguardState.DREAMING, to = KeyguardState.GLANCEABLE_HUB)
+
+ verify(dreamManager, never()).startDream()
+ }
+
+ @Test
+ fun shouldNotStartDreamWhenOccluded() =
+ testScope.runTest {
+ keyguardRepository.setKeyguardShowing(true)
+ keyguardRepository.setDreaming(false)
+ powerRepository.setScreenPowerState(ScreenPowerState.SCREEN_ON)
+ keyguardRepository.setKeyguardOccluded(true)
+ whenever(dreamManager.canStartDreaming(/* isScreenOn= */ true)).thenReturn(true)
+ runCurrent()
+
+ transition(from = KeyguardState.DREAMING, to = KeyguardState.GLANCEABLE_HUB)
+
+ verify(dreamManager, never()).startDream()
+ }
+
private suspend fun TestScope.transition(from: KeyguardState, to: KeyguardState) {
kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps(
from = from,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt
index 777ddab..75ae414 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt
@@ -664,22 +664,31 @@
testScope.runTest {
// Verify default is false
val isCommunalShowing by collectLastValue(underTest.isCommunalShowing)
- runCurrent()
- assertThat(isCommunalShowing).isFalse()
-
- // Verify scene changes without the flag doesn't have any impact
- underTest.changeScene(CommunalScenes.Communal, "test")
- runCurrent()
assertThat(isCommunalShowing).isFalse()
// Verify scene changes (with the flag) to communal sets the value to true
sceneInteractor.changeScene(Scenes.Communal, loggingReason = "")
- runCurrent()
assertThat(isCommunalShowing).isTrue()
// Verify scene changes (with the flag) to lockscreen sets the value to false
sceneInteractor.changeScene(Scenes.Lockscreen, loggingReason = "")
- runCurrent()
+ assertThat(isCommunalShowing).isFalse()
+ }
+
+ @Test
+ @EnableSceneContainer
+ fun isCommunalShowing_whenSceneContainerEnabledAndChangeToLegacyScene() =
+ testScope.runTest {
+ // Verify default is false
+ val isCommunalShowing by collectLastValue(underTest.isCommunalShowing)
+ assertThat(isCommunalShowing).isFalse()
+
+ // Verify legacy scene change still makes communal show
+ underTest.changeScene(CommunalScenes.Communal, "test")
+ assertThat(isCommunalShowing).isTrue()
+
+ // Verify legacy scene change to blank makes communal hidden
+ underTest.changeScene(CommunalScenes.Blank, "test")
assertThat(isCommunalShowing).isFalse()
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt
index dfb75ca..6a9b9be 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt
@@ -16,18 +16,23 @@
package com.android.systemui.communal.domain.interactor
-import androidx.test.ext.junit.runners.AndroidJUnit4
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.FlagsParameterization
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
+import com.android.systemui.Flags.FLAG_SCENE_CONTAINER
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.ActivityTransitionAnimator
import com.android.systemui.communal.data.repository.communalSceneRepository
import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor.OnSceneAboutToChangeListener
import com.android.systemui.communal.domain.model.CommunalTransitionProgressModel
import com.android.systemui.communal.shared.model.CommunalScenes
-import com.android.systemui.communal.shared.model.EditModeState
import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.flags.andSceneContainer
import com.android.systemui.kosmos.testScope
+import com.android.systemui.scene.initialSceneKey
+import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -42,10 +47,24 @@
import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.verify
+import platform.test.runner.parameterized.ParameterizedAndroidJunit4
+import platform.test.runner.parameterized.Parameters
@SmallTest
-@RunWith(AndroidJUnit4::class)
-class CommunalSceneInteractorTest : SysuiTestCase() {
+@RunWith(ParameterizedAndroidJunit4::class)
+class CommunalSceneInteractorTest(flags: FlagsParameterization) : SysuiTestCase() {
+
+ companion object {
+ @JvmStatic
+ @Parameters(name = "{0}")
+ fun getParams(): List<FlagsParameterization> {
+ return FlagsParameterization.allCombinationsOf().andSceneContainer()
+ }
+ }
+
+ init {
+ mSetFlagsRule.setFlagsParameterization(flags)
+ }
private val kosmos = testKosmos()
private val testScope = kosmos.testScope
@@ -53,6 +72,7 @@
private val repository = kosmos.communalSceneRepository
private val underTest by lazy { kosmos.communalSceneInteractor }
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun changeScene() =
testScope.runTest {
@@ -63,6 +83,7 @@
assertThat(currentScene).isEqualTo(CommunalScenes.Communal)
}
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun changeScene_callsSceneStateProcessor() =
testScope.runTest {
@@ -78,6 +99,7 @@
verify(callback).onSceneAboutToChange(CommunalScenes.Communal, null)
}
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun changeScene_doesNotCallSceneStateProcessorForDuplicateState() =
testScope.runTest {
@@ -93,6 +115,7 @@
verify(callback, never()).onSceneAboutToChange(any(), anyOrNull())
}
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun snapToScene() =
testScope.runTest {
@@ -104,6 +127,7 @@
}
@OptIn(ExperimentalCoroutinesApi::class)
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun snapToSceneWithDelay() =
testScope.runTest {
@@ -119,30 +143,7 @@
assertThat(currentScene).isEqualTo(CommunalScenes.Communal)
}
- @Test
- fun changeSceneForActivityStartOnDismissKeyguard() =
- testScope.runTest {
- val currentScene by collectLastValue(underTest.currentScene)
- underTest.snapToScene(CommunalScenes.Communal, "test")
- assertThat(currentScene).isEqualTo(CommunalScenes.Communal)
-
- underTest.changeSceneForActivityStartOnDismissKeyguard()
- assertThat(currentScene).isEqualTo(CommunalScenes.Blank)
- }
-
- @Test
- fun changeSceneForActivityStartOnDismissKeyguard_willNotChangeScene_forEditModeActivity() =
- testScope.runTest {
- val currentScene by collectLastValue(underTest.currentScene)
- underTest.snapToScene(CommunalScenes.Communal, "test")
- assertThat(currentScene).isEqualTo(CommunalScenes.Communal)
-
- underTest.setEditModeState(EditModeState.STARTING)
-
- underTest.changeSceneForActivityStartOnDismissKeyguard()
- assertThat(currentScene).isEqualTo(CommunalScenes.Communal)
- }
-
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun transitionProgress_fullProgress() =
testScope.runTest {
@@ -161,6 +162,7 @@
.isEqualTo(CommunalTransitionProgressModel.Idle(CommunalScenes.Communal))
}
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun transitionProgress_transitioningAwayFromTrackedScene() =
testScope.runTest {
@@ -201,6 +203,7 @@
.isEqualTo(CommunalTransitionProgressModel.Idle(CommunalScenes.Communal))
}
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun transitionProgress_transitioningToTrackedScene() =
testScope.runTest {
@@ -238,6 +241,7 @@
.isEqualTo(CommunalTransitionProgressModel.Idle(CommunalScenes.Communal))
}
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun isIdleOnCommunal() =
testScope.runTest {
@@ -265,6 +269,7 @@
assertThat(isIdleOnCommunal).isEqualTo(false)
}
+ @DisableFlags(FLAG_SCENE_CONTAINER)
@Test
fun isCommunalVisible() =
testScope.runTest {
@@ -304,4 +309,206 @@
)
assertThat(isCommunalVisible).isEqualTo(true)
}
+
+ @EnableFlags(FLAG_SCENE_CONTAINER)
+ @Test
+ fun changeScene_legacyCommunalScene_mapToStfScene() =
+ testScope.runTest {
+ val currentScene by collectLastValue(underTest.currentScene)
+
+ // Verify that the current scene is the initial scene
+ assertThat(currentScene).isEqualTo(kosmos.initialSceneKey)
+
+ // Change to legacy communal scene
+ underTest.changeScene(CommunalScenes.Communal, loggingReason = "test")
+
+ // Verify that scene changed to communal scene in STF
+ assertThat(currentScene).isEqualTo(Scenes.Communal)
+
+ // Now change to legacy blank scene
+ underTest.changeScene(CommunalScenes.Blank, loggingReason = "test")
+
+ // Verify that scene changed to lock screen scene in STF
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
+ }
+
+ @EnableFlags(FLAG_SCENE_CONTAINER)
+ @Test
+ fun changeScene_stfScenes() =
+ testScope.runTest {
+ val currentScene by collectLastValue(underTest.currentScene)
+
+ // Verify that the current scene is the initial scene
+ assertThat(currentScene).isEqualTo(kosmos.initialSceneKey)
+
+ // Change to communal scene
+ underTest.changeScene(Scenes.Communal, loggingReason = "test")
+
+ // Verify changed to communal scene
+ assertThat(currentScene).isEqualTo(Scenes.Communal)
+
+ // Now change to lockscreen scene
+ underTest.changeScene(Scenes.Lockscreen, loggingReason = "test")
+
+ // Verify changed to lockscreen scene
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
+ }
+
+ @EnableFlags(FLAG_SCENE_CONTAINER)
+ @Test
+ fun snapToScene_legacyCommunalScene_mapToStfScene() =
+ testScope.runTest {
+ val currentScene by collectLastValue(underTest.currentScene)
+
+ // Verify that the current scene is the initial scene
+ assertThat(currentScene).isEqualTo(kosmos.initialSceneKey)
+
+ // Snap to legacy communal scene
+ underTest.snapToScene(CommunalScenes.Communal, loggingReason = "test")
+
+ // Verify that scene changed to communal scene in STF
+ assertThat(currentScene).isEqualTo(Scenes.Communal)
+
+ // Now snap to legacy blank scene
+ underTest.snapToScene(CommunalScenes.Blank, loggingReason = "test")
+
+ // Verify that scene changed to lock screen scene in STF
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
+ }
+
+ @EnableFlags(FLAG_SCENE_CONTAINER)
+ @Test
+ fun snapToScene_stfScenes() =
+ testScope.runTest {
+ val currentScene by collectLastValue(underTest.currentScene)
+
+ // Verify that the current scene is the initial scene
+ assertThat(currentScene).isEqualTo(kosmos.initialSceneKey)
+
+ // Snap to communal scene
+ underTest.snapToScene(Scenes.Communal, loggingReason = "test")
+
+ // Verify changed to communal scene
+ assertThat(currentScene).isEqualTo(Scenes.Communal)
+
+ // Now snap to lockscreen scene
+ underTest.snapToScene(Scenes.Lockscreen, loggingReason = "test")
+
+ // Verify changed to lockscreen scene
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
+ }
+
+ @EnableFlags(FLAG_SCENE_CONTAINER)
+ @Test
+ fun isIdleOnCommunal_sceneContainerEnabled() =
+ testScope.runTest {
+ val transitionState: MutableStateFlow<ObservableTransitionState> =
+ MutableStateFlow(ObservableTransitionState.Idle(Scenes.Lockscreen))
+ underTest.setTransitionState(transitionState)
+
+ // isIdleOnCommunal is initially false
+ val isIdleOnCommunal by collectLastValue(underTest.isIdleOnCommunal)
+ assertThat(isIdleOnCommunal).isEqualTo(false)
+
+ // Start transition to communal.
+ transitionState.value =
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Lockscreen,
+ toScene = Scenes.Communal,
+ currentScene = flowOf(Scenes.Lockscreen),
+ progress = flowOf(0.1f),
+ isInitiatedByUserInput = false,
+ isUserInputOngoing = flowOf(false),
+ )
+ assertThat(isIdleOnCommunal).isEqualTo(false)
+
+ // Finish transition to communal
+ transitionState.value = ObservableTransitionState.Idle(Scenes.Communal)
+ assertThat(isIdleOnCommunal).isEqualTo(true)
+
+ // Start transition away from communal
+ transitionState.value =
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Communal,
+ toScene = Scenes.Lockscreen,
+ currentScene = flowOf(Scenes.Communal),
+ progress = flowOf(0.1f),
+ isInitiatedByUserInput = false,
+ isUserInputOngoing = flowOf(false),
+ )
+ assertThat(isIdleOnCommunal).isEqualTo(false)
+
+ // Finish transition to lock screen
+ transitionState.value = ObservableTransitionState.Idle(Scenes.Lockscreen)
+ assertThat(isIdleOnCommunal).isEqualTo(false)
+ }
+
+ @EnableFlags(FLAG_SCENE_CONTAINER)
+ @Test
+ fun isCommunalVisible_sceneContainerEnabled() =
+ testScope.runTest {
+ val transitionState: MutableStateFlow<ObservableTransitionState> =
+ MutableStateFlow(ObservableTransitionState.Idle(Scenes.Lockscreen))
+ underTest.setTransitionState(transitionState)
+
+ // isCommunalVisible is initially false
+ val isCommunalVisible by collectLastValue(underTest.isCommunalVisible)
+ assertThat(isCommunalVisible).isEqualTo(false)
+
+ // Start transition to communal.
+ transitionState.value =
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Lockscreen,
+ toScene = Scenes.Communal,
+ currentScene = flowOf(Scenes.Lockscreen),
+ progress = flowOf(0.1f),
+ isInitiatedByUserInput = false,
+ isUserInputOngoing = flowOf(false),
+ )
+ assertThat(isCommunalVisible).isEqualTo(true)
+
+ // Half-way transition to communal.
+ transitionState.value =
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Lockscreen,
+ toScene = Scenes.Communal,
+ currentScene = flowOf(Scenes.Lockscreen),
+ progress = flowOf(0.5f),
+ isInitiatedByUserInput = false,
+ isUserInputOngoing = flowOf(false),
+ )
+ assertThat(isCommunalVisible).isEqualTo(true)
+
+ // Finish transition to communal
+ transitionState.value = ObservableTransitionState.Idle(Scenes.Communal)
+ assertThat(isCommunalVisible).isEqualTo(true)
+
+ // Start transition away from communal
+ transitionState.value =
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Communal,
+ toScene = Scenes.Lockscreen,
+ currentScene = flowOf(Scenes.Communal),
+ progress = flowOf(0.1f),
+ isInitiatedByUserInput = false,
+ isUserInputOngoing = flowOf(false),
+ )
+ assertThat(isCommunalVisible).isEqualTo(true)
+
+ // Half-way transition away from communal
+ transitionState.value =
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Communal,
+ toScene = Scenes.Lockscreen,
+ currentScene = flowOf(Scenes.Communal),
+ progress = flowOf(0.5f),
+ isInitiatedByUserInput = false,
+ isUserInputOngoing = flowOf(false),
+ )
+ assertThat(isCommunalVisible).isEqualTo(true)
+
+ // Finish transition to lock screen
+ transitionState.value = ObservableTransitionState.Idle(Scenes.Lockscreen)
+ assertThat(isCommunalVisible).isEqualTo(false)
+ }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorTest.kt
index 3253edf..d90d58b 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorTest.kt
@@ -19,6 +19,7 @@
import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
+import com.android.compose.animation.scene.ObservableTransitionState
import com.android.compose.animation.scene.SceneKey
import com.android.systemui.SysuiTestCase
import com.android.systemui.authentication.data.repository.FakeAuthenticationRepository
@@ -42,11 +43,16 @@
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.SuccessFingerprintAuthenticationStatus
import com.android.systemui.kosmos.testScope
+import com.android.systemui.scene.domain.interactor.sceneBackInteractor
import com.android.systemui.scene.domain.interactor.sceneInteractor
+import com.android.systemui.scene.domain.startable.sceneContainerStartable
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.statusbar.sysuiStatusBarStateController
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Before
@@ -66,10 +72,14 @@
private val trustRepository by lazy { kosmos.fakeTrustRepository }
private val sceneInteractor by lazy { kosmos.sceneInteractor }
private val authenticationInteractor by lazy { kosmos.authenticationInteractor }
+ private val sceneBackInteractor by lazy { kosmos.sceneBackInteractor }
+ private val sceneContainerStartable by lazy { kosmos.sceneContainerStartable }
+ private val sysuiStatusBarStateController by lazy { kosmos.sysuiStatusBarStateController }
private lateinit var underTest: DeviceEntryInteractor
@Before
fun setUp() {
+ sceneContainerStartable.start()
underTest = kosmos.deviceEntryInteractor
}
@@ -423,8 +433,37 @@
assertThat(isUnlocked).isTrue()
}
- private fun switchToScene(sceneKey: SceneKey) {
+ @Test
+ fun isDeviceEntered_unlockedWhileOnShade_emitsTrue() =
+ testScope.runTest {
+ val isDeviceEntered by collectLastValue(underTest.isDeviceEntered)
+ assertThat(isDeviceEntered).isFalse()
+ val currentScene by collectLastValue(sceneInteractor.currentScene)
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
+
+ // Navigate to shade and bouncer:
+ switchToScene(Scenes.Shade)
+ assertThat(currentScene).isEqualTo(Scenes.Shade)
+ // Simulating a "leave it open when the keyguard is hidden" which means the bouncer will
+ // be
+ // shown and successful authentication should take the user back to where they are, the
+ // shade scene.
+ sysuiStatusBarStateController.setLeaveOpenOnKeyguardHide(true)
+ switchToScene(Scenes.Bouncer)
+ assertThat(currentScene).isEqualTo(Scenes.Bouncer)
+
+ assertThat(isDeviceEntered).isFalse()
+ // Authenticate with PIN to unlock and dismiss the lockscreen:
+ authenticationInteractor.authenticate(FakeAuthenticationRepository.DEFAULT_PIN)
+ runCurrent()
+
+ assertThat(isDeviceEntered).isTrue()
+ }
+
+ private fun TestScope.switchToScene(sceneKey: SceneKey) {
sceneInteractor.changeScene(sceneKey, "reason")
+ sceneInteractor.setTransitionState(flowOf(ObservableTransitionState.Idle(sceneKey)))
+ runCurrent()
}
private suspend fun givenCanShowAlternateBouncer() {
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt
index cd0c58f..98e0947 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt
@@ -19,14 +19,22 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
-import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.contextualeducation.GestureType.ALL_APPS
import com.android.systemui.contextualeducation.GestureType.BACK
+import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.education.data.repository.contextualEducationRepository
import com.android.systemui.education.data.repository.fakeEduClock
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
+import com.android.systemui.inputdevice.tutorial.tutorialSchedulerRepository
+import com.android.systemui.keyboard.data.repository.keyboardRepository
import com.android.systemui.kosmos.testScope
import com.android.systemui.testKosmos
+import com.android.systemui.touchpad.data.repository.touchpadRepository
import com.google.common.truth.Truth.assertThat
+import kotlin.time.Duration.Companion.seconds
+import kotlinx.coroutines.launch
import kotlinx.coroutines.test.runTest
+import org.junit.After
import org.junit.Test
import org.junit.runner.RunWith
@@ -36,24 +44,129 @@
private val kosmos = testKosmos()
private val testScope = kosmos.testScope
private val underTest = kosmos.keyboardTouchpadEduStatsInteractor
+ private val keyboardRepository = kosmos.keyboardRepository
+ private val touchpadRepository = kosmos.touchpadRepository
+ private val repository = kosmos.contextualEducationRepository
+ private val fakeClock = kosmos.fakeEduClock
+ private val tutorialSchedulerRepository = kosmos.tutorialSchedulerRepository
+ private val initialDelayElapsedDuration =
+ KeyboardTouchpadEduStatsInteractorImpl.initialDelayDuration + 1.seconds
@Test
- fun dataUpdatedOnIncrementSignalCount() =
+ fun dataUpdatedOnIncrementSignalCountWhenTouchpadConnected() =
testScope.runTest {
- val model by
- collectLastValue(kosmos.contextualEducationRepository.readGestureEduModelFlow(BACK))
+ setUpForInitialDelayElapse()
+ touchpadRepository.setIsAnyTouchpadConnected(true)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
val originalValue = model!!.signalCount
underTest.incrementSignalCount(BACK)
+
assertThat(model?.signalCount).isEqualTo(originalValue + 1)
}
@Test
+ fun dataUnchangedOnIncrementSignalCountWhenTouchpadDisconnected() =
+ testScope.runTest {
+ setUpForInitialDelayElapse()
+ touchpadRepository.setIsAnyTouchpadConnected(false)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
+ val originalValue = model!!.signalCount
+ underTest.incrementSignalCount(BACK)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ @Test
+ fun dataUpdatedOnIncrementSignalCountWhenKeyboardConnected() =
+ testScope.runTest {
+ setUpForInitialDelayElapse()
+ keyboardRepository.setIsAnyKeyboardConnected(true)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(ALL_APPS))
+ val originalValue = model!!.signalCount
+ underTest.incrementSignalCount(ALL_APPS)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+ }
+
+ @Test
+ fun dataUnchangedOnIncrementSignalCountWhenKeyboardDisconnected() =
+ testScope.runTest {
+ setUpForInitialDelayElapse()
+ keyboardRepository.setIsAnyKeyboardConnected(false)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(ALL_APPS))
+ val originalValue = model!!.signalCount
+ underTest.incrementSignalCount(ALL_APPS)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ @Test
fun dataAddedOnUpdateShortcutTriggerTime() =
testScope.runTest {
- val model by
- collectLastValue(kosmos.contextualEducationRepository.readGestureEduModelFlow(BACK))
+ val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
assertThat(model?.lastShortcutTriggeredTime).isNull()
underTest.updateShortcutTriggerTime(BACK)
assertThat(model?.lastShortcutTriggeredTime).isEqualTo(kosmos.fakeEduClock.instant())
}
+
+ @Test
+ fun dataUpdatedOnIncrementSignalCountAfterInitialDelay() =
+ testScope.runTest {
+ setUpForDeviceConnection()
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, fakeClock.instant())
+
+ fakeClock.offset(initialDelayElapsedDuration)
+ val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
+ val originalValue = model!!.signalCount
+ underTest.incrementSignalCount(BACK)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+ }
+
+ @Test
+ fun dataUnchangedOnIncrementSignalCountBeforeInitialDelay() =
+ testScope.runTest {
+ setUpForDeviceConnection()
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, fakeClock.instant())
+
+ // No offset to the clock to simulate update before initial delay
+ val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
+ val originalValue = model!!.signalCount
+ underTest.incrementSignalCount(BACK)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ @Test
+ fun dataUnchangedOnIncrementSignalCountWithoutOobeLaunchTime() =
+ testScope.runTest {
+ // No update to OOBE launch time to simulate no OOBE is launched yet
+ setUpForDeviceConnection()
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
+ val originalValue = model!!.signalCount
+ underTest.incrementSignalCount(BACK)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ private suspend fun setUpForInitialDelayElapse() {
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, fakeClock.instant())
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.KEYBOARD, fakeClock.instant())
+ fakeClock.offset(initialDelayElapsedDuration)
+ }
+
+ private fun setUpForDeviceConnection() {
+ touchpadRepository.setIsAnyTouchpadConnected(true)
+ keyboardRepository.setIsAnyKeyboardConnected(true)
+ }
+
+ @After
+ fun clear() {
+ testScope.launch { tutorialSchedulerRepository.clearDataStore() }
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractorTest.kt
similarity index 100%
rename from packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractorTest.kt
rename to packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractorTest.kt
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt
index ebefb4d..b843fd5 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt
@@ -225,6 +225,39 @@
}
@Test
+ fun dismissAlpha_onGlanceableHub_doesNotEmitWhenShadeResets() =
+ testScope.runTest {
+ val dismissAlpha by collectValues(underTest.dismissAlpha)
+ assertThat(dismissAlpha[0]).isEqualTo(1f)
+ assertThat(dismissAlpha.size).isEqualTo(1)
+
+ keyguardTransitionRepository.sendTransitionSteps(
+ from = KeyguardState.AOD,
+ to = KeyguardState.LOCKSCREEN,
+ testScope,
+ )
+
+ // User begins to swipe up
+ repository.setStatusBarState(StatusBarState.KEYGUARD)
+ repository.setKeyguardDismissible(true)
+ shadeRepository.setLegacyShadeExpansion(0.98f)
+
+ assertThat(dismissAlpha[1]).isGreaterThan(0.5f)
+ assertThat(dismissAlpha[1]).isLessThan(1f)
+ assertThat(dismissAlpha.size).isEqualTo(2)
+
+ keyguardTransitionRepository.sendTransitionSteps(
+ from = KeyguardState.LOCKSCREEN,
+ to = KeyguardState.GLANCEABLE_HUB,
+ testScope,
+ )
+
+ // Now reset the shade and verify we don't emit any new values
+ shadeRepository.setLegacyShadeExpansion(1f)
+ assertThat(dismissAlpha.size).isEqualTo(2)
+ }
+
+ @Test
fun dismissAlpha_doesNotEmitWhileTransitioning() =
testScope.runTest {
val dismissAlpha by collectLastValue(underTest.dismissAlpha)
@@ -262,7 +295,7 @@
configRepository.setDimensionPixelSize(
R.dimen.keyguard_translate_distance_on_swipe_up,
- 100
+ 100,
)
configRepository.onAnyConfigurationChange()
@@ -284,7 +317,7 @@
configRepository.setDimensionPixelSize(
R.dimen.keyguard_translate_distance_on_swipe_up,
- 100
+ 100,
)
configRepository.onAnyConfigurationChange()
@@ -306,7 +339,7 @@
configRepository.setDimensionPixelSize(
R.dimen.keyguard_translate_distance_on_swipe_up,
- 100
+ 100,
)
configRepository.onAnyConfigurationChange()
@@ -328,7 +361,7 @@
configRepository.setDimensionPixelSize(
R.dimen.keyguard_translate_distance_on_swipe_up,
- 100
+ 100,
)
configRepository.onAnyConfigurationChange()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt
index 3b2b12c..e4098ae 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt
@@ -335,6 +335,7 @@
}
@Test
+ @DisableSceneContainer
fun alpha_idleOnHub_isZero() =
testScope.runTest {
val alpha by collectLastValue(underTest.alpha(viewState))
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt
index 4253c29..a330cf0 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt
@@ -18,6 +18,7 @@
package com.android.systemui.keyguard.ui.viewmodel
+import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.testing.TestableLooper.RunWithLooper
import androidx.test.filters.SmallTest
@@ -27,6 +28,7 @@
import com.android.compose.animation.scene.SwipeDirection
import com.android.compose.animation.scene.TransitionKey
import com.android.compose.animation.scene.UserActionResult
+import com.android.compose.animation.scene.UserActionResult.ShowOverlay
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.authentication.data.repository.fakeAuthenticationRepository
@@ -42,8 +44,10 @@
import com.android.systemui.power.data.repository.fakePowerRepository
import com.android.systemui.power.shared.model.WakefulnessState
import com.android.systemui.scene.domain.interactor.sceneInteractor
+import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.TransitionKeys
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.testKosmos
@@ -111,12 +115,12 @@
private fun expectedDownDestination(
downFromEdge: Boolean,
- isSingleShade: Boolean,
+ isNarrowScreen: Boolean,
isShadeTouchable: Boolean,
): SceneKey? {
return when {
!isShadeTouchable -> null
- downFromEdge && isSingleShade -> Scenes.QuickSettings
+ downFromEdge && isNarrowScreen -> Scenes.QuickSettings
else -> Scenes.Shade
}
}
@@ -162,7 +166,7 @@
@JvmField @Parameter(0) var canSwipeToEnter: Boolean = false
@JvmField @Parameter(1) var downWithTwoPointers: Boolean = false
@JvmField @Parameter(2) var downFromEdge: Boolean = false
- @JvmField @Parameter(3) var isSingleShade: Boolean = true
+ @JvmField @Parameter(3) var isNarrowScreen: Boolean = true
@JvmField @Parameter(4) var isCommunalAvailable: Boolean = false
@JvmField @Parameter(5) var isShadeTouchable: Boolean = false
@@ -170,7 +174,8 @@
@Test
@EnableFlags(Flags.FLAG_COMMUNAL_HUB)
- fun userActions() =
+ @DisableFlags(Flags.FLAG_DUAL_SHADE)
+ fun userActions_fullscreenShade() =
testScope.runTest {
underTest.activateIn(this)
kosmos.fakeDeviceEntryRepository.setLockscreenEnabled(true)
@@ -182,7 +187,7 @@
}
)
sceneInteractor.changeScene(Scenes.Lockscreen, "reason")
- kosmos.shadeRepository.setShadeLayoutWide(!isSingleShade)
+ kosmos.shadeRepository.setShadeLayoutWide(!isNarrowScreen)
kosmos.setCommunalAvailable(isCommunalAvailable)
kosmos.fakePowerRepository.updateWakefulness(
rawState =
@@ -190,7 +195,7 @@
WakefulnessState.AWAKE
} else {
WakefulnessState.ASLEEP
- },
+ }
)
val userActions by collectLastValue(underTest.actions)
@@ -212,7 +217,7 @@
.isEqualTo(
expectedDownDestination(
downFromEdge = downFromEdge,
- isSingleShade = isSingleShade,
+ isNarrowScreen = isNarrowScreen,
isShadeTouchable = isShadeTouchable,
)
)
@@ -220,7 +225,7 @@
assertThat(downDestination?.transitionKey)
.isEqualTo(
expectedDownTransitionKey(
- isSingleShade = isSingleShade,
+ isSingleShade = isNarrowScreen,
isShadeTouchable = isShadeTouchable,
)
)
@@ -258,6 +263,101 @@
)
}
+ @Test
+ @EnableFlags(Flags.FLAG_COMMUNAL_HUB, Flags.FLAG_DUAL_SHADE)
+ fun userActions_dualShade() =
+ testScope.runTest {
+ underTest.activateIn(this)
+ kosmos.fakeDeviceEntryRepository.setLockscreenEnabled(true)
+ kosmos.fakeAuthenticationRepository.setAuthenticationMethod(
+ if (canSwipeToEnter) {
+ AuthenticationMethodModel.None
+ } else {
+ AuthenticationMethodModel.Pin
+ }
+ )
+ sceneInteractor.changeScene(Scenes.Lockscreen, "reason")
+ kosmos.shadeRepository.setShadeLayoutWide(!isNarrowScreen)
+ kosmos.setCommunalAvailable(isCommunalAvailable)
+ kosmos.fakePowerRepository.updateWakefulness(
+ rawState =
+ if (isShadeTouchable) {
+ WakefulnessState.AWAKE
+ } else {
+ WakefulnessState.ASLEEP
+ }
+ )
+
+ val userActions by collectLastValue(underTest.actions)
+
+ val downDestination =
+ userActions?.get(
+ Swipe(
+ SwipeDirection.Down,
+ fromSource = Edge.Top.takeIf { downFromEdge },
+ pointerCount = if (downWithTwoPointers) 2 else 1,
+ )
+ )
+
+ if (downFromEdge || downWithTwoPointers || !isShadeTouchable) {
+ // Top edge is not applicable in dual shade, as well as two-finger swipe.
+ assertThat(downDestination).isNull()
+ } else {
+ assertThat(downDestination).isEqualTo(ShowOverlay(Overlays.NotificationsShade))
+ assertThat(downDestination?.transitionKey).isNull()
+ }
+
+ val downFromTopRightDestination =
+ userActions?.get(
+ Swipe(
+ SwipeDirection.Down,
+ fromSource = SceneContainerEdge.TopRight,
+ pointerCount = if (downWithTwoPointers) 2 else 1,
+ )
+ )
+ when {
+ !isShadeTouchable -> assertThat(downFromTopRightDestination).isNull()
+ downWithTwoPointers -> assertThat(downFromTopRightDestination).isNull()
+ else -> {
+ assertThat(downFromTopRightDestination)
+ .isEqualTo(ShowOverlay(Overlays.QuickSettingsShade))
+ assertThat(downFromTopRightDestination?.transitionKey).isNull()
+ }
+ }
+
+ val upScene by
+ collectLastValue(
+ (userActions?.get(Swipe.Up) as? UserActionResult.ChangeScene)?.toScene?.let {
+ scene ->
+ kosmos.sceneInteractor.resolveSceneFamily(scene)
+ } ?: flowOf(null)
+ )
+
+ assertThat(upScene)
+ .isEqualTo(
+ expectedUpDestination(
+ canSwipeToEnter = canSwipeToEnter,
+ isShadeTouchable = isShadeTouchable,
+ )
+ )
+
+ val leftScene by
+ collectLastValue(
+ (userActions?.get(Swipe.Left) as? UserActionResult.ChangeScene)?.toScene?.let {
+ scene ->
+ kosmos.sceneInteractor.resolveSceneFamily(scene)
+ } ?: flowOf(null)
+ )
+
+ assertThat(leftScene)
+ .isEqualTo(
+ expectedLeftDestination(
+ isCommunalAvailable = isCommunalAvailable,
+ isShadeTouchable = isShadeTouchable,
+ )
+ )
+ }
+
private fun createLockscreenSceneViewModel(): LockscreenUserActionsViewModel {
return LockscreenUserActionsViewModel(
deviceEntryInteractor = kosmos.deviceEntryInteractor,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderTest.kt
index c1dcf37..69ccc58 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderTest.kt
@@ -41,7 +41,6 @@
import com.android.systemui.media.controls.shared.model.MediaData
import com.android.systemui.media.controls.util.fakeMediaControllerFactory
import com.android.systemui.media.controls.util.mediaFlags
-import com.android.systemui.plugins.activityStarter
import com.android.systemui.res.R
import com.android.systemui.statusbar.SbnBuilder
import com.android.systemui.testKosmos
@@ -86,7 +85,6 @@
context,
testDispatcher,
testScope,
- kosmos.activityStarter,
mediaControllerFactory,
mediaFlags,
kosmos.imageLoader,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepositoryTest.kt
index 1e5599b..93ba265 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepositoryTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepositoryTest.kt
@@ -19,7 +19,6 @@
import android.content.ComponentName
import android.content.packageManager
import android.content.pm.PackageManager
-import android.content.pm.ServiceInfo
import android.content.pm.UserInfo
import android.graphics.drawable.TestStubDrawable
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -35,6 +34,7 @@
import com.android.systemui.qs.pipeline.data.repository.fakeInstalledTilesRepository
import com.android.systemui.qs.pipeline.data.repository.installedTilesRepository
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.settings.FakeUserTracker
import com.android.systemui.settings.fakeUserTracker
import com.android.systemui.testKosmos
@@ -100,6 +100,7 @@
Icon.Loaded(drawable1, ContentDescription.Loaded(tileService1)),
Text.Loaded(tileService1),
Text.Loaded(appName1),
+ TileCategory.PROVIDED_BY_APP,
)
val expectedData2 =
EditTileData(
@@ -107,6 +108,7 @@
Icon.Loaded(drawable2, ContentDescription.Loaded(tileService2)),
Text.Loaded(tileService2),
Text.Loaded(appName2),
+ TileCategory.PROVIDED_BY_APP,
)
assertThat(editTileDataList).containsExactly(expectedData1, expectedData2)
@@ -144,6 +146,7 @@
Icon.Loaded(drawable1, ContentDescription.Loaded(tileService1)),
Text.Loaded(tileService1),
Text.Loaded(appName1),
+ TileCategory.PROVIDED_BY_APP,
)
val editTileDataList = underTest.getCustomTileData()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractorTest.kt
index deefbf5..053a59a 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractorTest.kt
@@ -31,6 +31,7 @@
import com.android.systemui.qs.pipeline.data.repository.FakeInstalledTilesComponentRepository
import com.android.systemui.qs.pipeline.data.repository.fakeInstalledTilesRepository
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tiles.impl.battery.qsBatterySaverTileConfig
import com.android.systemui.qs.tiles.impl.flashlight.qsFlashlightTileConfig
import com.android.systemui.qs.tiles.impl.internet.qsInternetTileConfig
@@ -132,6 +133,7 @@
icon = Icon.Loaded(icon, ContentDescription.Loaded(tileName)),
label = Text.Loaded(tileName),
appName = Text.Loaded(appName),
+ category = TileCategory.PROVIDED_BY_APP,
)
assertThat(editTiles.customTiles).hasSize(1)
@@ -181,7 +183,8 @@
tileSpec = this,
icon = Icon.Resource(android.R.drawable.star_on, ContentDescription.Loaded(spec)),
label = Text.Loaded(spec),
- appName = null
+ appName = null,
+ category = TileCategory.UNKNOWN,
)
}
@@ -192,6 +195,7 @@
Icon.Resource(uiConfig.iconRes, ContentDescription.Resource(uiConfig.labelRes)),
label = Text.Resource(uiConfig.labelRes),
appName = null,
+ category = category,
)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/EditTileListStateTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/EditTileListStateTest.kt
index 7f01fad..484a8ff 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/EditTileListStateTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/EditTileListStateTest.kt
@@ -16,11 +16,11 @@
package com.android.systemui.qs.panels.ui.compose
+import androidx.compose.ui.text.AnnotatedString
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.shared.model.Icon
-import com.android.systemui.common.shared.model.Text
import com.android.systemui.qs.panels.shared.model.SizedTile
import com.android.systemui.qs.panels.shared.model.SizedTileImpl
import com.android.systemui.qs.panels.ui.model.GridCell
@@ -28,6 +28,7 @@
import com.android.systemui.qs.panels.ui.model.TileGridCell
import com.android.systemui.qs.panels.ui.viewmodel.EditTileViewModel
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
@@ -141,10 +142,11 @@
EditTileViewModel(
tileSpec = TileSpec.create(tileSpec),
icon = Icon.Resource(0, null),
- label = Text.Loaded("unused"),
+ label = AnnotatedString("unused"),
appName = null,
isCurrent = true,
availableEditActions = emptySet(),
+ category = TileCategory.UNKNOWN,
),
width,
)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelTest.kt
index 601779f..583db72 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelTest.kt
@@ -26,6 +26,7 @@
import com.android.systemui.common.shared.model.ContentDescription
import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.Text
+import com.android.systemui.common.ui.compose.toAnnotatedString
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testScope
@@ -42,6 +43,7 @@
import com.android.systemui.qs.pipeline.domain.interactor.currentTilesInteractor
import com.android.systemui.qs.pipeline.shared.TileSpec
import com.android.systemui.qs.qsTileFactory
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tiles.impl.alarm.qsAlarmTileConfig
import com.android.systemui.qs.tiles.impl.battery.qsBatterySaverTileConfig
import com.android.systemui.qs.tiles.impl.flashlight.qsFlashlightTileConfig
@@ -190,7 +192,7 @@
.forEach {
val data = getEditTileData(it.tileSpec)
- assertThat(it.label).isEqualTo(data.label)
+ assertThat(it.label).isEqualTo(data.label.toAnnotatedString(context))
assertThat(it.icon).isEqualTo(data.icon)
assertThat(it.appName).isNull()
}
@@ -224,15 +226,19 @@
// service1
val model1 = tiles!!.first { it.tileSpec == TileSpec.create(component1) }
- assertThat(model1.label).isEqualTo(Text.Loaded(tileService1))
- assertThat(model1.appName).isEqualTo(Text.Loaded(appName1))
+ assertThat(model1.label)
+ .isEqualTo(Text.Loaded(tileService1).toAnnotatedString(context))
+ assertThat(model1.appName)
+ .isEqualTo(Text.Loaded(appName1).toAnnotatedString(context))
assertThat(model1.icon)
.isEqualTo(Icon.Loaded(drawable1, ContentDescription.Loaded(tileService1)))
// service2
val model2 = tiles!!.first { it.tileSpec == TileSpec.create(component2) }
- assertThat(model2.label).isEqualTo(Text.Loaded(tileService2))
- assertThat(model2.appName).isEqualTo(Text.Loaded(appName2))
+ assertThat(model2.label)
+ .isEqualTo(Text.Loaded(tileService2).toAnnotatedString(context))
+ assertThat(model2.appName)
+ .isEqualTo(Text.Loaded(appName2).toAnnotatedString(context))
assertThat(model2.icon)
.isEqualTo(Icon.Loaded(drawable2, ContentDescription.Loaded(tileService2)))
}
@@ -559,7 +565,8 @@
tileSpec = this,
icon = Icon.Resource(R.drawable.star_on, ContentDescription.Loaded(spec)),
label = Text.Loaded(spec),
- appName = null
+ appName = null,
+ category = TileCategory.UNKNOWN,
)
}
@@ -570,6 +577,7 @@
Icon.Resource(uiConfig.iconRes, ContentDescription.Resource(uiConfig.labelRes)),
label = Text.Resource(uiConfig.labelRes),
appName = null,
+ category = category,
)
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/shared/model/GroupAndSortCategoryAndNameTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/shared/model/GroupAndSortCategoryAndNameTest.kt
new file mode 100644
index 0000000..7f90e3b
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/shared/model/GroupAndSortCategoryAndNameTest.kt
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.qs.shared.model
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class GroupAndSortCategoryAndNameTest : SysuiTestCase() {
+
+ private val elements =
+ listOf(
+ CategoryAndName(TileCategory.DISPLAY, "B"),
+ CategoryAndName(TileCategory.PRIVACY, "A"),
+ CategoryAndName(TileCategory.DISPLAY, "C"),
+ CategoryAndName(TileCategory.UTILITIES, "B"),
+ CategoryAndName(TileCategory.CONNECTIVITY, "A"),
+ CategoryAndName(TileCategory.PROVIDED_BY_APP, "B"),
+ CategoryAndName(TileCategory.CONNECTIVITY, "C"),
+ CategoryAndName(TileCategory.ACCESSIBILITY, "A")
+ )
+
+ @Test
+ fun allElementsInResult() {
+ val grouped = groupAndSort(elements)
+ val allValues = grouped.values.reduce { acc, el -> acc + el }
+ assertThat(allValues).containsExactlyElementsIn(elements)
+ }
+
+ @Test
+ fun groupedByCategory() {
+ val grouped = groupAndSort(elements)
+ grouped.forEach { tileCategory, categoryAndNames ->
+ categoryAndNames.forEach { element ->
+ assertThat(element.category).isEqualTo(tileCategory)
+ }
+ }
+ }
+
+ @Test
+ fun sortedAlphabeticallyInEachCategory() {
+ val grouped = groupAndSort(elements)
+ grouped.values.forEach { elements ->
+ assertThat(elements.map(CategoryAndName::name)).isInOrder()
+ }
+ }
+
+ @Test
+ fun categoriesSortedInNaturalOrder() {
+ val grouped = groupAndSort(elements)
+ assertThat(grouped.keys).isInOrder()
+ }
+
+ @Test
+ fun missingCategoriesAreNotInResult() {
+ val grouped = groupAndSort(elements.filterNot { it.category == TileCategory.CONNECTIVITY })
+ assertThat(grouped.keys).doesNotContain(TileCategory.CONNECTIVITY)
+ }
+
+ companion object {
+ private fun CategoryAndName(category: TileCategory, name: String): CategoryAndName {
+ return object : CategoryAndName {
+ override val category = category
+ override val name = name
+ }
+ }
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt
index aaad0fc..5a45060 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt
@@ -184,7 +184,7 @@
)
val networkModel =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 4,
ssid = "test ssid",
)
@@ -219,7 +219,7 @@
)
val networkModel =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 4,
ssid = "test ssid",
hotspotDeviceType = WifiNetworkModel.HotspotDeviceType.NONE,
@@ -398,7 +398,7 @@
collectLastValue(
underTest.tileData(testUser, flowOf(DataUpdateTrigger.InitialRequest))
)
- val networkModel = WifiNetworkModel.Inactive
+ val networkModel = WifiNetworkModel.Inactive()
connectivityRepository.setWifiConnected(validated = false)
wifiRepository.setIsWifiDefault(true)
@@ -416,7 +416,7 @@
underTest.tileData(testUser, flowOf(DataUpdateTrigger.InitialRequest))
)
- val networkModel = WifiNetworkModel.Inactive
+ val networkModel = WifiNetworkModel.Inactive()
connectivityRepository.setWifiConnected(validated = false)
wifiRepository.setIsWifiDefault(true)
@@ -543,7 +543,7 @@
private fun setWifiNetworkWithHotspot(hotspot: WifiNetworkModel.HotspotDeviceType) {
val networkModel =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 4,
ssid = "test ssid",
hotspotDeviceType = hotspot,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt
index 2444229..fa6d8bf 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt
@@ -24,6 +24,7 @@
import com.android.systemui.kosmos.testCase
import com.android.systemui.qs.pipeline.shared.TileSpec
import com.android.systemui.qs.qsEventLogger
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tiles.viewmodel.QSTileConfig
import com.android.systemui.qs.tiles.viewmodel.QSTileState
import com.android.systemui.qs.tiles.viewmodel.QSTileUIConfig
@@ -43,7 +44,8 @@
QSTileConfig(
TileSpec.create(RecordIssueModule.TILE_SPEC),
uiConfig,
- kosmos.qsEventLogger.getNewInstanceId()
+ kosmos.qsEventLogger.getNewInstanceId(),
+ TileCategory.UTILITIES,
)
private val resources = kosmos.mainResources
private val theme = resources.newTheme()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt
index 4e58069..5bd3645 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt
@@ -31,6 +31,7 @@
import com.android.systemui.qs.tiles.base.interactor.QSTileInput
import com.android.systemui.qs.tiles.viewmodel.QSTileUserAction
import com.android.systemui.recordissue.RecordIssueDialogDelegate
+import com.android.systemui.screenrecord.RecordingController
import com.android.systemui.settings.UserContextProvider
import com.android.systemui.settings.userTracker
import com.android.systemui.statusbar.phone.KeyguardDismissUtil
@@ -40,12 +41,16 @@
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.Mock
import org.mockito.Mockito.mock
+import org.mockito.MockitoAnnotations
@SmallTest
@RunWith(AndroidJUnit4::class)
class IssueRecordingUserActionInteractorTest : SysuiTestCase() {
+ @Mock private lateinit var recordingController: RecordingController
+
val user = UserHandle(1)
val kosmos = Kosmos().also { it.testCase = this }
@@ -56,6 +61,7 @@
@Before
fun setup() {
+ MockitoAnnotations.initMocks(this)
hasCreatedDialogDelegate = false
with(kosmos) {
val factory =
@@ -84,7 +90,8 @@
dialogTransitionAnimator,
panelInteractor,
userTracker,
- factory
+ factory,
+ recordingController,
)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt
index 91d8e2a..de3dc57 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt
@@ -25,7 +25,9 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
+import com.android.settingslib.notification.modes.TestModeBuilder
import com.android.systemui.SysuiTestCase
+import com.android.systemui.SysuiTestableContext
import com.android.systemui.common.shared.model.asIcon
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.coroutines.collectValues
@@ -62,7 +64,12 @@
context.orCreateTestableResources.apply {
addOverride(MODES_DRAWABLE_ID, MODES_DRAWABLE)
addOverride(R.drawable.ic_zen_mode_type_bedtime, BEDTIME_DRAWABLE)
- addOverride(R.drawable.ic_zen_mode_type_driving, DRIVING_DRAWABLE)
+ }
+
+ val customPackageContext = SysuiTestableContext(context)
+ context.prepareCreatePackageContext(CUSTOM_PACKAGE, customPackageContext)
+ customPackageContext.orCreateTestableResources.apply {
+ addOverride(CUSTOM_DRAWABLE_ID, CUSTOM_DRAWABLE)
}
}
@@ -146,35 +153,41 @@
assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
- // Add an active mode: icon should be the mode icon. No iconResId, because we don't
- // really know that it's a system icon.
+ // Add an active mode with a default icon: icon should be the mode icon, and the
+ // iconResId is also populated, because we know it's a system icon.
zenModeRepository.addMode(
- id = "Bedtime",
+ id = "Bedtime with default icon",
type = AutomaticZenRule.TYPE_BEDTIME,
active = true
)
runCurrent()
assertThat(tileData?.icon).isEqualTo(BEDTIME_ICON)
- assertThat(tileData?.iconResId).isNull()
+ assertThat(tileData?.iconResId).isEqualTo(R.drawable.ic_zen_mode_type_bedtime)
- // Add another, less-prioritized mode: icon should remain the first mode icon
+ // Add another, less-prioritized mode that has a *custom* icon: for now, icon should
+ // remain the first mode icon
zenModeRepository.addMode(
- id = "Driving",
- type = AutomaticZenRule.TYPE_DRIVING,
- active = true
+ TestModeBuilder()
+ .setId("Driving with custom icon")
+ .setType(AutomaticZenRule.TYPE_DRIVING)
+ .setPackage(CUSTOM_PACKAGE)
+ .setIconResId(CUSTOM_DRAWABLE_ID)
+ .setActive(true)
+ .build()
)
runCurrent()
assertThat(tileData?.icon).isEqualTo(BEDTIME_ICON)
- assertThat(tileData?.iconResId).isNull()
+ assertThat(tileData?.iconResId).isEqualTo(R.drawable.ic_zen_mode_type_bedtime)
// Deactivate more important mode: icon should be the less important, still active mode
- zenModeRepository.deactivateMode("Bedtime")
+ // And because it's a package-provided icon, iconResId is not populated.
+ zenModeRepository.deactivateMode("Bedtime with default icon")
runCurrent()
- assertThat(tileData?.icon).isEqualTo(DRIVING_ICON)
+ assertThat(tileData?.icon).isEqualTo(CUSTOM_ICON)
assertThat(tileData?.iconResId).isNull()
// Deactivate remaining mode: back to the default modes icon
- zenModeRepository.deactivateMode("Driving")
+ zenModeRepository.deactivateMode("Driving with custom icon")
runCurrent()
assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
@@ -241,15 +254,17 @@
private companion object {
val TEST_USER = UserHandle.of(1)!!
+ const val CUSTOM_PACKAGE = "com.some.mode.owner.package"
val MODES_DRAWABLE_ID = R.drawable.ic_zen_priority_modes
+ const val CUSTOM_DRAWABLE_ID = 12345
val MODES_DRAWABLE = TestStubDrawable("modes_icon")
val BEDTIME_DRAWABLE = TestStubDrawable("bedtime")
- val DRIVING_DRAWABLE = TestStubDrawable("driving")
+ val CUSTOM_DRAWABLE = TestStubDrawable("custom")
val MODES_ICON = MODES_DRAWABLE.asIcon()
val BEDTIME_ICON = BEDTIME_DRAWABLE.asIcon()
- val DRIVING_ICON = DRIVING_DRAWABLE.asIcon()
+ val CUSTOM_ICON = CUSTOM_DRAWABLE.asIcon()
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt
index f7bdcb8..c3d45db 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt
@@ -18,7 +18,6 @@
import android.app.Flags
import android.graphics.drawable.TestStubDrawable
-import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
@@ -109,26 +108,7 @@
}
@Test
- @EnableFlags(Flags.FLAG_MODES_UI_ICONS)
- fun state_withEnabledFlag_noIconResId() {
- val icon = TestStubDrawable("res123").asIcon()
- val model =
- ModesTileModel(
- isActivated = false,
- activeModes = emptyList(),
- icon = icon,
- iconResId = 123 // Should not be populated, but is ignored even if present
- )
-
- val state = underTest.map(config, model)
-
- assertThat(state.icon()).isEqualTo(icon)
- assertThat(state.iconRes).isNull()
- }
-
- @Test
- @DisableFlags(Flags.FLAG_MODES_UI_ICONS)
- fun state_withDisabledFlag_includesIconResId() {
+ fun state_modelHasIconResId_includesIconResId() {
val icon = TestStubDrawable("res123").asIcon()
val model =
ModesTileModel(
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt
index 3133312..b54fd86 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt
@@ -19,12 +19,15 @@
import android.platform.test.annotations.EnabledOnRavenwood
import android.platform.test.annotations.RequiresFlagsDisabled
import android.platform.test.annotations.RequiresFlagsEnabled
+import android.platform.test.flag.junit.CheckFlagsRule
+import android.platform.test.flag.junit.DeviceFlagsValueProvider
import android.provider.Settings
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.server.display.feature.flags.Flags
import com.android.systemui.SysuiTestCase
+import com.android.systemui.accessibility.extradim.ExtraDimDialogManager
import com.android.systemui.accessibility.reduceBrightColorsController
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandler
@@ -33,8 +36,14 @@
import com.android.systemui.qs.tiles.impl.reducebrightness.domain.model.ReduceBrightColorsTileModel
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.runTest
+import org.junit.Before
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.anyOrNull
+import org.mockito.kotlin.verify
@SmallTest
@EnabledOnRavenwood
@@ -45,21 +54,34 @@
private val inputHandler = FakeQSTileIntentUserInputHandler()
private val controller = kosmos.reduceBrightColorsController
- private val underTest =
- ReduceBrightColorsTileUserActionInteractor(
- context.resources,
- inputHandler,
- controller,
- )
+ @Mock private lateinit var mExtraDimDialogManager: ExtraDimDialogManager
- private val underTestEvenDimmerEnabled =
- ReduceBrightColorsTileUserActionInteractor(
- context.orCreateTestableResources
- .apply { addOverride(R.bool.config_evenDimmerEnabled, true) }
- .resources,
- inputHandler,
- controller,
- )
+ @get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()
+
+ private lateinit var underTest: ReduceBrightColorsTileUserActionInteractor
+ private lateinit var underTestEvenDimmerEnabled: ReduceBrightColorsTileUserActionInteractor
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ underTest =
+ ReduceBrightColorsTileUserActionInteractor(
+ context.resources,
+ inputHandler,
+ controller,
+ mExtraDimDialogManager,
+ )
+
+ underTestEvenDimmerEnabled =
+ ReduceBrightColorsTileUserActionInteractor(
+ context.orCreateTestableResources
+ .apply { addOverride(R.bool.config_evenDimmerEnabled, true) }
+ .resources,
+ inputHandler,
+ controller,
+ mExtraDimDialogManager,
+ )
+ }
@Test
@RequiresFlagsDisabled(Flags.FLAG_EVEN_DIMMER)
@@ -142,9 +164,7 @@
QSTileInputTestKtx.longClick(ReduceBrightColorsTileModel(enabled))
)
- QSTileIntentUserInputHandlerSubject.assertThat(inputHandler).handledOneIntentInput {
- assertThat(it.intent.action).isEqualTo(Settings.ACTION_DISPLAY_SETTINGS)
- }
+ verify(mExtraDimDialogManager).dismissKeyguardIfNeededAndShowDialog(anyOrNull())
}
@Test
@@ -155,9 +175,6 @@
underTestEvenDimmerEnabled.handleInput(
QSTileInputTestKtx.longClick(ReduceBrightColorsTileModel(enabled))
)
-
- QSTileIntentUserInputHandlerSubject.assertThat(inputHandler).handledOneIntentInput {
- assertThat(it.intent.action).isEqualTo(Settings.ACTION_DISPLAY_SETTINGS)
- }
+ verify(mExtraDimDialogManager).dismissKeyguardIfNeededAndShowDialog(anyOrNull())
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt
index 2d42c42..a0cafcb 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt
@@ -161,9 +161,7 @@
val upDestinationSceneKey =
(actions?.get(Swipe.Up) as? UserActionResult.ChangeScene)?.toScene
assertThat(upDestinationSceneKey).isEqualTo(Scenes.Bouncer)
- kosmos.emulateUserDrivenTransition(
- to = upDestinationSceneKey,
- )
+ kosmos.emulateUserDrivenTransition(to = upDestinationSceneKey)
kosmos.fakeSceneDataSource.pause()
kosmos.enterPin()
@@ -226,16 +224,14 @@
(actions?.get(Swipe.Up) as? UserActionResult.ChangeScene)?.toScene
assertThat(upDestinationSceneKey).isEqualTo(SceneFamilies.Home)
assertThat(homeScene).isEqualTo(Scenes.Gone)
- kosmos.emulateUserDrivenTransition(
- to = homeScene,
- )
+ kosmos.emulateUserDrivenTransition(to = homeScene)
}
@Test
fun withAuthMethodNone_deviceWakeUp_skipsLockscreen() =
testScope.runTest {
kosmos.setAuthMethod(AuthenticationMethodModel.None, enableLockscreen = false)
- kosmos.putDeviceToSleep(instantlyLockDevice = false)
+ kosmos.putDeviceToSleep()
kosmos.assertCurrentScene(Scenes.Lockscreen)
kosmos.wakeUpDevice()
@@ -246,7 +242,7 @@
fun withAuthMethodSwipe_deviceWakeUp_doesNotSkipLockscreen() =
testScope.runTest {
kosmos.setAuthMethod(AuthenticationMethodModel.None, enableLockscreen = true)
- kosmos.putDeviceToSleep(instantlyLockDevice = false)
+ kosmos.putDeviceToSleep()
kosmos.assertCurrentScene(Scenes.Lockscreen)
kosmos.wakeUpDevice()
@@ -302,7 +298,7 @@
testScope.runTest {
kosmos.unlockDevice()
kosmos.assertCurrentScene(Scenes.Gone)
- kosmos.putDeviceToSleep(instantlyLockDevice = false)
+ kosmos.putDeviceToSleep()
kosmos.assertCurrentScene(Scenes.Lockscreen)
// Pretend like the timeout elapsed and now lock the device.
@@ -318,9 +314,7 @@
val upDestinationSceneKey =
(actions?.get(Swipe.Up) as? UserActionResult.ChangeScene)?.toScene
assertThat(upDestinationSceneKey).isEqualTo(Scenes.Bouncer)
- kosmos.emulateUserDrivenTransition(
- to = upDestinationSceneKey,
- )
+ kosmos.emulateUserDrivenTransition(to = upDestinationSceneKey)
kosmos.fakeSceneDataSource.pause()
kosmos.dismissIme()
@@ -388,7 +382,7 @@
kosmos.emulatePendingTransitionProgress(expectedVisible = true)
kosmos.enterSimPin(
authMethodAfterSimUnlock = AuthenticationMethodModel.None,
- enableLockscreen = false
+ enableLockscreen = false,
)
kosmos.assertCurrentScene(Scenes.Gone)
@@ -434,7 +428,7 @@
/** Updates the current authentication method and related states in the data layer. */
private fun Kosmos.setAuthMethod(
authMethod: AuthenticationMethodModel,
- enableLockscreen: Boolean = true
+ enableLockscreen: Boolean = true,
) {
if (authMethod.isSecure) {
assert(enableLockscreen) {
@@ -538,24 +532,27 @@
kosmos.fakeSceneDataSource.pause()
sceneInteractor.changeScene(to, "reason")
- emulatePendingTransitionProgress(
- expectedVisible = to != Scenes.Gone,
- )
+ emulatePendingTransitionProgress(expectedVisible = to != Scenes.Gone)
}
/**
- * Locks the device immediately (without delay).
+ * Locks the device.
*
* Asserts the device to be lockable (e.g. that the current authentication is secure).
*
- * Not to be confused with [putDeviceToSleep], which may also instantly lock the device.
+ * Internally emulates a power button press that puts the device to sleep, followed by another
+ * power button press that wakes up the device but is then expected to be in the locked state.
*/
private suspend fun Kosmos.lockDevice() {
val authMethod = authenticationInteractor.getAuthenticationMethod()
assertWithMessage("The authentication method of $authMethod is not secure, cannot lock!")
.that(authMethod.isSecure)
.isTrue()
- sceneInteractor.changeScene(Scenes.Lockscreen, "")
+
+ powerInteractor.setAsleepForTest()
+ testScope.runCurrent()
+
+ powerInteractor.setAwakeForTest()
testScope.runCurrent()
}
@@ -569,9 +566,7 @@
fakeSceneDataSource.pause()
enterPin()
- emulatePendingTransitionProgress(
- expectedVisible = false,
- )
+ emulatePendingTransitionProgress(expectedVisible = false)
}
/**
@@ -645,9 +640,7 @@
}
/** Changes device wakefulness state from awake to asleep, going through intermediary states. */
- private suspend fun Kosmos.putDeviceToSleep(
- instantlyLockDevice: Boolean = true,
- ) {
+ private suspend fun Kosmos.putDeviceToSleep() {
val wakefulnessModel = powerInteractor.detailedWakefulness.value
assertWithMessage("Cannot put device to sleep as it's already asleep!")
.that(wakefulnessModel.isAwake())
@@ -655,10 +648,6 @@
powerInteractor.setAsleepForTest()
testScope.runCurrent()
-
- if (instantlyLockDevice) {
- lockDevice()
- }
}
/** Emulates the dismissal of the IME (soft keyboard). */
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneBackInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneBackInteractorTest.kt
index 1f3454d..405cfd3 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneBackInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneBackInteractorTest.kt
@@ -28,6 +28,8 @@
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.kosmos.testScope
+import com.android.systemui.scene.data.model.asIterable
+import com.android.systemui.scene.data.model.sceneStackOf
import com.android.systemui.scene.domain.startable.sceneContainerStartable
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.testKosmos
@@ -173,12 +175,32 @@
)
}
+ @Test
+ @EnableSceneContainer
+ fun updateBackStack() =
+ testScope.runTest {
+ underTest.onSceneChange(from = Scenes.Lockscreen, to = Scenes.Shade)
+ underTest.onSceneChange(from = Scenes.Shade, to = Scenes.QuickSettings)
+ underTest.onSceneChange(from = Scenes.QuickSettings, to = Scenes.Bouncer)
+ assertThat(underTest.backStack.value.asIterable().toList())
+ .isEqualTo(listOf(Scenes.QuickSettings, Scenes.Shade, Scenes.Lockscreen))
+
+ underTest.updateBackStack { stack ->
+ // Reverse the stack, just to see if it can be done:
+ sceneStackOf(*stack.asIterable().reversed().toTypedArray())
+ }
+
+ assertThat(underTest.backStack.value.asIterable().toList())
+ .isEqualTo(listOf(Scenes.Lockscreen, Scenes.Shade, Scenes.QuickSettings))
+ }
+
private suspend fun TestScope.assertRoute(vararg route: RouteNode) {
val currentScene by collectLastValue(sceneInteractor.currentScene)
val backScene by collectLastValue(underTest.backScene)
route.forEachIndexed { index, node ->
sceneInteractor.changeScene(node.changeSceneTo, "")
+ runCurrent()
assertWithMessage("node at index $index currentScene mismatch")
.that(currentScene)
.isEqualTo(node.changeSceneTo)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt
index ec79cc6..763a1a9 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt
@@ -21,6 +21,8 @@
import android.app.StatusBarManager
import android.hardware.face.FaceManager
import android.os.PowerManager
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
import android.view.Display
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
@@ -28,8 +30,12 @@
import com.android.compose.animation.scene.SceneKey
import com.android.internal.logging.uiEventLoggerFake
import com.android.internal.policy.IKeyguardDismissCallback
+import com.android.keyguard.AuthInteractionProperties
+import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
+import com.android.systemui.authentication.data.repository.FakeAuthenticationRepository
import com.android.systemui.authentication.data.repository.fakeAuthenticationRepository
+import com.android.systemui.authentication.domain.interactor.authenticationInteractor
import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
import com.android.systemui.biometrics.data.repository.fingerprintPropertyRepository
import com.android.systemui.biometrics.shared.model.FingerprintSensorType
@@ -48,6 +54,7 @@
import com.android.systemui.deviceentry.shared.model.FailedFaceAuthenticationStatus
import com.android.systemui.deviceentry.shared.model.SuccessFaceAuthenticationStatus
import com.android.systemui.flags.EnableSceneContainer
+import com.android.systemui.haptics.msdl.fakeMSDLPlayer
import com.android.systemui.haptics.vibratorHelper
import com.android.systemui.keyevent.data.repository.fakeKeyEventRepository
import com.android.systemui.keyguard.data.repository.biometricSettingsRepository
@@ -77,7 +84,9 @@
import com.android.systemui.power.domain.interactor.powerInteractor
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.power.shared.model.WakefulnessState
+import com.android.systemui.scene.data.model.asIterable
import com.android.systemui.scene.data.repository.Transition
+import com.android.systemui.scene.domain.interactor.sceneBackInteractor
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.fakeSceneDataSource
@@ -95,6 +104,7 @@
import com.android.systemui.statusbar.sysuiStatusBarStateController
import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.mock
+import com.google.android.msdl.data.model.MSDLToken
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow
@@ -125,6 +135,7 @@
private val testScope = kosmos.testScope
private val deviceEntryHapticsInteractor by lazy { kosmos.deviceEntryHapticsInteractor }
private val sceneInteractor by lazy { kosmos.sceneInteractor }
+ private val sceneBackInteractor by lazy { kosmos.sceneBackInteractor }
private val bouncerInteractor by lazy { kosmos.bouncerInteractor }
private val faceAuthRepository by lazy { kosmos.fakeDeviceEntryFaceAuthRepository }
private val bouncerRepository by lazy { kosmos.fakeKeyguardBouncerRepository }
@@ -137,6 +148,8 @@
private val powerInteractor = kosmos.powerInteractor
private val fakeTrustRepository = kosmos.fakeTrustRepository
private val uiEventLoggerFake = kosmos.uiEventLoggerFake
+ private val msdlPlayer = kosmos.fakeMSDLPlayer
+ private val authInteractionProperties = AuthInteractionProperties()
private lateinit var underTest: SceneContainerStartable
@@ -229,17 +242,14 @@
fun hydrateVisibility_basedOnOcclusion() =
testScope.runTest {
val isVisible by collectLastValue(sceneInteractor.isVisible)
- prepareState(
- isDeviceUnlocked = true,
- initialSceneKey = Scenes.Lockscreen,
- )
+ prepareState(isDeviceUnlocked = true, initialSceneKey = Scenes.Lockscreen)
underTest.start()
assertThat(isVisible).isTrue()
kosmos.keyguardOcclusionInteractor.setWmNotifiedShowWhenLockedActivityOnTop(
true,
- mock()
+ mock(),
)
assertThat(isVisible).isFalse()
@@ -251,10 +261,7 @@
fun hydrateVisibility_basedOnAlternateBouncer() =
testScope.runTest {
val isVisible by collectLastValue(sceneInteractor.isVisible)
- prepareState(
- isDeviceUnlocked = false,
- initialSceneKey = Scenes.Lockscreen,
- )
+ prepareState(isDeviceUnlocked = false, initialSceneKey = Scenes.Lockscreen)
underTest.start()
assertThat(isVisible).isTrue()
@@ -262,7 +269,7 @@
// WHEN the device is occluded,
kosmos.keyguardOcclusionInteractor.setWmNotifiedShowWhenLockedActivityOnTop(
true,
- mock()
+ mock(),
)
// THEN scenes are not visible
assertThat(isVisible).isFalse()
@@ -385,6 +392,7 @@
fun switchFromBouncerToQuickSettingsWhenDeviceUnlocked_whenLeaveOpenShade() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val backStack by collectLastValue(sceneBackInteractor.backStack)
kosmos.sysuiStatusBarStateController.leaveOpen = true // leave shade open
val transitionState =
@@ -406,12 +414,14 @@
transitionState.value = ObservableTransitionState.Idle(Scenes.Bouncer)
runCurrent()
assertThat(currentSceneKey).isEqualTo(Scenes.Bouncer)
+ assertThat(backStack?.asIterable()?.last()).isEqualTo(Scenes.Lockscreen)
kosmos.fakeDeviceEntryFingerprintAuthRepository.setAuthenticationStatus(
SuccessFingerprintAuthenticationStatus(0, true)
)
assertThat(currentSceneKey).isEqualTo(Scenes.QuickSettings)
+ assertThat(backStack?.asIterable()?.last()).isEqualTo(Scenes.Gone)
}
@Test
@@ -470,10 +480,7 @@
fun stayOnLockscreenWhenDeviceUnlocksWithBypassOff() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
- prepareState(
- isBypassEnabled = false,
- initialSceneKey = Scenes.Lockscreen,
- )
+ prepareState(isBypassEnabled = false, initialSceneKey = Scenes.Lockscreen)
assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
underTest.start()
@@ -512,10 +519,7 @@
fun switchToGoneWhenDeviceIsUnlockedAndUserIsOnBouncerWithBypassDisabled() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
- prepareState(
- isBypassEnabled = false,
- initialSceneKey = Scenes.Bouncer,
- )
+ prepareState(isBypassEnabled = false, initialSceneKey = Scenes.Bouncer)
assertThat(currentSceneKey).isEqualTo(Scenes.Bouncer)
underTest.start()
@@ -531,10 +535,7 @@
val alternateBouncerVisible by
collectLastValue(bouncerRepository.alternateBouncerVisible)
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
- prepareState(
- isDeviceUnlocked = false,
- initialSceneKey = Scenes.Shade,
- )
+ prepareState(isDeviceUnlocked = false, initialSceneKey = Scenes.Shade)
assertThat(currentSceneKey).isEqualTo(Scenes.Shade)
bouncerRepository.setAlternateVisible(true)
underTest.start()
@@ -556,10 +557,7 @@
fun switchToLockscreenWhenDeviceSleepsLocked() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
- prepareState(
- isDeviceUnlocked = false,
- initialSceneKey = Scenes.Shade,
- )
+ prepareState(isDeviceUnlocked = false, initialSceneKey = Scenes.Shade)
assertThat(currentSceneKey).isEqualTo(Scenes.Shade)
underTest.start()
powerInteractor.setAsleepForTest()
@@ -575,10 +573,7 @@
val currentTransitionInfo by
collectLastValue(kosmos.keyguardTransitionRepository.currentTransitionInfoInternal)
val transitionState =
- prepareState(
- isDeviceUnlocked = false,
- initialSceneKey = Scenes.Shade,
- )
+ prepareState(isDeviceUnlocked = false, initialSceneKey = Scenes.Shade)
kosmos.keyguardRepository.setAodAvailable(true)
runCurrent()
assertThat(asleepState).isEqualTo(KeyguardState.AOD)
@@ -607,10 +602,7 @@
val currentTransitionInfo by
collectLastValue(kosmos.keyguardTransitionRepository.currentTransitionInfoInternal)
val transitionState =
- prepareState(
- isDeviceUnlocked = false,
- initialSceneKey = Scenes.Shade,
- )
+ prepareState(isDeviceUnlocked = false, initialSceneKey = Scenes.Shade)
kosmos.keyguardRepository.setAodAvailable(false)
runCurrent()
assertThat(asleepState).isEqualTo(KeyguardState.DOZING)
@@ -654,6 +646,7 @@
}
@Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun playSuccessHaptics_onSuccessfulLockscreenAuth_udfps() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -680,6 +673,31 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun playSuccessMSDLHaptics_onSuccessfulLockscreenAuth_udfps() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playSuccessHaptic by
+ collectLastValue(deviceEntryHapticsInteractor.playSuccessHaptic)
+
+ setupBiometricAuth(hasUdfps = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ unlockWithFingerprintAuth()
+
+ assertThat(playSuccessHaptic).isNotNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isEqualTo(MSDLToken.UNLOCK)
+ assertThat(msdlPlayer.latestPropertiesPlayed).isEqualTo(authInteractionProperties)
+
+ updateFingerprintAuthStatus(isSuccess = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Gone)
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun playSuccessHaptics_onSuccessfulLockscreenAuth_sfps() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -707,6 +725,32 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun playSuccessMSDLHaptics_onSuccessfulLockscreenAuth_sfps() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playSuccessHaptic by
+ collectLastValue(deviceEntryHapticsInteractor.playSuccessHaptic)
+
+ setupBiometricAuth(hasSfps = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ allowHapticsOnSfps()
+ unlockWithFingerprintAuth()
+
+ assertThat(playSuccessHaptic).isNotNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isEqualTo(MSDLToken.UNLOCK)
+ assertThat(msdlPlayer.latestPropertiesPlayed).isEqualTo(authInteractionProperties)
+
+ updateFingerprintAuthStatus(isSuccess = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Gone)
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun playErrorHaptics_onFailedLockscreenAuth_udfps() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -727,6 +771,27 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun playMSDLErrorHaptics_onFailedLockscreenAuth_udfps() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playErrorHaptic by collectLastValue(deviceEntryHapticsInteractor.playErrorHaptic)
+
+ setupBiometricAuth(hasUdfps = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ updateFingerprintAuthStatus(isSuccess = false)
+
+ assertThat(playErrorHaptic).isNotNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isEqualTo(MSDLToken.FAILURE)
+ assertThat(msdlPlayer.latestPropertiesPlayed).isEqualTo(authInteractionProperties)
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun playErrorHaptics_onFailedLockscreenAuth_sfps() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -747,6 +812,27 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun playMSDLErrorHaptics_onFailedLockscreenAuth_sfps() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playErrorHaptic by collectLastValue(deviceEntryHapticsInteractor.playErrorHaptic)
+
+ setupBiometricAuth(hasSfps = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ updateFingerprintAuthStatus(isSuccess = false)
+
+ assertThat(playErrorHaptic).isNotNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isEqualTo(MSDLToken.FAILURE)
+ assertThat(msdlPlayer.latestPropertiesPlayed).isEqualTo(authInteractionProperties)
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun skipsSuccessHaptics_whenPowerButtonDown_sfps() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -774,6 +860,32 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun skipsMSDLSuccessHaptics_whenPowerButtonDown_sfps() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playSuccessHaptic by
+ collectLastValue(deviceEntryHapticsInteractor.playSuccessHaptic)
+
+ setupBiometricAuth(hasSfps = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ allowHapticsOnSfps(isPowerButtonDown = true)
+ unlockWithFingerprintAuth()
+
+ assertThat(playSuccessHaptic).isNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isNull()
+ assertThat(msdlPlayer.latestPropertiesPlayed).isNull()
+
+ updateFingerprintAuthStatus(isSuccess = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Gone)
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun skipsSuccessHaptics_whenPowerButtonRecentlyPressed_sfps() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -801,6 +913,32 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun skipsMSDLSuccessHaptics_whenPowerButtonRecentlyPressed_sfps() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playSuccessHaptic by
+ collectLastValue(deviceEntryHapticsInteractor.playSuccessHaptic)
+
+ setupBiometricAuth(hasSfps = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ allowHapticsOnSfps(lastPowerPress = 50)
+ unlockWithFingerprintAuth()
+
+ assertThat(playSuccessHaptic).isNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isNull()
+ assertThat(msdlPlayer.latestPropertiesPlayed).isNull()
+
+ updateFingerprintAuthStatus(isSuccess = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Gone)
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun skipsErrorHaptics_whenPowerButtonDown_sfps() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -822,6 +960,28 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun skipsMSDLErrorHaptics_whenPowerButtonDown_sfps() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playErrorHaptic by collectLastValue(deviceEntryHapticsInteractor.playErrorHaptic)
+
+ setupBiometricAuth(hasSfps = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ kosmos.fakeKeyEventRepository.setPowerButtonDown(true)
+ updateFingerprintAuthStatus(isSuccess = false)
+
+ assertThat(playErrorHaptic).isNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isNull()
+ assertThat(msdlPlayer.latestPropertiesPlayed).isNull()
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MSDL_FEEDBACK)
fun skipsFaceErrorHaptics_nonSfps_coEx() =
testScope.runTest {
val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
@@ -842,6 +1002,26 @@
}
@Test
+ @EnableFlags(Flags.FLAG_MSDL_FEEDBACK)
+ fun skipsMSDLFaceErrorHaptics_nonSfps_coEx() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val playErrorHaptic by collectLastValue(deviceEntryHapticsInteractor.playErrorHaptic)
+
+ setupBiometricAuth(hasUdfps = true, hasFace = true)
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isFalse()
+
+ underTest.start()
+ updateFaceAuthStatus(isSuccess = false)
+
+ assertThat(playErrorHaptic).isNull()
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+ assertThat(msdlPlayer.latestTokenPlayed).isNull()
+ assertThat(msdlPlayer.latestPropertiesPlayed).isNull()
+ }
+
+ @Test
fun hydrateSystemUiState() =
testScope.runTest {
val transitionStateFlow = prepareState()
@@ -882,16 +1062,14 @@
@Test
fun hydrateSystemUiState_onLockscreen_basedOnOcclusion() =
testScope.runTest {
- prepareState(
- initialSceneKey = Scenes.Lockscreen,
- )
+ prepareState(initialSceneKey = Scenes.Lockscreen)
underTest.start()
runCurrent()
clearInvocations(sysUiState)
kosmos.keyguardOcclusionInteractor.setWmNotifiedShowWhenLockedActivityOnTop(
true,
- mock()
+ mock(),
)
runCurrent()
assertThat(
@@ -1014,7 +1192,7 @@
initialSceneKey = Scenes.Lockscreen,
authenticationMethod = AuthenticationMethodModel.Pin,
isDeviceUnlocked = false,
- startsAwake = false
+ startsAwake = false,
)
assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
underTest.start()
@@ -1032,11 +1210,14 @@
@Test
fun collectFalsingSignals_onSuccessfulUnlock() =
testScope.runTest {
- prepareState(
- initialSceneKey = Scenes.Lockscreen,
- authenticationMethod = AuthenticationMethodModel.Pin,
- isDeviceUnlocked = false,
- )
+ val currentScene by collectLastValue(sceneInteractor.currentScene)
+
+ val transitionStateFlow =
+ prepareState(
+ initialSceneKey = Scenes.Lockscreen,
+ authenticationMethod = AuthenticationMethodModel.Pin,
+ isDeviceUnlocked = false,
+ )
underTest.start()
runCurrent()
verify(falsingCollector, never()).onSuccessfulUnlock()
@@ -1051,36 +1232,46 @@
)
.forEach { sceneKey ->
sceneInteractor.changeScene(sceneKey, "reason")
+ transitionStateFlow.value = ObservableTransitionState.Idle(sceneKey)
runCurrent()
verify(falsingCollector, never()).onSuccessfulUnlock()
}
// Changing to the Gone scene should report a successful unlock.
- kosmos.fakeDeviceEntryFingerprintAuthRepository.setAuthenticationStatus(
- SuccessFingerprintAuthenticationStatus(0, true)
- )
+ kosmos.authenticationInteractor.authenticate(FakeAuthenticationRepository.DEFAULT_PIN)
runCurrent()
- sceneInteractor.changeScene(Scenes.Gone, "reason")
+ // Make sure that the startable changed the scene to Gone because the device unlocked.
+ assertThat(currentScene).isEqualTo(Scenes.Gone)
+ // Make the transition state match the current state
+ transitionStateFlow.value = ObservableTransitionState.Idle(Scenes.Gone)
runCurrent()
verify(falsingCollector).onSuccessfulUnlock()
// Move around scenes without changing back to Lockscreen, shouldn't report another
// unlock.
- listOf(
- Scenes.Shade,
- Scenes.QuickSettings,
- Scenes.Shade,
- Scenes.Gone,
- )
- .forEach { sceneKey ->
- sceneInteractor.changeScene(sceneKey, "reason")
- runCurrent()
- verify(falsingCollector, times(1)).onSuccessfulUnlock()
- }
+ listOf(Scenes.Shade, Scenes.QuickSettings, Scenes.Shade, Scenes.Gone).forEach { sceneKey
+ ->
+ sceneInteractor.changeScene(sceneKey, "reason")
+ transitionStateFlow.value = ObservableTransitionState.Idle(sceneKey)
+ runCurrent()
+ verify(falsingCollector, times(1)).onSuccessfulUnlock()
+ }
- // Changing to the Lockscreen scene shouldn't report a successful unlock.
- sceneInteractor.changeScene(Scenes.Lockscreen, "reason")
+ // Putting the device to sleep to lock it again, which shouldn't report another
+ // successful unlock.
+ kosmos.powerInteractor.setAsleepForTest()
runCurrent()
+ // Verify that the startable changed the scene to Lockscreen because the device locked
+ // following the sleep.
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
+ // Make the transition state match the current state
+ transitionStateFlow.value = ObservableTransitionState.Idle(Scenes.Lockscreen)
+ // Wake up the device again before continuing with the test.
+ kosmos.powerInteractor.setAwakeForTest()
+ runCurrent()
+ // Verify that the current scene is still the Lockscreen scene, now that the device is
+ // still locked.
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
verify(falsingCollector, times(1)).onSuccessfulUnlock()
// Move around scenes without unlocking.
@@ -1093,12 +1284,17 @@
)
.forEach { sceneKey ->
sceneInteractor.changeScene(sceneKey, "reason")
+ transitionStateFlow.value = ObservableTransitionState.Idle(sceneKey)
runCurrent()
verify(falsingCollector, times(1)).onSuccessfulUnlock()
}
- // Changing to the Gone scene should report a second successful unlock.
- sceneInteractor.changeScene(Scenes.Gone, "reason")
+ kosmos.authenticationInteractor.authenticate(FakeAuthenticationRepository.DEFAULT_PIN)
+ runCurrent()
+ // Make sure that the startable changed the scene to Gone because the device unlocked.
+ assertThat(currentScene).isEqualTo(Scenes.Gone)
+ // Make the transition state match the current scene.
+ transitionStateFlow.value = ObservableTransitionState.Idle(Scenes.Gone)
runCurrent()
verify(falsingCollector, times(2)).onSuccessfulUnlock()
}
@@ -1412,7 +1608,7 @@
kosmos.keyguardOcclusionInteractor.setWmNotifiedShowWhenLockedActivityOnTop(
true,
- mock()
+ mock(),
)
runCurrent()
verify(notificationShadeWindowController, times(1)).setKeyguardOccluded(true)
@@ -1427,10 +1623,7 @@
@Test
fun hydrateInteractionState_whileLocked() =
testScope.runTest {
- val transitionStateFlow =
- prepareState(
- initialSceneKey = Scenes.Lockscreen,
- )
+ val transitionStateFlow = prepareState(initialSceneKey = Scenes.Lockscreen)
underTest.start()
runCurrent()
verify(centralSurfaces).setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true)
@@ -1447,10 +1640,7 @@
},
verifyAfterTransition = {
verify(centralSurfaces)
- .setInteracting(
- StatusBarManager.WINDOW_STATUS_BAR,
- false,
- )
+ .setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false)
},
)
@@ -1465,11 +1655,7 @@
verify(centralSurfaces, never()).setInteracting(anyInt(), anyBoolean())
},
verifyAfterTransition = {
- verify(centralSurfaces)
- .setInteracting(
- StatusBarManager.WINDOW_STATUS_BAR,
- true,
- )
+ verify(centralSurfaces).setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true)
},
)
@@ -1485,10 +1671,7 @@
},
verifyAfterTransition = {
verify(centralSurfaces)
- .setInteracting(
- StatusBarManager.WINDOW_STATUS_BAR,
- false,
- )
+ .setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false)
},
)
@@ -1503,11 +1686,7 @@
verify(centralSurfaces, never()).setInteracting(anyInt(), anyBoolean())
},
verifyAfterTransition = {
- verify(centralSurfaces)
- .setInteracting(
- StatusBarManager.WINDOW_STATUS_BAR,
- true,
- )
+ verify(centralSurfaces).setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true)
},
)
@@ -1685,9 +1864,7 @@
testScope.runTest {
val currentScene by collectLastValue(sceneInteractor.currentScene)
val transitionStateFlow =
- prepareState(
- authenticationMethod = AuthenticationMethodModel.None,
- )
+ prepareState(authenticationMethod = AuthenticationMethodModel.None)
underTest.start()
assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
// Swipe to Gone, more than halfway
@@ -1753,9 +1930,7 @@
fun switchToGone_whenKeyguardBecomesDisabled_whenOnShadeScene() =
testScope.runTest {
val currentScene by collectLastValue(sceneInteractor.currentScene)
- prepareState(
- initialSceneKey = Scenes.Shade,
- )
+ prepareState(initialSceneKey = Scenes.Shade)
assertThat(currentScene).isEqualTo(Scenes.Shade)
underTest.start()
@@ -1785,10 +1960,7 @@
fun doesNotSwitchToGone_whenKeyguardBecomesDisabled_whenDeviceEntered() =
testScope.runTest {
val currentScene by collectLastValue(sceneInteractor.currentScene)
- prepareState(
- isDeviceUnlocked = true,
- initialSceneKey = Scenes.Gone,
- )
+ prepareState(isDeviceUnlocked = true, initialSceneKey = Scenes.Gone)
assertThat(currentScene).isEqualTo(Scenes.Gone)
assertThat(kosmos.deviceEntryInteractor.isDeviceEntered.value).isTrue()
underTest.start()
@@ -1901,10 +2073,7 @@
fun refreshLockscreenEnabled() =
testScope.runTest {
val transitionState =
- prepareState(
- isDeviceUnlocked = true,
- initialSceneKey = Scenes.Gone,
- )
+ prepareState(isDeviceUnlocked = true, initialSceneKey = Scenes.Gone)
underTest.start()
val isLockscreenEnabled by
collectLastValue(kosmos.deviceEntryInteractor.isLockscreenEnabled)
@@ -1978,10 +2147,7 @@
runCurrent()
verifyDuringTransition?.invoke()
- transitionStateFlow.value =
- ObservableTransitionState.Idle(
- currentScene = toScene,
- )
+ transitionStateFlow.value = ObservableTransitionState.Idle(currentScene = toScene)
runCurrent()
verifyAfterTransition?.invoke()
}
@@ -2066,7 +2232,7 @@
private fun TestScope.allowHapticsOnSfps(
isPowerButtonDown: Boolean = false,
- lastPowerPress: Long = 10000
+ lastPowerPress: Long = 10000,
) {
kosmos.fakeKeyEventRepository.setPowerButtonDown(isPowerButtonDown)
@@ -2091,7 +2257,7 @@
private fun TestScope.setupBiometricAuth(
hasSfps: Boolean = false,
hasUdfps: Boolean = false,
- hasFace: Boolean = false
+ hasFace: Boolean = false,
) {
if (hasSfps) {
setFingerprintSensorType(FingerprintSensorType.POWER_BUTTON)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModelTest.kt
index 03106ec..e6a24e3 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModelTest.kt
@@ -16,6 +16,8 @@
package com.android.systemui.scene.ui.viewmodel
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
@@ -29,6 +31,7 @@
import com.android.systemui.scene.shared.model.TransitionKeys.ToSplitShade
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.shade.domain.interactor.shadeInteractor
+import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -52,14 +55,12 @@
@Before
fun setUp() {
- underTest =
- GoneUserActionsViewModel(
- shadeInteractor = kosmos.shadeInteractor,
- )
+ underTest = GoneUserActionsViewModel(shadeInteractor = kosmos.shadeInteractor)
underTest.activateIn(testScope)
}
@Test
+ @DisableFlags(DualShade.FLAG_NAME)
fun downTransitionKey_splitShadeEnabled_isGoneToSplitShade() =
testScope.runTest {
val userActions by collectLastValue(underTest.actions)
@@ -71,6 +72,7 @@
}
@Test
+ @DisableFlags(DualShade.FLAG_NAME)
fun downTransitionKey_splitShadeDisabled_isNull() =
testScope.runTest {
val userActions by collectLastValue(underTest.actions)
@@ -79,4 +81,15 @@
assertThat(userActions?.get(Swipe(SwipeDirection.Down))?.transitionKey).isNull()
}
+
+ @Test
+ @EnableFlags(DualShade.FLAG_NAME)
+ fun downTransitionKey_dualShadeEnabled_isNull() =
+ testScope.runTest {
+ val userActions by collectLastValue(underTest.actions)
+ shadeRepository.setShadeLayoutWide(true)
+ runCurrent()
+
+ assertThat(userActions?.get(Swipe(SwipeDirection.Down))?.transitionKey).isNull()
+ }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt
index 4b132c4..a0bb017 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt
@@ -18,9 +18,12 @@
package com.android.systemui.scene.ui.viewmodel
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
import android.view.MotionEvent
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
+import com.android.compose.animation.scene.DefaultEdgeDetector
import com.android.systemui.SysuiTestCase
import com.android.systemui.classifier.domain.interactor.falsingInteractor
import com.android.systemui.classifier.fakeFalsingManager
@@ -37,6 +40,10 @@
import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.fakeSceneDataSource
+import com.android.systemui.shade.data.repository.fakeShadeRepository
+import com.android.systemui.shade.domain.interactor.shadeInteractor
+import com.android.systemui.shade.shared.flag.DualShade
+import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.mock
import com.android.systemui.util.mockito.whenever
@@ -60,6 +67,7 @@
private val testScope by lazy { kosmos.testScope }
private val sceneInteractor by lazy { kosmos.sceneInteractor }
private val fakeSceneDataSource by lazy { kosmos.fakeSceneDataSource }
+ private val fakeShadeRepository by lazy { kosmos.fakeShadeRepository }
private val sceneContainerConfig by lazy { kosmos.sceneContainerConfig }
private val falsingManager by lazy { kosmos.fakeFalsingManager }
@@ -75,6 +83,8 @@
sceneInteractor = sceneInteractor,
falsingInteractor = kosmos.falsingInteractor,
powerInteractor = kosmos.powerInteractor,
+ shadeInteractor = kosmos.shadeInteractor,
+ splitEdgeDetector = kosmos.splitEdgeDetector,
logger = kosmos.sceneLogger,
motionEventHandlerReceiver = { motionEventHandler ->
this@SceneContainerViewModelTest.motionEventHandler = motionEventHandler
@@ -287,4 +297,48 @@
assertThat(actionableContentKey).isEqualTo(Overlays.QuickSettingsShade)
}
+
+ @Test
+ @DisableFlags(DualShade.FLAG_NAME)
+ fun edgeDetector_singleShade_usesDefaultEdgeDetector() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(kosmos.shadeInteractor.shadeMode)
+ fakeShadeRepository.setShadeLayoutWide(false)
+ assertThat(shadeMode).isEqualTo(ShadeMode.Single)
+
+ assertThat(underTest.edgeDetector).isEqualTo(DefaultEdgeDetector)
+ }
+
+ @Test
+ @DisableFlags(DualShade.FLAG_NAME)
+ fun edgeDetector_splitShade_usesDefaultEdgeDetector() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(kosmos.shadeInteractor.shadeMode)
+ fakeShadeRepository.setShadeLayoutWide(true)
+ assertThat(shadeMode).isEqualTo(ShadeMode.Split)
+
+ assertThat(underTest.edgeDetector).isEqualTo(DefaultEdgeDetector)
+ }
+
+ @Test
+ @EnableFlags(DualShade.FLAG_NAME)
+ fun edgeDetector_dualShade_narrowScreen_usesSplitEdgeDetector() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(kosmos.shadeInteractor.shadeMode)
+ fakeShadeRepository.setShadeLayoutWide(false)
+
+ assertThat(shadeMode).isEqualTo(ShadeMode.Dual)
+ assertThat(underTest.edgeDetector).isEqualTo(kosmos.splitEdgeDetector)
+ }
+
+ @Test
+ @EnableFlags(DualShade.FLAG_NAME)
+ fun edgeDetector_dualShade_wideScreen_usesSplitEdgeDetector() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(kosmos.shadeInteractor.shadeMode)
+ fakeShadeRepository.setShadeLayoutWide(true)
+
+ assertThat(shadeMode).isEqualTo(ShadeMode.Dual)
+ assertThat(underTest.edgeDetector).isEqualTo(kosmos.splitEdgeDetector)
+ }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetectorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetectorTest.kt
new file mode 100644
index 0000000..3d76d28
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetectorTest.kt
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.scene.ui.viewmodel
+
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.IntOffset
+import androidx.compose.ui.unit.IntSize
+import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.dp
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.End
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.Resolved.Bottom
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.Resolved.Left
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.Resolved.Right
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.Resolved.TopLeft
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.Resolved.TopRight
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.Start
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.TopEnd
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge.TopStart
+import com.google.common.truth.Truth.assertThat
+import kotlin.test.assertFailsWith
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class SplitEdgeDetectorTest : SysuiTestCase() {
+
+ private val edgeSize = 40
+ private val screenWidth = 800
+ private val screenHeight = 600
+
+ private var edgeSplitFraction = 0.7f
+
+ private val underTest =
+ SplitEdgeDetector(
+ topEdgeSplitFraction = { edgeSplitFraction },
+ edgeSize = edgeSize.dp,
+ )
+
+ @Test
+ fun source_noEdge_detectsNothing() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = screenWidth / 2,
+ y = screenHeight / 2,
+ )
+ assertThat(detectedEdge).isNull()
+ }
+
+ @Test
+ fun source_swipeVerticallyOnTopLeft_detectsTopLeft() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = 1,
+ y = edgeSize - 1,
+ )
+ assertThat(detectedEdge).isEqualTo(TopLeft)
+ }
+
+ @Test
+ fun source_swipeHorizontallyOnTopLeft_detectsLeft() {
+ val detectedEdge =
+ swipeHorizontallyFrom(
+ x = 1,
+ y = edgeSize - 1,
+ )
+ assertThat(detectedEdge).isEqualTo(Left)
+ }
+
+ @Test
+ fun source_swipeVerticallyOnTopRight_detectsTopRight() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = screenWidth - 1,
+ y = edgeSize - 1,
+ )
+ assertThat(detectedEdge).isEqualTo(TopRight)
+ }
+
+ @Test
+ fun source_swipeHorizontallyOnTopRight_detectsRight() {
+ val detectedEdge =
+ swipeHorizontallyFrom(
+ x = screenWidth - 1,
+ y = edgeSize - 1,
+ )
+ assertThat(detectedEdge).isEqualTo(Right)
+ }
+
+ @Test
+ fun source_swipeVerticallyToLeftOfSplit_detectsTopLeft() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = (screenWidth * edgeSplitFraction).toInt() - 1,
+ y = edgeSize - 1,
+ )
+ assertThat(detectedEdge).isEqualTo(TopLeft)
+ }
+
+ @Test
+ fun source_swipeVerticallyToRightOfSplit_detectsTopRight() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = (screenWidth * edgeSplitFraction).toInt() + 1,
+ y = edgeSize - 1,
+ )
+ assertThat(detectedEdge).isEqualTo(TopRight)
+ }
+
+ @Test
+ fun source_edgeSplitFractionUpdatesDynamically() {
+ val middleX = (screenWidth * 0.5f).toInt()
+ val topY = 0
+
+ // Split closer to the right; middle of screen is considered "left".
+ edgeSplitFraction = 0.6f
+ assertThat(swipeVerticallyFrom(x = middleX, y = topY)).isEqualTo(TopLeft)
+
+ // Split closer to the left; middle of screen is considered "right".
+ edgeSplitFraction = 0.4f
+ assertThat(swipeVerticallyFrom(x = middleX, y = topY)).isEqualTo(TopRight)
+
+ // Illegal fraction.
+ edgeSplitFraction = 1.2f
+ assertFailsWith<IllegalArgumentException> { swipeVerticallyFrom(x = middleX, y = topY) }
+
+ // Illegal fraction.
+ edgeSplitFraction = -0.3f
+ assertFailsWith<IllegalArgumentException> { swipeVerticallyFrom(x = middleX, y = topY) }
+ }
+
+ @Test
+ fun source_swipeVerticallyOnBottom_detectsBottom() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = screenWidth / 3,
+ y = screenHeight - (edgeSize / 2),
+ )
+ assertThat(detectedEdge).isEqualTo(Bottom)
+ }
+
+ @Test
+ fun source_swipeHorizontallyOnBottom_detectsNothing() {
+ val detectedEdge =
+ swipeHorizontallyFrom(
+ x = screenWidth / 3,
+ y = screenHeight - (edgeSize - 1),
+ )
+ assertThat(detectedEdge).isNull()
+ }
+
+ @Test
+ fun source_swipeHorizontallyOnLeft_detectsLeft() {
+ val detectedEdge =
+ swipeHorizontallyFrom(
+ x = edgeSize - 1,
+ y = screenHeight / 2,
+ )
+ assertThat(detectedEdge).isEqualTo(Left)
+ }
+
+ @Test
+ fun source_swipeVerticallyOnLeft_detectsNothing() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = edgeSize - 1,
+ y = screenHeight / 2,
+ )
+ assertThat(detectedEdge).isNull()
+ }
+
+ @Test
+ fun source_swipeHorizontallyOnRight_detectsRight() {
+ val detectedEdge =
+ swipeHorizontallyFrom(
+ x = screenWidth - edgeSize + 1,
+ y = screenHeight / 2,
+ )
+ assertThat(detectedEdge).isEqualTo(Right)
+ }
+
+ @Test
+ fun source_swipeVerticallyOnRight_detectsNothing() {
+ val detectedEdge =
+ swipeVerticallyFrom(
+ x = screenWidth - edgeSize + 1,
+ y = screenHeight / 2,
+ )
+ assertThat(detectedEdge).isNull()
+ }
+
+ @Test
+ fun resolve_startInLtr_resolvesLeft() {
+ val resolvedEdge = Start.resolve(LayoutDirection.Ltr)
+ assertThat(resolvedEdge).isEqualTo(Left)
+ }
+
+ @Test
+ fun resolve_startInRtl_resolvesRight() {
+ val resolvedEdge = Start.resolve(LayoutDirection.Rtl)
+ assertThat(resolvedEdge).isEqualTo(Right)
+ }
+
+ @Test
+ fun resolve_endInLtr_resolvesRight() {
+ val resolvedEdge = End.resolve(LayoutDirection.Ltr)
+ assertThat(resolvedEdge).isEqualTo(Right)
+ }
+
+ @Test
+ fun resolve_endInRtl_resolvesLeft() {
+ val resolvedEdge = End.resolve(LayoutDirection.Rtl)
+ assertThat(resolvedEdge).isEqualTo(Left)
+ }
+
+ @Test
+ fun resolve_topStartInLtr_resolvesTopLeft() {
+ val resolvedEdge = TopStart.resolve(LayoutDirection.Ltr)
+ assertThat(resolvedEdge).isEqualTo(TopLeft)
+ }
+
+ @Test
+ fun resolve_topStartInRtl_resolvesTopRight() {
+ val resolvedEdge = TopStart.resolve(LayoutDirection.Rtl)
+ assertThat(resolvedEdge).isEqualTo(TopRight)
+ }
+
+ @Test
+ fun resolve_topEndInLtr_resolvesTopRight() {
+ val resolvedEdge = TopEnd.resolve(LayoutDirection.Ltr)
+ assertThat(resolvedEdge).isEqualTo(TopRight)
+ }
+
+ @Test
+ fun resolve_topEndInRtl_resolvesTopLeft() {
+ val resolvedEdge = TopEnd.resolve(LayoutDirection.Rtl)
+ assertThat(resolvedEdge).isEqualTo(TopLeft)
+ }
+
+ private fun swipeVerticallyFrom(x: Int, y: Int): SceneContainerEdge.Resolved? {
+ return swipeFrom(x, y, Orientation.Vertical)
+ }
+
+ private fun swipeHorizontallyFrom(x: Int, y: Int): SceneContainerEdge.Resolved? {
+ return swipeFrom(x, y, Orientation.Horizontal)
+ }
+
+ private fun swipeFrom(x: Int, y: Int, orientation: Orientation): SceneContainerEdge.Resolved? {
+ return underTest.source(
+ layoutSize = IntSize(width = screenWidth, height = screenHeight),
+ position = IntOffset(x, y),
+ density = Density(1f),
+ orientation = orientation,
+ )
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt
index 3283ea1..d163abf 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImplTest.kt
@@ -19,12 +19,9 @@
import android.app.StatusBarManager.DISABLE2_NONE
import android.app.StatusBarManager.DISABLE2_NOTIFICATION_SHADE
import android.app.StatusBarManager.DISABLE2_QUICK_SETTINGS
-import android.platform.test.annotations.DisableFlags
-import android.platform.test.annotations.EnableFlags
import android.platform.test.flag.junit.FlagsParameterization
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
-import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.flags.parameterizeSceneContainerFlag
import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
@@ -39,10 +36,7 @@
import com.android.systemui.power.data.repository.fakePowerRepository
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.power.shared.model.WakefulnessState
-import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.shade.shadeTestUtil
-import com.android.systemui.shade.shared.flag.DualShade
-import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.statusbar.disableflags.data.model.DisableFlagsModel
import com.android.systemui.statusbar.disableflags.data.repository.fakeDisableFlagsRepository
import com.android.systemui.statusbar.phone.dozeParameters
@@ -66,18 +60,17 @@
@SmallTest
@RunWith(ParameterizedAndroidJunit4::class)
class ShadeInteractorImplTest(flags: FlagsParameterization) : SysuiTestCase() {
- val kosmos = testKosmos()
- val testScope = kosmos.testScope
- val configurationRepository by lazy { kosmos.fakeConfigurationRepository }
- val deviceProvisioningRepository by lazy { kosmos.fakeDeviceProvisioningRepository }
- val disableFlagsRepository by lazy { kosmos.fakeDisableFlagsRepository }
- val keyguardRepository by lazy { kosmos.fakeKeyguardRepository }
- val keyguardTransitionRepository by lazy { kosmos.fakeKeyguardTransitionRepository }
- val powerRepository by lazy { kosmos.fakePowerRepository }
- val shadeTestUtil by lazy { kosmos.shadeTestUtil }
- val userRepository by lazy { kosmos.fakeUserRepository }
- val userSetupRepository by lazy { kosmos.fakeUserSetupRepository }
- val dozeParameters by lazy { kosmos.dozeParameters }
+ private val kosmos = testKosmos()
+ private val testScope = kosmos.testScope
+ private val deviceProvisioningRepository by lazy { kosmos.fakeDeviceProvisioningRepository }
+ private val disableFlagsRepository by lazy { kosmos.fakeDisableFlagsRepository }
+ private val keyguardRepository by lazy { kosmos.fakeKeyguardRepository }
+ private val keyguardTransitionRepository by lazy { kosmos.fakeKeyguardTransitionRepository }
+ private val powerRepository by lazy { kosmos.fakePowerRepository }
+ private val shadeTestUtil by lazy { kosmos.shadeTestUtil }
+ private val userRepository by lazy { kosmos.fakeUserRepository }
+ private val userSetupRepository by lazy { kosmos.fakeUserSetupRepository }
+ private val dozeParameters by lazy { kosmos.dozeParameters }
lateinit var underTest: ShadeInteractorImpl
@@ -142,9 +135,7 @@
userSetupRepository.setUserSetUp(true)
disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NOTIFICATION_SHADE,
- )
+ DisableFlagsModel(disable2 = DISABLE2_NOTIFICATION_SHADE)
val actual by collectLastValue(underTest.isExpandToQsEnabled)
@@ -158,9 +149,7 @@
userSetupRepository.setUserSetUp(true)
disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_QUICK_SETTINGS,
- )
+ DisableFlagsModel(disable2 = DISABLE2_QUICK_SETTINGS)
val actual by collectLastValue(underTest.isExpandToQsEnabled)
assertThat(actual).isFalse()
@@ -171,10 +160,7 @@
testScope.runTest {
deviceProvisioningRepository.setDeviceProvisioned(true)
userSetupRepository.setUserSetUp(true)
- disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NONE,
- )
+ disableFlagsRepository.disableFlags.value = DisableFlagsModel(disable2 = DISABLE2_NONE)
keyguardRepository.setIsDozing(true)
@@ -188,10 +174,7 @@
testScope.runTest {
deviceProvisioningRepository.setDeviceProvisioned(true)
keyguardRepository.setIsDozing(false)
- disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NONE,
- )
+ disableFlagsRepository.disableFlags.value = DisableFlagsModel(disable2 = DISABLE2_NONE)
userSetupRepository.setUserSetUp(true)
@@ -205,10 +188,7 @@
testScope.runTest {
deviceProvisioningRepository.setDeviceProvisioned(true)
keyguardRepository.setIsDozing(false)
- disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NONE,
- )
+ disableFlagsRepository.disableFlags.value = DisableFlagsModel(disable2 = DISABLE2_NONE)
userRepository.setSettings(UserSwitcherSettingsModel(isSimpleUserSwitcher = false))
@@ -222,10 +202,7 @@
testScope.runTest {
deviceProvisioningRepository.setDeviceProvisioned(true)
keyguardRepository.setIsDozing(false)
- disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NONE,
- )
+ disableFlagsRepository.disableFlags.value = DisableFlagsModel(disable2 = DISABLE2_NONE)
userSetupRepository.setUserSetUp(true)
val actual by collectLastValue(underTest.isExpandToQsEnabled)
@@ -250,10 +227,7 @@
testScope.runTest {
deviceProvisioningRepository.setDeviceProvisioned(true)
keyguardRepository.setIsDozing(false)
- disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NONE,
- )
+ disableFlagsRepository.disableFlags.value = DisableFlagsModel(disable2 = DISABLE2_NONE)
userSetupRepository.setUserSetUp(true)
val actual by collectLastValue(underTest.isExpandToQsEnabled)
@@ -262,17 +236,12 @@
// WHEN QS is disabled
disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_QUICK_SETTINGS,
- )
+ DisableFlagsModel(disable2 = DISABLE2_QUICK_SETTINGS)
// THEN expand is disabled
assertThat(actual).isFalse()
// WHEN QS is enabled
- disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NONE,
- )
+ disableFlagsRepository.disableFlags.value = DisableFlagsModel(disable2 = DISABLE2_NONE)
// THEN expand is enabled
assertThat(actual).isTrue()
}
@@ -282,10 +251,7 @@
testScope.runTest {
deviceProvisioningRepository.setDeviceProvisioned(true)
keyguardRepository.setIsDozing(false)
- disableFlagsRepository.disableFlags.value =
- DisableFlagsModel(
- disable2 = DISABLE2_NONE,
- )
+ disableFlagsRepository.disableFlags.value = DisableFlagsModel(disable2 = DISABLE2_NONE)
userSetupRepository.setUserSetUp(true)
val actual by collectLastValue(underTest.isExpandToQsEnabled)
@@ -359,9 +325,7 @@
)
)
keyguardRepository.setDozeTransitionModel(
- DozeTransitionModel(
- to = DozeStateModel.DOZE_AOD,
- )
+ DozeTransitionModel(to = DozeStateModel.DOZE_AOD)
)
val isShadeTouchable by collectLastValue(underTest.isShadeTouchable)
assertThat(isShadeTouchable).isFalse()
@@ -385,9 +349,7 @@
)
)
keyguardRepository.setDozeTransitionModel(
- DozeTransitionModel(
- to = DozeStateModel.DOZE_PULSING,
- )
+ DozeTransitionModel(to = DozeStateModel.DOZE_PULSING)
)
val isShadeTouchable by collectLastValue(underTest.isShadeTouchable)
assertThat(isShadeTouchable).isTrue()
@@ -450,51 +412,9 @@
lastSleepReason = WakeSleepReason.OTHER,
)
keyguardTransitionRepository.sendTransitionStep(
- TransitionStep(
- transitionState = TransitionState.STARTED,
- )
+ TransitionStep(transitionState = TransitionState.STARTED)
)
val isShadeTouchable by collectLastValue(underTest.isShadeTouchable)
assertThat(isShadeTouchable).isTrue()
}
-
- @Test
- @DisableFlags(DualShade.FLAG_NAME)
- fun legacyShadeMode_narrowScreen_singleShade() =
- testScope.runTest {
- val shadeMode by collectLastValue(underTest.shadeMode)
- kosmos.shadeRepository.setShadeLayoutWide(false)
-
- assertThat(shadeMode).isEqualTo(ShadeMode.Single)
- }
-
- @Test
- @DisableFlags(DualShade.FLAG_NAME)
- fun legacyShadeMode_wideScreen_splitShade() =
- testScope.runTest {
- val shadeMode by collectLastValue(underTest.shadeMode)
- kosmos.shadeRepository.setShadeLayoutWide(true)
-
- assertThat(shadeMode).isEqualTo(ShadeMode.Split)
- }
-
- @Test
- @EnableFlags(DualShade.FLAG_NAME)
- fun shadeMode_wideScreen_isDual() =
- testScope.runTest {
- val shadeMode by collectLastValue(underTest.shadeMode)
- kosmos.shadeRepository.setShadeLayoutWide(true)
-
- assertThat(shadeMode).isEqualTo(ShadeMode.Dual)
- }
-
- @Test
- @EnableFlags(DualShade.FLAG_NAME)
- fun shadeMode_narrowScreen_isDual() =
- testScope.runTest {
- val shadeMode by collectLastValue(underTest.shadeMode)
- kosmos.shadeRepository.setShadeLayoutWide(false)
-
- assertThat(shadeMode).isEqualTo(ShadeMode.Dual)
- }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorImplTest.kt
new file mode 100644
index 0000000..2a2817b
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorImplTest.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shade.domain.interactor
+
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.shade.data.repository.shadeRepository
+import com.android.systemui.shade.shared.flag.DualShade
+import com.android.systemui.shade.shared.model.ShadeMode
+import com.android.systemui.testKosmos
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.test.runTest
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class ShadeModeInteractorImplTest : SysuiTestCase() {
+
+ private val kosmos = testKosmos()
+ private val testScope = kosmos.testScope
+
+ private lateinit var underTest: ShadeModeInteractor
+
+ @Before
+ fun setUp() {
+ underTest = kosmos.shadeModeInteractor
+ }
+
+ @Test
+ @DisableFlags(DualShade.FLAG_NAME)
+ fun legacyShadeMode_narrowScreen_singleShade() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(underTest.shadeMode)
+ kosmos.shadeRepository.setShadeLayoutWide(false)
+
+ assertThat(shadeMode).isEqualTo(ShadeMode.Single)
+ }
+
+ @Test
+ @DisableFlags(DualShade.FLAG_NAME)
+ fun legacyShadeMode_wideScreen_splitShade() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(underTest.shadeMode)
+ kosmos.shadeRepository.setShadeLayoutWide(true)
+
+ assertThat(shadeMode).isEqualTo(ShadeMode.Split)
+ }
+
+ @Test
+ @EnableFlags(DualShade.FLAG_NAME)
+ fun shadeMode_wideScreen_isDual() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(underTest.shadeMode)
+ kosmos.shadeRepository.setShadeLayoutWide(true)
+
+ assertThat(shadeMode).isEqualTo(ShadeMode.Dual)
+ }
+
+ @Test
+ @EnableFlags(DualShade.FLAG_NAME)
+ fun shadeMode_narrowScreen_isDual() =
+ testScope.runTest {
+ val shadeMode by collectLastValue(underTest.shadeMode)
+ kosmos.shadeRepository.setShadeLayoutWide(false)
+
+ assertThat(shadeMode).isEqualTo(ShadeMode.Dual)
+ }
+
+ @Test
+ fun getTopEdgeSplitFraction_narrowScreen_splitInHalf() =
+ testScope.runTest {
+ // Ensure isShadeLayoutWide is collected.
+ val isShadeLayoutWide by collectLastValue(underTest.isShadeLayoutWide)
+ kosmos.shadeRepository.setShadeLayoutWide(false)
+
+ assertThat(underTest.getTopEdgeSplitFraction()).isEqualTo(0.5f)
+ }
+
+ @Test
+ fun getTopEdgeSplitFraction_wideScreen_leftSideLarger() =
+ testScope.runTest {
+ // Ensure isShadeLayoutWide is collected.
+ val isShadeLayoutWide by collectLastValue(underTest.isShadeLayoutWide)
+ kosmos.shadeRepository.setShadeLayoutWide(true)
+
+ assertThat(underTest.getTopEdgeSplitFraction()).isGreaterThan(0.5f)
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt
index 840aa92..26e1a4d 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt
@@ -26,6 +26,7 @@
import com.android.settingslib.notification.data.repository.updateNotificationPolicy
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.flags.Flags
import com.android.systemui.flags.andSceneContainer
@@ -36,6 +37,7 @@
import com.android.systemui.power.data.repository.fakePowerRepository
import com.android.systemui.power.shared.model.WakefulnessState
import com.android.systemui.res.R
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.shadeTestUtil
import com.android.systemui.statusbar.data.repository.fakeRemoteInputRepository
import com.android.systemui.statusbar.notification.data.repository.FakeHeadsUpRowRepository
@@ -51,6 +53,7 @@
import com.android.systemui.util.ui.value
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Before
@@ -153,7 +156,7 @@
fun shouldShowEmptyShadeView_trueWhenNoNotifs() =
testScope.runTest {
val shouldShowEmptyShadeView by collectLastValue(underTest.shouldShowEmptyShadeView)
- val shouldIncludeFooterView by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldIncludeFooterView by collectFooterViewVisibility()
// WHEN has no notifs
activeNotificationListRepository.setActiveNotifs(count = 0)
@@ -196,7 +199,7 @@
fun shouldShowEmptyShadeView_trueWhenQsExpandedInSplitShade() =
testScope.runTest {
val shouldShowEmptyShadeView by collectLastValue(underTest.shouldShowEmptyShadeView)
- val shouldIncludeFooterView by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldIncludeFooterView by collectFooterViewVisibility()
// WHEN has no notifs
activeNotificationListRepository.setActiveNotifs(count = 0)
@@ -217,7 +220,7 @@
fun shouldShowEmptyShadeView_trueWhenLockedShade() =
testScope.runTest {
val shouldShowEmptyShadeView by collectLastValue(underTest.shouldShowEmptyShadeView)
- val shouldIncludeFooterView by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldIncludeFooterView by collectFooterViewVisibility()
// WHEN has no notifs
activeNotificationListRepository.setActiveNotifs(count = 0)
@@ -315,7 +318,7 @@
@Test
fun shouldIncludeFooterView_trueWhenShade() =
testScope.runTest {
- val shouldIncludeFooterView by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldIncludeFooterView by collectFooterViewVisibility()
val shouldShowEmptyShadeView by collectLastValue(underTest.shouldShowEmptyShadeView)
// WHEN has notifs
@@ -333,7 +336,7 @@
@Test
fun shouldIncludeFooterView_trueWhenLockedShade() =
testScope.runTest {
- val shouldIncludeFooterView by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldIncludeFooterView by collectFooterViewVisibility()
val shouldShowEmptyShadeView by collectLastValue(underTest.shouldShowEmptyShadeView)
// WHEN has notifs
@@ -351,7 +354,7 @@
@Test
fun shouldIncludeFooterView_falseWhenKeyguard() =
testScope.runTest {
- val shouldInclude by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldInclude by collectFooterViewVisibility()
// WHEN has notifs
activeNotificationListRepository.setActiveNotifs(count = 2)
@@ -366,7 +369,7 @@
@Test
fun shouldIncludeFooterView_falseWhenUserNotSetUp() =
testScope.runTest {
- val shouldInclude by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldInclude by collectFooterViewVisibility()
// WHEN has notifs
activeNotificationListRepository.setActiveNotifs(count = 2)
@@ -384,7 +387,7 @@
@Test
fun shouldIncludeFooterView_falseWhenStartingToSleep() =
testScope.runTest {
- val shouldInclude by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldInclude by collectFooterViewVisibility()
// WHEN has notifs
activeNotificationListRepository.setActiveNotifs(count = 2)
@@ -402,7 +405,7 @@
@Test
fun shouldIncludeFooterView_falseWhenQsExpandedDefault() =
testScope.runTest {
- val shouldInclude by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldInclude by collectFooterViewVisibility()
// WHEN has notifs
activeNotificationListRepository.setActiveNotifs(count = 2)
@@ -421,7 +424,7 @@
@Test
fun shouldIncludeFooterView_trueWhenQsExpandedSplitShade() =
testScope.runTest {
- val shouldIncludeFooterView by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldIncludeFooterView by collectFooterViewVisibility()
val shouldShowEmptyShadeView by collectLastValue(underTest.shouldShowEmptyShadeView)
// WHEN has notifs
@@ -444,7 +447,7 @@
@Test
fun shouldIncludeFooterView_falseWhenRemoteInputActive() =
testScope.runTest {
- val shouldInclude by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldInclude by collectFooterViewVisibility()
// WHEN has notifs
activeNotificationListRepository.setActiveNotifs(count = 2)
@@ -462,7 +465,7 @@
@Test
fun shouldIncludeFooterView_animatesWhenShade() =
testScope.runTest {
- val shouldInclude by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldInclude by collectFooterViewVisibility()
// WHEN has notifs
activeNotificationListRepository.setActiveNotifs(count = 2)
@@ -478,7 +481,7 @@
@Test
fun shouldIncludeFooterView_notAnimatingOnKeyguard() =
testScope.runTest {
- val shouldInclude by collectLastValue(underTest.shouldIncludeFooterView)
+ val shouldInclude by collectFooterViewVisibility()
// WHEN has notifs
activeNotificationListRepository.setActiveNotifs(count = 2)
@@ -492,6 +495,22 @@
}
@Test
+ @EnableSceneContainer
+ fun shouldShowFooterView_falseWhenShadeIsClosed() =
+ testScope.runTest {
+ val shouldShow by collectLastValue(underTest.shouldShowFooterView)
+
+ // WHEN shade is closed
+ fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE)
+ shadeTestUtil.setShadeExpansion(0f)
+ runCurrent()
+
+ // THEN footer is hidden
+ assertThat(shouldShow?.value).isFalse()
+ }
+
+ @Test
+ @DisableSceneContainer
fun shouldHideFooterView_trueWhenShadeIsClosed() =
testScope.runTest {
val shouldHide by collectLastValue(underTest.shouldHideFooterView)
@@ -506,6 +525,7 @@
}
@Test
+ @DisableSceneContainer
fun shouldHideFooterView_falseWhenShadeIsOpen() =
testScope.runTest {
val shouldHide by collectLastValue(underTest.shouldHideFooterView)
@@ -520,6 +540,7 @@
}
@Test
+ @DisableSceneContainer
fun shouldHideFooterView_falseWhenQSPartiallyOpen() =
testScope.runTest {
val shouldHide by collectLastValue(underTest.shouldHideFooterView)
@@ -642,4 +663,10 @@
assertThat(animationsEnabled).isTrue()
}
+
+ private fun TestScope.collectFooterViewVisibility() =
+ collectLastValue(
+ if (SceneContainerFlag.isEnabled) underTest.shouldShowFooterView
+ else underTest.shouldIncludeFooterView
+ )
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
index 3f97f0b..425f16e 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
@@ -312,7 +312,7 @@
from = LOCKSCREEN,
to = GLANCEABLE_HUB,
value = 0f,
- )
+ ),
)
runCurrent()
@@ -321,7 +321,7 @@
Transition(
from = Scenes.Lockscreen,
to = Scenes.Communal,
- progress = flowOf(progress)
+ progress = flowOf(progress),
),
stateTransition =
TransitionStep(
@@ -329,7 +329,7 @@
from = LOCKSCREEN,
to = GLANCEABLE_HUB,
value = progress,
- )
+ ),
)
runCurrent()
@@ -344,7 +344,7 @@
from = LOCKSCREEN,
to = GLANCEABLE_HUB,
value = 1f,
- )
+ ),
)
assertThat(alpha).isEqualTo(0f)
@@ -378,7 +378,7 @@
from = DREAMING,
to = GLANCEABLE_HUB,
value = 0f,
- )
+ ),
)
runCurrent()
kosmos.setTransition(
@@ -386,7 +386,7 @@
Transition(
from = Scenes.Lockscreen,
to = Scenes.Communal,
- progress = flowOf(progress)
+ progress = flowOf(progress),
),
stateTransition =
TransitionStep(
@@ -394,7 +394,7 @@
from = DREAMING,
to = GLANCEABLE_HUB,
value = progress,
- )
+ ),
)
runCurrent()
// Keep notifications hidden during the transition from dream to hub
@@ -409,7 +409,7 @@
from = DREAMING,
to = GLANCEABLE_HUB,
value = 1f,
- )
+ ),
)
assertThat(alpha).isEqualTo(0f)
}
@@ -435,13 +435,13 @@
kosmos.setTransition(
sceneTransition = Idle(Scenes.Gone),
- stateTransition = TransitionStep(from = LOCKSCREEN, to = GONE)
+ stateTransition = TransitionStep(from = LOCKSCREEN, to = GONE),
)
assertThat(isOnLockscreen).isFalse()
kosmos.setTransition(
sceneTransition = Idle(Scenes.Lockscreen),
- stateTransition = TransitionStep(from = GONE, to = LOCKSCREEN)
+ stateTransition = TransitionStep(from = GONE, to = LOCKSCREEN),
)
assertThat(isOnLockscreen).isTrue()
// While progressing from lockscreen, should still be true
@@ -452,28 +452,20 @@
from = LOCKSCREEN,
to = GONE,
value = 0.8f,
- transitionState = TransitionState.RUNNING
- )
+ transitionState = TransitionState.RUNNING,
+ ),
)
assertThat(isOnLockscreen).isTrue()
kosmos.setTransition(
sceneTransition = Idle(Scenes.Lockscreen),
- stateTransition =
- TransitionStep(
- from = GONE,
- to = LOCKSCREEN,
- )
+ stateTransition = TransitionStep(from = GONE, to = LOCKSCREEN),
)
assertThat(isOnLockscreen).isTrue()
kosmos.setTransition(
sceneTransition = Idle(Scenes.Bouncer),
- stateTransition =
- TransitionStep(
- from = LOCKSCREEN,
- to = PRIMARY_BOUNCER,
- )
+ stateTransition = TransitionStep(from = LOCKSCREEN, to = PRIMARY_BOUNCER),
)
assertThat(isOnLockscreen).isTrue()
}
@@ -527,11 +519,7 @@
// Move to glanceable hub
kosmos.setTransition(
sceneTransition = Idle(Scenes.Communal),
- stateTransition =
- TransitionStep(
- from = LOCKSCREEN,
- to = GLANCEABLE_HUB,
- )
+ stateTransition = TransitionStep(from = LOCKSCREEN, to = GLANCEABLE_HUB),
)
assertThat(isOnGlanceableHubWithoutShade).isTrue()
@@ -553,11 +541,7 @@
shadeTestUtil.setLockscreenShadeExpansion(0f)
kosmos.setTransition(
sceneTransition = Idle(Scenes.Communal),
- stateTransition =
- TransitionStep(
- from = LOCKSCREEN,
- to = GLANCEABLE_HUB,
- )
+ stateTransition = TransitionStep(from = LOCKSCREEN, to = GLANCEABLE_HUB),
)
assertThat(isOnGlanceableHubWithoutShade).isTrue()
}
@@ -779,7 +763,7 @@
configurationRepository.setDimensionPixelSize(
R.dimen.keyguard_translate_distance_on_swipe_up,
- -100
+ -100,
)
configurationRepository.onAnyConfigurationChange()
@@ -800,7 +784,7 @@
configurationRepository.setDimensionPixelSize(
R.dimen.keyguard_translate_distance_on_swipe_up,
- -100
+ -100,
)
configurationRepository.onAnyConfigurationChange()
@@ -839,7 +823,8 @@
fun alphaOnFullQsExpansion() =
testScope.runTest {
val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
+ val alpha by
+ collectLastValue(underTest.keyguardAlpha(viewState, testScope.backgroundScope))
showLockscreenWithQSExpanded()
@@ -856,12 +841,15 @@
@Test
@BrokenWithSceneContainer(330311871)
- fun alphaDoesNotUpdateWhileGoneTransitionIsRunning() =
+ fun alphaWhenGoneIsSetToOne() =
testScope.runTest {
val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
+ val alpha by
+ collectLastValue(underTest.keyguardAlpha(viewState, testScope.backgroundScope))
showLockscreen()
+ assertThat(alpha).isEqualTo(1f)
+
// GONE transition gets to 90% complete
keyguardTransitionRepository.sendTransitionStep(
TransitionStep(
@@ -881,65 +869,23 @@
)
)
runCurrent()
-
- // At this point, alpha should be zero
- assertThat(alpha).isEqualTo(0f)
-
- // An attempt to override by the shade should be ignored
- shadeTestUtil.setQsExpansion(0.5f)
- assertThat(alpha).isEqualTo(0f)
- }
-
- @Test
- fun alphaDoesNotUpdateWhileOcclusionTransitionIsRunning() =
- testScope.runTest {
- val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
-
- showLockscreen()
- // OCCLUDED transition gets to 90% complete
- keyguardTransitionRepository.sendTransitionStep(
- TransitionStep(
- from = LOCKSCREEN,
- to = OCCLUDED,
- transitionState = TransitionState.STARTED,
- value = 0f,
- )
- )
- runCurrent()
- keyguardTransitionRepository.sendTransitionStep(
- TransitionStep(
- from = LOCKSCREEN,
- to = OCCLUDED,
- transitionState = TransitionState.RUNNING,
- value = 0.9f,
- )
- )
- runCurrent()
-
- // At this point, alpha should be zero
- assertThat(alpha).isEqualTo(0f)
-
- // An attempt to override by the shade should be ignored
- shadeTestUtil.setQsExpansion(0.5f)
- assertThat(alpha).isEqualTo(0f)
- }
-
- @Test
- fun alphaWhenGoneIsSetToOne() =
- testScope.runTest {
- val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
-
- showLockscreen()
-
- keyguardTransitionRepository.sendTransitionSteps(
- from = LOCKSCREEN,
- to = GONE,
- testScope
- )
+ // Change in state should not immediately set value to 1f. Should wait for
+ // transition to complete
keyguardRepository.setStatusBarState(StatusBarState.SHADE)
+ // Transition is active, and NSSL should be nearly faded out
+ assertThat(alpha).isLessThan(0.5f)
+
+ keyguardTransitionRepository.sendTransitionStep(
+ TransitionStep(
+ from = LOCKSCREEN,
+ to = GONE,
+ transitionState = TransitionState.FINISHED,
+ value = 1f,
+ )
+ )
+ runCurrent()
+ // Should reset to 1f
assertThat(alpha).isEqualTo(1f)
}
@@ -978,11 +924,7 @@
assertThat(fadeIn[0]).isEqualTo(false)
// ... then user hits power to go to AOD
- keyguardTransitionRepository.sendTransitionSteps(
- from = LOCKSCREEN,
- to = AOD,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = LOCKSCREEN, to = AOD, testScope)
// ... followed by a shade collapse
showLockscreen()
// ... does not trigger a fade in
@@ -994,7 +936,8 @@
fun alpha_isZero_fromPrimaryBouncerToGoneWhileCommunalSceneVisible() =
testScope.runTest {
val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
+ val alpha by
+ collectLastValue(underTest.keyguardAlpha(viewState, testScope.backgroundScope))
showPrimaryBouncer()
showCommunalScene()
@@ -1039,7 +982,7 @@
from = PRIMARY_BOUNCER,
to = GONE,
transitionState = TransitionState.FINISHED,
- value = 1f
+ value = 1f,
)
)
runCurrent()
@@ -1052,7 +995,8 @@
fun alpha_fromPrimaryBouncerToGoneWhenCommunalSceneNotVisible() =
testScope.runTest {
val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
+ val alpha by
+ collectLastValue(underTest.keyguardAlpha(viewState, testScope.backgroundScope))
showPrimaryBouncer()
hideCommunalScene()
@@ -1095,7 +1039,7 @@
from = PRIMARY_BOUNCER,
to = GONE,
transitionState = TransitionState.FINISHED,
- value = 1f
+ value = 1f,
)
)
runCurrent()
@@ -1107,7 +1051,8 @@
fun alpha_isZero_fromAlternateBouncerToGoneWhileCommunalSceneVisible() =
testScope.runTest {
val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
+ val alpha by
+ collectLastValue(underTest.keyguardAlpha(viewState, testScope.backgroundScope))
showAlternateBouncer()
showCommunalScene()
@@ -1152,7 +1097,7 @@
from = ALTERNATE_BOUNCER,
to = GONE,
transitionState = TransitionState.FINISHED,
- value = 1f
+ value = 1f,
)
)
runCurrent()
@@ -1165,7 +1110,8 @@
fun alpha_fromAlternateBouncerToGoneWhenCommunalSceneNotVisible() =
testScope.runTest {
val viewState = ViewStateAccessor()
- val alpha by collectLastValue(underTest.keyguardAlpha(viewState))
+ val alpha by
+ collectLastValue(underTest.keyguardAlpha(viewState, testScope.backgroundScope))
showAlternateBouncer()
hideCommunalScene()
@@ -1208,7 +1154,7 @@
from = ALTERNATE_BOUNCER,
to = GONE,
transitionState = TransitionState.FINISHED,
- value = 1f
+ value = 1f,
)
)
runCurrent()
@@ -1221,11 +1167,7 @@
runCurrent()
keyguardRepository.setStatusBarState(StatusBarState.KEYGUARD)
runCurrent()
- keyguardTransitionRepository.sendTransitionSteps(
- from = AOD,
- to = LOCKSCREEN,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)
}
private suspend fun TestScope.showDream() {
@@ -1247,11 +1189,7 @@
runCurrent()
keyguardRepository.setStatusBarState(StatusBarState.SHADE_LOCKED)
runCurrent()
- keyguardTransitionRepository.sendTransitionSteps(
- from = AOD,
- to = LOCKSCREEN,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)
}
private suspend fun TestScope.showLockscreenWithQSExpanded() {
@@ -1260,11 +1198,7 @@
runCurrent()
keyguardRepository.setStatusBarState(StatusBarState.SHADE_LOCKED)
runCurrent()
- keyguardTransitionRepository.sendTransitionSteps(
- from = AOD,
- to = LOCKSCREEN,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)
}
private suspend fun TestScope.showPrimaryBouncer() {
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/domain/interactor/WifiInteractorImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/domain/interactor/WifiInteractorImplTest.kt
index b9ca8fc..c0a1592 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/domain/interactor/WifiInteractorImplTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/domain/interactor/WifiInteractorImplTest.kt
@@ -78,7 +78,7 @@
@Test
fun ssid_inactiveNetwork_outputsNull() =
testScope.runTest {
- wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive)
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive())
var latest: String? = "default"
val job = underTest.ssid.onEach { latest = it }.launchIn(this)
@@ -93,7 +93,7 @@
fun ssid_carrierMergedNetwork_outputsNull() =
testScope.runTest {
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(subscriptionId = 2, level = 1)
+ WifiNetworkModel.CarrierMerged.of(subscriptionId = 2, level = 1)
)
var latest: String? = "default"
@@ -109,7 +109,7 @@
fun ssid_unknownSsid_outputsNull() =
testScope.runTest {
wifiRepository.setWifiNetwork(
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 1,
ssid = WifiManager.UNKNOWN_SSID,
)
@@ -128,7 +128,7 @@
fun ssid_validSsid_outputsSsid() =
testScope.runTest {
wifiRepository.setWifiNetwork(
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 1,
ssid = "MyAwesomeWifiNetwork",
)
@@ -189,7 +189,7 @@
fun wifiNetwork_matchesRepoWifiNetwork() =
testScope.runTest {
val wifiNetwork =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
isValidated = true,
level = 3,
ssid = "AB",
@@ -263,7 +263,7 @@
val latest by collectLastValue(underTest.areNetworksAvailable)
wifiRepository.wifiScanResults.value = emptyList()
- wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive)
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive())
assertThat(latest).isFalse()
}
@@ -280,7 +280,7 @@
WifiScanEntry(ssid = "ssid 3"),
)
- wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive)
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive())
assertThat(latest).isTrue()
}
@@ -298,7 +298,7 @@
)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
ssid = "ssid 2",
level = 2,
)
@@ -318,7 +318,7 @@
)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
ssid = "ssid 2",
level = 2,
)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelTest.kt
index 72a45b9..141e304 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelTest.kt
@@ -115,7 +115,7 @@
val latestKeyguard by collectLastValue(keyguard.wifiIcon)
val latestQs by collectLastValue(qs.wifiIcon)
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(isValidated = true, level = 1))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(isValidated = true, level = 1))
assertThat(latestHome).isInstanceOf(WifiIcon.Visible::class.java)
assertThat(latestHome).isEqualTo(latestKeyguard)
@@ -129,7 +129,7 @@
// Even WHEN the network has a valid hotspot type
wifiRepository.setWifiNetwork(
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
isValidated = true,
level = 1,
hotspotDeviceType = WifiNetworkModel.HotspotDeviceType.LAPTOP,
@@ -191,7 +191,7 @@
whenever(connectivityConstants.shouldShowActivityConfig).thenReturn(true)
createAndSetViewModel()
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(ssid = null, level = 1))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(ssid = null, level = 1))
val activityIn by collectLastValue(underTest.isActivityInViewVisible)
val activityOut by collectLastValue(underTest.isActivityOutViewVisible)
@@ -214,7 +214,7 @@
whenever(connectivityConstants.shouldShowActivityConfig).thenReturn(true)
createAndSetViewModel()
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(ssid = null, level = 1))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(ssid = null, level = 1))
val activityIn by collectLastValue(underTest.isActivityInViewVisible)
val activityOut by collectLastValue(underTest.isActivityOutViewVisible)
@@ -463,6 +463,6 @@
}
companion object {
- private val ACTIVE_VALID_WIFI_NETWORK = WifiNetworkModel.Active(ssid = "AB", level = 1)
+ private val ACTIVE_VALID_WIFI_NETWORK = WifiNetworkModel.Active.of(ssid = "AB", level = 1)
}
}
diff --git a/packages/SystemUI/res-keyguard/values-ja/strings.xml b/packages/SystemUI/res-keyguard/values-ja/strings.xml
index 9752eca..7c91daf 100644
--- a/packages/SystemUI/res-keyguard/values-ja/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ja/strings.xml
@@ -34,7 +34,7 @@
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 急速充電中"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 低速充電中"</string>
<string name="keyguard_plugged_in_charging_limited" msgid="5369697538556777542">"<xliff:g id="PERCENTAGE">%s</xliff:g> • バッテリーを保護するため、充電を一時停止しています"</string>
- <string name="keyguard_plugged_in_incompatible_charger" msgid="6384203333154532125">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 充電用アクセサリを確認してください"</string>
+ <string name="keyguard_plugged_in_incompatible_charger" msgid="6384203333154532125">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 充電用アクセサリーを確認してください"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ネットワークがロックされました"</string>
<string name="keyguard_missing_sim_message_short" msgid="685029586173458728">"SIM がありません"</string>
<string name="keyguard_permanent_disabled_sim_message_short" msgid="3955052454216046100">"SIM が使用できません。"</string>
diff --git a/packages/SystemUI/res/drawable/ic_volume_media_off.xml b/packages/SystemUI/res/drawable/ic_volume_media_off.xml
deleted file mode 100644
index 875b7b6..0000000
--- a/packages/SystemUI/res/drawable/ic_volume_media_off.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License
- -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/ic_volume_media_mute" />
-</selector>
diff --git a/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml b/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml
index 3b3ed39..91cd019 100644
--- a/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml
+++ b/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml
@@ -215,17 +215,4 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
tools:srcCompat="@tools:sample/avatars" />
-
- <com.android.systemui.biometrics.BiometricPromptLottieViewWrapper
- android:id="@+id/biometric_icon_overlay"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:layout_gravity="center"
- android:contentDescription="@null"
- android:scaleType="fitXY"
- android:importantForAccessibility="no"
- app:layout_constraintBottom_toBottomOf="@+id/biometric_icon"
- app:layout_constraintEnd_toEndOf="@+id/biometric_icon"
- app:layout_constraintStart_toStartOf="@+id/biometric_icon"
- app:layout_constraintTop_toTopOf="@+id/biometric_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml b/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml
index 2a00495..51117a7 100644
--- a/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml
+++ b/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml
@@ -40,19 +40,6 @@
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
- <com.android.systemui.biometrics.BiometricPromptLottieViewWrapper
- android:id="@+id/biometric_icon_overlay"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:layout_gravity="center"
- android:contentDescription="@null"
- android:scaleType="fitXY"
- android:importantForAccessibility="no"
- app:layout_constraintBottom_toBottomOf="@+id/biometric_icon"
- app:layout_constraintEnd_toEndOf="@+id/biometric_icon"
- app:layout_constraintStart_toStartOf="@+id/biometric_icon"
- app:layout_constraintTop_toTopOf="@+id/biometric_icon" />
-
<ScrollView
android:id="@+id/scrollView"
android:layout_width="0dp"
diff --git a/packages/SystemUI/res/layout/shelf_action_chip.xml b/packages/SystemUI/res/layout/shelf_action_chip.xml
index c7606e4..1c65e36 100644
--- a/packages/SystemUI/res/layout/shelf_action_chip.xml
+++ b/packages/SystemUI/res/layout/shelf_action_chip.xml
@@ -28,6 +28,7 @@
<ImageView
android:id="@+id/overlay_action_chip_icon"
android:tint="?androidprv:attr/materialColorOnSecondary"
+ android:tintMode="src_in"
android:layout_width="@dimen/overlay_action_chip_icon_size"
android:layout_height="@dimen/overlay_action_chip_icon_size"/>
<TextView
diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml
index 541aebe..32bcca1 100644
--- a/packages/SystemUI/res/layout/status_bar.xml
+++ b/packages/SystemUI/res/layout/status_bar.xml
@@ -102,7 +102,9 @@
<include layout="@layout/ongoing_activity_chip"
android:id="@+id/ongoing_activity_chip_primary"/>
- <!-- TODO(b/364653005): Add a second activity chip. -->
+ <include layout="@layout/ongoing_activity_chip"
+ android:id="@+id/ongoing_activity_chip_secondary"
+ android:visibility="gone"/>
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/notification_icon_area"
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 2a669de..0fb0aaf 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Voeg by nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Sluit skakel in"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Skermopnemer"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Verwerk tans skermopname"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Deurlopende kennisgewing vir \'n skermopnamesessie"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Sluimerskerm"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Moenie Steur Nie"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modusse"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Geen saamgebinde toestelle beskikbaar nie"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tik om ’n toestel te koppel of ontkoppel"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Maak Instellings oop"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Ander toestel"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Wissel oorsig"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modusse"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Klaar"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Instellings"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Aan"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Vou ikoon in"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Vou ikoon uit"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"of"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigeer met jou sleutelbord"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Leer kortpadsleutels"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigeer met jou raakpaneel"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Leer raakpaneelgebare"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigeer met jou sleutelbord en raakpaneel"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Leer raakpaneelgebare, kortpadsleutels en meer"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Teruggebaar"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Tuisgebaar"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Handelingsleutel"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Jy kan nou die skerm ekstra donker maak deur die helderheidvlak vanaf die bokant van jou skerm nog laer te maak.\n\nDit werk die beste wanneer jy in ’n donker omgewing is."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Verwyder kortpad vir ekstra donker"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Kortpad vir ekstra donker is verwyder. Gebruik die gewone helderheidbalk om jou helderheid te verlaag."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index f7f9763..286acea 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"ወደ ማስታወሻ አክል"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"አገናኝ አካትት"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g><xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"አገናኞች ከሌሎች መገለጫዎች ሊታከሉ አይችሉም"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"የማያ መቅረጫ"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"የማያ ገፅ ቀረጻን በማሰናዳት ላይ"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ለአንድ የማያ ገፅ ቀረጻ ክፍለ-ጊዜ በመካሄድ ያለ ማሳወቂያ"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"የማያ ገፅ ማቆያ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ኤተርኔት"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"አትረብሽ"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"ሁነታዎች"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ብሉቱዝ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ምንም የተጣመሩ መሣሪያዎች አይገኝም"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"መሣሪያን ለማገናኘት ወይም ግንኙነቱን ለማቋረጥ መታ ያድርጉ"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ቅንብሮችን ክፈት"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"ሌላ መሣሪያ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"አጠቃላይ እይታን ቀያይር"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"ሁነታዎች"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ተከናውኗል"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ቅንብሮች"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"በርቷል"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"መሰብሰቢያ አዶ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"መዘርጊያ አዶ"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ወይም"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"የቁልፍ ሰሌዳዎን በመጠቀም ያስሱ"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"የቁልፍ ሰሌዳ አቋራጮችን ይወቁ"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"የመዳሰሻ ሰሌዳዎን በመጠቀም ያስሱ"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"የመዳሰሻ ሰሌዳ ምልክቶችን ይወቁ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"የእርስዎን የቁልፍ ሰሌዳ እና የመዳሰሻ ሰሌዳ በመጠቀም ያስሱ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"የመዳሰሻ ሰሌዳ ምልክቶችን፣ የቁልፍ ሰሌዳ አቋራጮችን እና ሌሎችን ይወቁ"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"የተመለስ ምልክት"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"የቤት ምልክት"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"የተግባር ቁልፍ"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"አሁን ከማያ ገፅዎ በላይ የብሩህነት ደረጃውን ይበልጥ በመቀነስ ማያ ገፁን ተጨማሪ ደብዛዛ ማድረግ ይችላሉ።\n\nይህ በጨለማ አካባቢ ውስጥ ሲሆኑ በተሻለ ይሠራል።"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"ተጨማሪ ደብዛዛ አቋራጭን አስወግድ"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"የተጨማሪ ደብዛዛ አቋራጭን ያስወግዱ። የእርስዎን ብሩሃማነት ለመቀነስ መደበኛ የብሩሃማነት አሞሌውን ይጠቀሙ።"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 5d6b908..5b844f2 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"إضافة إلى الملاحظة"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"تضمين الرابط"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"مسجّل الشاشة"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"جارٍ معالجة تسجيل الشاشة"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"إشعار مستمر لجلسة تسجيل شاشة"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"شاشة الاستراحة"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"عدم الإزعاج"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"الأوضاع"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"بلوتوث"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"لا يتوفر أي أجهزة مقترنة"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"انقر للاتصال بجهاز أو قطع الاتصال به"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"فتح الإعدادات"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"جهاز آخر"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"تبديل \"النظرة العامة\""</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"الأوضاع"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"تم"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"الإعدادات"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"مفعَّل"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"رمز التصغير"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"رمز التوسيع"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"أو"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"التنقّل باستخدام لوحة المفاتيح"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"تعرَّف على اختصارات لوحة المفاتيح"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"التنقّل باستخدام لوحة اللمس"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"تعرَّف على إيماءات لوحة اللمس"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"التنقّل باستخدام لوحة المفاتيح ولوحة اللمس"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"تعرَّف على إيماءات لوحة اللمس واختصارات لوحة المفاتيح والمزيد"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"إيماءة الرجوع"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"إيماءة الانتقال إلى الشاشة الرئيسية"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"مفتاح الإجراء"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"يمكنك الآن زيادة تعتيم الشاشة عن طريق خفض مستوى السطوع بشكل أكبر من أعلى الشاشة.\n\nيُعد هذا الخيار مناسبًا عندما تكون في مكان مظلم."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"إزالة اختصار \"زيادة تعتيم الشاشة\""</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"تمت إزالة اختصار \"زيادة تعتيم الشاشة\". لخفض مستوى سطوع شاشتك، استخدِم شريط مستوى السطوع العادي."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-as/strings.xml b/packages/SystemUI/res/values-as/strings.xml
index 2e8a552..06f28f1 100644
--- a/packages/SystemUI/res/values-as/strings.xml
+++ b/packages/SystemUI/res/values-as/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"টোকাত যোগ দিয়ক"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"লিংক অন্তৰ্ভুক্ত কৰক"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"অন্য প্ৰ’ফাইলৰ পৰা লিংক যোগ দিব নোৱাৰি"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"স্ক্ৰীন ৰেকৰ্ডাৰ"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"স্ক্রীন ৰেকৰ্ডিঙৰ প্ৰক্ৰিয়াকৰণ হৈ আছে"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"স্ক্রীন ৰেকৰ্ডিং ছেশ্বন চলি থকা সময়ত পোৱা জাননী"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"স্ক্ৰীন ছেভাৰ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ইথাৰনেট"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"অসুবিধা নিদিব"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"ম’ড"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ব্লুটুথ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"কোনো যোৰা লগোৱা ডিভাইচ উপলব্ধ নহয়।"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"ডিভাইচ সংযোগ কৰিবলৈ অথবা সংযোগ বিচ্ছিন্ন কৰিবলৈ টিপক"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ছেটিং খোলক"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"অন্য ডিভাইচ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"অৱলোকন ট’গল কৰক"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"ম’ড"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"কৰা হ’ল"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ছেটিং"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"অন আছে"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"সংকোচন কৰাৰ চিহ্ন"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"বিস্তাৰ কৰাৰ চিহ্ন"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"অথবা"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"কীব’ৰ্ড ব্যৱহাৰ কৰি নেভিগে’ট কৰক"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"কীব’ৰ্ডৰ শ্বৰ্টকাটসমূহৰ বিষয়ে জানক"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"আপোনাৰ টাচ্চপেড ব্যৱহাৰ কৰি নেভিগে’ট কৰক"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"টাচ্চপেডৰ নিৰ্দেশসমূহ জানক"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"আপোনাৰ কীব’ৰ্ড আৰু টাচ্চপেড ব্যৱহাৰ কৰি নেভিগে’ট কৰক"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"টাচ্চপেডৰ নিৰ্দেশ, কীব’ৰ্ডৰ শ্বৰ্টকাট আৰু অধিকৰ বিষয়ে জানক"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"উভতি যাওক নিৰ্দেশ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"গৃহ স্ক্ৰীনলৈ যোৱাৰ নিৰ্দেশ"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"কাৰ্য কী"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"আপুনি এতিয়া আপোনাৰ স্ক্ৰীনৰ একেবাৰে ওপৰৰ পৰা উজ্জ্বলতাৰ স্তৰ আৰু অধিক হ্ৰাস কৰি স্ক্ৰীনখন এক্সট্ৰা ডিম কৰিব পাৰে।\n\nআপুনি অন্ধকাৰ পৰিৱেশত থাকিলে এই সুবিধাটোৱে আটাইতকৈ ভাল কাম কৰে।"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"এক্সট্ৰা ডিম শ্বৰ্টকাট আঁতৰাওক"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"এক্সট্ৰা ডিম শ্বৰ্টকাট আঁতৰোৱা হৈছে। আপোনাৰ উজ্জ্বলতা হ্ৰাস কৰিবলৈ, নিয়মীয়া উজ্জ্বলতা বাৰ ব্যৱহাৰ কৰক।"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-az/strings.xml b/packages/SystemUI/res/values-az/strings.xml
index b011ca64..24ab6ae 100644
--- a/packages/SystemUI/res/values-az/strings.xml
+++ b/packages/SystemUI/res/values-az/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Qeydə əlavə edin"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Keçid daxil edin"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g><xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Ekran yazıcısı"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Ekran çəkilişi emal edilir"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ekranın video çəkimi ərzində silinməyən bildiriş"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Ekran qoruyucu"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Narahat etməyin"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Rejimlər"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Heç bir cütlənmiş cihaz əlçatan deyil"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Toxunaraq cihaza qoşulun, yaxud əlaqəni ayırın"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Ayarları açın"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Digər cihaz"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"İcmala Keçin"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Rejimlər"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Hazırdır"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Ayarlar"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Aktiv"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"İkonanı yığcamlaşdırın"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"İkonanı genişləndirin"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"və ya"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Klaviaturadan istifadə edərək hərəkət edin"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Klaviatura qısayolları haqqında öyrənin"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Taçpeddən istifadə edərək hərəkət edin"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Taçped jestlərini öyrənin"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Klaviatura və taçpeddən istifadə edərək hərəkət edin"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Taçped jestləri, klaviatura qısayolları və s. haqqında öyrənin"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Geri jesti"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Əsas ekran jesti"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Əməliyyat düyməsi"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"İndi ekranın yuxarısında parlaqlıq səviyyəsini daha da aşağı salaraq ekranı əlavə qaralda bilərsiniz.\n\nTünd mühitdə olduqda nəticə yaxşı olur."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Əlavə qaraltma qısayolunu silin"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Əlavə qaraltma qısayolu silindi. Parlaqlığı aşağı salmaq üçün adi parlaqlıq panelindən istifadə edin."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index c581fd5..5efa223 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Dodaj u belešku"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Uvrsti link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Ne možete da dodate linkove sa drugih profila"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Snimač ekrana"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Obrađujemo video snimka ekrana"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Obaveštenje o sesiji snimanja ekrana je aktivno"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Čuvar ekrana"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Eternet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ne uznemiravaj"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Režimi"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nije dostupan nijedan upareni uređaj"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Dodirnite da biste povezali uređaj ili prekinuli vezu"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Otvori Podešavanja"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Drugi uređaj"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Uključi/isključi pregled"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Režimi"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Gotovo"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Podešavanja"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Uključeno"</string>
@@ -488,7 +487,7 @@
<string name="cta_tile_button_to_dismiss" msgid="3377597875997861754">"Odbaci"</string>
<string name="cta_label_to_edit_widget" msgid="6496885074209203756">"Dodajte, uklonite i preuredite vidžete ovde"</string>
<string name="cta_label_to_open_widget_picker" msgid="3874946756976360699">"Dodajte još vidžeta"</string>
- <string name="popup_on_dismiss_cta_tile_text" msgid="8292501780996070019">"Dugi pritisak za prilagođavanje vidžeta"</string>
+ <string name="popup_on_dismiss_cta_tile_text" msgid="8292501780996070019">"Dugo pritisnite za prilagođavanje vidžeta"</string>
<string name="button_to_configure_widgets_text" msgid="4191862850185256901">"Prilagodi vidžete"</string>
<string name="unlock_reason_to_customize_widgets" msgid="5011909432460546033">"Otključajte da biste prilagodili vidžete"</string>
<string name="icon_description_for_disabled_widget" msgid="4693151565003206943">"Ikona aplikacije za onemogućen vidžet"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona za skupljanje"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona za proširivanje"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ili"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Krećite se pomoću tastature"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Saznajte više o tasterskim prečicama"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Krećite se pomoću tačpeda"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Naučite pokrete za tačped"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Krećite se pomoću tastature i tačpeda"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Naučite pokrete za tačped, tasterske prečice i drugo"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Pokret za vraćanje"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Pokret za početnu stranicu"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Taster radnji"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Sada možete dodatno da zatamnite ekran smanjivanjem nivoa osvetljenosti pri vrhu ekrana. \n\nOvo najbolje funkcioniše kada ste u tamnom okruženju."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Ukloni prečicu za dodatno zatamnjivanje"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Uklonjena je prečica za dodatno zatamnjivanje. Da biste smanjili osvetljenost, koristite uobičajenu traku za osvetljenost."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index 31854f6..435d833 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Дадаць у нататку"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Дадаць спасылку"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Спасылкі нельга дадаваць з іншых профіляў"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Запіс экрана"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Апрацоўваецца запіс экрана"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Бягучае апавяшчэнне для сеанса запісу экрана"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Экранная застаўка"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Не турбаваць"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Рэжымы"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Няма даступных спалучаных прылад"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Націсніце, каб падключыць або адключыць прыладу"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Адкрыць налады"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Іншая прылада"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Уключыць/выключыць агляд"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Рэжымы"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Гатова"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Налады"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Уключана"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Значок \"Згарнуць\""</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Значок \"Разгарнуць\""</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"або"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Навігацыя з дапамогай клавіятуры"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Азнаёмцеся са спалучэннямі клавіш"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Навігацыя з дапамогай сэнсарнай панэлі"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Азнаёмцеся з жэстамі для сэнсарнай панэлі"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Навігацыя з дапамогай клавіятуры і сэнсарнай панэлі"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Азнаёмцеся з жэстамі для сэнсарнай панэлі, спалучэннямі клавіш і г. д."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Жэст для вяртання на папярэдні экран"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Жэст для вяртання на галоўны экран"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Клавіша дзеяння"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Цяпер вы можаце дадаткова зацямніць экран, яшчэ больш панізіўшы ўзровень яркасці праз налады ўверсе экрана.\n\nГэта функцыя працуе лепш за ўсё ў цёмным асяроддзі."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Выдаліць хуткую каманду для дадатковага памяншэння яркасці"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Хуткая каманда для дадатковага памяншэння яркасці выдалена. Каб паменшыць яркасць, выкарыстоўвайце звычайную панэль яркасці."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 64ecfd3..adbc13a 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Добавяне към бележката"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Включване на връзката"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Запис на екрана"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Записът на екрана се обработва"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Текущо известие за сесия за записване на екрана"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Скрийнсейвър"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Не безпокойте"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Режими"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Няма налични сдвоени устройства"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Докоснете, за да свържете устройство или да прекъснете връзката му"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Към настройките"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Друго устройство"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Превключване на общия преглед"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Режими"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Готово"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Настройки"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Вкл."</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Икона за свиване"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Икона за разгъване"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"или"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Навигирайте посредством клавиатурата си"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Научете за клавишните комбинации"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Навигирайте посредством сензорния панел"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Научете за жестовете със сензорния панел"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Навигирайте посредством клавиатурата и сензорния панел"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Научете за жестовете със сензорния панел, клавишните комбинации и др."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Жест за връщане назад"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Жест за преминаване към началния екран"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Клавиш за действия"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Вече можете да затъмнявате екрана допълнително, като намалявате яркостта още повече от лентата в горната му част.\n\nТова е най-полезно, когато сте на тъмно място."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Премахване на прекия път за допълнително затъмняване"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Прекият път за допълнително затъмняване е премахнат. За да намалите яркостта, използвайте обикновената лента за управлението ѝ."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index f62ee9e..2aa7786 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"নোটে যোগ করুন"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"লিঙ্ক যোগ করুন"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"স্ক্রিন রেকর্ডার"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"স্ক্রিন রেকর্ডিং প্রসেস হচ্ছে"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"স্ক্রিন রেকর্ডিং সেশন চলার বিজ্ঞপ্তি"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"স্ক্রিন সেভার"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ইথারনেট"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"বিরক্ত করবে না"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"মোড"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ব্লুটুথ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"চেনা কোনও ডিভাইস নেই"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"কোনও ডিভাইস কানেক্ট বা ডিসকানেক্ট করতে ট্যাপ করুন"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"সেটিংস খুলুন"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"অন্য ডিভাইস"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"\'এক নজরে\' বৈশিষ্ট্যটি চালু বা বন্ধ করুন"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"মোড"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"হয়ে গেছে"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"সেটিংস"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"চালু আছে"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"আইকন আড়াল করুন"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"আইকন বড় করুন"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"অথবা"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"আপনার কীবোর্ড ব্যবহার করে নেভিগেট করুন"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"কীবোর্ড শর্টকাট সম্পর্কে জানুন"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"আপনার টাচপ্যাড ব্যবহার করে নেভিগেট করুন"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"টাচপ্যাডের জেসচার সম্পর্কে জানুন"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"আপনার কীবোর্ড এবং টাচপ্যাড ব্যবহার করে নেভিগেট করুন"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"টাচপ্যাড জেসচার, কীবোর্ড শর্টকাট এবং আরও অনেক কিছু সম্পর্কে জানুন"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ফিরে যাওয়ার জেসচার"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"হোমপেজে যাওয়ার জেসচার"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"অ্যাকশন কী"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"আপনি এখন স্ক্রিনের উপর থেকে ব্রাইটনেস লেভেল কমিয়েও, স্ক্রিন অতিরিক্ত কম ব্রাইট করতে পারবেন।\n\nআপনি অন্ধকার পরিবেশে থাকলে এটি সবথেকে ভালো কাজ করে।"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"\'অতিরিক্ত কম ব্রাইটনেস\' ফিচারের শর্টকাট সরান"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"\'অতিরিক্ত কম ব্রাইটনেস\' ফিচারের শর্টকাট সরানো হয়েছে। আপনার ব্রাইটনেস কম করতে, সাধারণ ব্রাইটনেস বার ব্যবহার করুন।"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-bs/strings.xml b/packages/SystemUI/res/values-bs/strings.xml
index 51416ef..4802af8 100644
--- a/packages/SystemUI/res/values-bs/strings.xml
+++ b/packages/SystemUI/res/values-bs/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Dodaj u bilješku"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Uključi link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Snimač ekrana"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Obrađivanje snimka ekrana"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Obavještenje za sesiju snimanja ekrana je u toku"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Čuvar ekrana"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ne ometaj"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Načini rada"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nema dostupnih uparenih uređaja"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Dodirnite da povežete ili prekinete povezanost uređaja"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Otvori Postavke"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Drugi uređaj"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Pregled uključivanja/isključivanja"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Načini rada"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Gotovo"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Postavke"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Uključeno"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona sužavanja"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona proširivanja"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ili"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Krećite se pomoću tastature"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Saznajte više o prečicama tastature"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Krećite se pomoću dodirne podloge"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Saznajte više o pokretima na dodirnoj podlozi"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Krećite se pomoću tastature i dodirne podloge"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Saznajte više o pokretima na dodirnoj podlozi, prečicama tastature i drugim opcijama"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Pokret za povratak"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Pokret za povratak na početni ekran"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tipka radnji"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Sada možete dodatno zatamniti ekran daljnjim smanjenjem nivoa osvijetljenosti s vrha ekrana.\n\nOvo najbolje funkcionira u tamnom okruženju."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Ukloni prečicu za dodatno zatamnjenje"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Prečica za dodatno zatamnjenje je uklonjena. Da smanjite osvijetljenost, koristite običnu traku za osvijetljenost."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 182fe02..10fedd8 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Afegeix a una nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Inclou l\'enllaç"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Gravació de pantalla"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processant gravació de pantalla"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificació en curs d\'una sessió de gravació de la pantalla"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Estalvi de pantalla"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"No molestis"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modes"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"No hi ha dispositius vinculats disponibles"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Toca per connectar o desconnectar un dispositiu"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Obre Configuració"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Un altre dispositiu"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Activa o desactiva Aplicacions recents"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modes"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Fet"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Configuració"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Activat"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Replega la icona"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Desplega la icona"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"o"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navega amb el teclat"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Aprèn les tecles de drecera"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navega amb el ratolí tàctil"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Aprèn els gestos del ratolí tàctil"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navega amb el teclat i el ratolí tàctil"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Aprèn els gestos del ratolí tàctil, les tecles de drecera i més"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gest Enrere"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gest Inici"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tecla d\'acció"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Ara pots atenuar encara més la pantalla abaixant-ne el nivell de brillantor des de la part superior.\n\nFunciona millor si et trobes en un lloc fosc."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Suprimeix la drecera d\'atenuació extra"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"S\'ha suprimit la drecera d\'atenuació extra. Per abaixar la brillantor, utilitza la barra de brillantor normal."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index cebb175..f995b29 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Přidat do poznámky"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Zahrnout odkaz"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Nelze přidat odkazy z jiných profilů"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Nahrávání obrazovky"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Záznam obrazovky se zpracovává"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Trvalé oznámení o relaci nahrávání"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Spořič obrazovky"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Nerušit"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Režimy"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nejsou dostupná žádná spárovaná zařízení"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Klepnutím zařízení připojíte nebo odpojíte"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Otevřít nastavení"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Další zařízení"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Přepnout přehled"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Režimy"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Hotovo"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Nastavení"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Zapnuto"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona sbalení"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona rozbalení"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"nebo"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigujte pomocí klávesnice"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Naučte se klávesové zkratky"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigujte pomocí touchpadu"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Naučte se gesta touchpadu"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigujte pomocí klávesnice a touchpadu"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Naučte se gesta touchpadu, klávesové zkratky a další"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gesto zpět"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gesto domů"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Akční klávesa"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Obrazovku můžete v horní části nastavit jako velmi tmavou tím, že ještě víc snížíte jas.\n\nNejlépe to funguje ve tmavém prostředí."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Odstranit zkratku pro velmi tmavou obrazovku"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Zkratka pro velmi tmavou obrazovku byla odstraněna. Jas můžete snížit pomocí standardního sloupce jasu."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 974083e..3b74a6d 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Føj til note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Inkluder link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Skærmoptagelse"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Behandler skærmoptagelse"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Konstant notifikation om skærmoptagelse"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Pauseskærm"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Forstyr ikke"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Tilstande"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Der er ingen tilgængelige parrede enheder"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tryk for at oprette eller afbryde forbindelse til en enhed"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Åbn Indstillinger"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Anden enhed"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Slå Oversigt til/fra"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Tilstande"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Udfør"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Indstillinger"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Til"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikon for Skjul"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikon for Udvid"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"eller"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Naviger ved hjælp af dit tastatur"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Se tastaturgenveje"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Naviger ved hjælp af din touchplade"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Se bevægelser på touchpladen"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Naviger ved hjælp af dit tastatur og din touchplade"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Se bevægelser på touchpladen, tastaturgenveje m.m."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Bevægelse for at gå tilbage"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Bevægelse for at gå til startskærm"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Handlingstast"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Du kan nu dæmpe skærmens belysning ekstra meget ved at reducere lysstyrken endnu mere fra toppen af skærmen.\n\nDette fungerer bedst i mørke omgivelser."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Fjern genvejen til ekstra dæmpet belysning"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Genvejen til ekstra dæmpet belysning er fjernet. Brug den almindelige lysstyrkebjælke til at reducere lysstyrken."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 11dd46e..fa7ad56 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Zu Notiz hinzufügen"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Link einschließen"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Bildschirmaufzeichnung"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Bildschirmaufzeichnung…"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Fortlaufende Benachrichtigung für eine Bildschirmaufzeichnung"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Bildschirmschoner"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Bitte nicht stören"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modi"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Keine gekoppelten Geräte verfügbar"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Zum Verbinden oder Trennen eines Geräts tippen"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Einstellungen öffnen"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Sonstiges Gerät"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Übersicht ein-/ausblenden"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modi"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Fertig"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Einstellungen"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"An"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Symbol „Minimieren“"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Symbol „Maximieren“"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"oder"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigation mit der Tastatur"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Informationen zu Tastenkombinationen"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigation mit dem Touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Informationen zu Touchpad-Gesten"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigation mit Tastatur und Touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Informationen zu Touchpad-Gesten, Tastenkombinationen und mehr"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Touch-Geste „Zurück“"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Touch-Geste „Startbildschirm“"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Aktionstaste"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Du kannst das Display jetzt extradunkel machen, indem du die Helligkeit vom oberen Displayrand aus noch weiter senkst.\n\nDas funktioniert in dunklen Umgebungen am besten."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Verknüpfung für „Extradunkel“ entfernen"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Verknüpfung für „Extradunkel“ wurde entfernt. Wenn du die Helligkeit reduzieren möchtest, verwende einfach die normale Helligkeitsleiste."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 433137c..26f1c56 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Προσθήκη σε σημείωση"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Συμπερίληψη συνδέσμου"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Εγγραφή οθόνης"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Επεξεργασία εγγραφής οθόνης"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ειδοποίηση σε εξέλιξη για μια περίοδο λειτουργίας εγγραφής οθόνης"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Προφύλαξη οθόνης"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Μην ενοχλείτε"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Λειτουργίες"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Δεν υπάρχουν διαθέσιμες συσκευές σε σύζευξη"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Πατήστε για σύνδεση ή αποσύνδεση μιας συσκευής"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Άνοιγμα Ρυθμίσεων"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Άλλη συσκευή"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Εναλλαγή επισκόπησης"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Λειτουργίες"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Τέλος"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Ρυθμίσεις"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Ενεργό"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Εικονίδιο σύμπτυξης"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Εικονίδιο ανάπτυξης"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ή"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Πλοήγηση με το πληκτρολόγιο"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Μάθετε συντομεύσεις πληκτρολογίου"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Πλοήγηση με την επιφάνεια αφής"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Μάθετε κινήσεις επιφάνειας αφής"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Πλοήγηση με το πληκτρολόγιο και την επιφάνεια αφής"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Μάθετε κινήσεις επιφάνειας αφής, συντομεύσεις πληκτρολογίου και άλλα"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Κίνηση επιστροφής"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Κίνηση μετάβασης στην αρχική οθόνη"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Πλήκτρο ενέργειας"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Τώρα μπορείτε να μειώσετε επιπλέον τη φωτεινότητα της οθόνης, χαμηλώνοντας το επίπεδο φωτεινότητας ακόμα περισσότερο από το επάνω μέρος της οθόνης.\n\nΑυτό λειτουργεί καλύτερα όταν βρίσκεστε σε σκοτεινό περιβάλλον."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Κατάργηση συντόμευσης επιπλέον μείωσης φωτεινότητας"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Η συντόμευση της επιπλέον μείωσης φωτεινότητας καταργήθηκε. Για να χαμηλώσετε τη φωτεινότητα, χρησιμοποιήστε την κανονική γραμμή φωτεινότητας."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-en-rAU/strings.xml b/packages/SystemUI/res/values-en-rAU/strings.xml
index cb9dfe5..24922ac 100644
--- a/packages/SystemUI/res/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Add to note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Include link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Screen recorder"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processing screen recording"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ongoing notification for a screen record session"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Screen saver"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Do Not Disturb"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modes"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"No paired devices available"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tap to connect or disconnect a device"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Open settings"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Other device"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modes"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Done"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Settings"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"On"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Collapse icon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Expand icon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"or"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigate using your keyboard"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Learn keyboards shortcuts"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigate using your touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Learn touchpad gestures"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigate using your keyboard and touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Learn touchpad gestures, keyboards shortcuts and more"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Back gesture"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Home gesture"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Action key"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"You can now make the screen extra dim by lowering the brightness level even further from the top of your screen.\n\nThis works best when you\'re in a dark environment."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remove extra dim shortcut"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Extra dim shortcut removed. To lower your brightness, use the regular brightness bar."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index 3d4c31f..88f1753 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Add to note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Include link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Links can\'t be added from other profiles"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Screen Recorder"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processing screen recording"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ongoing notification for a screen record session"</string>
@@ -1436,4 +1437,11 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"You can now make the screen extra dim by lowering the brightness level even further from the top of your screen.\n\nThis works best when you\'re in a dark environment."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remove extra dim shortcut"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Extra dim shortcut removed. To lower your brightness, use the regular brightness bar."</string>
+ <string name="qs_edit_mode_category_connectivity" msgid="4559726936546032672">"Connectivity"</string>
+ <string name="qs_edit_mode_category_accessibility" msgid="7969091385071475922">"Accessibility"</string>
+ <string name="qs_edit_mode_category_utilities" msgid="8123080090108420095">"Utilities"</string>
+ <string name="qs_edit_mode_category_privacy" msgid="6577774443194551775">"Privacy"</string>
+ <string name="qs_edit_mode_category_providedByApps" msgid="8346112074897919019">"Provided by apps"</string>
+ <string name="qs_edit_mode_category_display" msgid="4749511439121053942">"Display"</string>
+ <string name="qs_edit_mode_category_unknown" msgid="509314252124053550">"Unknown"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index cb9dfe5..24922ac 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Add to note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Include link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Screen recorder"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processing screen recording"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ongoing notification for a screen record session"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Screen saver"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Do Not Disturb"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modes"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"No paired devices available"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tap to connect or disconnect a device"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Open settings"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Other device"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modes"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Done"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Settings"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"On"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Collapse icon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Expand icon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"or"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigate using your keyboard"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Learn keyboards shortcuts"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigate using your touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Learn touchpad gestures"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigate using your keyboard and touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Learn touchpad gestures, keyboards shortcuts and more"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Back gesture"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Home gesture"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Action key"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"You can now make the screen extra dim by lowering the brightness level even further from the top of your screen.\n\nThis works best when you\'re in a dark environment."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remove extra dim shortcut"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Extra dim shortcut removed. To lower your brightness, use the regular brightness bar."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index cb9dfe5..24922ac 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Add to note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Include link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Screen recorder"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processing screen recording"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ongoing notification for a screen record session"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Screen saver"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Do Not Disturb"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modes"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"No paired devices available"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tap to connect or disconnect a device"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Open settings"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Other device"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modes"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Done"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Settings"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"On"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Collapse icon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Expand icon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"or"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigate using your keyboard"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Learn keyboards shortcuts"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigate using your touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Learn touchpad gestures"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigate using your keyboard and touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Learn touchpad gestures, keyboards shortcuts and more"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Back gesture"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Home gesture"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Action key"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"You can now make the screen extra dim by lowering the brightness level even further from the top of your screen.\n\nThis works best when you\'re in a dark environment."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remove extra dim shortcut"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Extra dim shortcut removed. To lower your brightness, use the regular brightness bar."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index eb94d59..e8b3206 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Add to note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Include link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Links can\'t be added from other profiles"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Screen Recorder"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processing screen recording"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ongoing notification for a screen record session"</string>
@@ -1436,4 +1437,11 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"You can now make the screen extra dim by lowering the brightness level even further from the top of your screen.\n\nThis works best when you\'re in a dark environment."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remove extra dim shortcut"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Extra dim shortcut removed. To lower your brightness, use the regular brightness bar."</string>
+ <string name="qs_edit_mode_category_connectivity" msgid="4559726936546032672">"Connectivity"</string>
+ <string name="qs_edit_mode_category_accessibility" msgid="7969091385071475922">"Accessibility"</string>
+ <string name="qs_edit_mode_category_utilities" msgid="8123080090108420095">"Utilities"</string>
+ <string name="qs_edit_mode_category_privacy" msgid="6577774443194551775">"Privacy"</string>
+ <string name="qs_edit_mode_category_providedByApps" msgid="8346112074897919019">"Provided by apps"</string>
+ <string name="qs_edit_mode_category_display" msgid="4749511439121053942">"Display"</string>
+ <string name="qs_edit_mode_category_unknown" msgid="509314252124053550">"Unknown"</string>
</resources>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 2af8bd1..42c3510 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Agregar a la nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Incluir vínculo"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Grabadora de pantalla"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Procesando grabación pantalla"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificación constante para una sesión de grabación de pantalla"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Protector pantalla"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"No interrumpir"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modos"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"No hay dispositivos sincronizados disponibles"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Presiona para conectar o desconectar un dispositivo"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Abrir Configuración"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Otro dispositivo"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Ocultar o mostrar Recientes"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modos"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Listo"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Configuración"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Activado"</string>
@@ -1444,4 +1444,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Ahora puedes bajar el nivel del brillo desde la parte superior de la pantalla para atenuarla aún más.\n\nEsto funciona mejor si estás en un ambiente oscuro."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Quitar la combinación de teclas de atenuación extra"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Se quitó el atajo de atenuación extra. Para bajar el brillo, usa la barra de brillo normal."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 2e823ed..6595258 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Añadir a nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Incluir enlace"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"No se pueden añadir enlaces de otros perfiles"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Grabación de pantalla"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Procesando grabación de pantalla"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificación continua de una sesión de grabación de la pantalla"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Salvapantallas"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"No molestar"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modos"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"No hay dispositivos vinculados disponibles"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Toca para conectar o desconectar un dispositivo"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Abrir Ajustes"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Otro dispositivo"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Mostrar u ocultar aplicaciones recientes"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modos"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Hecho"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Ajustes"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Activado"</string>
@@ -1444,4 +1443,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Ahora puedes atenuar aún más tu pantalla reduciendo el nivel de brillo desde la parte superior.\n\nFunciona mejor cuando estás en un lugar con poca luz."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Eliminar acceso directo a la atenuación extra"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Acceso directo a la atenuación extra eliminado. Para reducir el brillo, usa la barra de brillo normal."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 09f461f..7042ac1 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Lisa märkmesse"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Kaasa link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Ekraanisalvesti"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Ekraanisalvestuse töötlemine"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Pooleli märguanne ekraanikuva salvestamise seansi puhul"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Ekraanisäästja"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Mitte segada"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Režiimid"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Ühtegi seotud seadet pole saadaval"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Puudutage seadme ühendamiseks või ühenduse katkestamiseks"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Ava menüü Seaded"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Muu seade"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Lehe Ülevaade sisse- ja väljalülitamine"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Režiimid"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Valmis"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Seaded"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Sees"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ahendamisikoon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Laiendamisikoon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"või"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigeerige klaviatuuri abil"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Õppige klaviatuuri otseteid"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigeerige puuteplaadi abil"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Õppige puuteplaadi liigutusi"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigeerige klaviatuuri ja puuteplaadi abil"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Õppige puuteplaadi liigutusi, klaviatuuri otseteid ja palju muud"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Tagasiliikumisliigutus"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Avakuvale liikumise liigutus"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Toiminguklahv"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Nüüd saate muuta ekraani eriti tumedaks, vähendades ereduse taset ekraani ülaosast veelgi rohkem.\n\nSee toimib kõige paremini hämaras keskkonnas."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Eemalda funktsiooni „Eriti tume“ otsetee"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Funktsiooni „Eriti tume“ otsetee eemaldati. Kasutage ereduse vähendamiseks tavapärast ereduse reguleerimise riba."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-eu/strings.xml b/packages/SystemUI/res/values-eu/strings.xml
index 329b6e2..e51e3753 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Gehitu oharrean"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Sartu esteka"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Pantaila-grabagailua"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Pantaila-grabaketa prozesatzen"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Pantailaren grabaketa-saioaren jakinarazpen jarraitua"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Pantaila-babeslea"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ez molestatzeko modua"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Moduak"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetootha"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Ez dago parekatutako gailurik erabilgarri"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Sakatu hau gailu bat konektatu edo deskonektatzeko"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Ireki Ezarpenak"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Beste gailu bat"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Aldatu ikuspegi orokorra"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Moduak"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Eginda"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Ezarpenak"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Aktibatuta"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Tolesteko ikonoa"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Zabaltzeko ikonoa"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"edo"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Nabigatu teklatua erabilita"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Ikasi lasterbideak"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Nabigatu ukipen-panela erabilita"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Ikasi ukipen-paneleko keinuak"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Nabigatu teklatua eta ukipen-panela erabilita"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Ikasi ukipen-paneleko keinuak, lasterbideak eta abar"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Atzera egiteko keinua"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Orri nagusira joateko keinua"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Ekintza-tekla"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Orain, pantaila are ilunago jar dezakezu, pantailaren goialdetik argitasun-maila are gehiago jaitsita.\n\nIngurune ilun batean zaudenean funtzionatzen du ondoen."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Kendu Are ilunago eginbidearen lasterbidea"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Kendu da Are ilunago eginbidearen lasterbidea. Argitasuna murrizteko, erabili argitasun-barra arrunta."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index f845027..13d403b 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"افزودن به یادداشت"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"اضافه کردن پیوند"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"نمیتوان از نمایههای دیگر پیوند اضافه کرد"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"ضبطکن صفحهنمایش"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"درحال پردازش ضبط صفحهنمایش"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"اعلان درحال انجام برای جلسه ضبط صفحهنمایش"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"محافظ صفحه"</string>
<string name="ethernet_label" msgid="2203544727007463351">"اترنت"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"مزاحم نشوید"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"حالتها"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"بلوتوث"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"هیچ دستگاه مرتبط شدهای موجود نیست"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"برای اتصال یا قطع اتصال دستگاه، تکضرب بزنید"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"باز کردن تنظیمات"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"دستگاه دیگر"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"تغییر وضعیت نمای کلی"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"حالتها"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"تمام"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"تنظیمات"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"روشن"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"نماد جمع کردن"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"نماد ازهم بازکردن"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"یا"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"پیمایش کردن بااستفاده از صفحهکلید"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"آشنایی با میانبرهای صفحهکلید"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"پیمایش کردن بااستفاده از صفحه لمسی"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"آشنایی با اشارههای صفحه لمسی"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"پیمایش کردن بااستفاده از صفحهکلید و صفحه لمسی"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"آشنایی با اشارههای صفحه لمسی، میانبرهای صفحهکلید، و موارد دیگر"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"اشاره برگشت"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"اشاره صفحه اصلی"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"دکمه کنش"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ازاینپس میتوانید با پایینتر آوردن سطح روشنایی از بالای صفحهنمایش، صفحهنمایش را بسیار کمنور کنید.\n\nاین ویژگی زمانی بهترین عملکرد را دارد که در محیطی تاریک باشید."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"حذف میانبر «بسیار کمنور»"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"میانبر «بسیار کمنور» حذف شد. برای کم کردن روشنایی، از نوار معمول روشنایی استفاده کنید."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index b9afcd5..ab31329 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Lisää muistiinpanoon"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Lisää linkki"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Näytön tallentaja"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Näytön tallennusta käsitellään"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Pysyvä ilmoitus näytön tallentamisesta"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Näytönsäästäjä"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Älä häiritse"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Tilat"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Laitepareja ei ole käytettävissä"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Muodosta yhteys laitteeseen tai katkaise yhteys napauttamalla"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Avaa Asetukset"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Muu laite"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Näytä/piilota viimeisimmät"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Tilat"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Valmis"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Asetukset"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Päällä"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Tiivistyskuvake"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Laajennuskuvake"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"tai"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Siirry käyttämällä näppäimistöä"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Opettele pikanäppäimiä"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Siirry käyttämällä kosketuslevyä"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Opettele kosketuslevyn eleitä"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Siirry käyttämällä näppäimistöä ja kosketuslevyä"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Opettele kosketuslevyn eleitä, pikanäppäimiä ja muuta"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Takaisin-ele"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Etusivu-ele"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Toimintonäppäin"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Voit nyt tehdä näytöstä erittäin himmeän vähentämällä kirkkautta vieläkin enemmän näytön yläreunasta.\n\nTämä toimii parhaiten pimeässä ympäristössä."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Poista erittäin himmeä ‑pikakomento"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Erittäin himmeä ‑pikakomento poistettu. Voit vähentää kirkkautta tavallisesta kirkkauspalkista."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 07e131e..ecb17f9 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Ajouter à une note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Inclure le lien"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Enregistreur d\'écran"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Trait. de l\'enregist. d\'écran…"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notification en cours pour une session d\'enregistrement d\'écran"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Écran de veille"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ne pas déranger"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modes"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Aucun des appareils associés n\'est disponible"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Touchez pour connecter ou déconnecter un appareil"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Ouvrir les paramètres"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Autre appareil"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Basculer l\'aperçu"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modes"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"OK"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Paramètres"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Activé"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Icône Réduire"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Icône Développer"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ou"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Naviguer à l\'aide de votre clavier"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Apprenez à utiliser les raccourcis-clavier"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Naviguer à l\'aide de votre pavé tactile"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Apprenez à utiliser les gestes du pavé tactile"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Naviguer à l\'aide de votre clavier et de votre pavé tactile"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Apprenez les gestes du pavé tactile, les raccourcis-clavier et bien plus encore"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Geste de retour"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Geste d\'accès à l\'écran d\'accueil"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Touche d\'action"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Vous pouvez désormais rendre l\'écran encore plus sombre en réduisant davantage le niveau de luminosité à partir du haut de l\'écran.\n\nCela fonctionne mieux lorsque vous êtes dans un environnement sombre."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Retirer le raccourci de réduction supplémentaire de la luminosité"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Le raccourci de réduction supplémentaire de la luminosité à été retiré. Pour réduire la luminosité, utilisez la barre de luminosité habituelle."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 9d3bbd7..c023f1b 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Ajouter à la note"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Inclure le lien"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Enregistreur d\'écran"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Enregistrement de l\'écran…"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notification en cours pour une session d\'enregistrement de l\'écran"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Économiseur d\'écran"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ne pas déranger"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modes"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Aucun appareil associé disponible."</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Appuyez pour connecter ou déconnecter un appareil"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Ouvrir les paramètres"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Autre appareil"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Activer/Désactiver l\'écran Récents"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modes"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"OK"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Paramètres"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Activé"</string>
@@ -498,7 +498,7 @@
<string name="hub_mode_add_widget_button_text" msgid="4831464661209971729">"Ajouter un widget"</string>
<string name="hub_mode_editing_exit_button_text" msgid="3704686734192264771">"OK"</string>
<string name="label_for_button_in_empty_state_cta" msgid="7314975555382055823">"Ajouter des widgets"</string>
- <string name="title_for_empty_state_cta" msgid="6161654421223450530">"Accéder rapidement aux widgets de vos applis préférées sans déverrouiller votre tablette."</string>
+ <string name="title_for_empty_state_cta" msgid="6161654421223450530">"Accédez rapidement aux widgets de vos applis préférées sans déverrouiller votre tablette."</string>
<string name="dialog_title_to_allow_any_widget" msgid="1004820948962675644">"Autoriser n\'importe quel widget sur l\'écran de verrouillage ?"</string>
<string name="button_text_to_open_settings" msgid="1987729256950941628">"Ouvrir les paramètres"</string>
<string name="work_mode_off_title" msgid="5794818421357835873">"Réactiver les applis pro ?"</string>
@@ -1444,4 +1444,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Désormais, vous pouvez rendre l\'écran encore plus sombre en abaissant davantage le niveau de luminosité en haut de l\'écran.\n\nCela fonctionne mieux lorsque vous êtes dans un environnement sombre."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Supprimer le raccourci Luminosité ultra-réduite"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Raccourci Luminosité ultra-réduite supprimé. Pour diminuer la luminosité, utilisez la barre de luminosité habituelle."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-gl/strings.xml b/packages/SystemUI/res/values-gl/strings.xml
index 6281570..b525bb8 100644
--- a/packages/SystemUI/res/values-gl/strings.xml
+++ b/packages/SystemUI/res/values-gl/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Engadir a unha nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Incluír ligazón"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Gravadora da pantalla"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Procesando gravación pantalla"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificación de actividade en curso sobre unha sesión de gravación de pantalla"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Protector pantalla"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Non molestar"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modos"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Non hai dispositivos vinculados dispoñibles"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Toca para conectar ou desconectar un dispositivo"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Abrir Configuración"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Outro dispositivo"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Activar/desactivar Visión xeral"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modos"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Feito"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Configuración"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Activado"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Icona de contraer"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Icona de despregar"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ou"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navega co teclado"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Aprende a usar os atallos de teclado"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navega co panel táctil"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Aprende a usar os xestos do panel táctil"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navega co teclado e o panel táctil"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Aprende a usar os xestos do panel táctil, atallos de teclado e moito máis"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Xesto para volver"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Xesto para ir ao inicio"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tecla de acción"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Agora podes aumentar a atenuación da pantalla: só tes que baixar o nivel de brillo aínda máis desde a parte superior.\n\nEsta opción funciona mellor se estás nun ambiente escuro."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Quitar atallo de atenuación extra"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Quitouse o atallo de atenuación extra. Para reducir o brillo, usa a barra de brillo normal."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index 2be88f2..9afbf8e 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"નોંધમાં ઉમેરો"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"લિંક શામેલ કરો"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"અન્ય પ્રોફાઇલમાંથી લિંક ઉમેરી શકાતી નથી"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"સ્ક્રીન રેકોર્ડર"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"સ્ક્રીન રેકૉર્ડિંગ ચાલુ છે"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"સ્ક્રીન રેકોર્ડિંગ સત્ર માટે ચાલુ નોટિફિકેશન"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"સ્ક્રીન સેવર"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ઇથરનેટ"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ખલેલ પાડશો નહીં"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"મોડ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"બ્લૂટૂથ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"કોઈ જોડી કરેલ ઉપકરણો ઉપલબ્ધ નથી"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"કોઈ ડિવાઇસ કનેક્ટ કરવા કે ડિસ્કનેક્ટ કરવા માટે ટૅપ કરો"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"સેટિંગ ખોલો"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"અન્ય ડિવાઇસ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ઝલકને ટૉગલ કરો"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"મોડ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"થઈ ગયું"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"સેટિંગ"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ચાલુ"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"\'નાનું કરો\'નું આઇકન"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"\'મોટું કરો\'નું આઇકન"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"અથવા"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"તમારા કીબોર્ડ વડે નૅવિગેટ કરો"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"કીબોર્ડ શૉર્ટકર્ટ જાણો"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"તમારા ટચપૅડ વડે નૅવિગેટ કરો"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ટચપૅડના સંકેતો વિશે જાણો"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"તમારા કીબોર્ડ અને ટચપૅડ વડે નૅવિગેટ કરો"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ટચપૅડના સંકેતો અને કીબોર્ડના શૉર્ટકટ જેવું બીજું ઘણું જાણો"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"પાછળ જવાનો સંકેત"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"હોમ સ્ક્રીન પર જવાનો સંકેત"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ઍક્શન કી"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"તમે હવે તમારી સ્ક્રીનના સૌથી ઉપરના ભાગમાંથી બ્રાઇટનેસ લેવલને હજી પણ ઘટાડીને સ્ક્રીનને એક્સ્ટ્રા ડિમ બનાવી શકો છો.\n\nતમે ડાર્ક વાતાવરણમાં હો, ત્યારે આ શ્રેષ્ઠ રીતે કામ કરે છે."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"એક્સ્ટ્રા ડિમ શૉર્ટકટ કાઢી નાખો"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"એક્સ્ટ્રા ડિમ શૉર્ટકટ કાઢી નાખ્યો. તમારી બ્રાઇટનેસ ઘટાડવા માટે, નિયમિત બ્રાઇટનેસ બારનો ઉપયોગ કરો."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 7c267bf..2b28b7a 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"नोट में जोड़ें"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"लिंक जोड़ें"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"अन्य प्रोफ़ाइलों से लिंक नहीं जोड़े जा सकते"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"स्क्रीन रिकॉर्डर"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"स्क्रीन रिकॉर्डिंग को प्रोसेस किया जा रहा है"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"स्क्रीन रिकॉर्ड सेशन के लिए जारी सूचना"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"स्क्रीन सेवर"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ईथरनेट"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"परेशान न करें"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"मोड"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ब्लूटूथ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"कोई भी युग्मित डिवाइस उपलब्ध नहीं"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"किसी डिवाइस को कनेक्ट या डिसकनेक्ट करने के लिए टैप करें"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"सेटिंग खोलें"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"अन्य डिवाइस"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"खास जानकारी टॉगल करें"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"मोड"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"हो गया"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"सेटिंग"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"चालू है"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"छोटा करने का आइकॉन"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"बड़ा करने का आइकॉन"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"या"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"कीबोर्ड का इस्तेमाल करके नेविगेट करें"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"कीबोर्ड शॉर्टकट के बारे में जानें"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"टचपैड का इस्तेमाल करके नेविगेट करें"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"टचपैड पर हाथ के जेस्चर के बारे में जानें"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"कीबोर्ड और टचपैड का इस्तेमाल करके नेविगेट करें"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"टचपैड पर हाथ के जेस्चर, कीबोर्ड शॉर्टकट वगैरह के बारे में जानें"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"पीछे जाने का जेस्चर"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"होम स्क्रीन पर जाने का जेस्चर"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ऐक्शन बटन"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"अब स्क्रीन के सबसे ऊपरी हिस्से से, स्क्रीन की रोशनी सामान्य लेवल से और कम की जा सकती है.\n\nयह सुविधा, अंधेरे वाली जगह पर बेहतर तरीके से काम करती है."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"स्क्रीन की रोशनी को सामान्य लेवल से और कम करने की सुविधा का शॉर्टकट हटाएं"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"स्क्रीन की रोशनी को सामान्य लेवल से और कम करने की सुविधा का शॉर्टकट हटा दिया गया. स्क्रीन की रोशनी कम करने के लिए, ब्राइटनेस बार का इस्तेमाल करें."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index bdf6e13..34bccbd 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Dodaj bilješci"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Uključi vezu"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Snimač zaslona"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Obrada snimanja zaslona"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Tekuća obavijest za sesiju snimanja zaslona"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Čuvar zaslona"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ne uznemiravaj"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Načini"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Upareni uređaji nisu dostupni"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Dodirnite da biste povezali uređaj ili prekinuli vezu s njim"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Otvori postavke"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Ostali uređaji"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Uključivanje/isključivanje pregleda"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Načini"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Gotovo"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Postavke"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Uključeno"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona za sažimanje"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona za proširivanje"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ili"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Krećite se pomoću tipkovnice"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Saznajte više o tipkovnim prečacima"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Krećite se pomoću dodirne podloge"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Saznajte više o pokretima za dodirnu podlogu"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Krećite se pomoću tipkovnice i dodirne podloge"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Saznajte više o pokretima za dodirnu podlogu, tipkovnim prečacima i ostalom"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Pokret za povratak"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Pokret za otvaranje početnog zaslona"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tipka za radnju"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Zaslon možete dodatno zatamniti daljnjim smanjivanjem razine svjetline na vrhu zaslona.\n\nTo najbolje funkcionira kada ste u tamnom okruženju."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Ukloni prečac za dodatno zatamnjenje"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Prečac za dodatno zatamnjenje je uklonjen. Da biste smanjili svjetlinu, upotrijebite regularnu traku za svjetlinu."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 773d9ba..cc2f66e 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Hozzáadás jegyzethez"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Linkkel együtt"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Képernyőrögzítő"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Képernyőrögzítés feldolgozása"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Folyamatban lévő értesítés képernyőrögzítési munkamenethez"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Képernyővédő"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ne zavarjanak"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Módok"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nem áll rendelkezésre párosított eszköz"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Koppintson egy eszköz csatlakoztatásához vagy leválasztásához"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Beállítások megnyitása"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Más eszköz"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Áttekintés be- és kikapcsolása"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Módok"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Kész"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Beállítások"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Be"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Összecsukás ikon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Kibontás ikon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"vagy"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigáció a billentyűzet segítségével"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Billentyűparancsok megismerése"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigálás az érintőpaddal"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Érintőpad-kézmozdulatok megismerése"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigálás a billentyűzet és az érintőpad használatával"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Érintőpad-kézmozdulatok, billentyűparancsok és egyebek megismerése"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Vissza kézmozdulat"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Kezdőképernyő kézmozdulat"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Műveletbillentyű"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"A képernyő tetején mostantól extrasötétre állíthatja a képernyőt, amivel a korábbinál még jobban csökkentheti a fényerőt.\n\nA funkció sötét környezetben használható a legjobban."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Az extrasötét funkció gyorsparancsának eltávolítása"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Eltávolította az extrasötét funkció gyorsparancsát. A fényerő csökkentéséhez használja a fényerő-beállítási sávot."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index 6a64c5d..c017263 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Ավելացնել նշմանը"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Ներառել հղումը"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Էկրանի տեսագրում"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Էկրանի տեսագրության մշակում"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Էկրանի տեսագրման աշխատաշրջանի ընթացիկ ծանուցում"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Էկրանապահ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Չանհանգստացնել"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Ռեժիմներ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Զուգակցված սարքեր չկան"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Հպեք՝ սարք միացնելու կամ անջատելու համար"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Բացել կարգավորումները"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Այլ սարք"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Միացնել/անջատել համատեսքը"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Ռեժիմներ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Պատրաստ է"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Կարգավորումներ"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Միացված է"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ծալել պատկերակը"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ծավալել պատկերակը"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"կամ"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Կողմնորոշվեք ձեր ստեղնաշարի օգնությամբ"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Սովորեք օգտագործել ստեղնային դյուրանցումները"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Կողմնորոշվեք ձեր հպահարթակի օգնությամբ"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Սովորեք օգտագործել հպահարթակի ժեստերը"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Կողմնորոշվեք ստեղնաշարի և հպահարթակի օգնությամբ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Սովորեք օգտագործել հպահարթակի ժեստերը, ստեղնային դյուրանցումները և ավելին"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"«Հետ» ժեստ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Հիմնական էկրան անցնելու ժեստ"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Գործողության ստեղն"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Էկրանը հավելյալ խամրեցնելու համար բացեք կարգավորումները էկրանի վերևի մասից։\n\nԽորհուրդ ենք տալիս օգտագործել այս գործառույթը, երբ շուրջը մութ է։"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Հեռացնել հավելյալ խամրեցման դյուրանցումը"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Հավելյալ խամրեցման դյուրանցումը հեռացվեց։ Պայծառության մակարդակը նվազեցնելու համար օգտագործեք պայծառության գոտին։"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 8c58012..a3ea9b2 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Tambahkan ke catatan"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Sertakan link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Perekam Layar"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Memproses perekaman layar"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notifikasi yang sedang berjalan untuk sesi rekaman layar"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Screensaver"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Jangan Ganggu"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Mode"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Perangkat yang disandingkan tak tersedia"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Ketuk untuk mulai atau berhenti menghubungkan perangkat"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Buka Setelan"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Perangkat lainnya"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Aktifkan Ringkasan"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Mode"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Selesai"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Setelan"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Aktif"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikon ciutkan"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikon luaskan"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"atau"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Menavigasi menggunakan keyboard"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Pelajari pintasan keyboard"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Menavigasi menggunakan touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Pelajari gestur touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Menavigasi menggunakan keyboard dan touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Pelajari gestur touchpad, pintasan keyboard, dan lainnya"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gestur kembali"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gestur layar utama"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tombol tindakan"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Anda kini dapat membuat layar menjadi ekstra redup dengan menurunkan tingkat kecerahan lebih banyak lagi dari bagian atas layar.\n\nFitur ini berfungsi optimal saat Anda berada di tempat yang gelap."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Hapus pintasan ekstra redup"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Pintasan ekstra redup dihapus. Untuk menurunkan kecerahan, gunakan panel kecerahan biasa."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-is/strings.xml b/packages/SystemUI/res/values-is/strings.xml
index 6b3b6732..2468bcc 100644
--- a/packages/SystemUI/res/values-is/strings.xml
+++ b/packages/SystemUI/res/values-is/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Bæta við glósu"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Hafa tengil með"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Ekki er hægt að bæta við tenglum frá öðrum prófílum"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Skjáupptaka"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Vinnur úr skjáupptöku"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Áframhaldandi tilkynning fyrir skjáupptökulotu"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Skjávari"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ónáðið ekki"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Stillingar"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Engin pöruð tæki til staðar"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Ýttu til að tengja eða aftengja tæki"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Opna stillingar"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Annað tæki"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Kveikja/slökkva á yfirliti"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Stillingar"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Lokið"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Stillingar"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Kveikt"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Minnka tákn"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Stækka tákn"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"eða"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Flettu með því að nota lyklaborðið"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Kynntu þér flýtilykla"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Flettu með því að nota snertiflötinn"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Nánar um bendingar á snertifleti"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Flettu með því að nota lyklaborðið og snertiflötinn"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Kynntu þér bendingar á snertifleti, flýtilykla og fleira"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Bending til að fara til baka"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Bending til að fara á upphafsskjá"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Aðgerðalykill"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Nú geturðu gert skjáinn mjög dökkan með því að lækka birtustigið enn frekar efst á skjánum.\n\nÞetta virkar best þegar umhverfi þitt er mjög dimmt."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Fjarlægja flýtilykil á mjög dökka stillingu"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Flýtilykill á mjög dökka stillingu fjarlægður. Notaðu hefðbundnu birtustigsstikuna til að lækka birtustigið."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 958d67b..5ea4486 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Aggiungi alla nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Includi link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Registrazione dello schermo"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Elaborazione registrazione…"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notifica costante per una sessione di registrazione dello schermo"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Salvaschermo"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Non disturbare"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modalità"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nessun dispositivo accoppiato disponibile"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tocca per connettere o disconnettere un dispositivo"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Apri Impostazioni"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Altro dispositivo"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Attiva/disattiva la panoramica"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modalità"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Fine"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Impostazioni"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"On"</string>
@@ -1444,4 +1444,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Ora puoi usare l\'attenuazione extra per lo schermo abbassando il livello di luminosità ancora di più dalla parte superiore della schermata.\n\nQuesta funzionalità opera in modo ottimale quando ti trovi in un ambiente buio."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Rimuovi scorciatoia attenuazione extra"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Scorciatoia attenuazione extra rimossa. Per diminuire la luminosità, usa la normale barra della luminosità."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index 1161fa0..5fd5ca6 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"הוספה לפתק"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"הכנסת הקישור"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"מקליט המסך"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"מתבצע עיבוד של הקלטת מסך"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"התראה מתמשכת לסשן הקלטת מסך"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"שומר מסך"</string>
<string name="ethernet_label" msgid="2203544727007463351">"אתרנט"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"נא לא להפריע"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"מצבים"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"אין מכשירים מותאמים זמינים"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"אפשר להקיש כדי להתחבר למכשיר או להתנתק ממנו"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"פתיחת ההגדרות"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"מכשיר אחר"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"החלפת מצב של מסכים אחרונים"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"מצבים"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"סיום"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"הגדרות"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"מצב מופעל"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"סמל הכיווץ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"סמל ההרחבה"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"או"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ניווט באמצעות המקלדת"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"מידע על מקשי קיצור"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ניווט באמצעות לוח המגע"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"מידע על התנועות בלוח המגע"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ניווט באמצעות המקלדת ולוח המגע"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"מידע על התנועות בלוח המגע, מקשי קיצור ועוד"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"תנועת חזרה"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"תנועת חזרה למסך הבית"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"מקש הפעולה"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"עכשיו אפשר להפוך את המסך למעומעם במיוחד באמצעות הפחתה נוספת של רמת הבהירות דרך החלק העליון במסך.\n\nהפעולה הזו עובדת הכי טוב בסביבה חשוכה."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"הסרה של קיצור הדרך לתכונה \'מעומעם במיוחד\'"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"קיצור הדרך לתכונה \'מעומעם במיוחד\' הוסר. כדי להפחית את הבהירות, אפשר להשתמש בסרגל הבהירות הרגיל."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 6436cdd..7897f48 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -44,8 +44,8 @@
<string name="usb_device_confirm_prompt" msgid="4091711472439910809">"<xliff:g id="APPLICATION">%1$s</xliff:g> を起動して <xliff:g id="USB_DEVICE">%2$s</xliff:g> を処理しますか?"</string>
<string name="usb_device_confirm_prompt_warn" msgid="990208659736311769">"<xliff:g id="APPLICATION">%1$s</xliff:g> を開いて <xliff:g id="USB_DEVICE">%2$s</xliff:g>を利用しますか?\nこのアプリに録音権限は付与されていませんが、この USB デバイスから音声を収集できるようになります。"</string>
<string name="usb_accessory_confirm_prompt" msgid="5728408382798643421">"<xliff:g id="APPLICATION">%1$s</xliff:g> を起動して <xliff:g id="USB_ACCESSORY">%2$s</xliff:g> を処理しますか?"</string>
- <string name="usb_accessory_uri_prompt" msgid="6756649383432542382">"このUSBアクセサリを扱うアプリはインストールされていません。詳細: <xliff:g id="URL">%1$s</xliff:g>"</string>
- <string name="title_usb_accessory" msgid="1236358027511638648">"USBアクセサリ"</string>
+ <string name="usb_accessory_uri_prompt" msgid="6756649383432542382">"このUSBアクセサリーを扱うアプリはインストールされていません。詳細: <xliff:g id="URL">%1$s</xliff:g>"</string>
+ <string name="title_usb_accessory" msgid="1236358027511638648">"USBアクセサリー"</string>
<string name="label_view" msgid="6815442985276363364">"表示"</string>
<string name="always_use_device" msgid="210535878779644679">"<xliff:g id="USB_DEVICE">%2$s</xliff:g> を接続している場合は常に <xliff:g id="APPLICATION">%1$s</xliff:g> を起動する"</string>
<string name="always_use_accessory" msgid="1977225429341838444">"<xliff:g id="USB_ACCESSORY">%2$s</xliff:g> を接続している場合は常に <xliff:g id="APPLICATION">%1$s</xliff:g> を起動する"</string>
@@ -67,8 +67,8 @@
<string name="wifi_debugging_secondary_user_title" msgid="2493201475880517725">"ワイヤレス デバッグは許可されていません"</string>
<string name="wifi_debugging_secondary_user_message" msgid="9085779370142222881">"このデバイスに現在ログインしているユーザーはワイヤレス デバッグを ON にできません。この機能を使用するには、管理者ユーザーに切り替えてください。"</string>
<string name="usb_contaminant_title" msgid="894052515034594113">"USB ポート無効"</string>
- <string name="usb_contaminant_message" msgid="7730476585174719805">"液体やゴミからデバイスを保護するため、USB ポートは無効になっています。アクセサリの検出は行われません。\n\nUSB ポートを再び安全に使用できるようになりましたらお知らせします。"</string>
- <string name="usb_port_enabled" msgid="531823867664717018">"USB ポートが有効になり、充電器やアクセサリを検出できるようになりました"</string>
+ <string name="usb_contaminant_message" msgid="7730476585174719805">"液体やゴミからデバイスを保護するため、USB ポートは無効になっています。アクセサリーの検出は行われません。\n\nUSB ポートを再び安全に使用できるようになりましたらお知らせします。"</string>
+ <string name="usb_port_enabled" msgid="531823867664717018">"USB ポートが有効になり、充電器やアクセサリーを検出できるようになりました"</string>
<string name="usb_disable_contaminant_detection" msgid="3827082183595978641">"USB を有効にする"</string>
<string name="learn_more" msgid="4690632085667273811">"詳細"</string>
<string name="global_action_screenshot" msgid="2760267567509131654">"スクリーンショット"</string>
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"メモに追加"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"リンクを含める"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"他のプロファイルからリンクを追加することはできません"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"スクリーン レコーダー"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"画面の録画を処理しています"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"画面の録画セッション中の通知"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"スクリーン セーバー"</string>
<string name="ethernet_label" msgid="2203544727007463351">"イーサネット"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"サイレント モード"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"モード"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ペア設定されたデバイスがありません"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"タップしてデバイスを接続または接続解除します"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"設定を開く"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"その他のデバイス"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"概要を切り替え"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"モード"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"完了"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"設定"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ON"</string>
@@ -949,7 +948,7 @@
<string name="thermal_shutdown_dialog_help_text" msgid="6413474593462902901">"取り扱いに関する手順をご覧ください"</string>
<string name="high_temp_dialog_help_text" msgid="7380171287943345858">"取り扱いに関する手順をご覧ください"</string>
<string name="high_temp_alarm_title" msgid="8654754369605452169">"デバイスを電源から外します"</string>
- <string name="high_temp_alarm_notify_message" msgid="3917622943609118956">"充電ポートの近くにデバイスを置くと、本体が熱くなります。デバイスが充電器や USB アクセサリに接続されている場合は外してください。ケーブルが熱くなっていることもあるので注意してください。"</string>
+ <string name="high_temp_alarm_notify_message" msgid="3917622943609118956">"充電ポートの近くにデバイスを置くと、本体が熱くなります。デバイスが充電器や USB アクセサリーに接続されている場合は外してください。ケーブルが熱くなっていることもあるので注意してください。"</string>
<string name="high_temp_alarm_help_care_steps" msgid="5017002218341329566">"取り扱いに関する手順をご覧ください"</string>
<string name="lockscreen_shortcut_left" msgid="1238765178956067599">"左ショートカット"</string>
<string name="lockscreen_shortcut_right" msgid="4138414674531853719">"右ショートカット"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"閉じるアイコン"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"開くアイコン"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"または"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"キーボードを使用して移動する"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"キーボード ショートカットの詳細"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"タッチパッドを使用して移動する"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"タッチパッド操作の詳細"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"キーボードとタッチパッドを使用して移動する"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"タッチパッド操作やキーボード ショートカットなどの詳細"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"「戻る」ジェスチャー"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"「ホーム」ジェスチャー"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"アクションキー"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"画面の上部で明るさを大幅に低く設定することで、画面の輝度をさらに下げられるようになりました。\n\nこの設定は暗い場所での操作に最適です。"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"「さらに輝度を下げる」のショートカットを削除する"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"「さらに輝度を下げる」のショートカットを削除しました。明るさを下げるには、通常の明るさのバーを使用してください。"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ka/strings.xml b/packages/SystemUI/res/values-ka/strings.xml
index 7d52760..5550a63 100644
--- a/packages/SystemUI/res/values-ka/strings.xml
+++ b/packages/SystemUI/res/values-ka/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"დაამატეთ შენიშვნა"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"ბმულის დართვა"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"სხვა პროფილებიდან ბმულების დამატება შეუძლებელია"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"ეკრანის ჩამწერი"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"ეკრანის ჩანაწერი მუშავდება"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"უწყვეტი შეტყობინება ეკრანის ჩაწერის სესიისთვის"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ეკრანმზოგი"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ეთერნეტი"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"არ შემაწუხოთ"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"რეჟიმები"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"დაწყვილებული მოწყობილობები მიუწვდომელია"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"შეეხეთ მოწყობილობის დასაკავშირებლად ან გასათიშად"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"პარამეტრების გახსნა"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"სხვა მოწყობილობა"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"მიმოხილვის გადართვა"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"რეჟიმები"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"მზადაა"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"პარამეტრები"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ჩართული"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"ხატულის ჩაკეცვა"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"ხატულის გაფართოება"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ან"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ნავიგაცია კლავიატურის გამოყენებით"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"კლავიატურის მალსახმობების სწავლა"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ნავიგაცია სენსორული პანელის გამოყენებით"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"სენსორული პანელის ჟესტების სწავლა"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ნავიგაცია კლავიატურის და სენსორული პანელის გამოყენებით"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"სენსორული პანელის ჟესტების, კლავიატურის მალსახმობების და სხვა ფუნქციების სწავლა"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"უკან დაბრუნების ჟესტი"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"მთავარ ეკრანზე გადასვლის ჟესტი"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"მოქმედების კლავიში"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ახლა თქვენ შეგიძლიათ დამატებით დაბინდოთ ეკრანი მის ზედა ნაწილში სიკაშკაშის დონის კიდევ უფრო შემცირების გზით.\n\nეს ყველაზე უკეთ ბნელ გარემოში ყოფნისას მუშაობს."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"დამატებითი დაბინდვის მალსახმობის ამოშლა"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"დამატებითი დაბინდვის მალსახმობი ამოშლილია. სიკაშკაშის შესამცირებლად გამოიყენეთ სიკაშკაშის ჩვეულებრივი პანელი."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index 7b32db1..d8b4542 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Ескертпеге қосу"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Сілтеме қосу"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Экран жазғыш"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Экран жазғыш бейнесін өңдеу"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Экранды бейнеге жазудың ағымдағы хабарландыруы"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Скринсейвер"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Этернет"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Мазаламау"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Режимдер"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Жұптасқан құрылғылар жоқ"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Құрылғыны жалғау не ажырату үшін түртіңіз."</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Параметрлерді ашу"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Басқа құрылғы"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Шолуды қосу/өшіру"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Режимдер"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Дайын"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Параметрлер"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Қосулы"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Жию белгішесі"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Жаю белгішесі"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"немесе"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Пернетақтамен жұмыс істеңіз"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Перне тіркесімдерін үйреніңіз."</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Сенсорлық тақтамен жұмыс істеңіз"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Сенсорлық тақта қимылдарын үйреніңіз."</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Пернетақтамен және сенсорлық тақтамен жұмыс істеңіз"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Сенсорлық тақта қимылдарын, перне тіркесімдерін және т.б. үйреніңіз."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Артқа қайтару қимылы"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Негізгі бетке қайтару қимылы"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Әрекет пернесі"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Енді экранның жоғарғы бөлігінде жарықтық деңгейін түсіру арқылы экранды одан сайын қарайтуға болады.\n\nБұл мүмкіндіктің артықшылығын қараңғы жерде көруге болады."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Экранды қарайту жылдам пәрменін өшіру"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Экранды қарайту жылдам пәрмені өшірілді. Жарықтықты азайту үшін әдеттегі жарықтық панелін пайдаланыңыз."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index 81664ca..f2fc313 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"បញ្ចូលទៅក្នុងកំណត់ចំណាំ"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"រួមបញ្ចូលតំណ"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"មិនអាចបញ្ចូលតំណពីកម្រងព័ត៌មានផ្សេងទៀតបានទេ"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"មុខងារថតវីដេអូអេក្រង់"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"កំពុងដំណើរការការថតអេក្រង់"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ការជូនដំណឹងដែលកំពុងដំណើរការសម្រាប់រយៈពេលប្រើការថតសកម្មភាពអេក្រង់"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ធាតុរក្សាអេក្រង់"</string>
<string name="ethernet_label" msgid="2203544727007463351">"អ៊ីសឺរណិត"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"កុំរំខាន"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"មុខងារ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ប៊្លូធូស"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"មិនមានឧបករណ៍ផ្គូផ្គងដែលអាចប្រើបាន"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"ចុចដើម្បីភ្ជាប់ ឬផ្ដាច់ឧបករណ៍"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"បើកការកំណត់"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"ឧបករណ៍ផ្សេងទៀត"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"បិទ/បើកទិដ្ឋភាពរួម"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"មុខងារ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"រួចរាល់"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ការកំណត់"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"បើក"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"រូបតំណាង \"បង្រួម\""</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"រូបតំណាង \"ពង្រីក\""</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ឬ"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"រុករកដោយប្រើក្ដារចុចរបស់អ្នក"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"ស្វែងយល់អំពីផ្លូវកាត់ក្ដារចុច"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"រុករកដោយប្រើផ្ទាំងប៉ះរបស់អ្នក"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ស្វែងយល់អំពីចលនាផ្ទាំងប៉ះ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"រុករកដោយប្រើក្ដារចុច និងផ្ទាំងប៉ះរបស់អ្នក"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ស្វែងយល់អំពីចលនាផ្ទាំងប៉ះ ផ្លូវកាត់ក្ដារចុច និងអ្វីៗជាច្រើនទៀត"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ចលនាថយក្រោយ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ចលនាទៅទំព័រដើម"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"គ្រាប់ចុចសកម្មភាព"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ឥឡូវនេះ អ្នកអាចធ្វើឱ្យអេក្រង់ងងឹតខ្លាំងបានដោយបន្ថយកម្រិតពន្លឺបន្ថែមទៀតដោយចូលទៅកាន់ផ្នែកខាងលើនៃអេក្រង់របស់អ្នក។\n\nការធ្វើបែបនេះទទួលបានលទ្ធផលប្រសើរបំផុត ពេលអ្នកស្ថិតនៅកន្លែងងងឹត។"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"ដកផ្លូវកាត់មុខងារងងឹតខ្លាំងចេញ"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"ផ្លូវកាត់មុខងារងងឹតខ្លាំងត្រូវបានដកចេញ។ ដើម្បីបន្ថយពន្លឺរបស់អ្នក សូមប្រើរបារពន្លឺធម្មតា។"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index e1b119c..6f63332 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -74,8 +74,8 @@
<string name="global_action_screenshot" msgid="2760267567509131654">"ಸ್ಕ್ರೀನ್ಶಾಟ್"</string>
<string name="global_action_smart_lock_disabled" msgid="6286551337177954859">"ಎಕ್ಸ್ಟೆಂಡ್ ಅನ್ಲಾಕ್ ಅನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ"</string>
<string name="remote_input_image_insertion_text" msgid="4850791636452521123">"ಚಿತ್ರವನ್ನು ಕಳುಹಿಸಲಾಗಿದೆ"</string>
- <string name="screenshot_saving_title" msgid="2298349784913287333">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಉಳಿಸಲಾಗುತ್ತಿದೆ…"</string>
- <string name="screenshot_saving_work_profile_title" msgid="5332829607308450880">"ಉದ್ಯೋಗ ಪ್ರೊಫೈಲ್ಗೆ ಸ್ಕ್ರೀನ್ಶಾಟ್ ಉಳಿಸಲಾಗುತ್ತಿದೆ…"</string>
+ <string name="screenshot_saving_title" msgid="2298349784913287333">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಸೇವ್ ಮಾಡಲಾಗುತ್ತಿದೆ…"</string>
+ <string name="screenshot_saving_work_profile_title" msgid="5332829607308450880">"ಉದ್ಯೋಗ ಪ್ರೊಫೈಲ್ಗೆ ಸ್ಕ್ರೀನ್ಶಾಟ್ ಸೇವ್ ಮಾಡಲಾಗುತ್ತಿದೆ…"</string>
<string name="screenshot_saving_private_profile" msgid="8934706048497093297">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಅನ್ನು ಖಾಸಗಿ ಪ್ರೊಫೈಲ್ಗೆ ಸೇವ್ ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
<string name="screenshot_saved_title" msgid="8893267638659083153">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಅನ್ನು ಸೇವ್ ಮಾಡಲಾಗಿದೆ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಅನ್ನು ಉಳಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ"</string>
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"ಟಿಪ್ಪಣಿಗೆ ಸೇರಿಸಿ"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"ಲಿಂಕ್ ಅನ್ನು ಸೇರಿಸಿ"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"ಇತರ ಪ್ರೊಫೈಲ್ಗಳಿಂದ ಲಿಂಕ್ಗಳನ್ನು ಸೇರಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"ಸ್ಕ್ರೀನ್ ರೆಕಾರ್ಡರ್"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"ಸ್ಕ್ರೀನ್ ರೆಕಾರ್ಡಿಂಗ್ ಆಗುತ್ತಿದೆ"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ಸ್ಕ್ರೀನ್ ರೆಕಾರ್ಡಿಂಗ್ ಸೆಶನ್ಗಾಗಿ ಚಾಲ್ತಿಯಲ್ಲಿರುವ ನೋಟಿಫಿಕೇಶನ್"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ಸ್ಕ್ರೀನ್ ಸೇವರ್"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ಇಥರ್ನೆಟ್"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ಅಡಚಣೆ ಮಾಡಬೇಡಿ"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"ಮೋಡ್ಗಳು"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ಬ್ಲೂಟೂತ್"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ಯಾವುದೇ ಜೋಡಿಸಲಾದ ಸಾಧನಗಳು ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"ಸಾಧನವನ್ನು ಕನೆಕ್ಟ್ ಅಥವಾ ಡಿಸ್ಕನೆಕ್ಟ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ಸೆಟ್ಟಿಂಗ್ಗಳನ್ನು ತೆರೆಯಿರಿ"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"ಅನ್ಯ ಸಾಧನ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ಟಾಗಲ್ ನ ಅವಲೋಕನ"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"ಮೋಡ್ಗಳು"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ಮುಗಿದಿದೆ"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ಆನ್ ಆಗಿದೆ"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"ಕುಗ್ಗಿಸುವ ಐಕಾನ್"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"ವಿಸ್ತೃತಗೊಳಿಸುವ ಐಕಾನ್"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ಅಥವಾ"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ನಿಮ್ಮ ಕೀಬೋರ್ಡ್ ಬಳಸಿ ನ್ಯಾವಿಗೇಟ್ ಮಾಡಿ"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"ಕೀಬೋರ್ಡ್ ಶಾರ್ಟ್ಕಟ್ಗಳನ್ನು ಕಲಿಯಿರಿ"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ನಿಮ್ಮ ಟಚ್ಪ್ಯಾಡ್ ಬಳಸಿ ನ್ಯಾವಿಗೇಟ್ ಮಾಡಿ"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ಟಚ್ಪ್ಯಾಡ್ ಗೆಸ್ಚರ್ಗಳನ್ನು ಕಲಿಯಿರಿ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ನಿಮ್ಮ ಕೀಬೋರ್ಡ್ ಮತ್ತು ಟಚ್ಪ್ಯಾಡ್ ಬಳಸಿ ನ್ಯಾವಿಗೇಟ್ ಮಾಡಿ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ಟಚ್ಪ್ಯಾಡ್ ಗೆಸ್ಚರ್ಗಳು, ಕೀಬೋರ್ಡ್ಗಳ ಶಾರ್ಟ್ಕಟ್ಗಳು ಮತ್ತು ಹೆಚ್ಚಿನದನ್ನು ತಿಳಿಯಿರಿ"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ಹಿಂಬದಿ ಗೆಸ್ಚರ್"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ಹೋಮ್ ಗೆಸ್ಚರ್"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ಆ್ಯಕ್ಷನ್ ಕೀ"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ ಮೇಲ್ಭಾಗದಿಂದ ಬ್ರೈಟ್ನೆಸ್ ಮಟ್ಟವನ್ನು ಇನ್ನಷ್ಟು ಕಡಿಮೆ ಮಾಡುವ ಮೂಲಕ ನೀವು ಈಗ ಸ್ಕ್ರೀನ್ ಅನ್ನು ಇನ್ನಷ್ಟು ಮಬ್ಬುಗೊಳಿಸಬಹುದು.\n\nನೀವು ಕತ್ತಲೆಯ ವಾತಾವರಣದಲ್ಲಿರುವಾಗ ಇದು ಉತ್ತಮವಾಗಿ ಕಾರ್ಯನಿರ್ವಹಿಸುತ್ತದೆ."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"ಇನ್ನಷ್ಟು ಮಬ್ಬು ಶಾರ್ಟ್ಕಟ್ ಅನ್ನು ತೆಗೆದುಹಾಕಿ"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"ಇನ್ನಷ್ಟು ಮಬ್ಬು ಶಾರ್ಟ್ಕಟ್ ಅನ್ನು ತೆಗೆದುಹಾಕಲಾಗಿದೆ. ನಿಮ್ಮ ಬ್ರೈಟ್ನೆಸ್ ಅನ್ನು ಕಡಿಮೆ ಮಾಡಲು, ಸಾಮಾನ್ಯ ಬ್ರೈಟ್ನೆಸ್ ಬಾರ್ ಬಳಸಿ."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 27aa785..75bc3b2 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"메모에 추가"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"링크 포함"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g><xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"화면 녹화"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"화면 녹화 처리 중"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"화면 녹화 세션에 관한 지속적인 알림"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"화면 보호기"</string>
<string name="ethernet_label" msgid="2203544727007463351">"이더넷"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"방해 금지 모드"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"모드"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"블루투스"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"페어링된 기기가 없습니다"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"기기를 연결 또는 연결 해제하려면 탭하세요"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"설정 열기"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"기타 기기"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"최근 사용 버튼 전환"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"모드"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"완료"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"설정"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"사용"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"접기 아이콘"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"확장 아이콘"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"또는"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"키보드를 사용하여 이동"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"단축키 알아보기"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"터치패드를 사용하여 이동"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"터치패드 동작 알아보기"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"키보드와 터치패드를 사용하여 이동"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"터치패드 동작, 단축키 등 알아보기"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"뒤로 동작"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"홈 동작"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"작업 키"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"이제 화면 상단에서 밝기 수준을 더 낮춰 화면을 더 어둡게 만들 수 있습니다\n\n이 기능은 어두운 환경에서 가장 잘 작동합니다."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"\'더 어둡게\' 단축키 삭제"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"\'더 어둡게\' 단축키가 삭제되었습니다. 밝기를 낮추려면 일반 밝기 막대를 사용하세요."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 306baa7..9bf427c 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Кыска жазууга кошуу"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Шилтеме кошуу"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Башка профилдердеги шилтемелерди кошууга болбойт"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Экрандан видео жаздырып алуу"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Экрандан жаздырылып алынган видео иштетилүүдө"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Экранды жаздыруу сеансы боюнча учурдагы билдирме"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Көшөгө"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Тынчымды алба"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Режимдер"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Жупташкан түзмөктөр жок"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Түзмөктү туташтыруу же ажыратуу үчүн таптаңыз"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Параметрлерди ачуу"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Башка түзмөк"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Назар режимин өчүрүү/күйгүзүү"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Режимдер"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Бүттү"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Параметрлер"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Күйүк"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Жыйыштыруу сүрөтчөсү"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Жайып көрсөтүү сүрөтчөсү"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"же"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Нерселерге баскычтоп аркылуу өтүңүз"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Ыкчам баскычтар тууралуу билип алыңыз"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Нерселерге сенсордук такта аркылуу өтүңүз"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Сенсордук тактадагы жаңсоолорду үйрөнүп алыңыз"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Нерселерге баскычтоп жана сенсордук такта аркылуу өтүңүз"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Сенсордук тактадагы жаңсоолор, ыкчам баскычтар жана башкалар жөнүндө билип алыңыз"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Артка кайтуу жаңсоосу"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Башкы бетке өтүү жаңсоосу"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Аракет баскычы"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Эми экраныңыздын өйдө жагынан жарыктыктын деңгээлин азайтып, экранды кошумча караңгылата аласыз.\n\nМуну караңгы жерде турганыңызда колдонуу сунушталат."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Кошумча караңгылатуу ыкчам баскычын өчүрүү"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Кошумча караңгылатуу ыкчам баскычы өчүрүлдү. Жарыктыкты азайтуу үчүн кадимки жарыктык тилкесин колдонуңуз."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-lo/strings.xml b/packages/SystemUI/res/values-lo/strings.xml
index 75f579c..bc0c22d 100644
--- a/packages/SystemUI/res/values-lo/strings.xml
+++ b/packages/SystemUI/res/values-lo/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"ເພີ່ມໃສ່ບັນທຶກ"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"ຮວມລິ້ງ"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"ບໍ່ສາມາດເພີ່ມລິ້ງຈາກໂປຣໄຟລ໌ອື່ນໆໄດ້"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"ໂປຣແກຣມບັນທຶກໜ້າຈໍ"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"ກຳລັງປະມວນຜົນການບັນທຶກໜ້າຈໍ"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ການແຈ້ງເຕືອນສຳລັບເຊດຊັນການບັນທຶກໜ້າຈໍໃດໜຶ່ງ"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ພາບພັກໜ້າຈໍ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ຫ້າມລົບກວນ"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"ໂໝດ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ບໍ່ມີອຸປະກອນທີ່ສາມາດຈັບຄູ່ໄດ້"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"ແຕະເພື່ອເຊື່ອມຕໍ່ ຫຼື ຕັດການເຊື່ອມຕໍ່ອຸປະກອນ"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ເປີດການຕັ້ງຄ່າ"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"ອຸປະກອນອື່ນໆ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ສະຫຼັບພາບຮວມ"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"ໂໝດ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ແລ້ວໆ"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ການຕັ້ງຄ່າ"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ເປີດ"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"ໄອຄອນຫຍໍ້ລົງ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"ໄອຄອນຂະຫຍາຍ"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ຫຼື"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ນຳທາງໂດຍໃຊ້ແປ້ນພິມຂອງທ່ານ"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"ສຶກສາຄີລັດ"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ນຳທາງໂດຍໃຊ້ແຜ່ນສຳຜັດຂອງທ່ານ"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ສຶກສາທ່າທາງຂອງແຜ່ນສຳຜັດ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ນຳທາງໂດຍໃຊ້ແປ້ນພິມ ແລະ ແຜ່ນສຳຜັດຂອງທ່ານ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ສຶກສາທ່າທາງຂອງແຜ່ນສຳຜັດ, ຄີລັດ ແລະ ອື່ນໆ"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ທ່າທາງສຳລັບກັບຄືນ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ທ່າທາງສຳລັບໜ້າຫຼັກ"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ປຸ່ມຄຳສັ່ງ"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ຕອນນີ້ທ່ານສາມາດເຮັດໃຫ້ໜ້າຈໍມືດລົງເປັນພິເສດໄດ້ໂດຍການຫຼຸດລະດັບຄວາມສະຫວ່າງລົງໃຫ້ຫຼາຍຂຶ້ນຈາກເທິງສຸດຂອງໜ້າຈໍຂອງທ່ານ.\n\nຄຸນສົມບັດນີ້ຈະເຮັດວຽກໄດ້ດີທີ່ສຸດເມື່ອທ່ານຢູ່ໃນສະພາບແວດລ້ອມທີ່ມືດ."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"ລຶບທາງລັດທີ່ຫຼຸດແສງເປັນພິເສດອອກ"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"ລຶບທາງລັດທີ່ຫຼຸດແສງເປັນພິເສດອອກແລ້ວ. ເພື່ອຫຼຸດຄວາມສະຫວ່າງຂອງທ່ານລົງ, ໃຫ້ໃຊ້ແຖບຄວາມສະຫວ່າງປົກກະຕິ."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 61516fe..91f8398 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Pridėti prie užrašo"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Įtraukti nuorodą"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"„<xliff:g id="APPNAME">%1$s</xliff:g>“ <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Ekrano vaizdo įrašytuvas"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Apdorojam. ekrano vaizdo įraš."</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Šiuo metu rodomas ekrano įrašymo sesijos pranešimas"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Ekrano užsklanda"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Eternetas"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Netrukdymo režimas"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Režimai"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nėra pasiekiamų susietų įrenginių"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Palieskite, kad prijungtumėte ar atjungtumėte įrenginį"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Atidaryti nustatymus"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Kitas įrenginys"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Perjungti apžvalgą"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Režimai"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Atlikta"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Nustatymai"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Įjungta"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Sutraukimo piktograma"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Išskleidimo piktograma"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"arba"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Naršykite naudodamiesi klaviatūra"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Sužinokite apie sparčiuosius klavišus"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Naršykite naudodamiesi jutikline dalimi"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Sužinokite jutiklinės dalies gestus"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Naršykite naudodamiesi klaviatūra ir jutikline dalimi"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Sužinokite jutiklinės dalies gestus, sparčiuosius klavišus ir kt."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Grįžimo atgal gestas"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Pagrindinio ekrano gestas"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Veiksmų klavišas"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Dabar galite padaryti ekraną itin blankų, dar labiau sumažindami ryškumo lygį nuo ekrano viršaus.\n\nŠi funkcija geriausiai veikia, kai esate tamsioje aplinkoje."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Pašalinti funkcijos „Itin blanku“ spartųjį klavišą"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Funkcijos „Itin blanku“ spartusis klavišas pašalintas. Jei norite sumažinti ryškumą, naudokite įprastą ryškumo juostą."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index 1b48d3f..29af399 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Pievienot piezīmei"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Iekļaut saiti"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Ekrāna ierakstītājs"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Ekrāna ieraksta apstrāde"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Aktīvs paziņojums par ekrāna ierakstīšanas sesiju"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Ekrānsaudzētājs"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Tīkls Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Režīms “Netraucēt”"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Režīmi"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nav pieejama neviena pārī savienota ierīce."</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Lai pievienotu vai atvienotu kādu ierīci, pieskarieties."</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Atvērt iestatījumus"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Cita ierīce"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Pārskata pārslēgšana"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Režīmi"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Gatavs"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Iestatījumi"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Ieslēgts"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Sakļaušanas ikona"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Izvēršanas ikona"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"vai"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Pārvietošanās, izmantojot tastatūru"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Uzziniet par īsinājumtaustiņiem."</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Pārvietošanās, izmantojot skārienpaliktni"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Apgūstiet skārienpaliktņa žestus."</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Pārvietošanās, izmantojot tastatūru un skārienpaliktni"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Uzziniet par skārienpaliktņa žestiem, īsinājumtaustiņiem un citām iespējām."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Žests pāriešanai atpakaļ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Žests pāriešanai uz sākumu"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Darbību taustiņš"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Tagad varat veikt ekrāna papildu aptumšošanu, vēl vairāk samazinot spilgtumu ekrāna augšdaļā.\n\nTas darbojas vislabāk, ja esat tumšā vietā."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Noņemt papildu aptumšošanas saīsni"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Papildu aptumšošanas saīsne ir noņemta. Lai samazinātu spilgtumu, izmantojiet parasto spilgtuma joslu."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index 1c853df..11fb67c 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Додај во белешка"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Опфати линк"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Снимач на екран"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Се обработува снимка од екран"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Тековно известување за сесија за снимање на екранот"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Штедач на екран"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Етернет"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Не вознемирувај"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Режими"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Нема достапни спарени уреди"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Допрете за да воспоставите или да прекинете врска со уред"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Отворете „Поставки“"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Друг уред"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Вклучи/исклучи преглед"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Режими"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Готово"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Поставки"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Вклучено"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Икона за собирање"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Икона за проширување"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"или"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Движете се со користење на тастатурата"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Научете кратенки од тастатурата"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Движете се со користење на допирната подлога"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Научете движења за допирната подлога"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Движете се со користење на тастатурата и допирната подлога"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Научете движења за допирната подлога, кратенки од тастатурата и друго"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Движење за назад"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Движење за почетен екран"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Копче за дејство"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Отсега може да го затемнувате екранот дополнително со намалување на нивото на осветленост од горниот дел на екранот.\n\nОва функционира најдобро кога сте во темна средина."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Отстрани ја кратенката за „Дополнително затемнување“"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Кратенката за „Дополнително затемнување“ е отстранета. Користете ја стандардната лента за осветленост за да ја намалите осветленоста."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index ef63d67..720275e 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"കുറിപ്പിലേക്ക് ചേർക്കുക"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"ലിങ്ക് ഉൾപ്പെടുത്തുക"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"മറ്റ് പ്രൊഫൈലുകളിൽ നിന്ന് ലിങ്കുകൾ ചേർക്കാനാകില്ല"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"സ്ക്രീൻ റെക്കോർഡർ"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"സ്ക്രീൻ റെക്കോർഡിംഗ് പ്രോസസുചെയ്യുന്നു"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ഒരു സ്ക്രീൻ റെക്കോർഡിംഗ് സെഷനായി നിലവിലുള്ള അറിയിപ്പ്"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"സ്ക്രീൻ സേവർ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ഇതർനെറ്റ്"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ശല്യപ്പെടുത്തരുത്"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"മോഡുകൾ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ജോടിയാക്കിയ ഉപകരണങ്ങളൊന്നും ലഭ്യമല്ല"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"ഒരു ഉപകരണം കണക്റ്റ് ചെയ്യാനോ വിച്ഛേദിക്കാനോ ടാപ്പ് ചെയ്യുക"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ക്രമീകരണം തുറക്കുക"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"മറ്റ് ഉപകരണം"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"അവലോകനം മാറ്റുക"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"മോഡുകൾ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ശരി"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ക്രമീകരണം"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ഓണാണ്"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"ചുരുക്കൽ ഐക്കൺ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"വികസിപ്പിക്കൽ ഐക്കൺ"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"അല്ലെങ്കിൽ"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"നിങ്ങളുടെ കീബോർഡ് ഉപയോഗിച്ച് നാവിഗേറ്റ് ചെയ്യുക"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"കീബോർഡ് കുറുക്കുവഴികൾ മനസ്സിലാക്കുക"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"നിങ്ങളുടെ ടച്ച്പാഡ് ഉപയോഗിച്ച് നാവിഗേറ്റ് ചെയ്യുക"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ടച്ച്പാഡ് ജെസ്ച്ചറുകൾ മനസ്സിലാക്കുക"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"നിങ്ങളുടെ കീപാഡ്, ടച്ച്പാഡ് എന്നിവ ഉപയോഗിച്ച് നാവിഗേറ്റ് ചെയ്യുക"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ടച്ച്പാഡ് ജെസ്ച്ചറുകൾ, കീബോർഡ് കുറുക്കുവഴികൾ എന്നിവയും മറ്റും മനസ്സിലാക്കുക"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"\'മടങ്ങുക\' ജെസ്ച്ചർ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ഹോം ജെസ്ച്ചർ"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ആക്ഷൻ കീ"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"മുകളിൽ നിന്ന് തെളിച്ചം കുറയ്ക്കുന്നതിലൂടെ നിങ്ങൾക്ക് ഇപ്പോൾ സ്ക്രീൻ കൂടുതൽ മങ്ങിക്കാൻ കഴിയും.\n\nനിങ്ങൾ ഇരുണ്ട മുറിയിലായിരിക്കുമ്പോൾ ഇത് മികച്ച രീതിയിൽ പ്രവർത്തിക്കുന്നു."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"കൂടുതൽ ഡിം ചെയ്യൽ കുറുക്കുവഴി നീക്കം ചെയ്യുക"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"കൂടുതൽ ഡിം ചെയ്യാനുള്ള കുറുക്കുവഴി നീക്കം ചെയ്തു. തെളിച്ചം കുറയ്ക്കാൻ, സാധാരണ \'തെളിച്ചം ബാർ\' ഉപയോഗിക്കുക."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-mn/strings.xml b/packages/SystemUI/res/values-mn/strings.xml
index ff8c52b..50a942e 100644
--- a/packages/SystemUI/res/values-mn/strings.xml
+++ b/packages/SystemUI/res/values-mn/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Тэмдэглэлд нэмэх"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Холбоосыг оруулах"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Дэлгэцийн үйлдэл бичигч"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Дэлгэц бичлэг боловсруулж байна"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Дэлгэц бичих горимын үргэлжилж буй мэдэгдэл"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Дэлгэц амраагч"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Этернет"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Бүү саад бол"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Горим"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Хослуулсан төхөөрөмж байхгүй"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Төхөөрөмжийг холбох эсвэл салгахын тулд товшино уу"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Тохиргоог нээх"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Бусад төхөөрөмж"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Тоймыг асаах/унтраах"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Горим"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Болсон"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Тохиргоо"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Асаалттай"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Хураах дүрс тэмдэг"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Дэлгэх дүрс тэмдэг"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"эсвэл"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Гараа ашиглан шилжих"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Товчлуурын шууд холбоосыг мэдэж аваарай"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Мэдрэгч самбараа ашиглан шилжээрэй"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Мэдрэгч самбарын зангааг мэдэж аваарай"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Гар эсвэл мэдрэгч самбараа ашиглан шилжээрэй"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Мэдрэгч самбарын зангаа, товчлуурын шууд холбоос болон бусад зүйлийг мэдэж аваарай"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Буцах зангаа"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Үндсэн нүүрний зангаа"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Тусгай товчлуур"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Та одоо дэлгэцийнхээ дээд талаас гэрэлтүүлгийн түвшнийг бүр илүү багасгаснаар дэлгэцийг хэт бүүдгэр болгох боломжтой.\n\nЭнэ нь таныг харанхуй орчинд байхад хамгийн сайн ажилладаг."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Хэт бүүдгэр онцлогийн товчлолыг хасах"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Хэт бүүдгэр онцлогийн товчлолыг хассан. Гэрэлтүүлгээ багасгахын тулд энгийн гэрэлтүүлгийн самбарыг ашиглана уу."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index 76515d2..75ef6e0 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"टीप जोडा"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"लिंकचा समावेश करा"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"इतर प्रोफाइलवरून लिंक जोडल्या जाऊ शकत नाहीत"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"स्क्रीन रेकॉर्डर"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"स्क्रीन रेकॉर्डिंग प्रोसेस सुरू"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"स्क्रीन रेकॉर्ड सत्रासाठी सुरू असलेली सूचना"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"स्क्रीन सेव्हर"</string>
<string name="ethernet_label" msgid="2203544727007463351">"इथरनेट"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"व्यत्यय आणू नका"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"मोड"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ब्लूटूथ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"कोणतेही जोडलेले डिव्हाइसेस उपलब्ध नाहीत"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"डिव्हाइस कनेक्ट किंवा डिस्कनेक्ट करण्यासाठी टॅप करा"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"सेटिंग्ज उघडा"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"इतर डिव्हाइस"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"अवलोकन टॉगल करा."</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"मोड"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"पूर्ण झाले"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"सेटिंग्ज"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"सुरू आहे"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"कोलॅप्स करा आयकन"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"विस्तार करा आयकन"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"किंवा"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"तुमचा कीबोर्ड वापरून नेव्हिगेट करा"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"कीबोर्ड शॉर्टकट जाणून घ्या"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"तुमचा टचपॅड वापरून नेव्हिगेट करा"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"टचपॅड जेश्चर जाणून घ्या"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"तुमचा कीबोर्ड आणि टचपॅड वापरून नेव्हिगेट करा"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"टचपॅड जेश्चर, कीबोर्ड शॉर्टकट आणि आणखी बरेच काही जाणून घ्या"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"मागे जा जेश्चर"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"होम जेश्चर"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"अॅक्शन की"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"तुम्ही आता तुमच्या स्क्रीनच्या सर्वात वरून ब्राइटनेसची पातळी आणखी कमी करून स्क्रीनला आणखी डिम करू शकता.\n\nतुम्ही गडद वातावरणात असता, तेव्हा हे सर्वोत्तम कार्य करते."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"आणखी डिमचा शॉर्टकट काढून टाका"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"आणखी डिमचा शॉर्टकट काढून टाकला आहे. तुमचा ब्राइटनेस कमी करण्यासाठी, नेहमीचा ब्राइटनेस बार वापरा."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index 181b0c7..e8213ba 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Tambahkan pada nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Sertakan pautan"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Pautan tidak dapat ditambahkan daripada profil lain"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Perakam Skrin"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Memproses rakaman skrin"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Pemberitahuan breterusan untuk sesi rakaman skrin"</string>
@@ -1391,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Kuncupkan ikon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Kembangkan ikon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"atau"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigasi menggunakan papan kekunci anda"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Ketahui pintasan papan kekunci"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigasi menggunakan pad sentuh anda"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Ketahui gerak isyarat pad sentuh"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigasi menggunakan papan kekunci dan pad sentuh anda"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Ketahui gerak isyarat pad sentuh, pintasan papan kekunci dan pelbagai lagi"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gerak isyarat kembali"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gerak isyarat pergi ke laman utama"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Kekunci tindakan"</string>
@@ -1442,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Kini anda boleh menjadikan skrin amat malap dengan merendahkan tahap kecerahan lebih jauh daripada bahagian atas skrin anda.\n\nCiri ini berfungsi paling baik apabila anda berada dalam persekitaran yang gelap."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Alih keluar pintasan amat malap"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Pintasan amat malap dialih keluar. Untuk mengurangkan kecerahan anda, gunakan bar kecerahan biasa."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-my/strings.xml b/packages/SystemUI/res/values-my/strings.xml
index afc57ac..8abb63d 100644
--- a/packages/SystemUI/res/values-my/strings.xml
+++ b/packages/SystemUI/res/values-my/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"မှတ်စုတွင် ထည့်ရန်"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"လင့်ခ်ထည့်သွင်းရန်"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"လင့်ခ်များကို အခြားပရိုဖိုင်များမှ ထည့်၍မရပါ"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"ဖန်သားပြင်ရိုက်ကူးစက်"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"စကရင်ရိုက်ကူးမှု အပြီးသတ်နေသည်"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ဖန်သားပြင် ရိုက်ကူးသည့် စက်ရှင်အတွက် ဆက်တိုက်လာနေသော အကြောင်းကြားချက်"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"စခရင်နားချိန်ပုံ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"အီသာနက်"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"မနှောင့်ယှက်ရ"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"မုဒ်များ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ဘလူးတုသ်"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ချိတ်တွဲထားသည့် ကိရိယာများ မရှိ"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"စက်ကို ချိတ်ဆက်ရန် (သို့) ချိတ်ဆက်မှုဖြုတ်ရန် တို့ပါ"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ဆက်တင်များဖွင့်ရန်"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"အခြားစက်ပစ္စည်း"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ဖွင့်၊ ပိတ် အနှစ်ချုပ်"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"မုဒ်များ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ပြီးပြီ"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ဆက်တင်များ"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ဖွင့်"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"လျှော့ပြရန် သင်္ကေတ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"ပိုပြရန် သင်္ကေတ"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"သို့မဟုတ်"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"သင့်ကီးဘုတ်ကိုသုံး၍ လမ်းညွှန်ခြင်း"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"လက်ကွက်ဖြတ်လမ်းများကို လေ့လာပါ"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"သင့်တာ့ချ်ပက်ကိုသုံး၍ လမ်းညွှန်ခြင်း"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"တာ့ချ်ပက်လက်ဟန်များကို လေ့လာပါ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"သင်၏ ကီးဘုတ်နှင့် တာ့ချ်ပက်တို့ကိုသုံး၍ လမ်းညွှန်ခြင်း"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"တာ့ချ်ပက်လက်ဟန်များ၊ လက်ကွက်ဖြတ်လမ်းများ စသည်တို့ကို လေ့လာပါ"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"နောက်သို့ လက်ဟန်"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ပင်မစာမျက်နှာ လက်ဟန်"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"လုပ်ဆောင်ချက်ကီး"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"သင့်စခရင်ထိပ်ဆုံး၌ပင် တောက်ပမှုအဆင့်လျှော့ချခြင်းဖြင့် စခရင်ကို ပိုမှိန်အောင် လုပ်နိုင်ပါပြီ။\n\nသင်သည် မှောင်သောပတ်ဝန်းကျင်၌ရှိချိန် ၎င်းက အကောင်းဆုံးအလုပ်လုပ်သည်။"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"ပိုမှိန်ခြင်း ဖြတ်လမ်း ဖယ်ရှားရန်"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"ပိုမှိန်ခြင်း ဖြတ်လမ်းကို ဖယ်ရှားလိုက်ပြီ။ တောက်ပမှုလျှော့ရန် ပုံမှန် တောက်ပမှုဘားကို အသုံးပြုပါ။"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index d222f31..8ccb776 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Legg til i notat"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Inkluder linken"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Skjermopptak"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Behandler skjermopptaket"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Vedvarende varsel for et skjermopptak"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Skjermsparer"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ikke forstyrr"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Moduser"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Ingen sammenkoblede enheter er tilgjengelige"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Trykk for å koble en enhet til eller fra"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Åpne Innstillinger"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Annen enhet"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Slå oversikten av eller på"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Moduser"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Ferdig"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Innstillinger"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"På"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Skjul-ikon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Vis-ikon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"eller"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Naviger med tastaturet"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Lær deg hurtigtaster"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Naviger med styreflaten"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Lær deg styreflatebevegelser"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Naviger med tastaturet og styreflaten"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Lær deg styreflatebevegelser, hurtigtaster med mer"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Tilbakebevegelse"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Startskjermbevegelse"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Handlingstast"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Nå kan du gjøre skjermen ekstra dimmet ved å redusere lysstyrkenivået enda mer fra toppen av skjermen.\n\nDette fungerer best i mørke omgivelser."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Fjern hurtigtasten for ekstra dimmet"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Hurtigtasten for ekstra dimmet er fjernet. For å redusere lysstyrken kan du bruke den vanlige lysstyrkeraden."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index 8af52a1..60e99ea 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"नोटमा सेभ गर्नुहोस्"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"लिंक समावेश गर्नुहोस्"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"अन्य प्रोफाइलबाट लिंकहरू हाल्न मिल्दैन"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"स्क्रिन रेकर्डर"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"स्क्रिन रेकर्डिङको प्रक्रिया अघि बढाइँदै"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"कुनै स्क्रिन रेकर्ड गर्ने सत्रका लागि चलिरहेको सूचना"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"स्क्रिन सेभर"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"बाधा नपुऱ्याउनुहोस्"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"मोडहरू"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ब्लुटुथ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"जोडी उपकरणहरू उपलब्ध छैन"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"कुनै डिभाइस कनेक्ट गर्न वा डिस्कनेक्ट गर्न ट्याप गर्नुहोस्"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"सेटिङ खोल्नुहोस्"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"अर्को डिभाइड"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"परिदृश्य टगल गर्नुहोस्"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"मोडहरू"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"सम्पन्न भयो"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"सेटिङ"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"अन छ"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"\"कोल्याप्स गर्नुहोस्\" आइकन"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"\"एक्स्पान्ड गर्नुहोस्\" आइकन"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"वा"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"किबोर्ड प्रयोग गरी नेभिगेट गर्नुहोस्"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"किबोर्डका सर्टकटहरू प्रयोग गर्न सिक्नुहोस्"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"टचप्याड प्रयोग गरी नेभिगेट गर्नुहोस्"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"टचप्याड जेस्चर प्रयोग गर्न सिक्नुहोस्"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"किबोर्ड र टचप्याड प्रयोग गरी नेभिगेट गर्नुहोस्"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"टचप्याड जेस्चर, किबोर्डका सर्टकट र अन्य कुरा प्रयोग गर्न सिक्नुहोस्"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ब्याक जेस्चर"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"होम जेस्चर"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"एक्सन की"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"तपाईं अब आफ्नो स्क्रिनको सिरानबाट चमकको स्तर घटाएर आफ्नो स्क्रिन अझै मधुरो बनाउन सक्नुहुन्छ।\n\nतपाईं अँध्यारो ठाउँमा भएका बेला यो सुविधाले अझ राम्रोसँग काम गर्छ।"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"\"अझै मधुरो\" सर्टकट हटाउनुहोस्"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"\"अझै मधुरो\" सर्टकट हटाइएको छ। स्क्रिनको चमक घटाउन \"रेगुलर ब्राइटनेस बार\" प्रयोग गर्नुहोस्।"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 24a4835..4b43ab1 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Toevoegen aan notitie"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Link opnemen"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Je kunt geen links toevoegen vanuit andere profielen"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Schermopname"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Schermopname verwerken"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Doorlopende melding voor een schermopname-sessie"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Screensaver"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Niet storen"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modi"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Geen gekoppelde apparaten beschikbaar"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tik om een apparaat te verbinden of de verbinding te verbreken"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Instellingen openen"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Ander apparaat"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Overzicht aan- of uitzetten"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modi"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Klaar"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Instellingen"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Aan"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Icoon voor samenvouwen"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Icoon voor uitvouwen"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"of"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigeren met je toetsenbord"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Leer sneltoetsen die je kunt gebruiken"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigeren met je touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Leer touchpadgebaren die je kunt gebruiken"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigeren met je toetsenbord en touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Leer meer over onder andere touchpadgebaren en sneltoetsen"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gebaar voor terug"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gebaar voor startscherm"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Actietoets"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Je kunt het scherm nu extra dimmen door het helderheidsniveau nog verder te verlagen vanaf de bovenkant van het scherm.\n\nDit werkt het beste als je in een donkere omgeving bent."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Snelkoppeling voor extra dimmen verwijderen"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Snelkoppeling voor extra dimmen verwijderd. Als je de helderheid wilt verlagen, gebruik je de gewone helderheidsbalk."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index 67537c2..af4ee77 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"ନୋଟରେ ଯୋଗ କରନ୍ତୁ"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"ଲିଙ୍କକୁ ଅନ୍ତର୍ଭୁକ୍ତ କରନ୍ତୁ"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"ସ୍କ୍ରିନ ରେକର୍ଡର"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"ସ୍କ୍ରିନ ରେକର୍ଡିଂର ପ୍ରକ୍ରିୟାକରଣ"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ଏକ ସ୍କ୍ରିନ୍ ରେକର୍ଡ୍ ସେସନ୍ ପାଇଁ ଚାଲୁଥିବା ବିଜ୍ଞପ୍ତି"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ସ୍କ୍ରିନ୍ ସେଭର୍"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ଇଥରନେଟ୍"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ବିରକ୍ତ କରନ୍ତୁ ନାହିଁ"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"ମୋଡ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ବ୍ଲୁଟୁଥ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ପେୟାର୍ ହୋଇଥିବା କୌଣସି ଡିଭାଇସ୍ ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"ଏକ ଡିଭାଇସ କନେକ୍ଟ କିମ୍ବା ଡିସକନେକ୍ଟ କରିବାକୁ ଟାପ କରନ୍ତୁ"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ସେଟିଂସ ଖୋଲନ୍ତୁ"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"ଅନ୍ୟ ଡିଭାଇସ୍"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ସଂକ୍ଷିପ୍ତ ବିବରଣୀକୁ ଟୋଗଲ୍ କରନ୍ତୁ"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"ମୋଡ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ହୋଇଗଲା"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ସେଟିଂସ"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ଚାଲୁ ଅଛି"</string>
@@ -653,7 +653,7 @@
<string name="screen_pinning_toast_recents_invisible" msgid="6850978077443052594">"ଏହି ଆପକୁ ଅନପିନ କରିବାକୁ, \"ବ୍ୟାକ\" ଏବଂ \"ହୋମ\" ବଟନକୁ ସ୍ପର୍ଶ କରି ଦବାଇ ଧରନ୍ତୁ"</string>
<string name="screen_pinning_toast_gesture_nav" msgid="170699893395336705">"ଏହି ଆପକୁ ଅନପିନ୍ କରିବାକୁ, ଉପରକୁ ସ୍ୱାଇପ୍ କରି ଧରି ରଖନ୍ତୁ"</string>
<string name="screen_pinning_positive" msgid="3285785989665266984">"ବୁଝିଗଲି"</string>
- <string name="screen_pinning_negative" msgid="6882816864569211666">"ନାହିଁ, ଥାଉ"</string>
+ <string name="screen_pinning_negative" msgid="6882816864569211666">"ନା, ଧନ୍ୟବାଦ"</string>
<string name="screen_pinning_start" msgid="7483998671383371313">"ଆପ୍ ପିନ୍ କରାଯାଇଛି"</string>
<string name="screen_pinning_exit" msgid="4553787518387346893">"ଆପ୍ ଅନପିନ୍ କରାଯାଇଛି"</string>
<string name="stream_voice_call" msgid="7468348170702375660">"କଲ କରନ୍ତୁ"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"ଆଇକନକୁ ସଙ୍କୁଚିତ କରନ୍ତୁ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"ଆଇକନକୁ ବିସ୍ତାର କରନ୍ତୁ"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"କିମ୍ବା"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ଆପଣଙ୍କ କୀବୋର୍ଡ ବ୍ୟବହାର କରି ନାଭିଗେଟ କରନ୍ତୁ"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"କୀବୋର୍ଡ ସର୍ଟକଟଗୁଡ଼ିକ ବିଷୟରେ ଜାଣନ୍ତୁ"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ଆପଣଙ୍କ ଟଚପେଡ ବ୍ୟବହାର କରି ନାଭିଗେଟ କରନ୍ତୁ"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ଟଚପେଡର ଜେଶ୍ଚରଗୁଡ଼ିକ ବିଷୟରେ ଜାଣନ୍ତୁ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ଆପଣଙ୍କ କୀବୋର୍ଡ ଏବଂ ଟଚପେଡ ବ୍ୟବହାର କରି ନାଭିଗେଟ କରନ୍ତୁ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ଟଚପେଡ ଜେଶ୍ଚର, କୀବୋର୍ଡ ସର୍ଟକଟ ଏବଂ ଆହୁରି ଅନେକ କିଛି ବିଷୟରେ ଜାଣନ୍ତୁ"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ବେକ ଜେଶ୍ଚର"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ହୋମ ଜେଶ୍ଚର"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ଆକ୍ସନ କୀ"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ବର୍ତ୍ତମାନ ଆପଣ ଆପଣଙ୍କ ସ୍କ୍ରିନର ଶୀର୍ଷରୁ ଉଜ୍ଜ୍ୱଳତାର ଲେଭେଲ ହ୍ରାସ କରି ସ୍କ୍ରିନକୁ ଅତିରିକ୍ତ ଡିମ କରିପାରିବେ।\n\nଆପଣ ଏକ ଡାର୍କ ପରିବେଶରେ ଥିଲେ ଏହା ସବୁଠାରୁ ଭଲ କାମ କରେ।"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"ଅତିରିକ୍ତ ଡିମ ସର୍ଟକଟକୁ କାଢ଼ି ଦିଅନ୍ତୁ"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"ଅତିରିକ୍ତ ଡିମର ସର୍ଟକଟ କାଢ଼ି ଦିଆଯାଇଛି। ଆପଣଙ୍କ ଉଜ୍ଜ୍ୱଳତା ହ୍ରାସ କରିବା ପାଇଁ ନିୟମିତ ଉଜ୍ଜ୍ୱଳତା ବାର ବ୍ୟବହାର କରନ୍ତୁ।"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index 1927d45..e6b275a 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"ਨੋਟ ਵਿੱਚ ਸ਼ਾਮਲ ਕਰੋ"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"ਲਿੰਕ ਸ਼ਾਮਲ ਕਰੋ"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"ਸਕ੍ਰੀਨ ਰਿਕਾਰਡਰ"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"ਸਕ੍ਰੀਨ ਰਿਕਾਰਡਿੰਗ ਜਾਰੀ ਹੈ"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"ਕਿਸੇ ਸਕ੍ਰੀਨ ਰਿਕਾਰਡ ਸੈਸ਼ਨ ਲਈ ਚੱਲ ਰਹੀ ਸੂਚਨਾ"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ਸਕ੍ਰੀਨ ਸੇਵਰ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ਈਥਰਨੈਟ"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ਪਰੇਸ਼ਾਨ ਨਾ ਕਰੋ"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"ਮੋਡ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"ਬਲੂਟੁੱਥ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ਕੋਈ ਜੋੜਾਬੱਧ ਕੀਤੀਆਂ ਡੀਵਾਈਸਾਂ ਉਪਲਬਧ ਨਹੀਂ"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"ਡੀਵਾਈਸ ਨੂੰ ਕਨੈਕਟ ਜਾਂ ਡਿਸਕਨੈਕਟ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ਸੈਟਿੰਗਾਂ ਖੋਲ੍ਹੋ"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"ਹੋਰ ਡੀਵਾਈਸ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ਰੂਪ-ਰੇਖਾ ਨੂੰ ਟੌਗਲ ਕਰੋ"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"ਮੋਡ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ਹੋ ਗਿਆ"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ਸੈਟਿੰਗਾਂ"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ਚਾਲੂ"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"ਪ੍ਰਤੀਕ ਨੂੰ ਸਮੇਟੋ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"ਪ੍ਰਤੀਕ ਦਾ ਵਿਸਤਾਰ ਕਰੋ"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ਜਾਂ"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ਆਪਣੇ ਕੀ-ਬੋਰਡ ਦੀ ਵਰਤੋਂ ਕਰ ਕੇ ਨੈਵੀਗੇਟ ਕਰੋ"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"ਕੀ-ਬੋਰਡ ਸ਼ਾਰਟਕੱਟ ਬਾਰੇ ਜਾਣੋ"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ਆਪਣੇ ਟੱਚਪੈਡ ਦੀ ਵਰਤੋਂ ਕਰ ਕੇ ਨੈਵੀਗੇਟ ਕਰੋ"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ਟੱਚਪੈਡ ਇਸ਼ਾਰਿਆਂ ਬਾਰੇ ਜਾਣੋ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ਆਪਣੇ ਕੀ-ਬੋਰਡ ਅਤੇ ਟੱਚਪੈਡ ਦੀ ਵਰਤੋਂ ਕਰ ਕੇ ਨੈਵੀਗੇਟ ਕਰੋ"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ਟੱਚਪੈਡ ਇਸ਼ਾਰੇ, ਕੀ-ਬੋਰਡ ਸ਼ਾਰਟਕੱਟ ਅਤੇ ਹੋਰ ਬਹੁਤ ਕੁਝ ਬਾਰੇ ਜਾਣੋ"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ਪਿੱਛੇ ਜਾਣ ਦਾ ਇਸ਼ਾਰਾ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ਹੋਮ \'ਤੇ ਜਾਣ ਦਾ ਇਸ਼ਾਰਾ"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ਕਾਰਵਾਈ ਕੁੰਜੀ"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ਤੁਸੀਂ ਹੁਣ ਆਪਣੀ ਸਕ੍ਰੀਨ ਦੇ ਸਿਖਰ ਤੋਂ ਚਕਮ ਦੇ ਪੱਧਰ ਨੂੰ ਹੋਰ ਵੀ ਘੱਟ ਕਰ ਕੇ ਸਕ੍ਰੀਨ ਦੀ ਚਮਕ ਨੂੰ ਜ਼ਿਆਦਾ ਘੱਟ ਕਰ ਸਕਦੇ ਹੋ।\n\nਇਹ ਉਦੋਂ ਬਿਹਤਰੀਨ ਕੰਮ ਕਰਦੀ ਹੈ, ਜਦੋਂ ਤੁਸੀਂ ਹਨੇਰੇ ਵਿੱਚ ਹੁੰਦੇ ਹੋ।"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"\'ਜ਼ਿਆਦਾ ਘੱਟ ਚਮਕ\' ਸ਼ਾਰਟਕੱਟ ਹਟਾਓ"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"\'ਜ਼ਿਆਦਾ ਘੱਟ ਚਮਕ\' ਸ਼ਾਰਟਕੱਟ ਹਟਾਇਆ ਗਿਆ। ਆਪਣੀ ਸਕ੍ਰੀਨ ਦੀ ਚਕਮ ਨੂੰ ਘੱਟ ਕਰਨ ਲਈ, ਨਿਯਮਿਤ ਚਮਕ ਪੱਟੀ ਦੀ ਵਰਤੋਂ ਕਰੋ।"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 1b27dba..0fefcae 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Dodaj do notatek"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Dołącz link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Nagrywanie ekranu"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Przetwarzam nagrywanie ekranu"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Stałe powiadomienie o sesji rejestrowania zawartości ekranu"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Wygaszacz ekranu"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Nie przeszkadzać"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Tryby"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Brak dostępnych sparowanych urządzeń"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Kliknij, aby podłączyć lub odłączyć urządzenie"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Otwórz Ustawienia"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Inne urządzenie"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Przełącz Przegląd"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Tryby"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Gotowe"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Ustawienia"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Wł."</string>
@@ -510,7 +510,7 @@
<string name="accessibility_action_label_remove_widget" msgid="3373779447448758070">"usuń widżet"</string>
<string name="accessibility_action_label_place_widget" msgid="1914197458644168978">"umieść wybrany widżet"</string>
<string name="communal_widget_picker_title" msgid="1953369090475731663">"Widżety na ekranie blokady"</string>
- <string name="communal_widget_picker_description" msgid="490515450110487871">"Każdy zobaczy widżety na ekranie blokady, nawet gdy tablet jest zablokowany."</string>
+ <string name="communal_widget_picker_description" msgid="490515450110487871">"Widżety są widoczne na ekranie blokady, nawet gdy tablet jest zablokowany."</string>
<string name="accessibility_action_label_unselect_widget" msgid="1041811747619468698">"odznacz widżet"</string>
<string name="communal_widgets_disclaimer_title" msgid="1150954395585308868">"Widżety na ekranie blokady"</string>
<string name="communal_widgets_disclaimer_text" msgid="1423545475160506349">"Aby otworzyć aplikację za pomocą widżetu, musisz potwierdzić swoją tożsamość. Pamiętaj też, że każdy będzie mógł wyświetlić widżety nawet wtedy, gdy tablet będzie zablokowany. Niektóre widżety mogą nie być przeznaczone do umieszczenia na ekranie blokady i ich dodanie w tym miejscu może być niebezpieczne."</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona zwijania"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona rozwijania"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"lub"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Nawiguj za pomocą klawiatury"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Dowiedz się więcej o skrótach klawiszowych"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Nawiguj za pomocą touchpada"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Poznaj gesty na touchpada"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Nawiguj za pomocą klawiatury i touchpada"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Poznaj gesty na touchpada, skróty klawiszowe i inne funkcje"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gest przejścia wstecz"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gest przejścia na ekran główny"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Klawisz działania"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Możesz teraz dodatkowo przyciemnić ekran, jeszcze bardziej zmniejszając poziom jasności u góry ekranu.\n\nTa funkcja sprawdza się najlepiej, gdy jesteś w ciemnym otoczeniu."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Usuń skrót do dodatkowego przyciemnienia"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Skrót do dodatkowego przyciemnienia został usunięty. Aby zmniejszyć jasność, użyj standardowego paska jasności."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings.xml b/packages/SystemUI/res/values-pt-rBR/strings.xml
index d5856af..1331ee6 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Incluir anotação"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Incluir link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Gravador de tela"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processando gravação de tela"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificação contínua para uma sessão de gravação de tela"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Protetor de tela"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Não perturbe"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modos"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Não há dispositivos pareados disponíveis"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Toque para conectar ou desconectar um dispositivo"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Abrir as Configurações"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Outro dispositivo"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Alternar Visão geral"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modos"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Concluído"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Configurações"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Ativado"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ícone \"Fechar\""</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ícone \"Abrir\""</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ou"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navegue usando o teclado"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Aprenda atalhos do teclado"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navegue usando o touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Aprenda gestos do touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navegue usando o teclado e o touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Aprenda gestos do touchpad, atalhos do teclado e muito mais"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gesto de volta"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gesto de início"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tecla de ação"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Agora, na parte de cima, é possível usar o recurso Escurecer a tela, que diminui ainda mais o nível de brilho.\n\nIsso funciona melhor quando você está em um ambiente escuro."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remover atalho de Escurecer a tela"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Atalho de Escurecer a tela removido. Use a barra normal para diminuir o brilho."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 6589b0f..e811fff 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Adicionar a uma nota"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Incluir link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Não é possível adicionar links de outros perfis"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Gravador de ecrã"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"A processar a gravação de ecrã"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificação persistente de uma sessão de gravação de ecrã"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Proteção ecrã"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Não incomodar"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modos"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Sem dispositivos sincronizados disponíveis"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Toque para associar ou desassociar um dispositivo"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Abrir definições"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Outro dispositivo"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Ativar/desativar Vista geral"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modos"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Concluir"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Definições"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Ativado"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ícone de reduzir"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ícone de expandir"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ou"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navegue com o teclado"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Aprenda atalhos de teclado"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navegue com o touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Aprenda gestos do touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navegue com o teclado e o touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Aprenda gestos do touchpad, atalhos de teclado e muito mais"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gesto para retroceder"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gesto para aceder ao ecrã principal"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tecla de ação"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Agora, pode tornar o ecrã ainda mais escuro reduzindo ainda mais o nível de brilho a partir da parte superior do ecrã.\n\nIsto funciona melhor quando está num ambiente escuro."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remover atalho do escurecimento extra"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Atalho do escurecimento extra removido. Para reduzir o brilho, use a barra do brilho normal."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index d5856af..1331ee6 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Incluir anotação"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Incluir link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Gravador de tela"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Processando gravação de tela"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificação contínua para uma sessão de gravação de tela"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Protetor de tela"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Não perturbe"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modos"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Não há dispositivos pareados disponíveis"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Toque para conectar ou desconectar um dispositivo"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Abrir as Configurações"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Outro dispositivo"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Alternar Visão geral"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modos"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Concluído"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Configurações"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Ativado"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ícone \"Fechar\""</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ícone \"Abrir\""</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ou"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navegue usando o teclado"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Aprenda atalhos do teclado"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navegue usando o touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Aprenda gestos do touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navegue usando o teclado e o touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Aprenda gestos do touchpad, atalhos do teclado e muito mais"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gesto de volta"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gesto de início"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tecla de ação"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Agora, na parte de cima, é possível usar o recurso Escurecer a tela, que diminui ainda mais o nível de brilho.\n\nIsso funciona melhor quando você está em um ambiente escuro."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Remover atalho de Escurecer a tela"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Atalho de Escurecer a tela removido. Use a barra normal para diminuir o brilho."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 59136e0..35d0025 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Adaugă în notă"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Include linkul"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Recorder pentru ecran"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Se procesează înregistrarea"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Notificare în curs pentru o sesiune de înregistrare a ecranului"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Screensaver"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Nu deranja"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Moduri"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Niciun dispozitiv conectat disponibil"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Atinge pentru a conecta sau deconecta un dispozitiv"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Deschide Setări"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Alt dispozitiv"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Comută secțiunea Recente"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Moduri"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Gata"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Setări"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Activat"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Pictograma de restrângere"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Pictograma de extindere"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"sau"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navighează folosind tastatura"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Învață comenzile rapide de la tastatură"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navighează folosind touchpadul"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Învață gesturi pentru touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navighează folosind tastatura și touchpadul"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Învață gesturi pentru touchpad, comenzi rapide de la tastatură și altele"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gestul Înapoi"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gestul Ecran de pornire"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tastă de acțiuni"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Poți reduce suplimentar luminozitatea ecranului dacă scazi nivelul de luminozitate din partea de sus a ecranului.\n\nAcest lucru funcționează cel mai bine într-un mediu întunecat."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Elimină comanda rapidă de luminozitate redusă suplimentar"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"S-a eliminat comanda rapidă de luminozitate redusă suplimentar. Ca să reduci luminozitatea, folosește bara obișnuită de luminozitate."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index de43676..2174dde 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Добавить в заметку"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Добавить ссылку"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Нельзя добавлять ссылки из других профилей."</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Запись видео с экрана"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Обработка записи с экрана…"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Текущее уведомление для записи видео с экрана"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Заставка"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Не беспокоить"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Режимы"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Нет доступных сопряженных устройств"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Нажмите, чтобы подключить или отключить устройство."</string>
@@ -301,7 +301,7 @@
<string name="see_all_bluetooth_devices" msgid="1761596816620200433">"Все"</string>
<string name="turn_on_bluetooth" msgid="5681370462180289071">"Использовать"</string>
<string name="quick_settings_bluetooth_device_connected" msgid="7884777006729260996">"Подключено"</string>
- <string name="quick_settings_bluetooth_device_audio_sharing" msgid="1496358082943301670">"Отправка аудио"</string>
+ <string name="quick_settings_bluetooth_device_audio_sharing" msgid="1496358082943301670">"Передача аудио"</string>
<string name="quick_settings_bluetooth_device_audio_sharing_or_switch_active" msgid="3227408556754456024">"Нажмите, чтобы переключить аудио или поделиться им"</string>
<string name="quick_settings_bluetooth_device_saved" msgid="7549938728928069477">"Сохранено"</string>
<string name="accessibility_quick_settings_bluetooth_device_tap_to_disconnect" msgid="415980329093277342">"отключить"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Открыть настройки"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Другое устройство"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Переключить режим обзора"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Режимы"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Готово"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Настройки"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Включено"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Значок \"Свернуть\""</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Значок \"Развернуть\""</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"или"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Навигация с помощью клавиатуры"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Узнайте о сочетаниях клавиш."</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Навигация с помощью сенсорной панели"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Узнайте о жестах на сенсорной панели."</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Навигация с помощью клавиатуры и сенсорной панели"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Узнайте о жестах на сенсорной панели, сочетаниях клавиш и многом другом."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Жест \"назад\""</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Жест \"на главный экран\""</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Клавиша действия"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Чтобы дополнительно понизить яркость экрана, откройте настройки в его верхней части.\n\nРекомендуем использовать эту функцию, когда вокруг темно."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Удалить быструю команду для дополнительного уменьшения яркости"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Быстрая команда для дополнительного уменьшения яркости удалена. Чтобы изменить уровень яркости, воспользуйтесь стандартным ползунком яркости."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-si/strings.xml b/packages/SystemUI/res/values-si/strings.xml
index 8d6cd09..167e9cd 100644
--- a/packages/SystemUI/res/values-si/strings.xml
+++ b/packages/SystemUI/res/values-si/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"සටහනට එක් කරන්න"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"සබැඳිය ඇතුළත් කරන්න"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"තිර රෙකෝඩරය"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"තිර පටිගත කිරීම සකසමින්"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"තිර පටිගත කිරීමේ සැසියක් සඳහා කෙරෙන දැනුම් දීම"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"තිර සුරැකුම"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ඊතර නෙට්"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"බාධා නොකරන්න"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"ප්රකාර"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"බ්ලූටූත්"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"යුගල කළ උපාංග නොතිබේ"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"උපාංගයක් සම්බන්ධ කිරීමට හෝ විසන්ධි කිරීමට තට්ටු කරන්න"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"සැකසීම් විවෘත කරන්න"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"වෙනත් උපාංගය"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"දළ විශ්ලේෂණය ටොගල කරන්න"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"ප්රකාර"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"නිමයි"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"සැකසීම්"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ක්රියාත්මකයි"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"හැකුළුම් නිරූපකය"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"දිගහැරීම් නිරූපකය"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"හෝ"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ඔබේ යතුරු පුවරුව භාවිතයෙන් සංචාලනය කරන්න"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"යතුරුපුවරු කෙටිමං ඉගෙන ගන්න"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ඔබේ ස්පර්ශ පෑඩ් භාවිතයෙන් සංචාලනය කරන්න"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ස්පර්ශක පුවරු අභිනයන් ඉගෙන ගන්න"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ඔබේ යතුරු පුවරුව සහ ස්පර්ශ පෑඩ් භාවිතයෙන් සංචාලනය කරන්න"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ස්පර්ශ පෑඩ් අභිනයන්, යතුරුපුවරු කෙටිමං සහ තවත් දේ ඉගෙන ගන්න"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ආපසු අභිනය"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"නිවෙස් අභිනය"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ක්රියා යතුර"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ඔබේ තිරයේ ඉහළ සිට දීප්තියේ මට්ටම තවත් අඩු කිරීමෙන් ඔබට දැන් තිරය තවත් අඳුරු කළ හැක.\n\nඔබ අඳුරු පරිසරයක සිටින විට මෙය වඩාත් හොඳින් ක්රියා කරයි."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"තවත් අඳුරු කෙටිමඟ ඉවත් කරන්න"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"තවත් අඳුරු කෙටිමඟ ඉවත් කරන ලදි. ඔබේ දීප්තිය අඩු කිරීමට, සාමාන්ය දීප්ත තීරුව භාවිත කරන්න."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 7159285..dd872c2 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Pridať do poznámky"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Zahrnúť odkaz"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Odkazy z iných profilov sa nedajú pridať"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Rekordér obrazovky"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Spracúva sa záznam obrazovky"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Zobrazuje sa upozornenie týkajúce sa relácie záznamu obrazovky"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Šetrič obrazovky"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Režim bez vyrušení"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Režimy"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nie sú k dispozícii žiadne spárované zariadenia"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Klepnutím pripojíte alebo odpojíte zariadenie"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Otvoriť Nastavenia"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Iné zariadenie"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Prepnúť prehľad"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Režimy"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Hotovo"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Nastavenia"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Zapnuté"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona zbalenia"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona rozbalenia"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"alebo"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Prechádzajte pomocou klávesnice"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Naučte sa klávesové skratky"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Prechádzajte pomocou touchpadu"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Naučte sa gestá touchpadu"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Prechádzajte pomocou klávesnice a touchpadu"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Naučte sa gestá touchpadu, klávesové skratky a ďalšie funkcie"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gesto prechodu späť"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gesto prechodu domov"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Akčný kláves"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Teraz môžete obrazovku mimoriadne stmaviť ešte ďalším znížením úrovne jasu v hornej časti obrazovky.\n\nNajlepšie to funguje v tmavom prostredí."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Odstrániť skratku mimoriadneho stmavenia"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Skratka mimoriadneho stmavenia bola odstránená. Ak chcete znížiť jas, použite bežný posúvač jasu."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index f2c466e..01ca4e5 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Dodaj v zapisek"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Vključi povezavo"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Povezav ni mogoče dodati iz drugih profilov"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Snemalnik zaslona"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Obdelava videoposnetka zaslona"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Nenehno obveščanje o seji snemanja zaslona"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Ohranjeval. zaslona"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ne moti"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Načini"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Na voljo ni nobene seznanjene naprave"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Dotaknite se za vzpostavitev ali prekinitev povezave z napravo"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Odpri nastavitve"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Druga naprava"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Vklop/izklop pregleda"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Načini"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Končano"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Nastavitve"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Vklopljeno"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona za strnitev"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona za razširitev"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ali"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Krmarjenje s tipkovnico"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Učenje bližnjičnih tipk"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Krmarjenje s sledilno ploščico"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Učenje potez na sledilni ploščici"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Krmarjenje s tipkovnico in sledilno ploščico"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Učenje potez na sledilni ploščici, bližnjičnih tipk in drugega"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Poteza za pomik nazaj"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Poteza za začetni zaslon"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Gumb za dejanje"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Zdaj lahko zelo zatemnite zaslon tako, da na vrhu zaslona dodatno zmanjšate raven svetlosti.\n\nTa funkcija najbolje deluje v temnem okolju."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Odstrani bližnjico do funkcije Zelo zatemnjeno"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Bližnjica do funkcije Zelo zatemnjeno je odstranjena. Če želite zmanjšati svetlost, uporabite običajno vrstico za uravnavanje svetlosti."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-sq/strings.xml b/packages/SystemUI/res/values-sq/strings.xml
index 70ea421..c4f8808 100644
--- a/packages/SystemUI/res/values-sq/strings.xml
+++ b/packages/SystemUI/res/values-sq/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Shto te shënimi"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Përfshi lidhjen"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Regjistruesi i ekranit"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Regjistrimi i ekranit po përpunohet"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Njoftim i vazhdueshëm për një seancë regjistrimi të ekranit"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Mbrojtësi i ekranit"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Eternet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Mos shqetëso"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modalitetet"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth-i"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Nuk ofrohet për përdorim asnjë pajisje e çiftuar"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Trokit për të lidhur ose shkëputur një pajisje"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Hap \"Cilësimet\""</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Pajisje tjetër"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Kalo te përmbledhja"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modalitetet"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"U krye"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Cilësimet"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Aktiv"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikona e palosjes"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikona e zgjerimit"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"ose"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigo duke përdorur tastierën tënde"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Mëso shkurtoret e tastierës"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigo duke përdorur bllokun me prekje"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Mëso gjestet e bllokut me prekje"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigo duke përdorur tastierën dhe bllokun me prekje"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Mëso gjestet e bllokut me prekje, shkurtoret e tastierës etj."</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Gjesti i kthimit prapa"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Gjesti për të shkuar tek ekrani bazë"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Tasti i veprimit"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Tani mund ta bësh ekranin shumë më të zbehtë duke e ulur nivelin e ndriçimit edhe më tej nga kreu i ekranit.\n\nKjo funksionon më mirë kur je në një mjedis të errët."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Hiq shkurtoren e modalitetit \"Shumë më i zbehtë\""</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Shkurtorja e modalitetit \"Shumë më i zbehtë\" u hoq. Për të ulur ndriçimin, përdor shiritin e zakonshëm të ndriçimit."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 6db372d..66a4915 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Додај у белешку"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Уврсти линк"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Не можете да додате линкове са других профила"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Снимач екрана"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Обрађујемо видео снимка екрана"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Обавештење о сесији снимања екрана је активно"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Чувар екрана"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Етернет"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Не узнемиравај"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Режими"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Није доступан ниједан упарени уређај"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Додирните да бисте повезали уређај или прекинули везу"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Отвори Подешавања"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Други уређај"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Укључи/искључи преглед"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Режими"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Готово"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Подешавања"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Укључено"</string>
@@ -488,7 +487,7 @@
<string name="cta_tile_button_to_dismiss" msgid="3377597875997861754">"Одбаци"</string>
<string name="cta_label_to_edit_widget" msgid="6496885074209203756">"Додајте, уклоните и преуредите виџете овде"</string>
<string name="cta_label_to_open_widget_picker" msgid="3874946756976360699">"Додајте још виџета"</string>
- <string name="popup_on_dismiss_cta_tile_text" msgid="8292501780996070019">"Дуги притисак за прилагођавање виџета"</string>
+ <string name="popup_on_dismiss_cta_tile_text" msgid="8292501780996070019">"Дуго притисните за прилагођавање виџета"</string>
<string name="button_to_configure_widgets_text" msgid="4191862850185256901">"Прилагоди виџете"</string>
<string name="unlock_reason_to_customize_widgets" msgid="5011909432460546033">"Откључајте да бисте прилагодили виџете"</string>
<string name="icon_description_for_disabled_widget" msgid="4693151565003206943">"Икона апликације за онемогућен виџет"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Икона за скупљање"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Икона за проширивање"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"или"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Крећите се помоћу тастатуре"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Сазнајте више о тастерским пречицама"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Крећите се помоћу тачпеда"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Научите покрете за тачпед"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Крећите се помоћу тастатуре и тачпeда"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Научите покрете за тачпед, тастерске пречице и друго"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Покрет за враћање"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Покрет за почетну страницу"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Тастер радњи"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Сада можете додатно да затамните екран смањивањем нивоа осветљености при врху екрана. \n\nОво најбоље функционише када сте у тамном окружењу."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Уклони пречицу за додатно затамњивање"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Уклоњена је пречица за додатно затамњивање. Да бисте смањили осветљеност, користите уобичајену траку за осветљеност."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 225e3b3..5ec9e96 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Lägg till i anteckning"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Inkludera länk"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Skärminspelare"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Behandlar skärminspelning"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Avisering om att skärminspelning pågår"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Skärmsläckare"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Stör ej"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Lägen"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Det finns inga kopplade enheter tillgängliga"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Tryck för att ansluta eller koppla från en enhet"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Öppna Inställningar"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Annan enhet"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Aktivera och inaktivera översikten"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Lägen"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Klar"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Inställningar"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"På"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Ikonen Komprimera"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Ikonen Utöka"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"eller"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Navigera med tangentbordet"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Lär dig kortkommandon"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Navigera med styrplattan"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Lär dig rörelser för styrplattan"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigera med tangentbordet och styrplattan"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Lär dig rörelser för styrplattan, kortkommandon med mera"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Tillbaka-rörelse"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Rörelse för att öppna startskärmen"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Åtgärdstangent"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Nu kan du göra skärmen extradimmad genom att sänka ljusstyrkan ännu mer från överst på skärmen.\n\nDetta fungerar bäst när omgivningen är mörk."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Ta bort kortkommandot för extradimmat"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Kortkommandot för extradimmat har tagits bort. Använd det vanliga fältet för ljusstyrka om du vill sänka ljusstyrkan."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 9fa8e55..ababf70 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Ongeza kwenye dokezo"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Jumuisha kiungo"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g> <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Kinasa Skrini"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Inachakata rekodi ya skrini"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Arifa inayoendelea ya kipindi cha kurekodi skrini"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Taswira ya skrini"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Usinisumbue"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Hali"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Hakuna vifaa vilivyooanishwa vinavyopatikana"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Gusa ili uunganishe au utenganishe kifaa"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Fungua Mipangilio"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Kifaa kingine"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Washa Muhtasari"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Hali"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Nimemaliza"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Mipangilio"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Imewashwa"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Kunja aikoni"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Panua aikoni"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"au"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Kusogeza kwa kutumia kibodi yako"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Jifunze kuhusu mikato ya kibodi"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Kusogeza kwa kutumia padi yako ya kugusa"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Jifunze kuhusu miguso ya padi ya kugusa"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Kusogeza kwa kutumia kibodi na padi yako ya kugusa"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Jifunze kuhusu miguso ya padi ya kugusa, mikato ya kibodi na mengineyo"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Ishara ya kurudi nyuma"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Mguso wa kurudi kwenye skrini ya kwanza"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Kitufe cha vitendo"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Sasa unaweza kupunguza mwangaza zaidi kwa kupunguza kabisa kiwango cha mwangaza katika sehemu ya juu ya skrini yako.\n\nMipangilio hii hufanya kazi vyema zaidi ukiwa katika mazingira yenye giza."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Ondoa njia ya mkato ya kipunguza mwangaza zaidi"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Njia ya mkato ya kipunguza mwangaza zaidi imeondolewa. Tumia upau wa kawaida wa mwangaza ili upunguze mwangaza wako."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index 7acd1e8..54ab3c3 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"குறிப்பில் சேர்"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"இணைப்பைச் சேர்"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"பிற சுயவிவர்ங்களில் இருந்து இணைப்புகளைச் சேர்க்க முடியாது"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"ஸ்கிரீன் ரெக்கார்டர்"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"ஸ்க்ரீன் ரெக்கார்டிங் செயலாக்கப்படுகிறது"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"திரை ரெக்கார்டிங் அமர்விற்கான தொடர் அறிவிப்பு"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ஸ்கிரீன் சேவர்"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ஈதர்நெட்"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"தொந்தரவு செய்ய வேண்டாம்"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"பயன்முறைகள்"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"புளூடூத்"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"இணைக்கப்பட்ட சாதனங்கள் இல்லை"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"சாதனத்தை இணைக்க/துண்டிக்க தட்டவும்"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"அமைப்புகளைத் திற"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"பிற சாதனம்"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"மேலோட்டப் பார்வையை நிலைமாற்று"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"பயன்முறைகள்"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"முடிந்தது"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"அமைப்புகள்"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"இயக்கப்பட்டுள்ளது"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"சுருக்குவதற்கான ஐகான்"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"விரிவாக்குவதற்கான ஐகான்"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"அல்லது"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"கீபோர்டைப் பயன்படுத்திச் செல்லுதல்"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"கீபோர்டு ஷார்ட்கட்கள் குறித்துத் தெரிந்துகொள்ளுங்கள்"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"டச்பேடைப் பயன்படுத்திச் செல்லுதல்"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"டச்பேட் சைகைள் குறித்துத் தெரிந்துகொள்ளுங்கள்"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"உங்கள் டச்பேட் மற்றும் கீபோர்டைப் பயன்படுத்திச் செல்லுதல்"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"டச்பேட் சைகைகள், கீபோர்டு ஷார்ட்கட்கள் மற்றும் பலவற்றைத் தெரிந்துகொள்ளுங்கள்"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"பின்செல்வதற்கான சைகை"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"முகப்பிற்குச் செல்வதற்கான சைகை"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ஆக்ஷன் பட்டன்"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"இப்போது உங்கள் திரையின் மேற்பகுதியில் ஒளிர்வு அளவைக் குறைப்பதன் மூலம் திரையை மிகக் குறைவான வெளிச்சத்திற்குக் கொண்டு வரலாம்.\n\nஇருட்டான சூழலில் இருக்கும்போது இது சிறப்பாகச் செயல்படும்."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"மிகக் குறைவான வெளிச்சத்திற்கான ஷார்ட்கட்டை அகற்று"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"மிகக் குறைவான வெளிச்சத்திற்கான ஷார்ட்கட் அகற்றப்பட்டது. உங்கள் ஒளிர்வைக் குறைக்க, வழக்கமான ஒளிர்வுப் பட்டியைப் பயன்படுத்துங்கள்."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index 5cba2ef..2c4109a 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"గమనికకు జోడించండి"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"లింక్ను చేర్చండి"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"ఇతర ప్రొఫైల్స్ నుండి లింక్లు జోడించబడవు"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"స్క్రీన్ రికార్డర్"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"స్క్రీన్ రికార్డింగ్ అవుతోంది"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"స్క్రీన్ రికార్డ్ సెషన్ కోసం ఆన్గోయింగ్ నోటిఫికేషన్"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"స్క్రీన్ సేవర్"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ఈథర్నెట్"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"అంతరాయం కలిగించవద్దు"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"మోడ్లు"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"బ్లూటూత్"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"జత చేసిన పరికరాలు ఏవీ అందుబాటులో లేవు"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"పరికరాన్ని కనెక్ట్ చేయడానికి లేదా డిస్కనెక్ట్ చేయడానికి ట్యాప్ చేయండి"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"సెట్టింగ్లను తెరవండి"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"ఇతర పరికరం"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"స్థూలదృష్టిని టోగుల్ చేయి"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"మోడ్లు"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"పూర్తయింది"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"సెట్టింగ్లు"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"ఆన్లో ఉంది"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"కుదించండి చిహ్నం"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"విస్తరించండి చిహ్నం"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"లేదా"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"మీ కీబోర్డ్ ఉపయోగించి నావిగేట్ చేయండి"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"కీబోర్డ్ షార్ట్కట్ల గురించి తెలుసుకోండి"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"మీ టచ్ప్యాడ్ని ఉపయోగించి నావిగేట్ చేయండి"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"టచ్ప్యాడ్ సంజ్ఞ గురించి తెలుసుకోండి"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"మీ కీబోర్డ్, టచ్ప్యాడ్ను ఉపయోగించి నావిగేట్ చేయండి"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"టచ్ప్యాడ్ సంజ్ఞలు, కీబోర్డ్ షార్ట్కట్లు, అలాగే మరిన్నింటిని గురించి తెలుసుకోండి"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"వెనుకకు పంపే సంజ్ఞ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"హోమ్కు పంపే సంజ్ఞ"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"యాక్షన్ కీ"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"మీరు ఇప్పుడు మీ స్క్రీన్ పైభాగం నుండి బ్రైట్నెస్ స్థాయిని తగ్గించడం ద్వారా కూడా స్క్రీన్ కాంతిని మరింత డిమ్ చేయవచ్చు.\n\nమీరు డార్క్ ఎన్విరాన్మెంట్లో ఉన్నప్పుడు కూడా ఇది బాగా పని చేస్తుంది."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"కాంతిని మరింత డిమ్ చేసే షార్ట్కట్ను తీసివేయండి"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"కాంతిని మరింత డిమ్ చేసే షార్ట్కట్ తీసివేయబడింది. మీ బ్రైట్నెస్ను తగ్గించడానికి, సాధారణ బ్రైట్నెస్ బార్ను ఉపయోగించండి."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 905ab98..20e730c 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"เพิ่มลงในโน้ต"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"รวมลิงก์"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"เพิ่มลิงก์จากโปรไฟล์อื่นไม่ได้"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"โปรแกรมบันทึกหน้าจอ"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"กำลังประมวลผลการอัดหน้าจอ"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"การแจ้งเตือนต่อเนื่องสำหรับเซสชันการบันทึกหน้าจอ"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"ภาพพักหน้าจอ"</string>
<string name="ethernet_label" msgid="2203544727007463351">"อีเทอร์เน็ต"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ห้ามรบกวน"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"โหมด"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"บลูทูธ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"ไม่มีอุปกรณ์ที่จับคู่ที่สามารถใช้ได้"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"แตะเพื่อเชื่อมต่อหรือยกเลิกการเชื่อมต่ออุปกรณ์"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"เปิดการตั้งค่า"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"อุปกรณ์อื่น"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"สลับภาพรวม"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"โหมด"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"เสร็จสิ้น"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"การตั้งค่า"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"เปิด"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"ไอคอนยุบ"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"ไอคอนขยาย"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"หรือ"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"ไปยังส่วนต่างๆ โดยใช้แป้นพิมพ์"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"ดูข้อมูลเกี่ยวกับแป้นพิมพ์ลัด"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"ไปยังส่วนต่างๆ โดยใช้ทัชแพด"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ดูข้อมูลเกี่ยวกับท่าทางสัมผัสของทัชแพด"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"ไปยังส่วนต่างๆ โดยใช้แป้นพิมพ์และทัชแพด"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ดูข้อมูลเกี่ยวกับท่าทางสัมผัสของทัชแพด แป้นพิมพ์ลัด และอื่นๆ"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"ท่าทางสัมผัสสำหรับย้อนกลับ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ท่าทางสัมผัสสำหรับหน้าแรก"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ปุ่มดำเนินการ"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"ตอนนี้คุณสามารถหรี่แสงหน้าจอเพิ่มเติมได้โดยลดระดับความสว่างจากด้านบนของหน้าจอมากขึ้น\n\nฟีเจอร์นี้จะทำงานได้ดีเมื่อคุณอยู่ในที่มืด"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"นำทางลัดหรี่แสงเพิ่มเติมออก"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"นำทางลัดหรี่แสงเพิ่มเติมออกแล้ว หากต้องการลดความสว่าง ให้ใช้แถบความสว่างปกติ"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 5e9d720..0bef743 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Idagdag sa tala"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Isama ang link"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"Hindi maidaragdag ang mga link mula sa ibang profile"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"Recorder ng Screen"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Pinoproseso screen recording"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Kasalukuyang notification para sa session ng pag-record ng screen"</string>
@@ -1391,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"I-collapse ang icon"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"I-expand ang icon"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"o"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Mag-navigate gamit ang iyong keyboard"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Matuto ng mga keyboard shortcut"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Mag-navigate gamit ang iyong touchpad"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Matuto ng mga galaw sa touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Mag-navigate gamit ang iyong keyboard at touchpad"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Matuto ng mga galaw sa touchpad, keyboard shortcut, at higit pa"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Galaw para bumalik"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Galaw para sa Home"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Action key"</string>
@@ -1442,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Puwede mo nang gawing extra dim ang screen sa pamamagitan ng pagpapababa ng level ng liwanag nang higit pa mula sa itaas ng iyong screen.\n\nPinakamahusay itong gumagana kapag nasa madilim na kapaligiran ka."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Alisin ang shortcut ng extra dim"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Inalis ang shortcut ng extra dim. Para bawasan ang liwanag, gamitin ang karaniwang bar ng liwanag."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index db49402..060ecd1 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Nota ekle"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Bağlantıyı dahil et"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Ekran Kaydedicisi"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Ekran kaydı işleniyor"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ekran kaydı oturumu için devam eden bildirim"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Ekran koruyucu"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Rahatsız Etmeyin"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Modlar"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Kullanılabilir eşlenmiş cihaz yok"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Cihaz bağlamak veya cihazın bağlantısını kesmek için dokunun"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Ayarlar\'ı aç"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Diğer cihaz"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Genel bakışı aç/kapat"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Modlar"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Bitti"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Ayarlar"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Açık"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Daralt simgesi"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Genişlet simgesi"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"veya"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Klavyenizi kullanarak gezinin"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Klavye kısayollarını öğrenin"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Dokunmatik alanınızı kullanarak gezinin"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Dokunmatik alan hareketlerini öğrenin"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Klavyenizi ve dokunmatik alanınızı kullanarak gezinin"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Dokunmatik alan hareketlerini, klavye kısayollarını ve daha fazlasını öğrenin"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Geri hareketi"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Ana sayfa hareketi"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Eylem tuşu"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Artık ekranınızın üst kısmından parlaklık seviyesini daha da düşürerek ekranı ekstra loş hale getirebilirsiniz.\n\nBu özellik, karanlık ortamdayken en iyi sonucu verir."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Ekstra loş kısayolunu kaldır"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Ekstra loş kısayolu kaldırıldı. Parlaklık seviyesini düşürmek için normal parlaklık çubuğunu kullanın."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 6d881df..ae07ae2 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Додати до примітки"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Додати посилання"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Запис відео з екрана"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Обробка записування екрана"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Сповіщення про сеанс запису екрана"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Заставка"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Не турбувати"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Режими"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Немає спарених пристроїв"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Натисніть, щоб під’єднати або від’єднати пристрій"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Відкрити налаштування"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Інший пристрій"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Увімкнути або вимкнути огляд"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Режими"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Готово"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Налаштування"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Увімкнено"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Значок згортання"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Значок розгортання"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"або"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Навігація за допомогою клавіатури"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Комбінації клавіш: докладніше"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Навігація за допомогою сенсорної панелі"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Жести для сенсорної панелі: докладніше"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Навігація за допомогою клавіатури й сенсорної панелі"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Жести для сенсорної панелі, комбінації клавіш тощо: докладніше"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Жест \"Назад\""</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Жест переходу на головний екран"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Клавіша дії"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Тепер ви можете зробити екран ще темнішим, додатково зменшуючи рівень яскравості вгорі екрана.\n\nНайкраще ця функція працює, коли ви перебуваєте в темному місці."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Видалити комбінацію клавіш для додаткового зменшення яскравості"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Комбінацію клавіш для додаткового зменшення яскравості видалено. Щоб зменшити яскравість, використовуйте стандартну панель регулювання."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-ur/strings.xml b/packages/SystemUI/res/values-ur/strings.xml
index 628d660..5d1f66e 100644
--- a/packages/SystemUI/res/values-ur/strings.xml
+++ b/packages/SystemUI/res/values-ur/strings.xml
@@ -105,6 +105,7 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"نوٹ میں شامل کریں"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"لنک شامل کریں"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <string name="backlinks_cross_profile_error" msgid="1355798585727802282">"دوسری پروفائلز سے لنکس شامل نہیں کیے جا سکتے"</string>
<string name="screenrecord_title" msgid="4257171601439507792">"اسکرین ریکارڈر"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"سکرین ریکارڈنگ پروسیس ہورہی ہے"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"اسکرین ریکارڈ سیشن کیلئے جاری اطلاع"</string>
@@ -292,8 +293,7 @@
<string name="start_dreams" msgid="9131802557946276718">"اسکرین سیور"</string>
<string name="ethernet_label" msgid="2203544727007463351">"ایتھرنیٹ"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"ڈسٹرب نہ کریں"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"موڈز"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"بلوٹوتھ"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"کوئی جوڑا بنائے ہوئے آلات دستیاب نہیں ہیں"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"کسی آلے کو منسلک یا غیر منسلک کرنے کے لیے تھپتھپائیں"</string>
@@ -434,8 +434,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"ترتیبات کھولیں"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"دوسرا آلہ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"مجموعی جائزہ ٹوگل کریں"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"موڈز"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"ہو گیا"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"ترتیبات"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"آن ہے"</string>
@@ -1393,18 +1392,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"آئیکن سکیڑیں"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"آئیکن پھیلائیں"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"یا"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"اپنے کی بورڈ کا استعمال کر کے نیویگیٹ کریں"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"کی بورڈ شارٹ کٹس جانیں"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"اپنے ٹچ پیڈ کا استعمال کر کے نیویگیٹ کریں"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"ٹچ پیڈ کے اشارے کو جانیں"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"اپنے کی بورڈ اور ٹچ پیڈ کا استعمال کر کے نیویگیٹ کریں"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"ٹچ پیڈ کے اشارے، کی بورڈ شارٹ کٹس اور مزید جانیں"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"پیچھے جانے کا اشارہ"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"ہوم کا اشارہ"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"ایکشن کلید"</string>
@@ -1444,4 +1437,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"آپ اپنی اسکرین کے اوپری حصے سے چمکیلے پن لیول کو مزید کم کر کے اپنی اسکرین کو اضافی دھندلی بنا سکتے ہیں۔\n\nجب آپ تاریک ماحول میں ہوتے ہیں تو یہ بہتر کام کرتا ہے۔"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"اضافی دھندلا شارٹ کٹ کو ہٹائیں"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"اضافی دھندلا شارٹ کٹ کو ہٹا دیا گیا۔ اپنا چمکیلا پن کم کرنے کیلئے، ریگولر چمک بار کا استعمال کریں"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index f0988ed..af35adf 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Qaydga qoʻshish"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Havolani kiritish"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g>, <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Ekranni yozib olish"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Ekran yozib olinmoqda"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Ekrandan yozib olish seansi uchun joriy bildirishnoma"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Ekran lavhasi"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Bezovta qilinmasin"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Rejimlar"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Ulangan qurilmalar topilmadi"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Qurilma ulash yoki uzish uchun tegining"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Sozlamalarni ochish"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Boshqa qurilma"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Umumiy nazar rejimini almashtirish"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Rejimlar"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Tayyor"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Sozlamalar"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Yoniq"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Yigʻish belgisi"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Yoyish belgisi"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"yoki"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Klaviatura yordamida kezing"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Tezkor tugmalar haqida"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Sensorli panel yordamida kezing"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Sensorli panel ishoralari haqida"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Klaviatura va sensorli panel yordamida kezing"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Sensorli panel ishoralari, tezkor tugmalar va boshqalar haqida"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Orqaga qaytish ishorasi"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Asosiy ekran ishorasi"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Amal tugmasi"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Endi yorqinlik darajasini ekranning yuqori qismidan yanada pasaytirish orqali ekranni yanada xiralashtirishingiz mumkin.\n\nBu qorongʻi muhitda eng yaxshi ishlaydi."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Juda xira yorligʻini olib tashlash"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Juda xira yorligʻi olib tashlandi. Yorqinlikni pasaytirish uchun oddiy yorqinlik panelidan foydalaning."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 6ad5db4..b7cd6b0 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Thêm vào ghi chú"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Thêm đường liên kết"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Trình ghi màn hình"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Đang xử lý video ghi màn hình"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Thông báo đang diễn ra về phiên ghi màn hình"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Trình bảo vệ m.hình"</string>
<string name="ethernet_label" msgid="2203544727007463351">"Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Không làm phiền"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Chế độ"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Không có thiết bị nào được ghép nối"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Nhấn để kết nối/ngắt kết nối với một thiết bị"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Mở phần Cài đặt"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Thiết bị khác"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Bật/tắt chế độ xem Tổng quan"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Chế độ"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Xong"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Cài đặt"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Đang bật"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Biểu tượng Thu gọn"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Biểu tượng Mở rộng"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"hoặc"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Di chuyển bằng bàn phím"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Tìm hiểu về phím tắt"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Di chuyển bằng bàn di chuột"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Tìm hiểu về cử chỉ trên bàn di chuột"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Di chuyển bằng bàn phím và bàn di chuột"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Tìm hiểu về cử chỉ trên bàn di chuột, phím tắt và nhiều mục khác"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Cử chỉ quay lại"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Cử chỉ chuyển đến màn hình chính"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Phím hành động"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Giờ đây, bạn có thể đặt màn hình ở chế độ siêu tối bằng cách giảm thêm độ sáng từ đầu màn hình.\n\nChế độ này hoạt động hiệu quả nhất khi bạn ở trong một môi trường tối."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Xoá lối tắt của chế độ siêu tối"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Đã xoá lối tắt của chế độ siêu tối. Để giảm độ sáng, hãy dùng thanh độ sáng như thông thường."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 35f8851..a329965 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"添加到备注中"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"包括链接"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"屏幕录制器"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"正在处理屏幕录制视频"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"持续显示屏幕录制会话通知"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"屏保"</string>
<string name="ethernet_label" msgid="2203544727007463351">"有线网络"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"勿扰"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"模式"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"蓝牙"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"没有可用的配对设备"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"点按即可连接设备或断开设备连接"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"打开“设置”"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"其他设备"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"切换概览"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"模式"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"完成"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"设置"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"已开启"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"收起图标"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"展开图标"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"或"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"使用键盘导航"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"了解键盘快捷键"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"使用触控板导航"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"了解触控板手势"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"使用键盘和触控板进行导航"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"了解触控板手势、键盘快捷键等"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"返回手势"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"主屏幕手势"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"快捷操作按键"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"现在,您可从屏幕顶部进一步调低亮度,将屏幕调成极暗。\n\n此功能在昏暗环境中效果最佳。"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"移除“极暗”快捷方式"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"已移除“极暗”快捷方式。如要调低亮度,请使用常规亮度条。"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index 359b3cc..73bfbe6c 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"新增至筆記"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"加入連結"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"螢幕錄影機"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"正在處理螢幕錄影內容"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"持續顯示錄影畫面工作階段通知"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"螢幕保護程式"</string>
<string name="ethernet_label" msgid="2203544727007463351">"以太網"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"請勿騷擾"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"模式"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"藍牙"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"找不到配對的裝置"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"輕按即可連結或解除連結裝置"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"開啟「設定」"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"其他裝置"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"切換概覽"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"模式"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"完成"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"設定"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"開啟"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"收合圖示"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"展開圖示"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"或"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"使用鍵盤導覽"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"瞭解鍵盤快速鍵"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"使用觸控板導覽"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"瞭解觸控板手勢"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"使用鍵盤和觸控板導覽"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"瞭解觸控板手勢、鍵盤快速鍵等等"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"返去手勢"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"主畫面手勢"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"快捷操作鍵"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"而家喺螢幕頂部進一步校低亮度,就可以令螢幕變得超暗\n\n呢個功能喺陰暗環境之下嘅效果最好"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"移除超暗功能快速鍵"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"超暗功能快速鍵已移除。如要降低亮度,請使用一般的亮度列。"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 63b19d6b..46847fc 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"新增至記事本"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"包含連結"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"螢幕錄影器"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"處理螢幕錄影內容"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"持續顯示螢幕畫面錄製工作階段通知"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"螢幕保護程式"</string>
<string name="ethernet_label" msgid="2203544727007463351">"乙太網路"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"零打擾"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"模式"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"藍牙"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"找不到配對的裝置"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"輕觸即可連結/取消連結裝置"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"開啟「設定」"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"其他裝置"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"切換總覽"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"模式"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"完成"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"設定"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"開啟"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"收合圖示"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"展開圖示"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"或"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"使用鍵盤操作"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"學習鍵盤快速鍵"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"使用觸控板操作"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"學習觸控板手勢"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"使用鍵盤和觸控板操作"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"學習觸控板手勢、鍵盤快速鍵等"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"返回手勢"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"主畫面手勢"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"快捷操作鍵"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"現在只要在螢幕頂端將亮度設定調得更低,就能讓螢幕變得更暗。\n\n這項設定最適合在昏暗環境下使用。"</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"移除「超暗」捷徑"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"「超暗」捷徑已移除。如要調低亮度,請使用一般的亮度列。"</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index 048cb01..dbfb926 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -105,6 +105,8 @@
<string name="app_clips_save_add_to_note" msgid="3460200751278069445">"Engeza kunothi"</string>
<string name="backlinks_include_link" msgid="4562093591148248158">"Faka ilinki"</string>
<string name="backlinks_duplicate_label_format" msgid="558445128952827926">"<xliff:g id="APPNAME">%1$s</xliff:g> <xliff:g id="FREQUENCYCOUNT">(%2$d)</xliff:g>"</string>
+ <!-- no translation found for backlinks_cross_profile_error (1355798585727802282) -->
+ <skip />
<string name="screenrecord_title" msgid="4257171601439507792">"Okokuqopha iskrini"</string>
<string name="screenrecord_background_processing_label" msgid="7244617554884238898">"Icubungula okokuqopha iskrini"</string>
<string name="screenrecord_channel_description" msgid="4147077128486138351">"Isaziso esiqhubekayo seseshini yokurekhoda isikrini"</string>
@@ -292,8 +294,7 @@
<string name="start_dreams" msgid="9131802557946276718">"Isigciniskrini"</string>
<string name="ethernet_label" msgid="2203544727007463351">"I-Ethernet"</string>
<string name="quick_settings_dnd_label" msgid="7728690179108024338">"Ungaphazamisi"</string>
- <!-- no translation found for quick_settings_modes_label (879156359479504244) -->
- <skip />
+ <string name="quick_settings_modes_label" msgid="879156359479504244">"Amamodi"</string>
<string name="quick_settings_bluetooth_label" msgid="7018763367142041481">"I-Bluetooth"</string>
<string name="quick_settings_bluetooth_detail_empty_text" msgid="5760239584390514322">"Awekho amadivayisi abhanqiwe atholakalayo"</string>
<string name="quick_settings_bluetooth_tile_subtitle" msgid="212752719010829550">"Thepha ukuze uxhumae noma ungaxhumi idivaysi"</string>
@@ -434,8 +435,7 @@
<string name="sensor_privacy_dialog_open_settings" msgid="5635865896053011859">"Vula Amasethingi"</string>
<string name="media_seamless_other_device" msgid="4654849800789196737">"Enye idivayisi"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Guqula ukubuka konke"</string>
- <!-- no translation found for zen_modes_dialog_title (8854640808100096934) -->
- <skip />
+ <string name="zen_modes_dialog_title" msgid="8854640808100096934">"Amamodi"</string>
<string name="zen_modes_dialog_done" msgid="6654130880256438950">"Kwenziwe"</string>
<string name="zen_modes_dialog_settings" msgid="2310248023728936697">"Amasethingi"</string>
<string name="zen_mode_on" msgid="9085304934016242591">"Vuliwe"</string>
@@ -1393,18 +1393,12 @@
<string name="shortcut_helper_content_description_collapse_icon" msgid="8028015738431664954">"Goqa isithonjana"</string>
<string name="shortcut_helper_content_description_expand_icon" msgid="1084435697860417390">"Nweba isithonjana"</string>
<string name="shortcut_helper_key_combinations_or_separator" msgid="7082902112102125540">"noma"</string>
- <!-- no translation found for launch_keyboard_tutorial_notification_title (8849933155160522519) -->
- <skip />
- <!-- no translation found for launch_keyboard_tutorial_notification_content (2880339951512757918) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_title (2243780062772196901) -->
- <skip />
- <!-- no translation found for launch_touchpad_tutorial_notification_content (7931085031240753226) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_title (1940023776496198762) -->
- <skip />
- <!-- no translation found for launch_keyboard_touchpad_tutorial_notification_content (1780725168171929365) -->
- <skip />
+ <string name="launch_keyboard_tutorial_notification_title" msgid="8849933155160522519">"Funa usebenzisa ikhibhodi yakho"</string>
+ <string name="launch_keyboard_tutorial_notification_content" msgid="2880339951512757918">"Funda izinqamuleli zamakhibhodi"</string>
+ <string name="launch_touchpad_tutorial_notification_title" msgid="2243780062772196901">"Funa usebenzisa iphedi yokuthinta"</string>
+ <string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Funda ukunyakaza kwephedi lokuthinta"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Funa usebenzisa ikhibhodi yakho nephedi yokuthinta"</string>
+ <string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Funda ukunyakaza kwephedi yokuthinta, izinqamuleli zamakhibhodi, nokuningi"</string>
<string name="touchpad_tutorial_back_gesture_button" msgid="2746834288077265946">"Ukunyakazisa umzimba kwangemuva"</string>
<string name="touchpad_tutorial_home_gesture_button" msgid="7640544867625955304">"Ukunyakazisa umzimba kwasekhaya"</string>
<string name="touchpad_tutorial_action_key_button" msgid="3220074511852927267">"Inkinobho yokufinyelela"</string>
@@ -1444,4 +1438,18 @@
<string name="accessibility_deprecate_extra_dim_dialog_description" msgid="7513137763024327538">"Manje ungenza isikrini sifiphale ngokwengeziwe ngokwehlisa izinga lokukhanya nakakhulu kusukela phezulu kwesikrini sakho.\n\nLokhu kusebenza kahle kakhulu uma usendaweni emnyama."</string>
<string name="accessibility_deprecate_extra_dim_dialog_button" msgid="1782147201534669800">"Susa isinqamuleli esifiphele esengeziwe"</string>
<string name="accessibility_deprecate_extra_dim_dialog_toast" msgid="4070696910424515757">"Isinqamuleli esifiphele ngokwengeziwe sikhishiwe. Ukuze wehlise ukukhanya kwakho, sebenzisa ibha yokukhanya evamile."</string>
+ <!-- no translation found for qs_edit_mode_category_connectivity (4559726936546032672) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_accessibility (7969091385071475922) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_utilities (8123080090108420095) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_privacy (6577774443194551775) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_providedByApps (8346112074897919019) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_display (4749511439121053942) -->
+ <skip />
+ <!-- no translation found for qs_edit_mode_category_unknown (509314252124053550) -->
+ <skip />
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 141d035..e1808fa 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -2002,10 +2002,10 @@
<!-- Shadow for dream overlay status bar complications -->
<dimen name="dream_overlay_status_bar_key_text_shadow_dx">0.5dp</dimen>
<dimen name="dream_overlay_status_bar_key_text_shadow_dy">0.5dp</dimen>
- <dimen name="dream_overlay_status_bar_key_text_shadow_radius">1dp</dimen>
+ <dimen name="dream_overlay_status_bar_key_text_shadow_radius">3dp</dimen>
<dimen name="dream_overlay_status_bar_ambient_text_shadow_dx">0.5dp</dimen>
<dimen name="dream_overlay_status_bar_ambient_text_shadow_dy">0.5dp</dimen>
- <dimen name="dream_overlay_status_bar_ambient_text_shadow_radius">2dp</dimen>
+ <dimen name="dream_overlay_status_bar_ambient_text_shadow_radius">3dp</dimen>
<dimen name="dream_overlay_icon_inset_dimen">0dp</dimen>
<!-- Default device corner radius, used for assist UI -->
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 1fb1dad..589d9dd 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -3812,4 +3812,33 @@
<!-- Toast message for notifying users to use regular brightness bar to lower the brightness. [CHAR LIMIT=NONE] -->
<string name="accessibility_deprecate_extra_dim_dialog_toast">
Extra dim shortcut removed. To lower your brightness, use the regular brightness bar.</string>
+
+ <!-- Label for category in QS Edit mode list of tiles, for tiles that are related to connectivity, e.g. Internet. [CHAR LIMIT=NONE] -->
+ <string name="qs_edit_mode_category_connectivity">
+ Connectivity
+ </string>
+ <!-- Label for category in QS Edit mode list of tiles, for tiles that are related to accessibility functions, e.g. Hearing devices. [CHAR LIMIT=NONE] -->
+ <string name="qs_edit_mode_category_accessibility">
+ Accessibility
+ </string>
+ <!-- Label for category in QS Edit mode list of tiles, for tiles that are related to general utilities, e.g. Flashlight. [CHAR LIMIT=NONE] -->
+ <string name="qs_edit_mode_category_utilities">
+ Utilities
+ </string>
+ <!-- Label for category in QS Edit mode list of tiles, for tiles that are related to privacy, e.g. Mic access. [CHAR LIMIT=NONE] -->
+ <string name="qs_edit_mode_category_privacy">
+ Privacy
+ </string>
+ <!-- Label for category in QS Edit mode list of tiles, for tiles that are provided by an app, e.g. Calculator. [CHAR LIMIT=NONE] -->
+ <string name="qs_edit_mode_category_providedByApps">
+ Provided by apps
+ </string>
+ <!-- Label for category in QS Edit mode list of tiles, for tiles that are related to the display, e.g. Dark theme. [CHAR LIMIT=NONE] -->
+ <string name="qs_edit_mode_category_display">
+ Display
+ </string>
+ <!-- Label for category in QS Edit mode list of tiles, for tiles with an unknown category. [CHAR LIMIT=NONE] -->
+ <string name="qs_edit_mode_category_unknown">
+ Unknown
+ </string>
</resources>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/dagger/qualifiers/DisplaySpecific.kt b/packages/SystemUI/shared/src/com/android/systemui/dagger/qualifiers/DisplaySpecific.kt
index 57a49c8..3e39ae9 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/dagger/qualifiers/DisplaySpecific.kt
+++ b/packages/SystemUI/shared/src/com/android/systemui/dagger/qualifiers/DisplaySpecific.kt
@@ -15,10 +15,7 @@
*/
package com.android.systemui.dagger.qualifiers
-import java.lang.annotation.Documented
-import java.lang.annotation.Retention
-import java.lang.annotation.RetentionPolicy.RUNTIME
import javax.inject.Qualifier
/** Annotates a class that is display specific. */
-@Qualifier @Documented @Retention(RUNTIME) annotation class DisplaySpecific
+@Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class DisplaySpecific
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl
index c00007b..283e455 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl
@@ -132,4 +132,9 @@
* Sent when {@link TaskbarDelegate#transitionTo} is called.
*/
void transitionTo(int barMode, boolean animate) = 33;
+
+ /**
+ * Sent when {@link TaskbarDelegate#appTransitionPending} is called.
+ */
+ void appTransitionPending(boolean pending) = 34;
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/RecentsTransition.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/RecentsTransition.java
index b8319e5..c8de9f6 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/RecentsTransition.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/RecentsTransition.java
@@ -36,36 +36,6 @@
public class RecentsTransition {
/**
- * Creates a new transition aspect scaled transition activity options.
- */
- public static ActivityOptions createAspectScaleAnimation(Context context, Handler handler,
- boolean scaleUp, AppTransitionAnimationSpecsFuture animationSpecsFuture,
- final Runnable animationStartCallback) {
- final OnAnimationStartedListener animStartedListener = new OnAnimationStartedListener() {
- private boolean mHandled;
-
- @Override
- public void onAnimationStarted(long elapsedRealTime) {
- // OnAnimationStartedListener can be called numerous times, so debounce here to
- // prevent multiple callbacks
- if (mHandled) {
- return;
- }
- mHandled = true;
-
- if (animationStartCallback != null) {
- animationStartCallback.run();
- }
- }
- };
- final ActivityOptions opts = ActivityOptions.makeMultiThumbFutureAspectScaleAnimation(
- context, handler,
- animationSpecsFuture != null ? animationSpecsFuture.getFuture() : null,
- animStartedListener, scaleUp);
- return opts;
- }
-
- /**
* Wraps a animation-start callback in a binder that can be called from window manager.
*/
public static IRemoteCallback wrapStartedListener(final Handler handler,
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
index bbf4698..76af813 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
@@ -18,13 +18,13 @@
import android.os.RemoteException;
import android.util.Log;
-import android.view.IRecentsAnimationController;
import android.view.SurfaceControl;
import android.window.PictureInPictureSurfaceTransaction;
import android.window.TaskSnapshot;
import com.android.internal.os.IResultReceiver;
import com.android.systemui.shared.recents.model.ThumbnailData;
+import com.android.wm.shell.recents.IRecentsAnimationController;
public class RecentsAnimationControllerCompat {
@@ -58,14 +58,6 @@
}
}
- public void setAnimationTargetsBehindSystemBars(boolean behindSystemBars) {
- try {
- mAnimationController.setAnimationTargetsBehindSystemBars(behindSystemBars);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to set whether animation targets are behind system bars", e);
- }
- }
-
/**
* Sets the final surface transaction on a Task. This is used by Launcher to notify the system
* that animating Activity to PiP has completed and the associated task surface should be
@@ -103,22 +95,6 @@
}
}
- public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) {
- try {
- mAnimationController.setDeferCancelUntilNextTransition(defer, screenshot);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to set deferred cancel with screenshot", e);
- }
- }
-
- public void cleanupScreenshot() {
- try {
- mAnimationController.cleanupScreenshot();
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to clean up screenshot of recents animation", e);
- }
- }
-
/**
* @see {{@link IRecentsAnimationController#setWillFinishToHome(boolean)}}.
*/
@@ -131,18 +107,6 @@
}
/**
- * @see IRecentsAnimationController#removeTask
- */
- public boolean removeTask(int taskId) {
- try {
- return mAnimationController.removeTask(taskId);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to remove remote animation target", e);
- return false;
- }
- }
-
- /**
* @see IRecentsAnimationController#detachNavigationBarFromApp
*/
public void detachNavigationBarFromApp(boolean moveHomeToTop) {
@@ -152,15 +116,4 @@
Log.e(TAG, "Failed to detach the navigation bar from app", e);
}
}
-
- /**
- * @see IRecentsAnimationController#animateNavigationBarToApp(long)
- */
- public void animateNavigationBarToApp(long duration) {
- try {
- mAnimationController.animateNavigationBarToApp(duration);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to animate the navigation bar to app", e);
- }
- }
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
index 2407350..51892aa 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
@@ -42,14 +42,4 @@
* was running becomes ready for control.
*/
void onTasksAppeared(RemoteAnimationTarget[] app);
-
- /**
- * Called to request that the current task tile be switched out for a screenshot (if not
- * already). Once complete, onFinished should be called.
- * @return true if this impl will call onFinished. No other onSwitchToScreenshot impls will
- * be called afterwards (to avoid multiple calls to onFinished).
- */
- default boolean onSwitchToScreenshot(Runnable onFinished) {
- return false;
- }
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index 28f1381..b43d8b6 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -19,10 +19,8 @@
import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL;
import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL_UNLOCKED;
import static com.android.keyguard.KeyguardAbsKeyInputView.MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT;
-import static com.android.systemui.Flags.msdlFeedback;
import static com.android.systemui.Flags.notifyPasswordTextViewUserActivityInBackground;
-import android.annotation.Nullable;
import android.content.res.ColorStateList;
import android.os.AsyncTask;
import android.os.CountDownTimer;
@@ -37,15 +35,13 @@
import com.android.keyguard.EmergencyButtonController.EmergencyButtonCallback;
import com.android.keyguard.KeyguardAbsKeyInputView.KeyDownListener;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingClassifier;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.res.R;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
-import com.google.android.msdl.data.model.MSDLToken;
-import com.google.android.msdl.domain.MSDLPlayer;
-
import java.util.HashMap;
import java.util.Map;
@@ -62,8 +58,6 @@
protected AsyncTask<?, ?, ?> mPendingLockCheck;
protected boolean mResumed;
protected boolean mLockedOut;
- @Nullable
- protected MSDLPlayer mMSDLPlayer;
private final KeyDownListener mKeyDownListener = (keyCode, keyEvent) -> {
// Fingerprint sensor sends a KeyEvent.KEYCODE_UNKNOWN.
@@ -91,16 +85,16 @@
LatencyTracker latencyTracker, FalsingCollector falsingCollector,
EmergencyButtonController emergencyButtonController,
FeatureFlags featureFlags, SelectedUserInteractor selectedUserInteractor,
- @Nullable MSDLPlayer msdlPlayer,
+ BouncerHapticPlayer bouncerHapticPlayer,
UserActivityNotifier userActivityNotifier) {
super(view, securityMode, keyguardSecurityCallback, emergencyButtonController,
- messageAreaControllerFactory, featureFlags, selectedUserInteractor);
+ messageAreaControllerFactory, featureFlags, selectedUserInteractor,
+ bouncerHapticPlayer);
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mLockPatternUtils = lockPatternUtils;
mLatencyTracker = latencyTracker;
mFalsingCollector = falsingCollector;
mEmergencyButtonController = emergencyButtonController;
- mMSDLPlayer = msdlPlayer;
mUserActivityNotifier = userActivityNotifier;
}
@@ -191,7 +185,9 @@
void onPasswordChecked(int userId, boolean matched, int timeoutMs, boolean isValidPassword) {
boolean dismissKeyguard = mSelectedUserInteractor.getSelectedUserId() == userId;
if (matched) {
- playAuthenticationHaptics(/* unlock= */true);
+ mBouncerHapticPlayer.playAuthenticationFeedback(
+ /* authenticationSucceeded = */true
+ );
getKeyguardSecurityCallback().reportUnlockAttempt(userId, true, 0);
if (dismissKeyguard) {
mDismissing = true;
@@ -199,7 +195,9 @@
getKeyguardSecurityCallback().dismiss(true, userId, getSecurityMode());
}
} else {
- playAuthenticationHaptics(/* unlock= */false);
+ mBouncerHapticPlayer.playAuthenticationFeedback(
+ /* authenticationSucceeded = */false
+ );
mView.resetPasswordText(true /* animate */, false /* announce deletion if no match */);
if (isValidPassword) {
getKeyguardSecurityCallback().reportUnlockAttempt(userId, false, timeoutMs);
@@ -216,18 +214,6 @@
}
}
- private void playAuthenticationHaptics(boolean unlock) {
- if (!msdlFeedback() || mMSDLPlayer == null) return;
-
- MSDLToken token;
- if (unlock) {
- token = MSDLToken.UNLOCK;
- } else {
- token = MSDLToken.FAILURE;
- }
- mMSDLPlayer.playToken(token, mAuthInteractionProperties);
- }
-
protected void startErrorAnimation() { /* no-op */ }
protected void verifyPasswordAndUnlock() {
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
index dd84bc6..ff78848 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
@@ -35,6 +35,7 @@
import com.android.systemui.bouncer.domain.interactor.BouncerMessageInteractor;
import com.android.systemui.bouncer.ui.BouncerMessageView;
import com.android.systemui.bouncer.ui.binder.BouncerMessageViewBinder;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.flags.FeatureFlags;
@@ -45,9 +46,6 @@
import com.android.systemui.util.ViewController;
import com.android.systemui.util.concurrency.DelayableExecutor;
-import com.google.android.msdl.domain.InteractionProperties;
-import com.google.android.msdl.domain.MSDLPlayer;
-
import javax.inject.Inject;
/** Controller for a {@link KeyguardSecurityView}. */
@@ -66,21 +64,22 @@
private KeyguardSecurityCallback mNullCallback = new KeyguardSecurityCallback() {};
private final FeatureFlags mFeatureFlags;
protected final SelectedUserInteractor mSelectedUserInteractor;
- protected final InteractionProperties mAuthInteractionProperties =
- new AuthInteractionProperties();
+ protected final BouncerHapticPlayer mBouncerHapticPlayer;
protected KeyguardInputViewController(T view, SecurityMode securityMode,
KeyguardSecurityCallback keyguardSecurityCallback,
EmergencyButtonController emergencyButtonController,
@Nullable KeyguardMessageAreaController.Factory messageAreaControllerFactory,
FeatureFlags featureFlags,
- SelectedUserInteractor selectedUserInteractor) {
+ SelectedUserInteractor selectedUserInteractor,
+ BouncerHapticPlayer bouncerHapticPlayer) {
super(view);
mSecurityMode = securityMode;
mKeyguardSecurityCallback = keyguardSecurityCallback;
mEmergencyButtonController = emergencyButtonController;
mFeatureFlags = featureFlags;
mSelectedUserInteractor = selectedUserInteractor;
+ mBouncerHapticPlayer = bouncerHapticPlayer;
if (messageAreaControllerFactory != null) {
try {
BouncerKeyguardMessageArea kma = view.requireViewById(R.id.bouncer_message_area);
@@ -219,7 +218,7 @@
private final SelectedUserInteractor mSelectedUserInteractor;
private final UiEventLogger mUiEventLogger;
private final KeyguardKeyboardInteractor mKeyguardKeyboardInteractor;
- private final MSDLPlayer mMSDLPlayer;
+ private final BouncerHapticPlayer mBouncerHapticPlayer;
private final UserActivityNotifier mUserActivityNotifier;
@Inject
@@ -236,7 +235,7 @@
FeatureFlags featureFlags, SelectedUserInteractor selectedUserInteractor,
UiEventLogger uiEventLogger,
KeyguardKeyboardInteractor keyguardKeyboardInteractor,
- MSDLPlayer msdlPlayer,
+ BouncerHapticPlayer bouncerHapticPlayer,
UserActivityNotifier userActivityNotifier) {
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mLockPatternUtils = lockPatternUtils;
@@ -255,7 +254,7 @@
mSelectedUserInteractor = selectedUserInteractor;
mUiEventLogger = uiEventLogger;
mKeyguardKeyboardInteractor = keyguardKeyboardInteractor;
- mMSDLPlayer = msdlPlayer;
+ mBouncerHapticPlayer = bouncerHapticPlayer;
mUserActivityNotifier = userActivityNotifier;
}
@@ -271,7 +270,8 @@
mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
keyguardSecurityCallback, mLatencyTracker, mFalsingCollector,
emergencyButtonController, mMessageAreaControllerFactory,
- mDevicePostureController, mFeatureFlags, mSelectedUserInteractor);
+ mDevicePostureController, mFeatureFlags, mSelectedUserInteractor,
+ mBouncerHapticPlayer);
} else if (keyguardInputView instanceof KeyguardPasswordView) {
return new KeyguardPasswordViewController((KeyguardPasswordView) keyguardInputView,
mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
@@ -279,14 +279,14 @@
mInputMethodManager, emergencyButtonController, mMainExecutor, mResources,
mFalsingCollector, mKeyguardViewController,
mDevicePostureController, mFeatureFlags, mSelectedUserInteractor,
- mKeyguardKeyboardInteractor, mMSDLPlayer, mUserActivityNotifier);
+ mKeyguardKeyboardInteractor, mBouncerHapticPlayer, mUserActivityNotifier);
} else if (keyguardInputView instanceof KeyguardPINView) {
return new KeyguardPinViewController((KeyguardPINView) keyguardInputView,
mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
mLiftToActivateListener, emergencyButtonController, mFalsingCollector,
mDevicePostureController, mFeatureFlags, mSelectedUserInteractor,
- mUiEventLogger, mKeyguardKeyboardInteractor, mMSDLPlayer,
+ mUiEventLogger, mKeyguardKeyboardInteractor, mBouncerHapticPlayer,
mUserActivityNotifier);
} else if (keyguardInputView instanceof KeyguardSimPinView) {
return new KeyguardSimPinViewController((KeyguardSimPinView) keyguardInputView,
@@ -294,14 +294,14 @@
keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
mLiftToActivateListener, mTelephonyManager, mFalsingCollector,
emergencyButtonController, mFeatureFlags, mSelectedUserInteractor,
- mKeyguardKeyboardInteractor, mMSDLPlayer, mUserActivityNotifier);
+ mKeyguardKeyboardInteractor, mBouncerHapticPlayer, mUserActivityNotifier);
} else if (keyguardInputView instanceof KeyguardSimPukView) {
return new KeyguardSimPukViewController((KeyguardSimPukView) keyguardInputView,
mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
mLiftToActivateListener, mTelephonyManager, mFalsingCollector,
emergencyButtonController, mFeatureFlags, mSelectedUserInteractor,
- mKeyguardKeyboardInteractor, mMSDLPlayer, mUserActivityNotifier
+ mKeyguardKeyboardInteractor, mBouncerHapticPlayer, mUserActivityNotifier
);
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
index 905fa09..4628ed7 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java
@@ -19,7 +19,6 @@
import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;
-import android.annotation.Nullable;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
@@ -48,6 +47,7 @@
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.domain.interactor.KeyguardKeyboardInteractor;
import com.android.systemui.Flags;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.flags.FeatureFlags;
@@ -56,8 +56,6 @@
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
import com.android.systemui.util.concurrency.DelayableExecutor;
-import com.google.android.msdl.domain.MSDLPlayer;
-
import java.util.List;
public class KeyguardPasswordViewController
@@ -138,12 +136,12 @@
FeatureFlags featureFlags,
SelectedUserInteractor selectedUserInteractor,
KeyguardKeyboardInteractor keyguardKeyboardInteractor,
- @Nullable MSDLPlayer msdlPlayer,
+ BouncerHapticPlayer bouncerHapticPlayer,
UserActivityNotifier userActivityNotifier) {
super(view, keyguardUpdateMonitor, securityMode, lockPatternUtils, keyguardSecurityCallback,
messageAreaControllerFactory, latencyTracker, falsingCollector,
- emergencyButtonController, featureFlags, selectedUserInteractor, msdlPlayer,
- userActivityNotifier);
+ emergencyButtonController, featureFlags, selectedUserInteractor,
+ bouncerHapticPlayer, userActivityNotifier);
mKeyguardSecurityCallback = keyguardSecurityCallback;
mInputMethodManager = inputMethodManager;
mPostureController = postureController;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
index caa74780..7fb6664 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
@@ -36,6 +36,7 @@
import com.android.internal.widget.LockscreenCredential;
import com.android.keyguard.EmergencyButtonController.EmergencyButtonCallback;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingClassifier;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
@@ -75,6 +76,10 @@
}
};
+ private final LockPatternView.ExternalHapticsPlayer mExternalHapticsPlayer = () -> {
+ mBouncerHapticPlayer.playPatternDotFeedback(mView);
+ };
+
/**
* Useful for clearing out the wrong pattern after a delay
*/
@@ -166,6 +171,9 @@
boolean isValidPattern) {
boolean dismissKeyguard = mSelectedUserInteractor.getSelectedUserId() == userId;
if (matched) {
+ mBouncerHapticPlayer.playAuthenticationFeedback(
+ /* authenticationSucceeded= */true
+ );
getKeyguardSecurityCallback().reportUnlockAttempt(userId, true, 0);
if (dismissKeyguard) {
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
@@ -173,6 +181,9 @@
getKeyguardSecurityCallback().dismiss(true, userId, SecurityMode.Pattern);
}
} else {
+ mBouncerHapticPlayer.playAuthenticationFeedback(
+ /* authenticationSucceeded= */false
+ );
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
if (isValidPattern) {
getKeyguardSecurityCallback().reportUnlockAttempt(userId, false, timeoutMs);
@@ -200,9 +211,11 @@
EmergencyButtonController emergencyButtonController,
KeyguardMessageAreaController.Factory messageAreaControllerFactory,
DevicePostureController postureController, FeatureFlags featureFlags,
- SelectedUserInteractor selectedUserInteractor) {
+ SelectedUserInteractor selectedUserInteractor, BouncerHapticPlayer bouncerHapticPlayer
+ ) {
super(view, securityMode, keyguardSecurityCallback, emergencyButtonController,
- messageAreaControllerFactory, featureFlags, selectedUserInteractor);
+ messageAreaControllerFactory, featureFlags, selectedUserInteractor,
+ bouncerHapticPlayer);
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mLockPatternUtils = lockPatternUtils;
mLatencyTracker = latencyTracker;
@@ -249,6 +262,7 @@
if (deadline != 0) {
handleAttemptLockout(deadline);
}
+ mLockPatternView.setExternalHapticsPlayer(mExternalHapticsPlayer);
}
@Override
@@ -262,6 +276,7 @@
cancelBtn.setOnClickListener(null);
}
mPostureController.removeCallback(mPostureCallback);
+ mLockPatternView.setExternalHapticsPlayer(null);
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java
index f575cf2..d999994 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java
@@ -16,11 +16,9 @@
package com.android.keyguard;
-import static com.android.systemui.Flags.msdlFeedback;
import static com.android.systemui.Flags.pinInputFieldStyledFocusState;
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;
-import android.annotation.Nullable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.StateListDrawable;
@@ -37,14 +35,12 @@
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.domain.interactor.KeyguardKeyboardInteractor;
import com.android.systemui.Flags;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.res.R;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
-import com.google.android.msdl.data.model.MSDLToken;
-import com.google.android.msdl.domain.MSDLPlayer;
-
public abstract class KeyguardPinBasedInputViewController<T extends KeyguardPinBasedInputView>
extends KeyguardAbsKeyInputViewController<T> {
@@ -83,12 +79,12 @@
FeatureFlags featureFlags,
SelectedUserInteractor selectedUserInteractor,
KeyguardKeyboardInteractor keyguardKeyboardInteractor,
- @Nullable MSDLPlayer msdlPlayer,
+ BouncerHapticPlayer bouncerHapticPlayer,
UserActivityNotifier userActivityNotifier) {
super(view, keyguardUpdateMonitor, securityMode, lockPatternUtils, keyguardSecurityCallback,
messageAreaControllerFactory, latencyTracker, falsingCollector,
- emergencyButtonController, featureFlags, selectedUserInteractor, msdlPlayer,
- userActivityNotifier);
+ emergencyButtonController, featureFlags, selectedUserInteractor,
+ bouncerHapticPlayer, userActivityNotifier);
mLiftToActivateListener = liftToActivateListener;
mFalsingCollector = falsingCollector;
mKeyguardKeyboardInteractor = keyguardKeyboardInteractor;
@@ -110,16 +106,16 @@
return false;
});
button.setAnimationEnabled(showAnimations);
- button.setMSDLPlayer(mMSDLPlayer);
+ button.setBouncerHapticHelper(mBouncerHapticPlayer);
}
mPasswordEntry.setOnKeyListener(mOnKeyListener);
mPasswordEntry.setUserActivityListener(this::onUserInput);
View deleteButton = mView.findViewById(R.id.delete_button);
- if (msdlFeedback()) {
+ if (mBouncerHapticPlayer.isEnabled()) {
deleteButton.setOnTouchListener((View view, MotionEvent event) -> {
- if (event.getActionMasked() == MotionEvent.ACTION_DOWN && mMSDLPlayer != null) {
- mMSDLPlayer.playToken(MSDLToken.KEYPRESS_DELETE, null);
+ if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
+ mBouncerHapticPlayer.playDeleteKeyPressFeedback();
}
return false;
});
@@ -137,8 +133,8 @@
if (mPasswordEntry.isEnabled()) {
mView.resetPasswordText(true /* animate */, true /* announce */);
}
- if (msdlFeedback() && mMSDLPlayer != null) {
- mMSDLPlayer.playToken(MSDLToken.LONG_PRESS, null);
+ if (mBouncerHapticPlayer.isEnabled()) {
+ mBouncerHapticPlayer.playDeleteKeyLongPressedFeedback();
} else {
mView.doHapticKeyClick();
}
@@ -147,7 +143,7 @@
View okButton = mView.findViewById(R.id.key_enter);
if (okButton != null) {
- if (!msdlFeedback()) {
+ if (!mBouncerHapticPlayer.isEnabled()) {
okButton.setOnTouchListener(mActionButtonTouchListener);
}
okButton.setOnClickListener(v -> {
@@ -201,7 +197,7 @@
for (NumPadKey button : mView.getButtons()) {
button.setOnTouchListener(null);
- button.setMSDLPlayer(null);
+ button.setBouncerHapticHelper(null);
}
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
index 3b5bf1a..d3c02e6 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
@@ -18,7 +18,6 @@
import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;
-import android.annotation.Nullable;
import android.view.View;
import com.android.internal.logging.UiEvent;
@@ -27,6 +26,7 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.domain.interactor.KeyguardKeyboardInteractor;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
@@ -34,8 +34,6 @@
import com.android.systemui.statusbar.policy.DevicePostureController;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
-import com.google.android.msdl.domain.MSDLPlayer;
-
public class KeyguardPinViewController
extends KeyguardPinBasedInputViewController<KeyguardPINView> {
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
@@ -65,12 +63,12 @@
DevicePostureController postureController, FeatureFlags featureFlags,
SelectedUserInteractor selectedUserInteractor, UiEventLogger uiEventLogger,
KeyguardKeyboardInteractor keyguardKeyboardInteractor,
- @Nullable MSDLPlayer msdlPlayer,
+ BouncerHapticPlayer bouncerHapticPlayer,
UserActivityNotifier userActivityNotifier) {
super(view, keyguardUpdateMonitor, securityMode, lockPatternUtils, keyguardSecurityCallback,
messageAreaControllerFactory, latencyTracker, liftToActivateListener,
emergencyButtonController, falsingCollector, featureFlags, selectedUserInteractor,
- keyguardKeyboardInteractor, msdlPlayer, userActivityNotifier);
+ keyguardKeyboardInteractor, bouncerHapticPlayer, userActivityNotifier);
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mPostureController = postureController;
mLockPatternUtils = lockPatternUtils;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
index 47fe2b2..1c1acf8 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
@@ -21,7 +21,6 @@
import static com.android.systemui.util.PluralMessageFormaterKt.icuMessageFormat;
import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
@@ -44,13 +43,12 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.domain.interactor.KeyguardKeyboardInteractor;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.res.R;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
-import com.google.android.msdl.domain.MSDLPlayer;
-
public class KeyguardSimPinViewController
extends KeyguardPinBasedInputViewController<KeyguardSimPinView> {
public static final String TAG = "KeyguardSimPinView";
@@ -99,12 +97,12 @@
EmergencyButtonController emergencyButtonController, FeatureFlags featureFlags,
SelectedUserInteractor selectedUserInteractor,
KeyguardKeyboardInteractor keyguardKeyboardInteractor,
- @Nullable MSDLPlayer msdlPlayer,
+ BouncerHapticPlayer bouncerHapticPlayer,
UserActivityNotifier userActivityNotifier) {
super(view, keyguardUpdateMonitor, securityMode, lockPatternUtils, keyguardSecurityCallback,
messageAreaControllerFactory, latencyTracker, liftToActivateListener,
emergencyButtonController, falsingCollector, featureFlags, selectedUserInteractor,
- keyguardKeyboardInteractor, msdlPlayer, userActivityNotifier);
+ keyguardKeyboardInteractor, bouncerHapticPlayer, userActivityNotifier);
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mTelephonyManager = telephonyManager;
mSimImageView = mView.findViewById(R.id.keyguard_sim);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
index c688acb..9adc5ba 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
@@ -17,7 +17,6 @@
package com.android.keyguard;
import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -39,13 +38,12 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.keyguard.domain.interactor.KeyguardKeyboardInteractor;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.res.R;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
-import com.google.android.msdl.domain.MSDLPlayer;
-
public class KeyguardSimPukViewController
extends KeyguardPinBasedInputViewController<KeyguardSimPukView> {
private static final boolean DEBUG = KeyguardConstants.DEBUG;
@@ -96,12 +94,12 @@
EmergencyButtonController emergencyButtonController, FeatureFlags featureFlags,
SelectedUserInteractor selectedUserInteractor,
KeyguardKeyboardInteractor keyguardKeyboardInteractor,
- @Nullable MSDLPlayer msdlPlayer,
+ BouncerHapticPlayer bouncerHapticPlayer,
UserActivityNotifier userActivityNotifier) {
super(view, keyguardUpdateMonitor, securityMode, lockPatternUtils, keyguardSecurityCallback,
messageAreaControllerFactory, latencyTracker, liftToActivateListener,
emergencyButtonController, falsingCollector, featureFlags, selectedUserInteractor,
- keyguardKeyboardInteractor, msdlPlayer, userActivityNotifier);
+ keyguardKeyboardInteractor, bouncerHapticPlayer, userActivityNotifier);
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mTelephonyManager = telephonyManager;
mSimImageView = mView.findViewById(R.id.keyguard_sim);
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
index 4fb80de..7fe4ec8 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
@@ -15,7 +15,6 @@
*/
package com.android.keyguard;
-import static com.android.systemui.Flags.msdlFeedback;
import static com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_KEY;
import android.content.Context;
@@ -37,11 +36,9 @@
import androidx.annotation.Nullable;
import com.android.settingslib.Utils;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.res.R;
-import com.google.android.msdl.data.model.MSDLToken;
-import com.google.android.msdl.domain.MSDLPlayer;
-
/**
* Viewgroup for the bouncer numpad button, specifically for digits.
*/
@@ -62,7 +59,7 @@
private NumPadAnimator mAnimator;
private int mOrientation;
@Nullable
- private MSDLPlayer mMSDLPlayer;
+ private BouncerHapticPlayer mBouncerHapticPlayer;
private View.OnClickListener mListener = new View.OnClickListener() {
@Override
@@ -227,8 +224,8 @@
// Cause a VIRTUAL_KEY vibration
public void doHapticKeyClick() {
- if (msdlFeedback() && mMSDLPlayer != null) {
- mMSDLPlayer.playToken(MSDLToken.KEYPRESS_STANDARD, null);
+ if (mBouncerHapticPlayer != null && mBouncerHapticPlayer.isEnabled()) {
+ mBouncerHapticPlayer.playNumpadKeyFeedback();
} else {
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
@@ -255,7 +252,7 @@
info.setTextEntryKey(true);
}
- public void setMSDLPlayer(@Nullable MSDLPlayer player) {
- mMSDLPlayer = player;
+ public void setBouncerHapticHelper(@Nullable BouncerHapticPlayer bouncerHapticPlayer) {
+ mBouncerHapticPlayer = bouncerHapticPlayer;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java
index 2c97d62..4d5e717 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java
@@ -28,6 +28,7 @@
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -68,8 +69,9 @@
}
@Inject
- public AccessibilityButtonModeObserver(Context context, UserTracker userTracker) {
- super(context, userTracker, Settings.Secure.ACCESSIBILITY_BUTTON_MODE);
+ public AccessibilityButtonModeObserver(
+ Context context, UserTracker userTracker, SecureSettings secureSettings) {
+ super(context, userTracker, secureSettings, Settings.Secure.ACCESSIBILITY_BUTTON_MODE);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserver.java b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserver.java
index 53a21b3..1363b1c 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserver.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserver.java
@@ -24,6 +24,7 @@
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import javax.inject.Inject;
@@ -49,8 +50,9 @@
}
@Inject
- public AccessibilityButtonTargetsObserver(Context context, UserTracker userTracker) {
- super(context, userTracker, Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
+ public AccessibilityButtonTargetsObserver(
+ Context context, UserTracker userTracker, SecureSettings secureSettings) {
+ super(context, userTracker, secureSettings, Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserver.java b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserver.java
index c944878..736217a 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserver.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserver.java
@@ -24,6 +24,7 @@
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import javax.inject.Inject;
@@ -49,8 +50,9 @@
}
@Inject
- public AccessibilityGestureTargetsObserver(Context context, UserTracker userTracker) {
- super(context, userTracker, Settings.Secure.ACCESSIBILITY_GESTURE_TARGETS);
+ public AccessibilityGestureTargetsObserver(
+ Context context, UserTracker userTracker, SecureSettings secureSettings) {
+ super(context, userTracker, secureSettings, Settings.Secure.ACCESSIBILITY_GESTURE_TARGETS);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/MirrorWindowControl.java b/packages/SystemUI/src/com/android/systemui/accessibility/MirrorWindowControl.java
index 443441f..eb4de68 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/MirrorWindowControl.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/MirrorWindowControl.java
@@ -18,6 +18,9 @@
import static android.view.WindowManager.LayoutParams;
+import static com.android.app.viewcapture.ViewCaptureFactory.getViewCaptureAwareWindowManagerInstance;
+import static com.android.systemui.Flags.enableViewCaptureTracing;
+
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
@@ -29,8 +32,8 @@
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.WindowManager;
+import com.android.app.viewcapture.ViewCaptureAwareWindowManager;
import com.android.systemui.res.R;
/**
@@ -70,11 +73,12 @@
* @see #setDefaultPosition(LayoutParams)
*/
private final Point mControlPosition = new Point();
- private final WindowManager mWindowManager;
+ private final ViewCaptureAwareWindowManager mWindowManager;
MirrorWindowControl(Context context) {
mContext = context;
- mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
+ mWindowManager = getViewCaptureAwareWindowManagerInstance(mContext,
+ enableViewCaptureTracing());
}
public void setWindowDelegate(@Nullable MirrorWindowDelegate windowDelegate) {
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/SecureSettingsContentObserver.java b/packages/SystemUI/src/com/android/systemui/accessibility/SecureSettingsContentObserver.java
index 326773f..c50cf85 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/SecureSettingsContentObserver.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/SecureSettingsContentObserver.java
@@ -28,6 +28,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import java.util.ArrayList;
import java.util.List;
@@ -48,6 +49,7 @@
private final UserTracker mUserTracker;
@VisibleForTesting
final ContentObserver mContentObserver;
+ private final SecureSettings mSecureSettings;
private final String mKey;
@@ -55,7 +57,7 @@
final List<T> mListeners = new ArrayList<>();
protected SecureSettingsContentObserver(Context context, UserTracker userTracker,
- String secureSettingsKey) {
+ SecureSettings secureSettings, String secureSettingsKey) {
mKey = secureSettingsKey;
mContentResolver = context.getContentResolver();
mUserTracker = userTracker;
@@ -65,6 +67,7 @@
updateValueChanged();
}
};
+ mSecureSettings = secureSettings;
}
/**
@@ -80,9 +83,8 @@
}
if (mListeners.size() == 1) {
- mContentResolver.registerContentObserver(
- Settings.Secure.getUriFor(mKey), /* notifyForDescendants= */
- false, mContentObserver, UserHandle.USER_ALL);
+ mSecureSettings.registerContentObserverForUserAsync(Settings.Secure.getUriFor(mKey),
+ /* notifyForDescendants= */ false, mContentObserver, UserHandle.USER_ALL);
}
}
@@ -97,7 +99,7 @@
mListeners.remove(listener);
if (mListeners.isEmpty()) {
- mContentResolver.unregisterContentObserver(mContentObserver);
+ mSecureSettings.unregisterContentObserverAsync(mContentObserver);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java
index 7750f6b..51c5b00 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java
@@ -18,8 +18,6 @@
import static android.view.WindowManager.ScreenshotSource.SCREENSHOT_ACCESSIBILITY_ACTIONS;
-import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
-
import android.accessibilityservice.AccessibilityService;
import android.app.PendingIntent;
import android.app.RemoteAction;
@@ -45,7 +43,6 @@
import android.view.accessibility.Flags;
import com.android.internal.R;
-import com.android.internal.accessibility.dialog.AccessibilityButtonChooserActivity;
import com.android.internal.accessibility.util.AccessibilityUtils;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ScreenshotHelper;
@@ -561,16 +558,13 @@
}
private void handleAccessibilityButton() {
- AccessibilityManager.getInstance(mContext).notifyAccessibilityButtonClicked(
+ mA11yManager.notifyAccessibilityButtonClicked(
mDisplayTracker.getDefaultDisplayId());
}
private void handleAccessibilityButtonChooser() {
- final Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- final String chooserClassName = AccessibilityButtonChooserActivity.class.getName();
- intent.setClassName(CHOOSER_PACKAGE_NAME, chooserClassName);
- mContext.startActivityAsUser(intent, mUserTracker.getUserHandle());
+ mA11yManager.notifyAccessibilityButtonLongClicked(
+ mDisplayTracker.getDefaultDisplayId());
}
private void handleAccessibilityShortcut() {
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/data/model/CaptioningModel.kt b/packages/SystemUI/src/com/android/systemui/accessibility/data/model/CaptioningModel.kt
new file mode 100644
index 0000000..4eb2274
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/data/model/CaptioningModel.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.accessibility.data.model
+
+data class CaptioningModel(
+ val isSystemAudioCaptioningUiEnabled: Boolean,
+ val isSystemAudioCaptioningEnabled: Boolean,
+)
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/CaptioningRepository.kt b/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/CaptioningRepository.kt
index bf749d4..5414b62 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/CaptioningRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/CaptioningRepository.kt
@@ -16,98 +16,90 @@
package com.android.systemui.accessibility.data.repository
+import android.annotation.SuppressLint
import android.view.accessibility.CaptioningManager
+import com.android.systemui.accessibility.data.model.CaptioningModel
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.dagger.qualifiers.Background
+import com.android.systemui.user.data.repository.UserRepository
+import com.android.systemui.user.utils.UserScopedService
+import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow
+import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.channels.ProducerScope
+import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.awaitClose
-import kotlinx.coroutines.flow.SharedFlow
+import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.callbackFlow
-import kotlinx.coroutines.flow.filterIsInstance
+import kotlinx.coroutines.flow.filterNotNull
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
-import kotlinx.coroutines.flow.shareIn
import kotlinx.coroutines.flow.stateIn
-import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
interface CaptioningRepository {
- /** The system audio caption enabled state. */
- val isSystemAudioCaptioningEnabled: StateFlow<Boolean>
+ /** Current state of Live Captions. */
+ val captioningModel: StateFlow<CaptioningModel?>
- /** The system audio caption UI enabled state. */
- val isSystemAudioCaptioningUiEnabled: StateFlow<Boolean>
-
- /** Sets [isSystemAudioCaptioningEnabled]. */
+ /** Sets [CaptioningModel.isSystemAudioCaptioningEnabled]. */
suspend fun setIsSystemAudioCaptioningEnabled(isEnabled: Boolean)
}
-class CaptioningRepositoryImpl(
- private val captioningManager: CaptioningManager,
- private val backgroundCoroutineContext: CoroutineContext,
- coroutineScope: CoroutineScope,
+@OptIn(ExperimentalCoroutinesApi::class)
+class CaptioningRepositoryImpl
+@Inject
+constructor(
+ private val userScopedCaptioningManagerProvider: UserScopedService<CaptioningManager>,
+ userRepository: UserRepository,
+ @Background private val backgroundCoroutineContext: CoroutineContext,
+ @Application coroutineScope: CoroutineScope,
) : CaptioningRepository {
- private val captioningChanges: SharedFlow<CaptioningChange> =
- callbackFlow {
- val listener = CaptioningChangeProducingListener(this)
- captioningManager.addCaptioningChangeListener(listener)
- awaitClose { captioningManager.removeCaptioningChangeListener(listener) }
- }
- .shareIn(coroutineScope, SharingStarted.WhileSubscribed(), replay = 0)
+ @SuppressLint("NonInjectedService") // this uses user-aware context
+ private val captioningManager: StateFlow<CaptioningManager?> =
+ userRepository.selectedUser
+ .map { userScopedCaptioningManagerProvider.forUser(it.userInfo.userHandle) }
+ .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), null)
- override val isSystemAudioCaptioningEnabled: StateFlow<Boolean> =
- captioningChanges
- .filterIsInstance(CaptioningChange.IsSystemAudioCaptioningEnabled::class)
- .map { it.isEnabled }
- .onStart { emit(captioningManager.isSystemAudioCaptioningEnabled) }
- .stateIn(
- coroutineScope,
- SharingStarted.WhileSubscribed(),
- captioningManager.isSystemAudioCaptioningEnabled,
- )
-
- override val isSystemAudioCaptioningUiEnabled: StateFlow<Boolean> =
- captioningChanges
- .filterIsInstance(CaptioningChange.IsSystemUICaptioningEnabled::class)
- .map { it.isEnabled }
- .onStart { emit(captioningManager.isSystemAudioCaptioningUiEnabled) }
- .stateIn(
- coroutineScope,
- SharingStarted.WhileSubscribed(),
- captioningManager.isSystemAudioCaptioningUiEnabled,
- )
+ override val captioningModel: StateFlow<CaptioningModel?> =
+ captioningManager
+ .filterNotNull()
+ .flatMapLatest { it.captioningModel() }
+ .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), null)
override suspend fun setIsSystemAudioCaptioningEnabled(isEnabled: Boolean) {
withContext(backgroundCoroutineContext) {
- captioningManager.isSystemAudioCaptioningEnabled = isEnabled
+ captioningManager.value?.isSystemAudioCaptioningEnabled = isEnabled
}
}
- private sealed interface CaptioningChange {
+ private fun CaptioningManager.captioningModel(): Flow<CaptioningModel> {
+ return conflatedCallbackFlow {
+ val listener =
+ object : CaptioningManager.CaptioningChangeListener() {
- data class IsSystemAudioCaptioningEnabled(val isEnabled: Boolean) : CaptioningChange
+ override fun onSystemAudioCaptioningChanged(enabled: Boolean) {
+ trySend(Unit)
+ }
- data class IsSystemUICaptioningEnabled(val isEnabled: Boolean) : CaptioningChange
- }
-
- private class CaptioningChangeProducingListener(
- private val scope: ProducerScope<CaptioningChange>
- ) : CaptioningManager.CaptioningChangeListener() {
-
- override fun onSystemAudioCaptioningChanged(enabled: Boolean) {
- emitChange(CaptioningChange.IsSystemAudioCaptioningEnabled(enabled))
- }
-
- override fun onSystemAudioCaptioningUiChanged(enabled: Boolean) {
- emitChange(CaptioningChange.IsSystemUICaptioningEnabled(enabled))
- }
-
- private fun emitChange(change: CaptioningChange) {
- scope.launch { scope.send(change) }
- }
+ override fun onSystemAudioCaptioningUiChanged(enabled: Boolean) {
+ trySend(Unit)
+ }
+ }
+ addCaptioningChangeListener(listener)
+ awaitClose { removeCaptioningChangeListener(listener) }
+ }
+ .onStart { emit(Unit) }
+ .map {
+ CaptioningModel(
+ isSystemAudioCaptioningEnabled = isSystemAudioCaptioningEnabled,
+ isSystemAudioCaptioningUiEnabled = isSystemAudioCaptioningUiEnabled,
+ )
+ }
+ .flowOn(backgroundCoroutineContext)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/domain/interactor/CaptioningInteractor.kt b/packages/SystemUI/src/com/android/systemui/accessibility/domain/interactor/CaptioningInteractor.kt
index 1d493c6..840edf4 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/domain/interactor/CaptioningInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/domain/interactor/CaptioningInteractor.kt
@@ -17,16 +17,22 @@
package com.android.systemui.accessibility.domain.interactor
import com.android.systemui.accessibility.data.repository.CaptioningRepository
-import kotlinx.coroutines.flow.StateFlow
+import com.android.systemui.dagger.SysUISingleton
+import javax.inject.Inject
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.filterNotNull
+import kotlinx.coroutines.flow.map
-class CaptioningInteractor(private val repository: CaptioningRepository) {
+@SysUISingleton
+class CaptioningInteractor @Inject constructor(private val repository: CaptioningRepository) {
- val isSystemAudioCaptioningEnabled: StateFlow<Boolean>
- get() = repository.isSystemAudioCaptioningEnabled
+ val isSystemAudioCaptioningEnabled: Flow<Boolean> =
+ repository.captioningModel.filterNotNull().map { it.isSystemAudioCaptioningEnabled }
- val isSystemAudioCaptioningUiEnabled: StateFlow<Boolean>
- get() = repository.isSystemAudioCaptioningUiEnabled
+ val isSystemAudioCaptioningUiEnabled: Flow<Boolean> =
+ repository.captioningModel.filterNotNull().map { it.isSystemAudioCaptioningUiEnabled }
- suspend fun setIsSystemAudioCaptioningEnabled(enabled: Boolean) =
+ suspend fun setIsSystemAudioCaptioningEnabled(enabled: Boolean) {
repository.setIsSystemAudioCaptioningEnabled(enabled)
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManager.kt b/packages/SystemUI/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManager.kt
index e1297d3..60d80ef 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/extradim/ExtraDimDialogManager.kt
@@ -15,7 +15,9 @@
*/
package com.android.systemui.accessibility.extradim
-import androidx.annotation.VisibleForTesting
+import com.android.systemui.animation.DialogCuj
+import com.android.systemui.animation.DialogTransitionAnimator
+import com.android.systemui.animation.Expandable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.statusbar.phone.SystemUIDialog
@@ -28,25 +30,35 @@
@Inject
constructor(
private val extraDimDialogDelegateProvider: Provider<ExtraDimDialogDelegate>,
- private val mActivityStarter: ActivityStarter
+ private val mActivityStarter: ActivityStarter,
+ private val dialogTransitionAnimator: DialogTransitionAnimator,
) {
private var dialog: SystemUIDialog? = null
- @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
- fun dismissKeyguardIfNeededAndShowDialog() {
+ @JvmOverloads
+ fun dismissKeyguardIfNeededAndShowDialog(expandable: Expandable? = null) {
mActivityStarter.executeRunnableDismissingKeyguard(
- { showRemoveExtraDimShortcutsDialog() },
+ { showRemoveExtraDimShortcutsDialog(expandable) },
/* cancelAction= */ null,
/* dismissShade= */ false,
/* afterKeyguardGone= */ true,
- /* deferred= */ false
+ /* deferred= */ false,
)
}
/** Show the dialog for removing all Extra Dim shortcuts. */
- private fun showRemoveExtraDimShortcutsDialog() {
+ private fun showRemoveExtraDimShortcutsDialog(expandable: Expandable?) {
dialog?.dismiss()
- dialog = extraDimDialogDelegateProvider.get().createDialog()
- dialog!!.show()
+ val dialog2 = extraDimDialogDelegateProvider.get().createDialog()
+ dialog = dialog2
+
+ val controller =
+ expandable?.dialogTransitionController(
+ DialogCuj(com.android.internal.jank.Cuj.CUJ_SHADE_DIALOG_OPEN)
+ )
+
+ controller?.let {
+ dialogTransitionAnimator.show(dialog2, it, animateBackgroundBoundsChange = true)
+ } ?: dialog2.show()
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java
index d08653c3..60edaae 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java
@@ -52,7 +52,6 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.bluetooth.BluetoothCallback;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.HapClientProfile;
@@ -105,7 +104,8 @@
private final AudioManager mAudioManager;
private final LocalBluetoothProfileManager mProfileManager;
private final HapClientProfile mHapClientProfile;
- private final UiEventLogger mUiEventLogger;
+ private final HearingDevicesUiEventLogger mUiEventLogger;
+ private final int mLaunchSourceId;
private HearingDevicesListAdapter mDeviceListAdapter;
private HearingDevicesPresetsController mPresetsController;
private Context mApplicationContext;
@@ -153,20 +153,22 @@
public interface Factory {
/** Create a {@link HearingDevicesDialogDelegate} instance */
HearingDevicesDialogDelegate create(
- boolean showPairNewDevice);
+ boolean showPairNewDevice,
+ @HearingDevicesUiEventLogger.LaunchSourceId int launchSource);
}
@AssistedInject
public HearingDevicesDialogDelegate(
@Application Context applicationContext,
@Assisted boolean showPairNewDevice,
+ @Assisted @HearingDevicesUiEventLogger.LaunchSourceId int launchSourceId,
SystemUIDialog.Factory systemUIDialogFactory,
ActivityStarter activityStarter,
DialogTransitionAnimator dialogTransitionAnimator,
@Nullable LocalBluetoothManager localBluetoothManager,
@Main Handler handler,
AudioManager audioManager,
- UiEventLogger uiEventLogger) {
+ HearingDevicesUiEventLogger uiEventLogger) {
mApplicationContext = applicationContext;
mShowPairNewDevice = showPairNewDevice;
mSystemUIDialogFactory = systemUIDialogFactory;
@@ -178,6 +180,7 @@
mProfileManager = localBluetoothManager.getProfileManager();
mHapClientProfile = mProfileManager.getHapClientProfile();
mUiEventLogger = uiEventLogger;
+ mLaunchSourceId = launchSourceId;
}
@Override
@@ -191,7 +194,7 @@
@Override
public void onDeviceItemGearClicked(@NonNull DeviceItem deviceItem, @NonNull View view) {
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_GEAR_CLICK);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_GEAR_CLICK, mLaunchSourceId);
dismissDialogIfExists();
Intent intent = new Intent(ACTION_BLUETOOTH_DEVICE_DETAILS);
Bundle bundle = new Bundle();
@@ -207,15 +210,17 @@
CachedBluetoothDevice cachedBluetoothDevice = deviceItem.getCachedBluetoothDevice();
switch (deviceItem.getType()) {
case ACTIVE_MEDIA_BLUETOOTH_DEVICE, CONNECTED_BLUETOOTH_DEVICE -> {
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_DISCONNECT);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_DISCONNECT,
+ mLaunchSourceId);
cachedBluetoothDevice.disconnect();
}
case AVAILABLE_MEDIA_BLUETOOTH_DEVICE -> {
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_SET_ACTIVE);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_SET_ACTIVE,
+ mLaunchSourceId);
cachedBluetoothDevice.setActive();
}
case SAVED_BLUETOOTH_DEVICE -> {
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_CONNECT);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_CONNECT, mLaunchSourceId);
cachedBluetoothDevice.connect();
}
}
@@ -275,7 +280,7 @@
if (mLocalBluetoothManager == null) {
return;
}
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_DIALOG_SHOW);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_DIALOG_SHOW, mLaunchSourceId);
mPairButton = dialog.requireViewById(R.id.pair_new_device_button);
mDeviceList = dialog.requireViewById(R.id.device_list);
mPresetSpinner = dialog.requireViewById(R.id.preset_spinner);
@@ -363,7 +368,8 @@
mPresetSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_PRESET_SELECT);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_PRESET_SELECT,
+ mLaunchSourceId);
mPresetsController.selectPreset(
mPresetsController.getAllPresetInfo().get(position).getIndex());
}
@@ -381,7 +387,7 @@
private void setupPairNewDeviceButton(SystemUIDialog dialog, @Visibility int visibility) {
if (visibility == VISIBLE) {
mPairButton.setOnClickListener(v -> {
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_PAIR);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_PAIR, mLaunchSourceId);
dismissDialogIfExists();
final Intent intent = new Intent(Settings.ACTION_HEARING_DEVICE_PAIRING_SETTINGS);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
@@ -485,7 +491,8 @@
final String name = intent.getComponent() != null
? intent.getComponent().flattenToString()
: intent.getPackage() + "/" + intent.getAction();
- mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_RELATED_TOOL_CLICK, 0, name);
+ mUiEventLogger.log(HearingDevicesUiEvent.HEARING_DEVICES_RELATED_TOOL_CLICK,
+ mLaunchSourceId, name);
dismissDialogIfExists();
mActivityStarter.postStartActivityDismissingKeyguard(intent, /* delay= */ 0,
mDialogTransitionAnimator.createActivityTransitionController(view));
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManager.java b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManager.java
index bc4cb45..3d24177 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManager.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogManager.java
@@ -70,8 +70,10 @@
* Shows the dialog.
*
* @param expandable {@link Expandable} from which the dialog is shown.
+ * @param launchSourceId the id indicates where the dialog is launched from.
*/
- public void showDialog(Expandable expandable) {
+ public void showDialog(Expandable expandable,
+ @HearingDevicesUiEventLogger.LaunchSourceId int launchSourceId) {
if (mDialog != null) {
if (DEBUG) {
Log.d(TAG, "HearingDevicesDialog already showing. Destroy it first.");
@@ -91,7 +93,8 @@
});
pairedHearingDeviceCheckTask.addListener(() -> {
try {
- mDialog = mDialogFactory.create(!pairedHearingDeviceCheckTask.get()).createDialog();
+ mDialog = mDialogFactory.create(!pairedHearingDeviceCheckTask.get(),
+ launchSourceId).createDialog();
if (expandable != null) {
DialogTransitionAnimator.Controller controller =
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogReceiver.java b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogReceiver.java
index 6a34d19..02e65fd 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogReceiver.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogReceiver.java
@@ -16,6 +16,8 @@
package com.android.systemui.accessibility.hearingaid;
+import static com.android.systemui.accessibility.hearingaid.HearingDevicesUiEventLogger.LAUNCH_SOURCE_A11Y;
+
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -46,7 +48,7 @@
}
if (ACTION.equals(intent.getAction())) {
- mDialogManager.showDialog(/* view= */ null);
+ mDialogManager.showDialog(/* expandable= */ null, LAUNCH_SOURCE_A11Y);
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEvent.java b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEvent.java
deleted file mode 100644
index 3fbe56e..0000000
--- a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEvent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.accessibility.hearingaid;
-
-import com.android.internal.logging.UiEvent;
-import com.android.internal.logging.UiEventLogger;
-
-public enum HearingDevicesUiEvent implements UiEventLogger.UiEventEnum {
-
- @UiEvent(doc = "Hearing devices dialog is shown")
- HEARING_DEVICES_DIALOG_SHOW(1848),
- @UiEvent(doc = "Pair new device")
- HEARING_DEVICES_PAIR(1849),
- @UiEvent(doc = "Connect to the device")
- HEARING_DEVICES_CONNECT(1850),
- @UiEvent(doc = "Disconnect from the device")
- HEARING_DEVICES_DISCONNECT(1851),
- @UiEvent(doc = "Set the device as active device")
- HEARING_DEVICES_SET_ACTIVE(1852),
- @UiEvent(doc = "Click on the device gear to enter device detail page")
- HEARING_DEVICES_GEAR_CLICK(1853),
- @UiEvent(doc = "Select a preset from preset spinner")
- HEARING_DEVICES_PRESET_SELECT(1854),
- @UiEvent(doc = "Click on related tool")
- HEARING_DEVICES_RELATED_TOOL_CLICK(1856);
-
- private final int mId;
-
- HearingDevicesUiEvent(int id) {
- mId = id;
- }
-
- @Override
- public int getId() {
- return mId;
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEvent.kt b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEvent.kt
new file mode 100644
index 0000000..9e77b02
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEvent.kt
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.accessibility.hearingaid
+
+import com.android.internal.logging.UiEvent
+import com.android.internal.logging.UiEventLogger
+
+enum class HearingDevicesUiEvent(private val id: Int) : UiEventLogger.UiEventEnum {
+
+ @UiEvent(doc = "Hearing devices dialog is shown") HEARING_DEVICES_DIALOG_SHOW(1848),
+ @UiEvent(doc = "Pair new device") HEARING_DEVICES_PAIR(1849),
+ @UiEvent(doc = "Connect to the device") HEARING_DEVICES_CONNECT(1850),
+ @UiEvent(doc = "Disconnect from the device") HEARING_DEVICES_DISCONNECT(1851),
+ @UiEvent(doc = "Set the device as active device") HEARING_DEVICES_SET_ACTIVE(1852),
+ @UiEvent(doc = "Click on the device gear to enter device detail page")
+ HEARING_DEVICES_GEAR_CLICK(1853),
+ @UiEvent(doc = "Select a preset from preset spinner") HEARING_DEVICES_PRESET_SELECT(1854),
+ @UiEvent(doc = "Click on related tool") HEARING_DEVICES_RELATED_TOOL_CLICK(1856);
+
+ override fun getId(): Int = this.id
+}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEventLogger.kt b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEventLogger.kt
new file mode 100644
index 0000000..0b32cfc
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesUiEventLogger.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.accessibility.hearingaid
+
+import android.annotation.IntDef
+import com.android.internal.logging.UiEventLogger
+import com.android.systemui.dagger.SysUISingleton
+import javax.inject.Inject
+
+@SysUISingleton
+class HearingDevicesUiEventLogger @Inject constructor(private val uiEventLogger: UiEventLogger) {
+
+ /** Logs the given event */
+ fun log(event: UiEventLogger.UiEventEnum, launchSourceId: Int) {
+ log(event, launchSourceId, null)
+ }
+
+ fun log(event: UiEventLogger.UiEventEnum, launchSourceId: Int, pkgName: String?) {
+ uiEventLogger.log(event, launchSourceId, pkgName)
+ }
+
+ /**
+ * The possible launch source of hearing devices dialog
+ *
+ * @hide
+ */
+ @IntDef(LAUNCH_SOURCE_UNKNOWN, LAUNCH_SOURCE_A11Y, LAUNCH_SOURCE_QS_TILE)
+ annotation class LaunchSourceId
+
+ companion object {
+ const val LAUNCH_SOURCE_UNKNOWN = 0
+ const val LAUNCH_SOURCE_A11Y = 1 // launch from AccessibilityManagerService
+ const val LAUNCH_SOURCE_QS_TILE = 2
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/qs/QSAccessibilityModule.kt b/packages/SystemUI/src/com/android/systemui/accessibility/qs/QSAccessibilityModule.kt
index bb80396..cd9efaf 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/qs/QSAccessibilityModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/qs/QSAccessibilityModule.kt
@@ -19,6 +19,7 @@
import com.android.systemui.Flags
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.ColorCorrectionTile
import com.android.systemui.qs.tiles.ColorInversionTile
@@ -179,6 +180,7 @@
labelRes = R.string.quick_settings_color_correction_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.ACCESSIBILITY,
)
/** Inject ColorCorrectionTile into tileViewModelMap in QSModule */
@@ -210,6 +212,7 @@
labelRes = R.string.quick_settings_inversion_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.ACCESSIBILITY,
)
/** Inject ColorInversionTile into tileViewModelMap in QSModule */
@@ -241,6 +244,7 @@
labelRes = R.string.quick_settings_font_scaling_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.DISPLAY,
)
/** Inject FontScaling Tile into tileViewModelMap in QSModule */
@@ -272,6 +276,7 @@
labelRes = com.android.internal.R.string.reduce_bright_colors_feature_name,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.DISPLAY,
)
@Provides
@@ -286,6 +291,7 @@
labelRes = R.string.quick_settings_hearing_devices_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.ACCESSIBILITY,
)
/**
@@ -322,6 +328,7 @@
labelRes = R.string.quick_settings_onehanded_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.ACCESSIBILITY,
)
/** Inject One Handed Mode Tile into tileViewModelMap in QSModule. */
@@ -355,6 +362,7 @@
labelRes = R.string.quick_settings_night_display_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.DISPLAY,
)
/**
diff --git a/packages/SystemUI/src/com/android/systemui/battery/BatterySaverModule.kt b/packages/SystemUI/src/com/android/systemui/battery/BatterySaverModule.kt
index 8a9a322..831bc1d 100644
--- a/packages/SystemUI/src/com/android/systemui/battery/BatterySaverModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/battery/BatterySaverModule.kt
@@ -2,6 +2,7 @@
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.BatterySaverTile
import com.android.systemui.qs.tiles.base.interactor.QSTileAvailabilityInteractor
@@ -33,7 +34,7 @@
@IntoMap
@StringKey(BATTERY_SAVER_TILE_SPEC)
fun provideBatterySaverAvailabilityInteractor(
- impl: BatterySaverTileDataInteractor
+ impl: BatterySaverTileDataInteractor
): QSTileAvailabilityInteractor
companion object {
@@ -51,6 +52,7 @@
labelRes = R.string.battery_detail_switch_title,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.UTILITIES,
)
/** Inject BatterySaverTile into tileViewModelMap in QSModule */
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/domain/BiometricsDomainLayerModule.kt b/packages/SystemUI/src/com/android/systemui/biometrics/domain/BiometricsDomainLayerModule.kt
index ec3fd9f..7ecbb88 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/domain/BiometricsDomainLayerModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/domain/BiometricsDomainLayerModule.kt
@@ -25,6 +25,8 @@
import com.android.systemui.biometrics.domain.interactor.LogContextInteractorImpl
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractorImpl
+import com.android.systemui.biometrics.domain.interactor.SideFpsOverlayInteractor
+import com.android.systemui.biometrics.domain.interactor.SideFpsOverlayInteractorImpl
import com.android.systemui.dagger.SysUISingleton
import dagger.Binds
import dagger.Module
@@ -46,6 +48,12 @@
@Binds
@SysUISingleton
+ fun providesSideFpsOverlayInteractor(
+ impl: SideFpsOverlayInteractorImpl
+ ): SideFpsOverlayInteractor
+
+ @Binds
+ @SysUISingleton
fun providesCredentialInteractor(impl: CredentialInteractorImpl): CredentialInteractor
@Binds
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractor.kt b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractor.kt
new file mode 100644
index 0000000..10c3483
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractor.kt
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.biometrics.domain.interactor
+
+import android.util.Log
+import com.android.systemui.biometrics.shared.model.AuthenticationReason.NotRunning
+import com.android.systemui.keyguard.domain.interactor.DeviceEntrySideFpsOverlayInteractor
+import com.android.systemui.util.kotlin.sample
+import javax.inject.Inject
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.flow.onEach
+
+/** Encapsulates business logic for showing and hiding the side fingerprint sensor indicator. */
+interface SideFpsOverlayInteractor {
+ /** Whether the side fingerprint sensor indicator is currently showing. */
+ val isShowing: Flow<Boolean>
+}
+
+@OptIn(ExperimentalCoroutinesApi::class)
+class SideFpsOverlayInteractorImpl
+@Inject
+constructor(
+ biometricStatusInteractor: BiometricStatusInteractor,
+ displayStateInteractor: DisplayStateInteractor,
+ deviceEntrySideFpsOverlayInteractor: DeviceEntrySideFpsOverlayInteractor,
+ sfpsSensorInteractor: SideFpsSensorInteractor,
+ // TODO(b/365182034): add progress bar input when rest to unlock feature is implemented
+) : SideFpsOverlayInteractor {
+ private val sfpsOverlayEnabled: Flow<Boolean> =
+ sfpsSensorInteractor.isAvailable.sample(displayStateInteractor.isInRearDisplayMode) {
+ isAvailable: Boolean,
+ isInRearDisplayMode: Boolean ->
+ isAvailable && !isInRearDisplayMode
+ }
+
+ private val showSideFpsOverlay: Flow<Boolean> =
+ combine(
+ biometricStatusInteractor.sfpsAuthenticationReason,
+ deviceEntrySideFpsOverlayInteractor.showIndicatorForDeviceEntry,
+ // TODO(b/365182034): add progress bar input when rest to unlock feature is implemented
+ ) { systemServerAuthReason, showIndicatorForDeviceEntry ->
+ Log.d(
+ TAG,
+ "systemServerAuthReason = $systemServerAuthReason, " +
+ "showIndicatorForDeviceEntry = $showIndicatorForDeviceEntry, "
+ )
+ systemServerAuthReason != NotRunning || showIndicatorForDeviceEntry
+ }
+
+ override val isShowing: Flow<Boolean> =
+ sfpsOverlayEnabled
+ .flatMapLatest { sfpsOverlayEnabled ->
+ if (!sfpsOverlayEnabled) {
+ flowOf(false)
+ } else {
+ showSideFpsOverlay
+ }
+ }
+ .onEach { Log.d(TAG, "isShowing: $it") }
+
+ companion object {
+ private const val TAG = "SideFpsOverlayInteractor"
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt
index 85c3ae3..d055731 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt
@@ -18,13 +18,11 @@
import android.animation.Animator
import android.animation.AnimatorSet
-import android.animation.ValueAnimator
import android.graphics.Outline
import android.graphics.Rect
import android.transition.AutoTransition
import android.transition.TransitionManager
import android.util.TypedValue
-import android.view.Surface
import android.view.View
import android.view.ViewGroup
import android.view.ViewOutlineProvider
@@ -160,16 +158,13 @@
fun setVisibilities(hideSensorIcon: Boolean, size: PromptSize) {
viewsToHideWhenSmall.forEach { it.showContentOrHide(forceHide = size.isSmall) }
largeConstraintSet.setVisibility(iconHolderView.id, View.GONE)
- largeConstraintSet.setVisibility(R.id.biometric_icon_overlay, View.GONE)
largeConstraintSet.setVisibility(R.id.indicator, View.GONE)
largeConstraintSet.setVisibility(R.id.scrollView, View.GONE)
if (hideSensorIcon) {
smallConstraintSet.setVisibility(iconHolderView.id, View.GONE)
- smallConstraintSet.setVisibility(R.id.biometric_icon_overlay, View.GONE)
smallConstraintSet.setVisibility(R.id.indicator, View.GONE)
mediumConstraintSet.setVisibility(iconHolderView.id, View.GONE)
- mediumConstraintSet.setVisibility(R.id.biometric_icon_overlay, View.GONE)
mediumConstraintSet.setVisibility(R.id.indicator, View.GONE)
}
}
@@ -413,13 +408,12 @@
ANIMATE_SMALL_TO_MEDIUM_DURATION_MS.toLong()
)
- TransitionManager.beginDelayedTransition(view, autoTransition)
-
if (position.isLeft) {
flipConstraintSet.applyTo(view)
} else {
mediumConstraintSet.applyTo(view)
}
+ TransitionManager.beginDelayedTransition(view, autoTransition)
}
size.isMedium -> {
if (position.isLeft) {
@@ -428,14 +422,18 @@
mediumConstraintSet.applyTo(view)
}
}
- size.isLarge && currentSize.isMedium -> {
+ size.isLarge -> {
val autoTransition = AutoTransition()
autoTransition.setDuration(
- ANIMATE_MEDIUM_TO_LARGE_DURATION_MS.toLong()
+ if (currentSize.isSmall) {
+ ANIMATE_SMALL_TO_MEDIUM_DURATION_MS.toLong()
+ } else {
+ ANIMATE_MEDIUM_TO_LARGE_DURATION_MS.toLong()
+ }
)
- TransitionManager.beginDelayedTransition(view, autoTransition)
largeConstraintSet.applyTo(view)
+ TransitionManager.beginDelayedTransition(view, autoTransition)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt
index 9578da4..9fe1dc5 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt
@@ -33,89 +33,44 @@
import com.android.app.animation.Interpolators
import com.android.keyguard.KeyguardPINView
import com.android.systemui.CoreStartable
-import com.android.systemui.biometrics.domain.interactor.BiometricStatusInteractor
-import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractor
-import com.android.systemui.biometrics.domain.interactor.SideFpsSensorInteractor
-import com.android.systemui.biometrics.shared.model.AuthenticationReason.NotRunning
+import com.android.systemui.biometrics.domain.interactor.SideFpsOverlayInteractor
import com.android.systemui.biometrics.shared.model.LottieCallback
import com.android.systemui.biometrics.ui.viewmodel.SideFpsOverlayViewModel
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
-import com.android.systemui.keyguard.domain.interactor.DeviceEntrySideFpsOverlayInteractor
-import com.android.systemui.keyguard.ui.viewmodel.SideFpsProgressBarViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.res.R
-import com.android.systemui.util.kotlin.sample
import dagger.Lazy
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.launch
/** Binds the side fingerprint sensor indicator view to [SideFpsOverlayViewModel]. */
-@OptIn(ExperimentalCoroutinesApi::class)
@SysUISingleton
class SideFpsOverlayViewBinder
@Inject
constructor(
@Application private val applicationScope: CoroutineScope,
@Application private val applicationContext: Context,
- private val biometricStatusInteractor: Lazy<BiometricStatusInteractor>,
- private val displayStateInteractor: Lazy<DisplayStateInteractor>,
- private val deviceEntrySideFpsOverlayInteractor: Lazy<DeviceEntrySideFpsOverlayInteractor>,
private val layoutInflater: Lazy<LayoutInflater>,
- private val sideFpsProgressBarViewModel: Lazy<SideFpsProgressBarViewModel>,
- private val sfpsSensorInteractor: Lazy<SideFpsSensorInteractor>,
+ private val sideFpsOverlayInteractor: Lazy<SideFpsOverlayInteractor>,
+ private val sideFpsOverlayViewModel: Lazy<SideFpsOverlayViewModel>,
private val windowManager: Lazy<WindowManager>
) : CoreStartable {
+ private var overlayView: View? = null
override fun start() {
- applicationScope
- .launch {
- sfpsSensorInteractor.get().isAvailable.collect { isSfpsAvailable ->
- if (isSfpsAvailable) {
- combine(
- biometricStatusInteractor.get().sfpsAuthenticationReason,
- deviceEntrySideFpsOverlayInteractor
- .get()
- .showIndicatorForDeviceEntry,
- sideFpsProgressBarViewModel.get().isVisible,
- ::Triple
- )
- .sample(displayStateInteractor.get().isInRearDisplayMode, ::Pair)
- .collect { (combinedFlows, isInRearDisplayMode: Boolean) ->
- val (
- systemServerAuthReason,
- showIndicatorForDeviceEntry,
- progressBarIsVisible) =
- combinedFlows
- Log.d(
- TAG,
- "systemServerAuthReason = $systemServerAuthReason, " +
- "showIndicatorForDeviceEntry = " +
- "$showIndicatorForDeviceEntry, " +
- "progressBarIsVisible = $progressBarIsVisible"
- )
- if (!isInRearDisplayMode) {
- if (progressBarIsVisible) {
- hide()
- } else if (systemServerAuthReason != NotRunning) {
- show()
- } else if (showIndicatorForDeviceEntry) {
- show()
- } else {
- hide()
- }
- }
- }
- }
+ applicationScope.launch {
+ sideFpsOverlayInteractor.get().isShowing.collect { isShowing: Boolean ->
+ if (isShowing) {
+ show()
+ } else {
+ hide()
}
}
+ }
}
- private var overlayView: View? = null
-
/** Show the side fingerprint sensor indicator */
private fun show() {
if (overlayView?.isAttachedToWindow == true) {
@@ -125,17 +80,10 @@
)
return
}
-
overlayView = layoutInflater.get().inflate(R.layout.sidefps_view, null, false)
-
- val overlayViewModel =
- SideFpsOverlayViewModel(
- applicationContext,
- deviceEntrySideFpsOverlayInteractor.get(),
- displayStateInteractor.get(),
- sfpsSensorInteractor.get(),
- )
+ val overlayViewModel = sideFpsOverlayViewModel.get()
bind(overlayView!!, overlayViewModel, windowManager.get())
+
overlayView!!.visibility = View.INVISIBLE
Log.d(TAG, "show(): adding overlayView $overlayView")
windowManager.get().addView(overlayView, overlayViewModel.defaultOverlayViewParams)
@@ -161,6 +109,20 @@
companion object {
private const val TAG = "SideFpsOverlayViewBinder"
+ private val accessibilityDelegate =
+ object : View.AccessibilityDelegate() {
+ override fun dispatchPopulateAccessibilityEvent(
+ host: View,
+ event: AccessibilityEvent
+ ): Boolean {
+ return if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
+ true
+ } else {
+ super.dispatchPopulateAccessibilityEvent(host, event)
+ }
+ }
+ }
+
/** Binds overlayView (side fingerprint sensor indicator view) to SideFpsOverlayViewModel */
fun bind(
overlayView: View,
@@ -184,24 +146,7 @@
overlayShowAnimator.start()
- it.setAccessibilityDelegate(
- object : View.AccessibilityDelegate() {
- override fun dispatchPopulateAccessibilityEvent(
- host: View,
- event: AccessibilityEvent
- ): Boolean {
- return if (
- event.getEventType() ===
- android.view.accessibility.AccessibilityEvent
- .TYPE_WINDOW_STATE_CHANGED
- ) {
- true
- } else {
- super.dispatchPopulateAccessibilityEvent(host, event)
- }
- }
- }
- )
+ it.accessibilityDelegate = accessibilityDelegate
repeatOnLifecycle(Lifecycle.State.STARTED) {
launch {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
index 168ba11..85f221f 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
@@ -78,11 +78,11 @@
class PromptViewModel
@Inject
constructor(
- displayStateInteractor: DisplayStateInteractor,
+ private val displayStateInteractor: DisplayStateInteractor,
private val promptSelectorInteractor: PromptSelectorInteractor,
@Application private val context: Context,
- private val udfpsOverlayInteractor: UdfpsOverlayInteractor,
- private val biometricStatusInteractor: BiometricStatusInteractor,
+ udfpsOverlayInteractor: UdfpsOverlayInteractor,
+ biometricStatusInteractor: BiometricStatusInteractor,
private val udfpsUtils: UdfpsUtils,
private val iconProvider: IconProvider,
private val activityTaskManager: ActivityTaskManager,
@@ -135,11 +135,13 @@
R.dimen.biometric_prompt_landscape_medium_horizontal_padding
)
+ val currentRotation: StateFlow<DisplayRotation> = displayStateInteractor.currentRotation
+
val udfpsOverlayParams: StateFlow<UdfpsOverlayParams> =
udfpsOverlayInteractor.udfpsOverlayParams
private val udfpsSensorBounds: Flow<Rect> =
- combine(udfpsOverlayParams, displayStateInteractor.currentRotation) { params, rotation ->
+ combine(udfpsOverlayParams, currentRotation) { params, rotation ->
val rotatedBounds = Rect(params.sensorBounds)
RotationUtils.rotateBounds(
rotatedBounds,
@@ -262,7 +264,7 @@
_forceLargeSize,
promptKind,
displayStateInteractor.isLargeScreen,
- displayStateInteractor.currentRotation,
+ currentRotation,
modalities
) { forceLarge, promptKind, isLargeScreen, rotation, modalities ->
when {
@@ -454,7 +456,7 @@
/** Padding for prompt UI elements */
val promptPadding: Flow<Rect> =
- combine(size, displayStateInteractor.currentRotation) { size, rotation ->
+ combine(size, currentRotation) { size, rotation ->
if (size != PromptSize.LARGE) {
val navBarInsets = Utils.getNavbarInsets(context)
if (rotation == DisplayRotation.ROTATION_90) {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModel.kt
index c2a4ee3..7c1984e 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModel.kt
@@ -147,8 +147,7 @@
_lottieBounds,
sensorLocation,
displayRotation,
- ) { bounds: Rect?, sensorLocation: SideFpsSensorLocation, displayRotation: DisplayRotation
- ->
+ ) { _: Rect?, sensorLocation: SideFpsSensorLocation, _: DisplayRotation ->
val topLeft = Point(sensorLocation.left, sensorLocation.top)
defaultOverlayViewParams.apply {
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt
index f36ef66..8b5a09b 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt
@@ -34,10 +34,14 @@
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.doze.DozeLogger
+import com.android.systemui.scene.domain.interactor.SceneInteractor
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
+import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionsRepository
import com.android.systemui.telephony.domain.interactor.TelephonyInteractor
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import com.android.systemui.util.EmergencyDialerConstants
+import dagger.Lazy
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
@@ -69,6 +73,7 @@
private val emergencyDialerIntentFactory: EmergencyDialerIntentFactory,
private val metricsLogger: MetricsLogger,
private val dozeLogger: DozeLogger,
+ private val sceneInteractor: Lazy<SceneInteractor>,
) {
/** The bouncer action button. If `null`, the button should not be shown. */
val actionButton: Flow<BouncerActionButtonModel?> =
@@ -158,14 +163,17 @@
}
private fun prepareToPerformAction() {
- // TODO(b/308001302): Trigger occlusion and resetting bouncer state.
+ if (SceneContainerFlag.isEnabled) {
+ sceneInteractor.get().changeScene(Scenes.Lockscreen, "Bouncer action button clicked")
+ }
+
metricsLogger.action(MetricsEvent.ACTION_EMERGENCY_CALL)
activityTaskManager.stopSystemLockTaskMode()
}
@SuppressLint("MissingPermission")
private fun returnToCall() {
- telecomManager?.showInCallScreen(/* showDialpad = */ false)
+ telecomManager?.showInCallScreen(/* showDialpad= */ false)
}
private val <T> Flow<T>.asUnitFlow: Flow<Unit>
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/shared/flag/ComposeBouncerFlags.kt b/packages/SystemUI/src/com/android/systemui/bouncer/shared/flag/ComposeBouncerFlags.kt
index a1111f6..d7a4863b 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/shared/flag/ComposeBouncerFlags.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/shared/flag/ComposeBouncerFlags.kt
@@ -21,6 +21,10 @@
object ComposeBouncerFlags {
+ /** @see [isComposeBouncerOrSceneContainerEnabled] */
+ val isEnabled: Boolean
+ get() = isComposeBouncerOrSceneContainerEnabled()
+
/**
* Returns `true` if the Compose bouncer is enabled or if the scene container framework is
* enabled; `false` otherwise.
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/helper/BouncerHapticPlayer.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/helper/BouncerHapticPlayer.kt
new file mode 100644
index 0000000..19e7537
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/helper/BouncerHapticPlayer.kt
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.bouncer.ui.helper
+
+import android.view.HapticFeedbackConstants
+import android.view.View
+import com.android.keyguard.AuthInteractionProperties
+import com.android.systemui.Flags
+//noinspection CleanArchitectureDependencyViolation: Data layer only referenced for this enum class
+import com.google.android.msdl.data.model.MSDLToken
+import com.google.android.msdl.domain.MSDLPlayer
+import javax.inject.Inject
+
+/**
+ * A helper class to deliver haptic feedback in bouncer interactions.
+ *
+ * @param[msdlPlayer] The [MSDLPlayer] used to deliver MSDL feedback.
+ */
+class BouncerHapticPlayer @Inject constructor(private val msdlPlayer: dagger.Lazy<MSDLPlayer>) {
+
+ private val authInteractionProperties by
+ lazy(LazyThreadSafetyMode.NONE) { AuthInteractionProperties() }
+
+ val isEnabled: Boolean
+ get() = Flags.msdlFeedback()
+
+ /**
+ * Deliver MSDL feedback as a result of authenticating through a bouncer.
+ *
+ * @param[authenticationSucceeded] Whether the authentication was successful or not.
+ */
+ fun playAuthenticationFeedback(authenticationSucceeded: Boolean) {
+ if (!isEnabled) return
+
+ val token =
+ if (authenticationSucceeded) {
+ MSDLToken.UNLOCK
+ } else {
+ MSDLToken.FAILURE
+ }
+ msdlPlayer.get().playToken(token, authInteractionProperties)
+ }
+
+ /**
+ * Deliver feedback when dragging through cells in the pattern bouncer. This function can play
+ * MSDL feedback using a [MSDLPlayer], or fallback to a default haptic feedback using the
+ * [View.performHapticFeedback] API and a [View].
+ *
+ * @param[view] A [View] for default haptic feedback using [View.performHapticFeedback]
+ */
+ fun playPatternDotFeedback(view: View?) {
+ if (!isEnabled) {
+ view?.performHapticFeedback(
+ HapticFeedbackConstants.VIRTUAL_KEY,
+ HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING,
+ )
+ } else {
+ msdlPlayer.get().playToken(MSDLToken.DRAG_INDICATOR)
+ }
+ }
+
+ /** Deliver MSDL feedback when the delete key of the pin bouncer is pressed */
+ fun playDeleteKeyPressFeedback() = msdlPlayer.get().playToken(MSDLToken.KEYPRESS_DELETE)
+
+ /**
+ * Deliver MSDL feedback when the delete key of the pin bouncer is long-pressed
+ *
+ * @return whether MSDL feedback is allowed to play.
+ */
+ fun playDeleteKeyLongPressedFeedback() = msdlPlayer.get().playToken(MSDLToken.LONG_PRESS)
+
+ /** Deliver MSDL feedback when a numpad key is pressed on the pin bouncer */
+ fun playNumpadKeyFeedback() = msdlPlayer.get().playToken(MSDLToken.KEYPRESS_STANDARD)
+}
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt
index df6ca9b..da29c62 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt
@@ -31,6 +31,7 @@
import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
import com.android.systemui.bouncer.domain.interactor.BouncerInteractor
import com.android.systemui.bouncer.domain.interactor.SimBouncerInteractor
+import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.res.R
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
@@ -265,6 +266,15 @@
}
}
+ /** Notifies that the user has pressed down on a digit button. */
+ fun onDigitButtonDown() {
+ if (ComposeBouncerFlags.isOnlyComposeBouncerEnabled()) {
+ // Current PIN bouncer informs FalsingInteractor#avoidGesture() upon every Pin button
+ // touch.
+ super.onDown()
+ }
+ }
+
@AssistedFactory
interface Factory {
fun create(
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
index e1ba93c..83d4091 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
@@ -34,8 +34,6 @@
import com.android.systemui.classifier.FalsingDataProvider.SessionListener;
import com.android.systemui.classifier.HistoryTracker.BeliefListener;
import com.android.systemui.dagger.qualifiers.TestHarness;
-import com.android.systemui.flags.FeatureFlags;
-import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -396,6 +394,7 @@
|| mDataProvider.isA11yAction()
|| mDataProvider.isFromTrackpad()
|| mDataProvider.isFromKeyboard()
+ || !mDataProvider.isTouchScreenSource()
|| mDataProvider.isUnfolded();
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java
index dcd4195..a62600d 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java
@@ -25,6 +25,7 @@
public class FalsingCollectorFake implements FalsingCollector {
public KeyEvent lastKeyEvent = null;
+ public boolean avoidGestureInvoked = false;
@Override
public void init() {
@@ -87,6 +88,16 @@
@Override
public void avoidGesture() {
+ avoidGestureInvoked = true;
+ }
+
+ /**
+ * @return whether {@link #avoidGesture()} was invoked.
+ */
+ public boolean wasLastGestureAvoided() {
+ boolean wasLastGestureAvoided = avoidGestureInvoked;
+ avoidGestureInvoked = false;
+ return wasLastGestureAvoided;
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
index 2eca02c..962ab99 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
@@ -21,6 +21,7 @@
import android.hardware.SensorManager;
import android.hardware.biometrics.BiometricSourceType;
import android.util.Log;
+import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -28,6 +29,7 @@
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
+import com.android.systemui.Flags;
import com.android.systemui.communal.domain.interactor.CommunalInteractor;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
@@ -343,7 +345,9 @@
// will be ignored by the collector until another MotionEvent.ACTION_DOWN is passed in.
// avoidGesture must be called immediately following the MotionEvent.ACTION_DOWN, before
// any other events are processed, otherwise the whole gesture will be recorded.
- if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
+ //
+ // We should only delay processing of these events for touchscreen sources
+ if (ev.getActionMasked() == MotionEvent.ACTION_DOWN && isTouchscreenSource(ev)) {
// Make a copy of ev, since it will be recycled after we exit this method.
mPendingDownEvent = MotionEvent.obtain(ev);
mAvoidGesture = false;
@@ -410,6 +414,22 @@
mFalsingDataProvider.onA11yAction();
}
+ /**
+ * returns {@code true} if the device supports Touchscreen, {@code false} otherwise. Defaults to
+ * {@code true} if the device is {@code null}
+ */
+ private boolean isTouchscreenSource(MotionEvent ev) {
+ if (!Flags.nonTouchscreenDevicesBypassFalsing()) {
+ return true;
+ }
+ InputDevice device = ev.getDevice();
+ if (device != null) {
+ return device.supportsSource(InputDevice.SOURCE_TOUCHSCREEN);
+ } else {
+ return true;
+ }
+ }
+
private boolean shouldSessionBeActive() {
return mScreenOn
&& (mState == StatusBarState.KEYGUARD)
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java
index 1501701..769976e 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java
@@ -20,11 +20,13 @@
import android.hardware.devicestate.DeviceStateManager.FoldStateListener;
import android.util.DisplayMetrics;
+import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.MotionEvent.PointerCoords;
import android.view.MotionEvent.PointerProperties;
+import com.android.systemui.Flags;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dock.DockManager;
import com.android.systemui.statusbar.policy.BatteryController;
@@ -281,6 +283,9 @@
}
public boolean isFromTrackpad() {
+ if (Flags.nonTouchscreenDevicesBypassFalsing()) {
+ return false;
+ }
if (mRecentMotionEvents.isEmpty()) {
return false;
}
@@ -290,6 +295,25 @@
|| classification == MotionEvent.CLASSIFICATION_TWO_FINGER_SWIPE;
}
+ /**
+ * returns {@code true} if the device supports Touchscreen, {@code false} otherwise. Defaults to
+ * {@code true} if the device is {@code null}
+ */
+ public boolean isTouchScreenSource() {
+ if (!Flags.nonTouchscreenDevicesBypassFalsing()) {
+ return true;
+ }
+ if (mRecentMotionEvents.isEmpty()) {
+ return true;
+ }
+ InputDevice device = mRecentMotionEvents.get(mRecentMotionEvents.size() - 1).getDevice();
+ if (device != null) {
+ return device.supportsSource(InputDevice.SOURCE_TOUCHSCREEN);
+ } else {
+ return true;
+ }
+ }
+
private void recalculateData() {
if (!mDirty) {
return;
diff --git a/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingView.kt b/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingView.kt
index b6ace81..9c4736a 100644
--- a/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingView.kt
+++ b/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingView.kt
@@ -27,6 +27,7 @@
import android.view.accessibility.AccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat
+import com.android.systemui.log.LongPressHandlingViewLogger
import com.android.systemui.shade.TouchLogger
import kotlin.math.pow
import kotlin.math.sqrt
@@ -42,6 +43,8 @@
context: Context,
attrs: AttributeSet?,
longPressDuration: () -> Long,
+ allowedTouchSlop: Int = ViewConfiguration.getTouchSlop(),
+ logger: LongPressHandlingViewLogger? = null,
) :
View(
context,
@@ -97,6 +100,8 @@
},
onSingleTapDetected = { listener?.onSingleTapDetected(this@LongPressHandlingView) },
longPressDuration = longPressDuration,
+ allowedTouchSlop = allowedTouchSlop,
+ logger = logger,
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandler.kt b/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandler.kt
index d3fc610..4e38a49 100644
--- a/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandler.kt
+++ b/packages/SystemUI/src/com/android/systemui/common/ui/view/LongPressHandlingViewInteractionHandler.kt
@@ -17,7 +17,7 @@
package com.android.systemui.common.ui.view
-import android.view.ViewConfiguration
+import com.android.systemui.log.LongPressHandlingViewLogger
import kotlinx.coroutines.DisposableHandle
/** Encapsulates logic to handle complex touch interactions with a [LongPressHandlingView]. */
@@ -35,6 +35,14 @@
private val onSingleTapDetected: () -> Unit,
/** Time for the touch to be considered a long-press in ms */
var longPressDuration: () -> Long,
+ /**
+ * Default touch slop that is allowed, if the movement between [MotionEventModel.Down] and
+ * [MotionEventModel.Up] is more than [allowedTouchSlop] then the touch is not processed as
+ * single tap or a long press.
+ */
+ val allowedTouchSlop: Int,
+ /** Optional logger that can be passed in to log touch events */
+ val logger: LongPressHandlingViewLogger? = null,
) {
sealed class MotionEventModel {
object Other : MotionEventModel()
@@ -70,22 +78,26 @@
true
}
is MotionEventModel.Move -> {
- if (event.distanceMoved > ViewConfiguration.getTouchSlop()) {
+ if (event.distanceMoved > allowedTouchSlop) {
+ logger?.cancelingLongPressDueToTouchSlop(event.distanceMoved, allowedTouchSlop)
cancelScheduledLongPress()
}
false
}
is MotionEventModel.Up -> {
+ logger?.onUpEvent(event.distanceMoved, allowedTouchSlop, event.gestureDuration)
cancelScheduledLongPress()
if (
- event.distanceMoved <= ViewConfiguration.getTouchSlop() &&
+ event.distanceMoved <= allowedTouchSlop &&
event.gestureDuration < longPressDuration()
) {
+ logger?.dispatchingSingleTap()
dispatchSingleTap()
}
false
}
is MotionEventModel.Cancel -> {
+ logger?.motionEventCancelled()
cancelScheduledLongPress()
false
}
@@ -97,15 +109,18 @@
x: Int,
y: Int,
) {
+ val duration = longPressDuration()
+ logger?.schedulingLongPress(duration)
scheduledLongPressHandle =
postDelayed(
{
+ logger?.longPressTriggered()
dispatchLongPress(
x = x,
y = y,
)
},
- longPressDuration(),
+ duration,
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalDreamStartable.kt b/packages/SystemUI/src/com/android/systemui/communal/CommunalDreamStartable.kt
index c69cea4..04393fe 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/CommunalDreamStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalDreamStartable.kt
@@ -21,6 +21,7 @@
import com.android.systemui.CoreStartable
import com.android.systemui.Flags.glanceableHubAllowKeyguardWhenDreaming
import com.android.systemui.Flags.restartDreamOnUnocclude
+import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor
import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
@@ -55,6 +56,7 @@
private val keyguardInteractor: KeyguardInteractor,
private val keyguardTransitionInteractor: KeyguardTransitionInteractor,
private val dreamManager: DreamManager,
+ private val communalSceneInteractor: CommunalSceneInteractor,
@Background private val bgScope: CoroutineScope,
) : CoreStartable {
/** Flow that emits when the dream should be started underneath the glanceable hub. */
@@ -66,6 +68,8 @@
not(keyguardInteractor.isDreaming),
// TODO(b/362830856): Remove this workaround.
keyguardInteractor.isKeyguardShowing,
+ not(communalSceneInteractor.isLaunchingWidget),
+ not(keyguardInteractor.isKeyguardOccluded),
)
.filter { it }
diff --git a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt
index ac496f0..3826fb4 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt
@@ -24,11 +24,14 @@
import com.android.systemui.communal.domain.model.CommunalTransitionProgressModel
import com.android.systemui.communal.shared.log.CommunalSceneLogger
import com.android.systemui.communal.shared.model.CommunalScenes
-import com.android.systemui.communal.shared.model.CommunalTransitionKeys
+import com.android.systemui.communal.shared.model.CommunalScenes.toSceneContainerSceneKey
import com.android.systemui.communal.shared.model.EditModeState
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.shared.model.KeyguardState
+import com.android.systemui.scene.domain.interactor.SceneInteractor
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
+import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf
import com.android.systemui.util.kotlin.pairwiseBy
import javax.inject.Inject
@@ -45,6 +48,7 @@
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.stateIn
@OptIn(ExperimentalCoroutinesApi::class)
@@ -55,6 +59,7 @@
@Application private val applicationScope: CoroutineScope,
private val repository: CommunalSceneRepository,
private val logger: CommunalSceneLogger,
+ private val sceneInteractor: SceneInteractor,
) {
private val _isLaunchingWidget = MutableStateFlow(false)
@@ -72,8 +77,14 @@
private val onSceneAboutToChangeListener = mutableSetOf<OnSceneAboutToChangeListener>()
- /** Registers a listener which is called when the scene is about to change. */
+ /**
+ * Registers a listener which is called when the scene is about to change.
+ *
+ * This API is for legacy communal container scenes, and should not be used when
+ * [SceneContainerFlag] is enabled.
+ */
fun registerSceneStateProcessor(processor: OnSceneAboutToChangeListener) {
+ SceneContainerFlag.assertInLegacyMode()
onSceneAboutToChangeListener.add(processor)
}
@@ -87,6 +98,15 @@
transitionKey: TransitionKey? = null,
keyguardState: KeyguardState? = null,
) {
+ if (SceneContainerFlag.isEnabled) {
+ return sceneInteractor.changeScene(
+ toScene = newScene.toSceneContainerSceneKey(),
+ loggingReason = loggingReason,
+ transitionKey = transitionKey,
+ sceneState = keyguardState,
+ )
+ }
+
applicationScope.launch("$TAG#changeScene") {
if (currentScene.value == newScene) return@launch
logger.logSceneChangeRequested(
@@ -107,6 +127,13 @@
delayMillis: Long = 0,
keyguardState: KeyguardState? = null
) {
+ if (SceneContainerFlag.isEnabled) {
+ return sceneInteractor.snapToScene(
+ toScene = newScene.toSceneContainerSceneKey(),
+ loggingReason = loggingReason,
+ )
+ }
+
applicationScope.launch("$TAG#snapToScene") {
delay(delayMillis)
if (currentScene.value == newScene) return@launch
@@ -125,37 +152,27 @@
onSceneAboutToChangeListener.forEach { it.onSceneAboutToChange(newScene, keyguardState) }
}
- /** Changes to Blank scene when starting an activity after dismissing keyguard. */
- fun changeSceneForActivityStartOnDismissKeyguard() {
- // skip if we're starting edit mode activity, as it will be handled later by changeScene
- // with transition key [CommunalTransitionKeys.ToEditMode].
- if (_editModeState.value == EditModeState.STARTING) {
- return
- }
- changeScene(
- CommunalScenes.Blank,
- "activity start dismissing keyguard",
- CommunalTransitionKeys.SimpleFade,
- )
- }
-
/**
* Target scene as requested by the underlying [SceneTransitionLayout] or through [changeScene].
*/
val currentScene: StateFlow<SceneKey> =
- repository.currentScene
- .pairwiseBy(initialValue = repository.currentScene.value) { from, to ->
- logger.logSceneChangeCommitted(
- from = from,
- to = to,
+ if (SceneContainerFlag.isEnabled) {
+ sceneInteractor.currentScene
+ } else {
+ repository.currentScene
+ .pairwiseBy(initialValue = repository.currentScene.value) { from, to ->
+ logger.logSceneChangeCommitted(
+ from = from,
+ to = to,
+ )
+ to
+ }
+ .stateIn(
+ scope = applicationScope,
+ started = SharingStarted.Eagerly,
+ initialValue = repository.currentScene.value,
)
- to
- }
- .stateIn(
- scope = applicationScope,
- started = SharingStarted.Eagerly,
- initialValue = repository.currentScene.value,
- )
+ }
private val _editModeState = MutableStateFlow<EditModeState?>(null)
/**
@@ -170,13 +187,17 @@
/** Transition state of the hub mode. */
val transitionState: StateFlow<ObservableTransitionState> =
- repository.transitionState
- .onEach { logger.logSceneTransition(it) }
- .stateIn(
- scope = applicationScope,
- started = SharingStarted.Eagerly,
- initialValue = repository.transitionState.value,
- )
+ if (SceneContainerFlag.isEnabled) {
+ sceneInteractor.transitionState
+ } else {
+ repository.transitionState
+ .onEach { logger.logSceneTransition(it) }
+ .stateIn(
+ scope = applicationScope,
+ started = SharingStarted.Eagerly,
+ initialValue = repository.transitionState.value,
+ )
+ }
/**
* Updates the transition state of the hub [SceneTransitionLayout].
@@ -184,10 +205,19 @@
* Note that you must call is with `null` when the UI is done or risk a memory leak.
*/
fun setTransitionState(transitionState: Flow<ObservableTransitionState>?) {
- repository.setTransitionState(transitionState)
+ if (SceneContainerFlag.isEnabled) {
+ sceneInteractor.setTransitionState(transitionState)
+ } else {
+ repository.setTransitionState(transitionState)
+ }
}
- /** Returns a flow that tracks the progress of transitions to the given scene from 0-1. */
+ /**
+ * Returns a flow that tracks the progress of transitions to the given scene from 0-1.
+ *
+ * This API is for legacy communal container scenes, and should not be used when
+ * [SceneContainerFlag] is enabled.
+ */
fun transitionProgressToScene(targetScene: SceneKey) =
transitionState
.flatMapLatest { state ->
@@ -209,6 +239,7 @@
}
}
.distinctUntilChanged()
+ .onStart { SceneContainerFlag.assertInLegacyMode() }
/**
* Flow that emits a boolean if the communal UI is fully visible and not in transition.
@@ -219,7 +250,10 @@
val isIdleOnCommunal: StateFlow<Boolean> =
transitionState
.map {
- it is ObservableTransitionState.Idle && it.currentScene == CommunalScenes.Communal
+ it is ObservableTransitionState.Idle &&
+ (it.currentScene ==
+ if (SceneContainerFlag.isEnabled) Scenes.Communal
+ else CommunalScenes.Communal)
}
.stateIn(
scope = applicationScope,
@@ -239,7 +273,13 @@
val isCommunalVisible: StateFlow<Boolean> =
transitionState
.map {
- !(it is ObservableTransitionState.Idle && it.currentScene == CommunalScenes.Blank)
+ if (SceneContainerFlag.isEnabled)
+ it is ObservableTransitionState.Idle && it.currentScene == Scenes.Communal ||
+ (it is ObservableTransitionState.Transition &&
+ (it.fromContent == Scenes.Communal || it.toContent == Scenes.Communal))
+ else
+ !(it is ObservableTransitionState.Idle &&
+ it.currentScene == CommunalScenes.Blank)
}
.stateIn(
scope = applicationScope,
diff --git a/packages/SystemUI/src/com/android/systemui/communal/shared/model/CommunalScenes.kt b/packages/SystemUI/src/com/android/systemui/communal/shared/model/CommunalScenes.kt
index d5a56c1..e562dfc 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/shared/model/CommunalScenes.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/shared/model/CommunalScenes.kt
@@ -17,6 +17,8 @@
package com.android.systemui.communal.shared.model
import com.android.compose.animation.scene.SceneKey
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
+import com.android.systemui.scene.shared.model.Scenes
/** Definition of the possible scenes for the communal UI. */
object CommunalScenes {
@@ -27,4 +29,30 @@
@JvmField val Communal = SceneKey("communal")
@JvmField val Default = Blank
+
+ private fun SceneKey.isCommunalScene(): Boolean {
+ return this == Blank || this == Communal
+ }
+
+ /**
+ * Maps a legacy communal scene to a scene in the scene container.
+ *
+ * The rules are simple:
+ * - A legacy communal scene maps to a communal scene in the Scene Transition Framework (STF).
+ * - A legacy blank scene means that the communal scene layout does not render anything so
+ * whatever is beneath the layout is shown. That usually means lockscreen or dream, both of
+ * which are represented by the lockscreen scene in STF (but different keyguard states in
+ * KTF).
+ */
+ fun SceneKey.toSceneContainerSceneKey(): SceneKey {
+ if (!isCommunalScene() || !SceneContainerFlag.isEnabled) {
+ return this
+ }
+
+ return when (this) {
+ Communal -> Scenes.Communal
+ Blank -> Scenes.Lockscreen
+ else -> throw Throwable("Unrecognized communal scene: $this")
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt
index d84dc20..13b4aa9 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt
@@ -50,6 +50,7 @@
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.core.Logger
import com.android.systemui.log.dagger.CommunalLog
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
import javax.inject.Inject
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
@@ -244,15 +245,18 @@
private fun listenForTransitionAndChangeScene() {
lifecycleScope.launch {
communalViewModel.canShowEditMode.collect {
- communalViewModel.changeScene(
- scene = CommunalScenes.Blank,
- loggingReason = "edit mode opening",
- transitionKey = CommunalTransitionKeys.ToEditMode,
- keyguardState = KeyguardState.GONE,
- )
- // wait till transitioned to Blank scene, then animate in communal content in
- // edit mode
- communalViewModel.currentScene.first { it == CommunalScenes.Blank }
+ if (!SceneContainerFlag.isEnabled) {
+ communalViewModel.changeScene(
+ scene = CommunalScenes.Blank,
+ loggingReason = "edit mode opening",
+ transitionKey = CommunalTransitionKeys.ToEditMode,
+ keyguardState = KeyguardState.GONE,
+ )
+ // wait till transitioned to Blank scene, then animate in communal content in
+ // edit mode
+ communalViewModel.currentScene.first { it == CommunalScenes.Blank }
+ }
+
communalViewModel.setEditModeState(EditModeState.SHOWING)
// Inform the ActivityController that we are now fully visible.
diff --git a/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsModule.kt b/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsModule.kt
index db7ffc1..037b6fa 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsModule.kt
@@ -48,6 +48,7 @@
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.DeviceControlsTile
import com.android.systemui.qs.tiles.viewmodel.QSTileConfig
@@ -86,15 +87,16 @@
@IntoMap
@StringKey(DEVICE_CONTROLS_SPEC)
fun provideDeviceControlsTileConfig(uiEventLogger: QsEventLogger): QSTileConfig =
- QSTileConfig(
- tileSpec = TileSpec.create(DEVICE_CONTROLS_SPEC),
- uiConfig =
- QSTileUIConfig.Resource(
- iconRes = com.android.systemui.res.R.drawable.controls_icon,
- labelRes = com.android.systemui.res.R.string.quick_controls_title
- ),
- instanceId = uiEventLogger.getNewInstanceId(),
- )
+ QSTileConfig(
+ tileSpec = TileSpec.create(DEVICE_CONTROLS_SPEC),
+ uiConfig =
+ QSTileUIConfig.Resource(
+ iconRes = com.android.systemui.res.R.drawable.controls_icon,
+ labelRes = com.android.systemui.res.R.string.quick_controls_title
+ ),
+ instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.UTILITIES,
+ )
}
@Binds
@@ -115,12 +117,12 @@
@Binds
abstract fun provideSettingsManager(
- manager: ControlsSettingsRepositoryImpl
+ manager: ControlsSettingsRepositoryImpl
): ControlsSettingsRepository
@Binds
abstract fun provideDialogManager(
- manager: ControlsSettingsDialogManagerImpl
+ manager: ControlsSettingsDialogManagerImpl
): ControlsSettingsDialogManager
@Binds
@@ -141,8 +143,7 @@
repository: SelectedComponentRepositoryImpl
): SelectedComponentRepository
- @BindsOptionalOf
- abstract fun optionalPersistenceWrapper(): ControlsFavoritePersistenceWrapper
+ @BindsOptionalOf abstract fun optionalPersistenceWrapper(): ControlsFavoritePersistenceWrapper
@BindsOptionalOf
abstract fun provideControlsTileResourceConfiguration(): ControlsTileResourceConfiguration
@@ -157,23 +158,17 @@
@Binds
@IntoMap
@ClassKey(ControlsFavoritingActivity::class)
- abstract fun provideControlsFavoritingActivity(
- activity: ControlsFavoritingActivity
- ): Activity
+ abstract fun provideControlsFavoritingActivity(activity: ControlsFavoritingActivity): Activity
@Binds
@IntoMap
@ClassKey(ControlsEditingActivity::class)
- abstract fun provideControlsEditingActivity(
- activity: ControlsEditingActivity
- ): Activity
+ abstract fun provideControlsEditingActivity(activity: ControlsEditingActivity): Activity
@Binds
@IntoMap
@ClassKey(ControlsRequestDialog::class)
- abstract fun provideControlsRequestDialog(
- activity: ControlsRequestDialog
- ): Activity
+ abstract fun provideControlsRequestDialog(activity: ControlsRequestDialog): Activity
@Binds
@IntoMap
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java b/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java
index 21a704d..8818c3a 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java
@@ -202,6 +202,13 @@
return context.getSystemService(CaptioningManager.class);
}
+ @Provides
+ @Singleton
+ static UserScopedService<CaptioningManager> provideUserScopedCaptioningManager(
+ Context context) {
+ return new UserScopedServiceImpl<>(context, CaptioningManager.class);
+ }
+
/** */
@Provides
@Singleton
diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractor.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractor.kt
index 7018f9d..dbd7f07 100644
--- a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractor.kt
@@ -24,8 +24,11 @@
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.deviceentry.data.repository.DeviceEntryRepository
import com.android.systemui.keyguard.DismissCallbackRegistry
+import com.android.systemui.scene.data.model.asIterable
+import com.android.systemui.scene.domain.interactor.SceneBackInteractor
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.util.kotlin.pairwise
import com.android.systemui.utils.coroutines.flow.mapLatestConflated
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -34,6 +37,7 @@
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
@@ -59,6 +63,7 @@
private val deviceUnlockedInteractor: DeviceUnlockedInteractor,
private val alternateBouncerInteractor: AlternateBouncerInteractor,
private val dismissCallbackRegistry: DismissCallbackRegistry,
+ sceneBackInteractor: SceneBackInteractor,
) {
/**
* Whether the device is unlocked.
@@ -86,19 +91,40 @@
* Note: This does not imply that the lockscreen is visible or not.
*/
val isDeviceEntered: StateFlow<Boolean> =
- sceneInteractor.currentScene
- .filter { currentScene ->
- currentScene == Scenes.Gone || currentScene == Scenes.Lockscreen
- }
- .mapLatestConflated { scene ->
- if (scene == Scenes.Gone) {
- // Make sure device unlock status is definitely unlocked before we consider the
- // device "entered".
- deviceUnlockedInteractor.deviceUnlockStatus.first { it.isUnlocked }
- true
- } else {
- false
- }
+ combine(
+ // This flow emits true when the currentScene switches to Gone for the first time
+ // after having been on Lockscreen.
+ sceneInteractor.currentScene
+ .filter { currentScene ->
+ currentScene == Scenes.Gone || currentScene == Scenes.Lockscreen
+ }
+ .mapLatestConflated { scene ->
+ if (scene == Scenes.Gone) {
+ // Make sure device unlock status is definitely unlocked before we
+ // consider the device "entered".
+ deviceUnlockedInteractor.deviceUnlockStatus.first { it.isUnlocked }
+ true
+ } else {
+ false
+ }
+ },
+ // This flow emits true only if the bottom of the navigation back stack has been
+ // switched from Lockscreen to Gone. In other words, only if the device was unlocked
+ // while visiting at least one scene "above" the Lockscreen scene.
+ sceneBackInteractor.backStack
+ // The bottom of the back stack, which is Lockscreen, Gone, or null if empty.
+ .map { it.asIterable().lastOrNull() }
+ // Filter out cases where the stack changes but the bottom remains unchanged.
+ .distinctUntilChanged()
+ // Detect changes of the bottom of the stack, start with null, so the first
+ // update emits a value and the logic doesn't need to wait for a second value
+ // before emitting something.
+ .pairwise(initialValue = null)
+ // Replacing a bottom of the stack that was Lockscreen with Gone constitutes a
+ // "device entered" event.
+ .map { (from, to) -> from == Scenes.Lockscreen && to == Scenes.Gone },
+ ) { enteredDirectly, enteredOnBackStack ->
+ enteredOnBackStack || enteredDirectly
}
.stateIn(
scope = applicationScope,
@@ -129,7 +155,7 @@
},
isLockscreenEnabled,
deviceUnlockedInteractor.deviceUnlockStatus,
- isDeviceEntered
+ isDeviceEntered,
) { isNoneAuthMethod, isLockscreenEnabled, deviceUnlockStatus, isDeviceEntered ->
val isSwipeAuthMethod = isNoneAuthMethod && isLockscreenEnabled
(isSwipeAuthMethod ||
@@ -155,9 +181,7 @@
* canceled
*/
@JvmOverloads
- fun attemptDeviceEntry(
- callback: IKeyguardDismissCallback? = null,
- ) {
+ fun attemptDeviceEntry(callback: IKeyguardDismissCallback? = null) {
callback?.let { dismissCallbackRegistry.addCallback(it) }
// TODO (b/307768356),
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
index f6ac7a5..a45ad15 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
@@ -38,6 +38,7 @@
import com.android.systemui.dreams.homecontrols.HomeControlsDreamService;
import com.android.systemui.qs.QsEventLogger;
import com.android.systemui.qs.pipeline.shared.TileSpec;
+import com.android.systemui.qs.shared.model.TileCategory;
import com.android.systemui.qs.tiles.viewmodel.QSTileConfig;
import com.android.systemui.qs.tiles.viewmodel.QSTilePolicy;
import com.android.systemui.qs.tiles.viewmodel.QSTileUIConfig;
@@ -196,6 +197,7 @@
R.drawable.ic_qs_screen_saver,
R.string.quick_settings_screensaver_label),
uiEventLogger.getNewInstanceId(),
+ TileCategory.UTILITIES,
tileSpec.getSpec(),
QSTilePolicy.NoRestrictions.INSTANCE
);
diff --git a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt b/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt
index 3223433..0e2d9b6 100644
--- a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt
@@ -16,11 +16,25 @@
package com.android.systemui.education.domain.interactor
+import android.os.SystemProperties
+import com.android.systemui.contextualeducation.GestureType
+import com.android.systemui.contextualeducation.GestureType.ALL_APPS
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
-import com.android.systemui.contextualeducation.GestureType
+import com.android.systemui.education.dagger.ContextualEducationModule.EduClock
+import com.android.systemui.inputdevice.data.repository.UserInputDeviceRepository
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType.KEYBOARD
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType.TOUCHPAD
+import com.android.systemui.inputdevice.tutorial.data.repository.TutorialSchedulerRepository
+import java.time.Clock
import javax.inject.Inject
+import kotlin.time.Duration
+import kotlin.time.Duration.Companion.hours
+import kotlin.time.DurationUnit
+import kotlin.time.toDuration
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
/**
@@ -39,12 +53,29 @@
@Inject
constructor(
@Background private val backgroundScope: CoroutineScope,
- private val contextualEducationInteractor: ContextualEducationInteractor
+ private val contextualEducationInteractor: ContextualEducationInteractor,
+ private val inputDeviceRepository: UserInputDeviceRepository,
+ private val tutorialRepository: TutorialSchedulerRepository,
+ @EduClock private val clock: Clock,
) : KeyboardTouchpadEduStatsInteractor {
+ companion object {
+ val initialDelayDuration: Duration
+ get() =
+ SystemProperties.getLong(
+ "persist.contextual_edu.initial_delay_sec",
+ /* defaultValue= */ 72.hours.inWholeSeconds
+ )
+ .toDuration(DurationUnit.SECONDS)
+ }
+
override fun incrementSignalCount(gestureType: GestureType) {
- // Todo: check if keyboard/touchpad is connected before update
- backgroundScope.launch { contextualEducationInteractor.incrementSignalCount(gestureType) }
+ backgroundScope.launch {
+ val targetDevice = getTargetDevice(gestureType)
+ if (isTargetDeviceConnected(targetDevice) && hasInitialDelayElapsed(targetDevice)) {
+ contextualEducationInteractor.incrementSignalCount(gestureType)
+ }
+ }
}
override fun updateShortcutTriggerTime(gestureType: GestureType) {
@@ -52,4 +83,29 @@
contextualEducationInteractor.updateShortcutTriggerTime(gestureType)
}
}
+
+ private suspend fun isTargetDeviceConnected(deviceType: DeviceType): Boolean {
+ return when (deviceType) {
+ KEYBOARD -> inputDeviceRepository.isAnyKeyboardConnectedForUser.first().isConnected
+ TOUCHPAD -> inputDeviceRepository.isAnyTouchpadConnectedForUser.first().isConnected
+ }
+ }
+
+ /**
+ * Keyboard shortcut education would be provided for All Apps. Touchpad gesture education would
+ * be provided for the rest of the gesture types (i.e. Home, Overview, Back). This method maps
+ * gesture to its target education device.
+ */
+ private fun getTargetDevice(gestureType: GestureType) =
+ when (gestureType) {
+ ALL_APPS -> KEYBOARD
+ else -> TOUCHPAD
+ }
+
+ private suspend fun hasInitialDelayElapsed(deviceType: DeviceType): Boolean {
+ val oobeLaunchTime = tutorialRepository.launchTime(deviceType) ?: return false
+ return clock
+ .instant()
+ .isAfter(oobeLaunchTime.plusSeconds(initialDelayDuration.inWholeSeconds))
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/haptics/msdl/dagger/MSDLModule.kt b/packages/SystemUI/src/com/android/systemui/haptics/msdl/dagger/MSDLModule.kt
index 5ea96b8..d2dc8c1 100644
--- a/packages/SystemUI/src/com/android/systemui/haptics/msdl/dagger/MSDLModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/haptics/msdl/dagger/MSDLModule.kt
@@ -16,7 +16,9 @@
package com.android.systemui.haptics.msdl.dagger
+import android.annotation.SuppressLint
import android.content.Context
+import android.os.VibratorManager
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.google.android.msdl.domain.MSDLPlayer
@@ -25,8 +27,12 @@
@Module
object MSDLModule {
+ @SuppressLint("NonInjectedService")
@Provides
@SysUISingleton
- fun provideMSDLPlayer(@Application context: Context): MSDLPlayer =
- MSDLPlayer.createPlayer(context)
+ fun provideMSDLPlayer(@Application context: Context): MSDLPlayer {
+ val vibratorManager =
+ context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager
+ return MSDLPlayer.createPlayer(vibratorManager.defaultVibrator)
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/KeyboardTouchpadTutorialCoreStartable.kt b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/KeyboardTouchpadTutorialCoreStartable.kt
index 7ecacdc..092a25a 100644
--- a/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/KeyboardTouchpadTutorialCoreStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/KeyboardTouchpadTutorialCoreStartable.kt
@@ -16,9 +16,17 @@
package com.android.systemui.inputdevice.tutorial
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.content.IntentFilter
+import android.os.UserHandle
import com.android.systemui.CoreStartable
+import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.inputdevice.tutorial.ui.TutorialNotificationCoordinator
+import com.android.systemui.inputdevice.tutorial.ui.view.KeyboardTouchpadTutorialActivity
import com.android.systemui.shared.Flags.newTouchpadGesturesTutorial
import dagger.Lazy
import javax.inject.Inject
@@ -27,11 +35,35 @@
@SysUISingleton
class KeyboardTouchpadTutorialCoreStartable
@Inject
-constructor(private val tutorialNotificationCoordinator: Lazy<TutorialNotificationCoordinator>) :
- CoreStartable {
+constructor(
+ private val tutorialNotificationCoordinator: Lazy<TutorialNotificationCoordinator>,
+ private val broadcastDispatcher: BroadcastDispatcher,
+ @Application private val applicationContext: Context,
+) : CoreStartable {
override fun start() {
if (newTouchpadGesturesTutorial()) {
tutorialNotificationCoordinator.get().start()
+ registerTutorialBroadcastReceiver()
}
}
+
+ private fun registerTutorialBroadcastReceiver() {
+ broadcastDispatcher.registerReceiver(
+ receiver =
+ object : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ applicationContext.startActivityAsUser(
+ Intent(
+ applicationContext,
+ KeyboardTouchpadTutorialActivity::class.java
+ ),
+ UserHandle.SYSTEM
+ )
+ }
+ },
+ filter = IntentFilter("com.android.systemui.action.KEYBOARD_TOUCHPAD_TUTORIAL"),
+ flags = Context.RECEIVER_EXPORTED,
+ user = UserHandle.ALL,
+ )
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt
index 63f3d52..beec348 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt
@@ -82,6 +82,7 @@
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithContent
+import androidx.compose.ui.focus.FocusDirection
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.geometry.CornerRadius
@@ -92,8 +93,12 @@
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.input.key.Key
+import androidx.compose.ui.input.key.key
+import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
@@ -731,14 +736,13 @@
val interactionSource = remember { MutableInteractionSource() }
val isFocused by interactionSource.collectIsFocusedAsState()
- Surface(
+ SelectableShortcutSurface(
selected = selected,
onClick = onClick,
modifier =
Modifier.semantics { role = Role.Tab }
.heightIn(min = 64.dp)
.fillMaxWidth()
- .focusable(interactionSource = interactionSource)
.outlineFocusModifier(
isFocused = isFocused,
focusColor = MaterialTheme.colorScheme.secondary,
@@ -747,6 +751,7 @@
),
shape = RoundedCornerShape(28.dp),
color = colors.containerColor(selected).value,
+ interactionSource = interactionSource
) {
Row(Modifier.padding(horizontal = 24.dp), verticalAlignment = Alignment.CenterVertically) {
ShortcutCategoryIcon(
@@ -824,9 +829,18 @@
// from the ViewModel.
var queryInternal by remember { mutableStateOf("") }
val focusRequester = remember { FocusRequester() }
+ val focusManager = LocalFocusManager.current
LaunchedEffect(Unit) { focusRequester.requestFocus() }
SearchBar(
- modifier = Modifier.fillMaxWidth().focusRequester(focusRequester),
+ modifier =
+ Modifier.fillMaxWidth().focusRequester(focusRequester).onKeyEvent {
+ if (it.key == Key.DirectionDown) {
+ focusManager.moveFocus(FocusDirection.Down)
+ return@onKeyEvent true
+ } else {
+ return@onKeyEvent false
+ }
+ },
colors = SearchBarDefaults.colors(containerColor = MaterialTheme.colorScheme.surfaceBright),
query = queryInternal,
active = false,
@@ -846,14 +860,12 @@
private fun KeyboardSettings(horizontalPadding: Dp, verticalPadding: Dp, onClick: () -> Unit) {
val interactionSource = remember { MutableInteractionSource() }
val isFocused by interactionSource.collectIsFocusedAsState()
- Surface(
+ ClickableShortcutSurface(
onClick = onClick,
shape = RoundedCornerShape(24.dp),
color = Color.Transparent,
- modifier =
- Modifier.semantics { role = Role.Button }
- .fillMaxWidth()
- .focusable(interactionSource = interactionSource)
+ modifier = Modifier.semantics { role = Role.Button }.fillMaxWidth(),
+ interactionSource = interactionSource
) {
Row(
modifier =
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/Surfaces.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/Surfaces.kt
new file mode 100644
index 0000000..3ba3bd8
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/Surfaces.kt
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.keyboard.shortcut.ui.composable
+
+import androidx.compose.foundation.BorderStroke
+import androidx.compose.foundation.background
+import androidx.compose.foundation.border
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.interaction.MutableInteractionSource
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.selection.selectable
+import androidx.compose.material3.ColorScheme
+import androidx.compose.material3.LocalAbsoluteTonalElevation
+import androidx.compose.material3.LocalContentColor
+import androidx.compose.material3.LocalTonalElevationEnabled
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.contentColorFor
+import androidx.compose.material3.minimumInteractiveComponentSize
+import androidx.compose.material3.surfaceColorAtElevation
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.NonRestartableComposable
+import androidx.compose.runtime.Stable
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.RectangleShape
+import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import com.android.compose.modifiers.thenIf
+
+/**
+ * A selectable surface with no default focus/hover indications.
+ *
+ * This composable is similar to [androidx.compose.material3.Surface], but removes default
+ * focus/hover states to enable custom implementations.
+ */
+@Composable
+@NonRestartableComposable
+fun SelectableShortcutSurface(
+ selected: Boolean,
+ onClick: () -> Unit,
+ modifier: Modifier = Modifier,
+ enabled: Boolean = true,
+ shape: Shape = RectangleShape,
+ color: Color = MaterialTheme.colorScheme.surface,
+ contentColor: Color = contentColorFor(color),
+ tonalElevation: Dp = 0.dp,
+ shadowElevation: Dp = 0.dp,
+ border: BorderStroke? = null,
+ interactionSource: MutableInteractionSource? = null,
+ content: @Composable () -> Unit
+) {
+ @Suppress("NAME_SHADOWING")
+ val interactionSource = interactionSource ?: remember { MutableInteractionSource() }
+ val absoluteElevation = LocalAbsoluteTonalElevation.current + tonalElevation
+ CompositionLocalProvider(
+ LocalContentColor provides contentColor,
+ LocalAbsoluteTonalElevation provides absoluteElevation
+ ) {
+ Box(
+ modifier =
+ modifier
+ .minimumInteractiveComponentSize()
+ .surface(
+ shape = shape,
+ backgroundColor =
+ surfaceColorAtElevation(color = color, elevation = absoluteElevation),
+ border = border,
+ shadowElevation = with(LocalDensity.current) { shadowElevation.toPx() }
+ )
+ .selectable(
+ selected = selected,
+ interactionSource = interactionSource,
+ indication = null,
+ enabled = enabled,
+ onClick = onClick
+ ),
+ propagateMinConstraints = true
+ ) {
+ content()
+ }
+ }
+}
+
+/**
+ * A clickable surface with no default focus/hover indications.
+ *
+ * This composable is similar to [androidx.compose.material3.Surface], but removes default
+ * focus/hover states to enable custom implementations.
+ */
+@Composable
+@NonRestartableComposable
+fun ClickableShortcutSurface(
+ onClick: () -> Unit,
+ modifier: Modifier = Modifier,
+ enabled: Boolean = true,
+ shape: Shape = RectangleShape,
+ color: Color = MaterialTheme.colorScheme.surface,
+ contentColor: Color = contentColorFor(color),
+ tonalElevation: Dp = 0.dp,
+ shadowElevation: Dp = 0.dp,
+ border: BorderStroke? = null,
+ interactionSource: MutableInteractionSource? = null,
+ content: @Composable () -> Unit
+) {
+ @Suppress("NAME_SHADOWING")
+ val interactionSource = interactionSource ?: remember { MutableInteractionSource() }
+ val absoluteElevation = LocalAbsoluteTonalElevation.current + tonalElevation
+ CompositionLocalProvider(
+ LocalContentColor provides contentColor,
+ LocalAbsoluteTonalElevation provides absoluteElevation
+ ) {
+ Box(
+ modifier =
+ modifier
+ .minimumInteractiveComponentSize()
+ .surface(
+ shape = shape,
+ backgroundColor =
+ surfaceColorAtElevation(color = color, elevation = absoluteElevation),
+ border = border,
+ shadowElevation = with(LocalDensity.current) { shadowElevation.toPx() }
+ )
+ .clickable(
+ interactionSource = interactionSource,
+ indication = null,
+ enabled = enabled,
+ onClick = onClick
+ ),
+ propagateMinConstraints = true
+ ) {
+ content()
+ }
+ }
+}
+
+@Composable
+private fun surfaceColorAtElevation(color: Color, elevation: Dp): Color {
+ return MaterialTheme.colorScheme.applyTonalElevation(color, elevation)
+}
+
+@Composable
+internal fun ColorScheme.applyTonalElevation(backgroundColor: Color, elevation: Dp): Color {
+ val tonalElevationEnabled = LocalTonalElevationEnabled.current
+ return if (backgroundColor == surface && tonalElevationEnabled) {
+ surfaceColorAtElevation(elevation)
+ } else {
+ backgroundColor
+ }
+}
+
+/**
+ * Applies surface-related modifiers to a composable.
+ *
+ * This function adds background, border, and shadow effects to a composable. Also ensure the
+ * composable is clipped to the given shape.
+ *
+ * @param shape The shape to apply to the composable's background, border, and clipping.
+ * @param backgroundColor The background color to apply to the composable.
+ * @param border An optional border to draw around the composable.
+ * @param shadowElevation The size of the shadow below the surface. To prevent shadow creep, only
+ * apply shadow elevation when absolutely necessary, such as when the surface requires visual
+ * separation from a patterned background. Note that It will not affect z index of the Surface. If
+ * you want to change the drawing order you can use `Modifier.zIndex`.
+ * @return The modified Modifier instance with surface-related modifiers applied.
+ */
+@Stable
+private fun Modifier.surface(
+ shape: Shape,
+ backgroundColor: Color,
+ border: BorderStroke?,
+ shadowElevation: Float,
+): Modifier {
+ return this.thenIf(shadowElevation > 0f) {
+ Modifier.graphicsLayer(shadowElevation = shadowElevation, shape = shape, clip = false)
+ }
+ .thenIf(border != null) { Modifier.border(border!!, shape) }
+ .background(color = backgroundColor, shape = shape)
+ .clip(shape)
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
index 1bc91ca..67625d0 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
@@ -81,6 +81,7 @@
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardEnabledInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
+import com.android.systemui.keyguard.domain.interactor.KeyguardStateCallbackInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardWakeDirectlyToGoneInteractor;
import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindParamsApplier;
import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindViewBinder;
@@ -126,6 +127,7 @@
private final Lazy<DeviceEntryInteractor> mDeviceEntryInteractorLazy;
private final Executor mMainExecutor;
private final Lazy<KeyguardStateCallbackStartable> mKeyguardStateCallbackStartableLazy;
+ private final KeyguardStateCallbackInteractor mKeyguardStateCallbackInteractor;
private static RemoteAnimationTarget[] wrap(TransitionInfo info, boolean wallpapers,
SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap,
@@ -350,7 +352,8 @@
Lazy<KeyguardStateCallbackStartable> keyguardStateCallbackStartableLazy,
KeyguardWakeDirectlyToGoneInteractor keyguardWakeDirectlyToGoneInteractor,
KeyguardDismissInteractor keyguardDismissInteractor,
- Lazy<DeviceEntryInteractor> deviceEntryInteractorLazy) {
+ Lazy<DeviceEntryInteractor> deviceEntryInteractorLazy,
+ KeyguardStateCallbackInteractor keyguardStateCallbackInteractor) {
super();
mKeyguardViewMediator = keyguardViewMediator;
mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher;
@@ -363,6 +366,7 @@
mSceneInteractorLazy = sceneInteractorLazy;
mMainExecutor = mainExecutor;
mKeyguardStateCallbackStartableLazy = keyguardStateCallbackStartableLazy;
+ mKeyguardStateCallbackInteractor = keyguardStateCallbackInteractor;
mDeviceEntryInteractorLazy = deviceEntryInteractorLazy;
if (KeyguardWmStateRefactor.isEnabled()) {
@@ -455,6 +459,8 @@
checkPermission();
if (SceneContainerFlag.isEnabled()) {
mKeyguardStateCallbackStartableLazy.get().addCallback(callback);
+ } else if (KeyguardWmStateRefactor.isEnabled()) {
+ mKeyguardStateCallbackInteractor.addCallback(callback);
} else {
mKeyguardViewMediator.addStateMonitorCallback(callback);
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt
index 362e016c..df0f10a 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt
@@ -71,6 +71,7 @@
import com.android.systemui.statusbar.KeyguardIndicationController
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.phone.ScreenOffAnimationController
+import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
import com.android.systemui.temporarydisplay.chipbar.ChipbarCoordinator
import com.google.android.msdl.domain.MSDLPlayer
import dagger.Lazy
@@ -112,6 +113,7 @@
private val clockInteractor: KeyguardClockInteractor,
private val keyguardViewMediator: KeyguardViewMediator,
private val deviceEntryUnlockTrackerViewBinder: Optional<DeviceEntryUnlockTrackerViewBinder>,
+ private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
@Main private val mainDispatcher: CoroutineDispatcher,
private val msdlPlayer: MSDLPlayer,
) : CoreStartable {
@@ -220,6 +222,7 @@
vibratorHelper,
falsingManager,
keyguardViewMediator,
+ statusBarKeyguardViewManager,
mainDispatcher,
msdlPlayer,
)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index d38c952..3b1569d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -2288,6 +2288,10 @@
}
private void updateInputRestrictedLocked() {
+ if (KeyguardWmStateRefactor.isEnabled()) {
+ return;
+ }
+
boolean inputRestricted = isInputRestricted();
if (mInputRestricted != inputRestricted) {
mInputRestricted = inputRestricted;
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt
index db5a63b..58c8a04 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt
@@ -73,7 +73,7 @@
if (SceneContainerFlag.isEnabled) return
listenForGoneToAodOrDozing()
listenForGoneToDreaming()
- listenForGoneToLockscreenOrHub()
+ listenForGoneToLockscreenOrHubOrOccluded()
listenForGoneToOccluded()
listenForGoneToDreamingLockscreenHosted()
}
@@ -89,22 +89,19 @@
*/
private fun listenForGoneToOccluded() {
scope.launch("$TAG#listenForGoneToOccluded") {
- keyguardInteractor.showDismissibleKeyguard
- .filterRelevantKeyguardState()
- .sample(keyguardInteractor.isKeyguardOccluded, ::Pair)
- .collect { (_, isKeyguardOccluded) ->
- if (isKeyguardOccluded) {
- startTransitionTo(
- KeyguardState.OCCLUDED,
- ownerReason = "Dismissible keyguard with occlusion"
- )
- }
+ keyguardInteractor.showDismissibleKeyguard.filterRelevantKeyguardState().collect {
+ if (keyguardInteractor.isKeyguardOccluded.value) {
+ startTransitionTo(
+ KeyguardState.OCCLUDED,
+ ownerReason = "Dismissible keyguard with occlusion"
+ )
}
+ }
}
}
// Primarily for when the user chooses to lock down the device
- private fun listenForGoneToLockscreenOrHub() {
+ private fun listenForGoneToLockscreenOrHubOrOccluded() {
if (KeyguardWmStateRefactor.isEnabled) {
scope.launch("$TAG#listenForGoneToLockscreenOrHub") {
biometricSettingsRepository.isCurrentUserInLockdown
@@ -137,7 +134,7 @@
}
}
} else {
- scope.launch("$TAG#listenForGoneToLockscreenOrHub") {
+ scope.launch("$TAG#listenForGoneToLockscreenOrHubOrOccluded") {
keyguardInteractor.isKeyguardShowing
.filterRelevantKeyguardStateAnd { isKeyguardShowing -> isKeyguardShowing }
.sample(communalSceneInteractor.isIdleOnCommunalNotEditMode, ::Pair)
@@ -145,6 +142,8 @@
val to =
if (isIdleOnCommunal) {
KeyguardState.GLANCEABLE_HUB
+ } else if (keyguardInteractor.isKeyguardOccluded.value) {
+ KeyguardState.OCCLUDED
} else {
KeyguardState.LOCKSCREEN
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt
index e2bb540..7afc759 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt
@@ -80,10 +80,7 @@
}
applicationScope.launch {
val refreshConfig =
- Config(
- Type.NoTransition,
- rebuildSections = listOf(smartspaceSection),
- )
+ Config(Type.NoTransition, rebuildSections = listOf(smartspaceSection))
configurationInteractor.onAnyConfigurationChange.collect {
refreshBlueprint(refreshConfig)
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractor.kt
index 7801c00..60c5386 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractor.kt
@@ -18,6 +18,7 @@
package com.android.systemui.keyguard.domain.interactor
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
+import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
@@ -32,6 +33,7 @@
import com.android.systemui.scene.domain.resolver.QuickSettingsSceneFamilyResolver
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.util.kotlin.Utils.Companion.sampleFilter
import com.android.systemui.util.kotlin.sample
import javax.inject.Inject
@@ -44,6 +46,7 @@
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterNot
+import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.flow.stateIn
@@ -58,12 +61,14 @@
transitionInteractor: KeyguardTransitionInteractor,
val dismissInteractor: KeyguardDismissInteractor,
@Application private val applicationScope: CoroutineScope,
- sceneInteractor: SceneInteractor,
- deviceEntryInteractor: DeviceEntryInteractor,
- quickSettingsSceneFamilyResolver: QuickSettingsSceneFamilyResolver,
- notifShadeSceneFamilyResolver: NotifShadeSceneFamilyResolver,
+ sceneInteractor: dagger.Lazy<SceneInteractor>,
+ deviceEntryInteractor: dagger.Lazy<DeviceEntryInteractor>,
+ quickSettingsSceneFamilyResolver: dagger.Lazy<QuickSettingsSceneFamilyResolver>,
+ notifShadeSceneFamilyResolver: dagger.Lazy<NotifShadeSceneFamilyResolver>,
powerInteractor: PowerInteractor,
alternateBouncerInteractor: AlternateBouncerInteractor,
+ keyguardInteractor: dagger.Lazy<KeyguardInteractor>,
+ shadeInteractor: dagger.Lazy<ShadeInteractor>,
) {
val dismissAction: Flow<DismissAction> = repository.dismissAction
@@ -98,15 +103,31 @@
* device is unlocked. Else, false.
*/
private val isOnShadeWhileUnlocked: Flow<Boolean> =
- combine(
- sceneInteractor.currentScene,
- deviceEntryInteractor.isUnlocked,
- ) { scene, isUnlocked ->
- isUnlocked &&
- (quickSettingsSceneFamilyResolver.includesScene(scene) ||
- notifShadeSceneFamilyResolver.includesScene(scene))
+ if (SceneContainerFlag.isEnabled) {
+ combine(
+ sceneInteractor.get().currentScene,
+ deviceEntryInteractor.get().isUnlocked,
+ ) { scene, isUnlocked ->
+ isUnlocked &&
+ (quickSettingsSceneFamilyResolver.get().includesScene(scene) ||
+ notifShadeSceneFamilyResolver.get().includesScene(scene))
+ }
+ .distinctUntilChanged()
+ } else if (ComposeBouncerFlags.isOnlyComposeBouncerEnabled()) {
+ shadeInteractor.get().isAnyExpanded.sample(
+ keyguardInteractor.get().isKeyguardDismissible
+ ) { isAnyExpanded, isKeyguardDismissible ->
+ isAnyExpanded && isKeyguardDismissible
}
- .distinctUntilChanged()
+ } else {
+ flow {
+ error(
+ "This should not be used when both SceneContainerFlag " +
+ "and ComposeBouncerFlag are disabled"
+ )
+ }
+ }
+
val executeDismissAction: Flow<() -> KeyguardDone> =
merge(
finishedTransitionToGone,
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
index f6f0cc5..e444092 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
@@ -39,6 +39,7 @@
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.KeyguardState.AOD
import com.android.systemui.keyguard.shared.model.KeyguardState.DOZING
+import com.android.systemui.keyguard.shared.model.KeyguardState.GLANCEABLE_HUB
import com.android.systemui.keyguard.shared.model.KeyguardState.GONE
import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN
import com.android.systemui.keyguard.shared.model.KeyguardState.OCCLUDED
@@ -167,10 +168,7 @@
* but not vice-versa. Also accounts for [isDreamingWithOverlay]
*/
val isDreaming: StateFlow<Boolean> =
- merge(
- repository.isDreaming,
- repository.isDreamingWithOverlay,
- )
+ merge(repository.isDreaming, repository.isDreamingWithOverlay)
.stateIn(
scope = applicationScope,
started = SharingStarted.Eagerly,
@@ -242,7 +240,7 @@
.map { it == 1f }
.onStart { emit(false) }
.distinctUntilChanged(),
- repository.topClippingBounds
+ repository.topClippingBounds,
) { isGone, topClippingBounds ->
if (!isGone) {
emit(topClippingBounds)
@@ -287,11 +285,10 @@
/** Whether camera is launched over keyguard. */
val isSecureCameraActive: Flow<Boolean> by lazy {
- combine(
+ combine(isKeyguardVisible, primaryBouncerShowing, onCameraLaunchDetected) {
isKeyguardVisible,
- primaryBouncerShowing,
- onCameraLaunchDetected,
- ) { isKeyguardVisible, isPrimaryBouncerShowing, cameraLaunchEvent ->
+ isPrimaryBouncerShowing,
+ cameraLaunchEvent ->
when {
isKeyguardVisible -> false
isPrimaryBouncerShowing -> false
@@ -328,15 +325,17 @@
keyguardTransitionInteractor.currentKeyguardState,
keyguardTransitionInteractor.transitionState,
isKeyguardDismissible,
+ keyguardTransitionInteractor.isFinishedIn(Scenes.Communal, GLANCEABLE_HUB),
)
- .filter { (_, _, _, step, _) -> !step.transitionState.isTransitioning() }
+ .filter { (_, _, _, step, _, _) -> !step.transitionState.isTransitioning() }
.transform {
(
legacyShadeExpansion,
statusBarState,
currentKeyguardState,
step,
- isKeyguardDismissible) ->
+ isKeyguardDismissible,
+ onGlanceableHub) ->
if (
statusBarState == StatusBarState.KEYGUARD &&
isKeyguardDismissible &&
@@ -344,7 +343,9 @@
legacyShadeExpansion != 1f
) {
emit(MathUtils.constrainedMap(0f, 1f, 0.95f, 1f, legacyShadeExpansion))
- } else if (legacyShadeExpansion == 0f || legacyShadeExpansion == 1f) {
+ } else if (
+ (legacyShadeExpansion == 0f || legacyShadeExpansion == 1f) && !onGlanceableHub
+ ) {
// Resets alpha state
emit(1f)
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardStateCallbackInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardStateCallbackInteractor.kt
new file mode 100644
index 0000000..420fbd4
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardStateCallbackInteractor.kt
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.keyguard.domain.interactor
+
+import android.os.DeadObjectException
+import android.os.RemoteException
+import com.android.internal.policy.IKeyguardStateCallback
+import com.android.systemui.CoreStartable
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.dagger.qualifiers.Background
+import com.android.systemui.keyguard.KeyguardWmStateRefactor
+import com.android.systemui.keyguard.shared.model.KeyguardState
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
+import com.android.systemui.user.domain.interactor.SelectedUserInteractor
+import kotlinx.coroutines.CoroutineDispatcher
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.flow.collectLatest
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+import javax.inject.Inject
+
+/**
+ * Updates KeyguardStateCallbacks provided to KeyguardService with KeyguardTransitionInteractor
+ * state.
+ *
+ * This borrows heavily from [KeyguardStateCallbackStartable], which requires Flexiglass. This class
+ * can be removed after Flexiglass launches.
+ */
+@SysUISingleton
+class KeyguardStateCallbackInteractor
+@Inject
+constructor(
+ @Application private val applicationScope: CoroutineScope,
+ @Background private val backgroundDispatcher: CoroutineDispatcher,
+ private val selectedUserInteractor: SelectedUserInteractor,
+ private val keyguardTransitionInteractor: KeyguardTransitionInteractor,
+) : CoreStartable {
+ private val callbacks = mutableListOf<IKeyguardStateCallback>()
+
+ override fun start() {
+ if (!KeyguardWmStateRefactor.isEnabled || SceneContainerFlag.isEnabled) {
+ return
+ }
+
+ applicationScope.launch {
+ combine(
+ selectedUserInteractor.selectedUser,
+ keyguardTransitionInteractor.currentKeyguardState,
+ ::Pair
+ ).collectLatest { (selectedUser, currentState) ->
+ val iterator = callbacks.iterator()
+ withContext(backgroundDispatcher) {
+ while (iterator.hasNext()) {
+ val callback = iterator.next()
+ try {
+ callback.onShowingStateChanged(
+ currentState != KeyguardState.GONE,
+ selectedUser
+ )
+ callback.onInputRestrictedStateChanged(
+ currentState != KeyguardState.GONE)
+ } catch (e: RemoteException) {
+ if (e is DeadObjectException) {
+ iterator.remove()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ fun addCallback(callback: IKeyguardStateCallback) {
+ KeyguardWmStateRefactor.isUnexpectedlyInLegacyMode()
+ callbacks.add(callback)
+ }
+}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt
index d9c48fa..25b8fd3 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt
@@ -29,6 +29,7 @@
private val auditLogger: KeyguardTransitionAuditLogger,
private val bootInteractor: KeyguardTransitionBootInteractor,
private val statusBarDisableFlagsInteractor: StatusBarDisableFlagsInteractor,
+ private val keyguardStateCallbackInteractor: KeyguardStateCallbackInteractor,
) : CoreStartable {
override fun start() {
@@ -55,6 +56,7 @@
auditLogger.start()
bootInteractor.start()
statusBarDisableFlagsInteractor.start()
+ keyguardStateCallbackInteractor.start()
}
companion object {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StatusBarDisableFlagsInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StatusBarDisableFlagsInteractor.kt
index e00e33d..43aab35 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StatusBarDisableFlagsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StatusBarDisableFlagsInteractor.kt
@@ -39,12 +39,14 @@
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.power.shared.model.WakefulnessModel
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
+import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@@ -75,62 +77,66 @@
private val disableToken: IBinder = Binder()
private val disableFlagsForUserId =
- combine(
- selectedUserInteractor.selectedUser,
- keyguardTransitionInteractor.startedKeyguardTransitionStep.map { it.to },
- deviceConfigInteractor.property(
- namespace = DeviceConfig.NAMESPACE_SYSTEMUI,
- name = SystemUiDeviceConfigFlags.NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN,
- default = true,
- ),
- navigationInteractor.isGesturalMode,
- authenticationInteractor.authenticationMethod,
- powerInteractor.detailedWakefulness,
- ) { values ->
- val selectedUserId = values[0] as Int
- val startedState = values[1] as KeyguardState
- val isShowHomeOverLockscreen = values[2] as Boolean
- val isGesturalMode = values[3] as Boolean
- val authenticationMethod = values[4] as AuthenticationMethodModel
- val wakefulnessModel = values[5] as WakefulnessModel
- val isOccluded = startedState == KeyguardState.OCCLUDED
+ if (!KeyguardWmStateRefactor.isEnabled || SceneContainerFlag.isEnabled) {
+ flowOf(Pair(0, StatusBarManager.DISABLE_NONE))
+ } else {
+ combine(
+ selectedUserInteractor.selectedUser,
+ keyguardTransitionInteractor.startedKeyguardTransitionStep.map { it.to },
+ deviceConfigInteractor.property(
+ namespace = DeviceConfig.NAMESPACE_SYSTEMUI,
+ name = SystemUiDeviceConfigFlags.NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN,
+ default = true,
+ ),
+ navigationInteractor.isGesturalMode,
+ authenticationInteractor.authenticationMethod,
+ powerInteractor.detailedWakefulness,
+ ) { values ->
+ val selectedUserId = values[0] as Int
+ val startedState = values[1] as KeyguardState
+ val isShowHomeOverLockscreen = values[2] as Boolean
+ val isGesturalMode = values[3] as Boolean
+ val authenticationMethod = values[4] as AuthenticationMethodModel
+ val wakefulnessModel = values[5] as WakefulnessModel
+ val isOccluded = startedState == KeyguardState.OCCLUDED
- val hideHomeAndRecentsForBouncer =
- startedState == KeyguardState.PRIMARY_BOUNCER ||
- startedState == KeyguardState.ALTERNATE_BOUNCER
- val isKeyguardShowing = startedState != KeyguardState.GONE
- val isPowerGestureIntercepted =
- with(wakefulnessModel) {
- isAwake() &&
- powerButtonLaunchGestureTriggered &&
- lastSleepReason == WakeSleepReason.POWER_BUTTON
+ val hideHomeAndRecentsForBouncer =
+ startedState == KeyguardState.PRIMARY_BOUNCER ||
+ startedState == KeyguardState.ALTERNATE_BOUNCER
+ val isKeyguardShowing = startedState != KeyguardState.GONE
+ val isPowerGestureIntercepted =
+ with(wakefulnessModel) {
+ isAwake() &&
+ powerButtonLaunchGestureTriggered &&
+ lastSleepReason == WakeSleepReason.POWER_BUTTON
+ }
+
+ var flags = StatusBarManager.DISABLE_NONE
+
+ if (hideHomeAndRecentsForBouncer || (isKeyguardShowing && !isOccluded)) {
+ if (!isShowHomeOverLockscreen || !isGesturalMode) {
+ flags = flags or StatusBarManager.DISABLE_HOME
+ }
+ flags = flags or StatusBarManager.DISABLE_RECENT
}
- var flags = StatusBarManager.DISABLE_NONE
-
- if (hideHomeAndRecentsForBouncer || (isKeyguardShowing && !isOccluded)) {
- if (!isShowHomeOverLockscreen || !isGesturalMode) {
- flags = flags or StatusBarManager.DISABLE_HOME
+ if (
+ isPowerGestureIntercepted &&
+ isOccluded &&
+ authenticationMethod.isSecure &&
+ deviceEntryFaceAuthInteractor.isFaceAuthEnabledAndEnrolled()
+ ) {
+ flags = flags or StatusBarManager.DISABLE_RECENT
}
- flags = flags or StatusBarManager.DISABLE_RECENT
- }
- if (
- isPowerGestureIntercepted &&
- isOccluded &&
- authenticationMethod.isSecure &&
- deviceEntryFaceAuthInteractor.isFaceAuthEnabledAndEnrolled()
- ) {
- flags = flags or StatusBarManager.DISABLE_RECENT
+ selectedUserId to flags
}
-
- selectedUserId to flags
- }
- .distinctUntilChanged()
+ .distinctUntilChanged()
+ }
@SuppressLint("WrongConstant", "NonInjectedService")
override fun start() {
- if (!KeyguardWmStateRefactor.isEnabled) {
+ if (!KeyguardWmStateRefactor.isEnabled || SceneContainerFlag.isEnabled) {
return
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt
index 91a7f7f..7696273 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt
@@ -42,6 +42,7 @@
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerUdfpsIconViewModel
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerWindowViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
+import com.android.systemui.log.LongPressHandlingViewLogger
import com.android.systemui.res.R
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scrim.ScrimView
@@ -191,6 +192,7 @@
optionallyAddUdfpsViews(
view = view,
+ logger = alternateBouncerDependencies.logger,
udfpsIconViewModel = alternateBouncerDependencies.udfpsIconViewModel,
udfpsA11yOverlayViewModel =
alternateBouncerDependencies.udfpsAccessibilityOverlayViewModel,
@@ -248,6 +250,7 @@
private fun optionallyAddUdfpsViews(
view: ConstraintLayout,
+ logger: LongPressHandlingViewLogger,
udfpsIconViewModel: AlternateBouncerUdfpsIconViewModel,
udfpsA11yOverlayViewModel: Lazy<AlternateBouncerUdfpsAccessibilityOverlayViewModel>,
) {
@@ -276,7 +279,7 @@
var udfpsView = view.getViewById(udfpsViewId)
if (udfpsView == null) {
udfpsView =
- DeviceEntryIconView(view.context, null).apply {
+ DeviceEntryIconView(view.context, null, logger = logger).apply {
id = udfpsViewId
contentDescription =
context.resources.getString(
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt
index 4d6577c..b951b73 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt
@@ -19,6 +19,7 @@
import android.annotation.SuppressLint
import android.content.res.ColorStateList
+import android.util.Log
import android.util.StateSet
import android.view.HapticFeedbackConstants
import android.view.View
@@ -83,6 +84,11 @@
if (
!isA11yAction && falsingManager.isFalseLongTap(FalsingManager.LOW_PENALTY)
) {
+ Log.d(
+ TAG,
+ "Long press rejected because it is not a11yAction " +
+ "and it is a falseLongTap"
+ )
return
}
vibratorHelper.performHapticFeedback(
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissActionBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissActionBinder.kt
index 74a7262..69cb6a9 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissActionBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissActionBinder.kt
@@ -17,11 +17,11 @@
import com.android.keyguard.logging.KeyguardLogger
import com.android.systemui.CoreStartable
+import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissActionInteractor
import com.android.systemui.log.core.LogLevel
-import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.util.kotlin.sample
import dagger.Lazy
import javax.inject.Inject
@@ -41,7 +41,7 @@
) : CoreStartable {
override fun start() {
- if (!SceneContainerFlag.isEnabled) {
+ if (!ComposeBouncerFlags.isEnabled) {
return
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissBinder.kt
index ac24591..b55f813 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardDismissBinder.kt
@@ -18,13 +18,12 @@
import com.android.keyguard.ViewMediatorCallback
import com.android.keyguard.logging.KeyguardLogger
import com.android.systemui.CoreStartable
+import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
-import com.android.systemui.flags.FeatureFlagsClassic
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissInteractor
import com.android.systemui.keyguard.shared.model.KeyguardDone
import com.android.systemui.log.core.LogLevel
-import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -40,11 +39,10 @@
private val viewMediatorCallback: ViewMediatorCallback,
@Application private val scope: CoroutineScope,
private val keyguardLogger: KeyguardLogger,
- private val featureFlags: FeatureFlagsClassic,
) : CoreStartable {
override fun start() {
- if (!SceneContainerFlag.isEnabled) {
+ if (!ComposeBouncerFlags.isEnabled) {
return
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardQuickAffordanceOnTouchListener.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardQuickAffordanceOnTouchListener.kt
index f2d39da..ecfabc3 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardQuickAffordanceOnTouchListener.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardQuickAffordanceOnTouchListener.kt
@@ -18,13 +18,12 @@
import android.annotation.SuppressLint
import android.graphics.PointF
+import android.view.InputDevice
import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration
import android.view.ViewPropertyAnimator
-import androidx.core.animation.CycleInterpolator
-import androidx.core.animation.ObjectAnimator
-import com.android.systemui.res.R
+import com.android.systemui.Flags
import com.android.systemui.animation.Expandable
import com.android.systemui.common.ui.view.rawDistanceFrom
import com.android.systemui.keyguard.ui.viewmodel.KeyguardQuickAffordanceViewModel
@@ -71,11 +70,10 @@
// Moving too far while performing a long-press gesture cancels that
// gesture.
if (
- event
- .rawDistanceFrom(
- downDisplayCoords.x,
- downDisplayCoords.y,
- ) > ViewConfiguration.getTouchSlop()
+ event.rawDistanceFrom(
+ downDisplayCoords.x,
+ downDisplayCoords.y,
+ ) > ViewConfiguration.getTouchSlop()
) {
cancel()
}
@@ -151,10 +149,14 @@
event: MotionEvent,
pointerIndex: Int = 0,
): Boolean {
- return when (event.getToolType(pointerIndex)) {
- MotionEvent.TOOL_TYPE_STYLUS -> true
- MotionEvent.TOOL_TYPE_MOUSE -> true
- else -> false
+ return if (Flags.nonTouchscreenDevicesBypassFalsing()) {
+ event.device?.supportsSource(InputDevice.SOURCE_TOUCHSCREEN) == false
+ } else {
+ when (event.getToolType(pointerIndex)) {
+ MotionEvent.TOOL_TYPE_STYLUS -> true
+ MotionEvent.TOOL_TYPE_MOUSE -> true
+ else -> false
+ }
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
index 5bb7b64..ed82159 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt
@@ -24,6 +24,8 @@
import android.graphics.Rect
import android.util.Log
import android.view.HapticFeedbackConstants
+import android.view.InputDevice
+import android.view.MotionEvent
import android.view.View
import android.view.View.OnLayoutChangeListener
import android.view.View.VISIBLE
@@ -41,6 +43,7 @@
import com.android.internal.jank.InteractionJankMonitor
import com.android.internal.jank.InteractionJankMonitor.CUJ_SCREEN_OFF_SHOW_AOD
import com.android.keyguard.AuthInteractionProperties
+import com.android.systemui.Flags
import com.android.systemui.Flags.msdlFeedback
import com.android.systemui.Flags.newAodTransition
import com.android.systemui.common.shared.model.Icon
@@ -73,6 +76,7 @@
import com.android.systemui.statusbar.CrossFadeHelper
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.phone.ScreenOffAnimationController
+import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
import com.android.systemui.temporarydisplay.ViewPriority
import com.android.systemui.temporarydisplay.chipbar.ChipbarCoordinator
import com.android.systemui.temporarydisplay.chipbar.ChipbarInfo
@@ -115,6 +119,7 @@
vibratorHelper: VibratorHelper?,
falsingManager: FalsingManager?,
keyguardViewMediator: KeyguardViewMediator?,
+ statusBarKeyguardViewManager: StatusBarKeyguardViewManager?,
mainImmediateDispatcher: CoroutineDispatcher,
msdlPlayer: MSDLPlayer?,
): DisposableHandle {
@@ -124,12 +129,30 @@
if (KeyguardBottomAreaRefactor.isEnabled) {
disposables +=
view.onTouchListener { _, event ->
+ var consumed = false
if (falsingManager?.isFalseTap(FalsingManager.LOW_PENALTY) == false) {
+ // signifies a primary button click down has reached keyguardrootview
+ // we need to return true here otherwise an ACTION_UP will never arrive
+ if (Flags.nonTouchscreenDevicesBypassFalsing()) {
+ if (
+ event.action == MotionEvent.ACTION_DOWN &&
+ event.buttonState == MotionEvent.BUTTON_PRIMARY &&
+ !event.isTouchscreenSource()
+ ) {
+ consumed = true
+ } else if (
+ event.action == MotionEvent.ACTION_UP &&
+ !event.isTouchscreenSource()
+ ) {
+ statusBarKeyguardViewManager?.showBouncer(true)
+ consumed = true
+ }
+ }
viewModel.setRootViewLastTapPosition(
Point(event.x.toInt(), event.y.toInt())
)
}
- false
+ consumed
}
}
@@ -637,6 +660,10 @@
}
}
+ private fun MotionEvent.isTouchscreenSource(): Boolean {
+ return device?.supportsSource(InputDevice.SOURCE_TOUCHSCREEN) == true
+ }
+
private fun ViewPropertyAnimator.animateInIconTranslation(): ViewPropertyAnimator =
setInterpolator(Interpolators.DECELERATE_QUINT).translationY(0f)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
index f581a2e..0b8f741 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
@@ -417,6 +417,7 @@
null, // device entry haptics not required for preview mode
null, // falsing manager not required for preview mode
null, // keyguard view mediator is not required for preview mode
+ null, // primary bouncer interactor is not required for preview mode
mainDispatcher,
null,
)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt
index 3e6d5da..8d2e939 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/DeviceEntryIconView.kt
@@ -23,6 +23,7 @@
import android.util.StateSet
import android.view.Gravity
import android.view.View
+import android.view.ViewConfiguration
import android.view.ViewGroup
import android.view.accessibility.AccessibilityNodeInfo
import android.widget.FrameLayout
@@ -31,6 +32,7 @@
import com.airbnb.lottie.LottieCompositionFactory
import com.airbnb.lottie.LottieDrawable
import com.android.systemui.common.ui.view.LongPressHandlingView
+import com.android.systemui.log.LongPressHandlingViewLogger
import com.android.systemui.res.R
class DeviceEntryIconView
@@ -39,8 +41,17 @@
context: Context,
attrs: AttributeSet?,
defStyleAttrs: Int = 0,
+ logger: LongPressHandlingViewLogger? = null,
) : FrameLayout(context, attrs, defStyleAttrs) {
- val longPressHandlingView: LongPressHandlingView = LongPressHandlingView(context, attrs)
+
+ val longPressHandlingView: LongPressHandlingView =
+ LongPressHandlingView(
+ context = context,
+ attrs = attrs,
+ longPressDuration = { ViewConfiguration.getLongPressTimeout().toLong() },
+ allowedTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(),
+ logger = logger,
+ )
val iconView: ImageView = ImageView(context, attrs).apply { id = R.id.device_entry_icon_fg }
val bgView: ImageView = ImageView(context, attrs).apply { id = R.id.device_entry_icon_bg }
val aodFpDrawable: LottieDrawable = LottieDrawable()
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt
index 51230dd..782d37b 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt
@@ -42,6 +42,9 @@
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryBackgroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryForegroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryIconViewModel
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.LongPressHandlingViewLogger
+import com.android.systemui.log.dagger.LongPressTouchLog
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.res.R
import com.android.systemui.shade.NotificationPanelView
@@ -69,6 +72,7 @@
private val deviceEntryBackgroundViewModel: Lazy<DeviceEntryBackgroundViewModel>,
private val falsingManager: Lazy<FalsingManager>,
private val vibratorHelper: Lazy<VibratorHelper>,
+ @LongPressTouchLog private val logBuffer: LogBuffer,
) : KeyguardSection() {
private val deviceEntryIconViewId = R.id.device_entry_icon_view
private var disposableHandle: DisposableHandle? = null
@@ -88,7 +92,16 @@
val view =
if (DeviceEntryUdfpsRefactor.isEnabled) {
- DeviceEntryIconView(context, null).apply { id = deviceEntryIconViewId }
+ DeviceEntryIconView(
+ context,
+ null,
+ logger =
+ LongPressHandlingViewLogger(
+ logBuffer = logBuffer,
+ TAG
+ )
+ )
+ .apply { id = deviceEntryIconViewId }
} else {
// KeyguardBottomAreaRefactor.isEnabled or MigrateClocksToBlueprint.isEnabled
LockIconView(context, null).apply { id = R.id.lock_icon_view }
@@ -258,4 +271,8 @@
}
}
}
+
+ companion object {
+ private const val TAG = "DefaultDeviceEntrySection"
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AlternateBouncerDependencies.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AlternateBouncerDependencies.kt
index b432417..9f8e9c5 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AlternateBouncerDependencies.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AlternateBouncerDependencies.kt
@@ -18,6 +18,9 @@
import com.android.systemui.deviceentry.ui.viewmodel.AlternateBouncerUdfpsAccessibilityOverlayViewModel
import com.android.systemui.keyguard.ui.SwipeUpAnywhereGestureHandler
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.LongPressHandlingViewLogger
+import com.android.systemui.log.dagger.LongPressTouchLog
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.statusbar.gesture.TapGestureDetector
import dagger.Lazy
@@ -37,4 +40,11 @@
Lazy<AlternateBouncerUdfpsAccessibilityOverlayViewModel>,
val messageAreaViewModel: AlternateBouncerMessageAreaViewModel,
val powerInteractor: PowerInteractor,
-)
+ @LongPressTouchLog private val touchLogBuffer: LogBuffer,
+) {
+ val logger: LongPressHandlingViewLogger =
+ LongPressHandlingViewLogger(logBuffer = touchLogBuffer, TAG)
+ companion object {
+ private const val TAG = "AlternateBouncer"
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/BouncerToGoneFlows.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/BouncerToGoneFlows.kt
index 8485a26..1edfec8 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/BouncerToGoneFlows.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/BouncerToGoneFlows.kt
@@ -18,6 +18,7 @@
import com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor
+import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissActionInteractor
import com.android.systemui.keyguard.shared.model.Edge
import com.android.systemui.keyguard.shared.model.KeyguardState
@@ -25,7 +26,6 @@
import com.android.systemui.keyguard.shared.model.KeyguardState.PRIMARY_BOUNCER
import com.android.systemui.keyguard.shared.model.ScrimAlpha
import com.android.systemui.keyguard.ui.KeyguardTransitionAnimationFlow
-import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.SysuiStatusBarStateController
@@ -51,7 +51,7 @@
) {
/** Common fade for scrim alpha values during *BOUNCER->GONE */
fun scrimAlpha(duration: Duration, fromState: KeyguardState): Flow<ScrimAlpha> {
- return if (SceneContainerFlag.isEnabled) {
+ return if (ComposeBouncerFlags.isEnabled) {
keyguardDismissActionInteractor
.get()
.willAnimateDismissActionOnLockscreen
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToOccludedTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToOccludedTransitionViewModel.kt
index f33752f..12bcc7e 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToOccludedTransitionViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DozingToOccludedTransitionViewModel.kt
@@ -17,6 +17,7 @@
package com.android.systemui.keyguard.ui.viewmodel
import android.util.MathUtils
+import com.android.systemui.Flags.lightRevealMigration
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.domain.interactor.FromAodTransitionInteractor
import com.android.systemui.keyguard.shared.model.Edge
@@ -55,8 +56,18 @@
var currentAlpha = 0f
return transitionAnimation.sharedFlow(
duration = 250.milliseconds,
- startTime = 100.milliseconds, // Wait for the light reveal to "hit" the LS elements.
- onStart = { currentAlpha = viewState.alpha() },
+ startTime = if (lightRevealMigration()) {
+ 100.milliseconds // Wait for the light reveal to "hit" the LS elements.
+ } else {
+ 0.milliseconds
+ },
+ onStart = {
+ if (lightRevealMigration()) {
+ currentAlpha = viewState.alpha()
+ } else {
+ currentAlpha = 0f
+ }
+ },
onStep = { MathUtils.lerp(currentAlpha, 0f, it) },
onCancel = { 0f },
)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModel.kt
index dd47678..ecae079 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModel.kt
@@ -21,17 +21,19 @@
import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.Swipe
import com.android.compose.animation.scene.SwipeDirection
+import com.android.compose.animation.scene.TransitionKey
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
import com.android.systemui.communal.domain.interactor.CommunalInteractor
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
+import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.SceneFamilies
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.TransitionKeys.ToSplitShade
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge
import com.android.systemui.scene.ui.viewmodel.UserActionsViewModel
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
-import com.android.systemui.util.kotlin.filterValuesNotNull
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -52,71 +54,67 @@
shadeInteractor.isShadeTouchable
.flatMapLatest { isShadeTouchable ->
if (!isShadeTouchable) {
- flowOf(emptyMap())
- } else {
- combine(
- deviceEntryInteractor.isUnlocked,
- communalInteractor.isCommunalAvailable,
- shadeInteractor.shadeMode,
- ) { isDeviceUnlocked, isCommunalAvailable, shadeMode ->
- val notifShadeSceneKey =
- UserActionResult(
- toScene = SceneFamilies.NotifShade,
- transitionKey =
- ToSplitShade.takeIf { shadeMode is ShadeMode.Split },
+ return@flatMapLatest flowOf(emptyMap())
+ }
+
+ combine(
+ deviceEntryInteractor.isUnlocked,
+ communalInteractor.isCommunalAvailable,
+ shadeInteractor.shadeMode,
+ ) { isDeviceUnlocked, isCommunalAvailable, shadeMode ->
+ buildList {
+ if (isCommunalAvailable) {
+ add(Swipe.Left to Scenes.Communal)
+ }
+
+ add(Swipe.Up to if (isDeviceUnlocked) Scenes.Gone else Scenes.Bouncer)
+
+ addAll(
+ when (shadeMode) {
+ ShadeMode.Single -> fullscreenShadeActions()
+ ShadeMode.Split ->
+ fullscreenShadeActions(transitionKey = ToSplitShade)
+ ShadeMode.Dual -> dualShadeActions()
+ }
)
-
- mapOf(
- Swipe.Left to
- UserActionResult(Scenes.Communal).takeIf {
- isCommunalAvailable
- },
- Swipe.Up to if (isDeviceUnlocked) Scenes.Gone else Scenes.Bouncer,
-
- // Swiping down from the top edge goes to QS (or shade if in split
- // shade mode).
- swipeDownFromTop(pointerCount = 1) to
- if (shadeMode is ShadeMode.Single) {
- UserActionResult(Scenes.QuickSettings)
- } else {
- notifShadeSceneKey
- },
-
- // TODO(b/338577208): Remove once we add Dual Shade invocation zones
- swipeDownFromTop(pointerCount = 2) to
- UserActionResult(
- toScene = SceneFamilies.QuickSettings,
- transitionKey =
- ToSplitShade.takeIf { shadeMode is ShadeMode.Split }
- ),
-
- // Swiping down, not from the edge, always navigates to the notif
- // shade scene.
- swipeDown(pointerCount = 1) to notifShadeSceneKey,
- swipeDown(pointerCount = 2) to notifShadeSceneKey,
- )
- .filterValuesNotNull()
- }
+ }
+ .associate { it }
}
}
.collect { setActions(it) }
}
- private fun swipeDownFromTop(pointerCount: Int): Swipe {
- return Swipe(
- SwipeDirection.Down,
- fromSource = Edge.Top,
- pointerCount = pointerCount,
+ private fun fullscreenShadeActions(
+ transitionKey: TransitionKey? = null
+ ): Array<Pair<UserAction, UserActionResult>> {
+ val notifShadeSceneKey = UserActionResult(SceneFamilies.NotifShade, transitionKey)
+ val qsShadeSceneKey = UserActionResult(SceneFamilies.QuickSettings, transitionKey)
+ return arrayOf(
+ // Swiping down, not from the edge, always goes to shade.
+ Swipe.Down to notifShadeSceneKey,
+ swipeDown(pointerCount = 2) to notifShadeSceneKey,
+ // Swiping down from the top edge goes to QS.
+ swipeDownFromTop(pointerCount = 1) to qsShadeSceneKey,
+ swipeDownFromTop(pointerCount = 2) to qsShadeSceneKey,
)
}
- private fun swipeDown(pointerCount: Int): Swipe {
- return Swipe(
- SwipeDirection.Down,
- pointerCount = pointerCount,
+ private fun dualShadeActions(): Array<Pair<UserAction, UserActionResult>> {
+ return arrayOf(
+ Swipe.Down to Overlays.NotificationsShade,
+ Swipe(direction = SwipeDirection.Down, fromSource = SceneContainerEdge.TopRight) to
+ Overlays.QuickSettingsShade,
)
}
+ private fun swipeDownFromTop(pointerCount: Int): Swipe {
+ return Swipe(SwipeDirection.Down, fromSource = Edge.Top, pointerCount = pointerCount)
+ }
+
+ private fun swipeDown(pointerCount: Int): Swipe {
+ return Swipe(SwipeDirection.Down, pointerCount = pointerCount)
+ }
+
@AssistedFactory
interface Factory {
fun create(): LockscreenUserActionsViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModel.kt
index 8811908..17c678e 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModel.kt
@@ -17,6 +17,7 @@
package com.android.systemui.keyguard.ui.viewmodel
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor
+import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.domain.interactor.FromPrimaryBouncerTransitionInteractor.Companion.TO_GONE_DURATION
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissActionInteractor
@@ -25,7 +26,6 @@
import com.android.systemui.keyguard.shared.model.KeyguardState.PRIMARY_BOUNCER
import com.android.systemui.keyguard.shared.model.ScrimAlpha
import com.android.systemui.keyguard.ui.KeyguardTransitionAnimationFlow
-import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.statusbar.SysuiStatusBarStateController
import dagger.Lazy
import javax.inject.Inject
@@ -85,7 +85,7 @@
/** Bouncer container alpha */
val bouncerAlpha: Flow<Float> =
- if (SceneContainerFlag.isEnabled) {
+ if (ComposeBouncerFlags.isEnabled) {
keyguardDismissActionInteractor
.get()
.willAnimateDismissActionOnLockscreen
@@ -110,7 +110,7 @@
/** Lockscreen alpha */
val lockscreenAlpha: Flow<Float> =
- if (SceneContainerFlag.isEnabled) {
+ if (ComposeBouncerFlags.isEnabled) {
keyguardDismissActionInteractor
.get()
.willAnimateDismissActionOnLockscreen
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt
index c5909ed..75e3871 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt
@@ -107,6 +107,8 @@
}
}
+ // TODO(b/365182034): move to interactor, add as dependency of SideFpsOverlayInteractor when
+ // rest to unlock feature is implemented
val isVisible: Flow<Boolean> = _visible.asStateFlow()
val progress: Flow<Float> = _progress.asStateFlow()
diff --git a/packages/SystemUI/src/com/android/systemui/log/LongPressHandlingViewLogger.kt b/packages/SystemUI/src/com/android/systemui/log/LongPressHandlingViewLogger.kt
new file mode 100644
index 0000000..4ff8118
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/log/LongPressHandlingViewLogger.kt
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.log
+
+import com.android.systemui.log.core.LogLevel.DEBUG
+import com.google.errorprone.annotations.CompileTimeConstant
+
+data class LongPressHandlingViewLogger
+constructor(
+ private val logBuffer: LogBuffer,
+ @CompileTimeConstant private val tag: String = "LongPressHandlingViewLogger"
+) {
+ fun schedulingLongPress(delay: Long) {
+ logBuffer.log(
+ tag,
+ DEBUG,
+ { long1 = delay },
+ { "on MotionEvent.Down: scheduling long press activation after $long1 ms" }
+ )
+ }
+
+ fun longPressTriggered() {
+ logBuffer.log(tag, DEBUG, "long press event detected and dispatched")
+ }
+
+ fun motionEventCancelled() {
+ logBuffer.log(tag, DEBUG, "Long press may be cancelled due to MotionEventModel.Cancel")
+ }
+
+ fun dispatchingSingleTap() {
+ logBuffer.log(tag, DEBUG, "Dispatching single tap instead of long press")
+ }
+
+ fun onUpEvent(distanceMoved: Float, touchSlop: Int, gestureDuration: Long) {
+ logBuffer.log(
+ tag,
+ DEBUG,
+ {
+ double1 = distanceMoved.toDouble()
+ int1 = touchSlop
+ long1 = gestureDuration
+ },
+ {
+ "on MotionEvent.Up: distanceMoved: $double1, " +
+ "allowedTouchSlop: $int1, " +
+ "eventDuration: $long1"
+ }
+ )
+ }
+
+ fun cancelingLongPressDueToTouchSlop(distanceMoved: Float, allowedTouchSlop: Int) {
+ logBuffer.log(
+ tag,
+ DEBUG,
+ {
+ double1 = distanceMoved.toDouble()
+ int1 = allowedTouchSlop
+ },
+ {
+ "on MotionEvent.Motion: May cancel long press due to movement: " +
+ "distanceMoved: $double1, " +
+ "allowedTouchSlop: $int1 "
+ }
+ )
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/BouncerTableLog.kt b/packages/SystemUI/src/com/android/systemui/log/dagger/BouncerTableLog.kt
index 08df7db..9f893e0 100644
--- a/packages/SystemUI/src/com/android/systemui/log/dagger/BouncerTableLog.kt
+++ b/packages/SystemUI/src/com/android/systemui/log/dagger/BouncerTableLog.kt
@@ -16,10 +16,7 @@
package com.android.systemui.log.dagger
-import java.lang.annotation.Documented
-import java.lang.annotation.Retention
-import java.lang.annotation.RetentionPolicy
import javax.inject.Qualifier
/** Logger for the primary and alternative bouncers. */
-@Qualifier @Documented @Retention(RetentionPolicy.RUNTIME) annotation class BouncerTableLog
+@Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class BouncerTableLog
diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java b/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java
index 19906fd..2053b53 100644
--- a/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java
+++ b/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java
@@ -382,6 +382,16 @@
return factory.create("MediaLog", 20);
}
+ /**
+ * Provides a buffer for media device changes
+ */
+ @Provides
+ @SysUISingleton
+ @MediaDeviceLog
+ public static LogBuffer providesMediaDeviceLogBuffer(LogBufferFactory factory) {
+ return factory.create("MediaDeviceLog", 50);
+ }
+
/** Allows logging buffers to be tweaked via adb on debug builds but not on prod builds. */
@Provides
@SysUISingleton
@@ -717,4 +727,12 @@
public static LogBuffer provideVolumeLogBuffer(LogBufferFactory factory) {
return factory.create("VolumeLog", 50);
}
+
+ /** Provides a {@link LogBuffer} for use by long touch event handlers. */
+ @Provides
+ @SysUISingleton
+ @LongPressTouchLog
+ public static LogBuffer providesLongPressTouchLog(LogBufferFactory factory) {
+ return factory.create("LongPressViewLog", 200);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/LongPressTouchLog.kt b/packages/SystemUI/src/com/android/systemui/log/dagger/LongPressTouchLog.kt
new file mode 100644
index 0000000..1163d74
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/log/dagger/LongPressTouchLog.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.log.dagger
+
+import javax.inject.Qualifier
+
+/** Log buffer for logging touch/long press events */
+@Qualifier
+@MustBeDocumented
+@Retention(AnnotationRetention.RUNTIME)
+annotation class LongPressTouchLog
diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/MediaDeviceLog.kt b/packages/SystemUI/src/com/android/systemui/log/dagger/MediaDeviceLog.kt
new file mode 100644
index 0000000..06bd269
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/log/dagger/MediaDeviceLog.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.log.dagger
+
+import com.android.systemui.log.LogBuffer
+import javax.inject.Qualifier
+
+/** A [LogBuffer] for [com.android.systemui.media.controls.domain.pipeline.MediaDeviceLogger] */
+@Qualifier
+@MustBeDocumented
+@Retention(AnnotationRetention.RUNTIME)
+annotation class MediaDeviceLog
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImpl.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImpl.kt
index 24c57be..84aae65 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImpl.kt
@@ -70,12 +70,14 @@
import com.android.systemui.media.controls.domain.pipeline.MediaDataManager.Companion.isMediaNotification
import com.android.systemui.media.controls.domain.resume.MediaResumeListener
import com.android.systemui.media.controls.domain.resume.ResumeMediaBrowser
+import com.android.systemui.media.controls.shared.MediaLogger
import com.android.systemui.media.controls.shared.model.EXTRA_KEY_TRIGGER_SOURCE
import com.android.systemui.media.controls.shared.model.EXTRA_VALUE_TRIGGER_PERIODIC
import com.android.systemui.media.controls.shared.model.MediaAction
import com.android.systemui.media.controls.shared.model.MediaButton
import com.android.systemui.media.controls.shared.model.MediaData
import com.android.systemui.media.controls.shared.model.MediaDeviceData
+import com.android.systemui.media.controls.shared.model.MediaNotificationAction
import com.android.systemui.media.controls.shared.model.SmartspaceMediaData
import com.android.systemui.media.controls.shared.model.SmartspaceMediaDataProvider
import com.android.systemui.media.controls.ui.view.MediaViewHolder
@@ -83,7 +85,7 @@
import com.android.systemui.media.controls.util.MediaDataUtils
import com.android.systemui.media.controls.util.MediaFlags
import com.android.systemui.media.controls.util.MediaUiEventLogger
-import com.android.systemui.plugins.ActivityStarter
+import com.android.systemui.media.controls.util.SmallHash
import com.android.systemui.plugins.BcSmartspaceDataPlugin
import com.android.systemui.res.R
import com.android.systemui.statusbar.NotificationMediaManager.isPlayingState
@@ -185,7 +187,6 @@
private val mediaDeviceManager: MediaDeviceManager,
mediaDataCombineLatest: MediaDataCombineLatest,
private val mediaDataFilter: LegacyMediaDataFilterImpl,
- private val activityStarter: ActivityStarter,
private val smartspaceMediaDataProvider: SmartspaceMediaDataProvider,
private var useMediaResumption: Boolean,
private val useQsMediaPlayer: Boolean,
@@ -196,6 +197,7 @@
private val smartspaceManager: SmartspaceManager?,
private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
private val mediaDataLoader: dagger.Lazy<MediaDataLoader>,
+ private val mediaLogger: MediaLogger,
) : Dumpable, BcSmartspaceDataPlugin.SmartspaceTargetListener, MediaDataManager {
companion object {
@@ -272,7 +274,6 @@
mediaDeviceManager: MediaDeviceManager,
mediaDataCombineLatest: MediaDataCombineLatest,
mediaDataFilter: LegacyMediaDataFilterImpl,
- activityStarter: ActivityStarter,
smartspaceMediaDataProvider: SmartspaceMediaDataProvider,
clock: SystemClock,
tunerService: TunerService,
@@ -281,6 +282,7 @@
smartspaceManager: SmartspaceManager?,
keyguardUpdateMonitor: KeyguardUpdateMonitor,
mediaDataLoader: dagger.Lazy<MediaDataLoader>,
+ mediaLogger: MediaLogger,
) : this(
context,
// Loading bitmap for UMO background can take longer time, so it cannot run on the default
@@ -300,7 +302,6 @@
mediaDeviceManager,
mediaDataCombineLatest,
mediaDataFilter,
- activityStarter,
smartspaceMediaDataProvider,
Utils.useMediaResumption(context),
Utils.useQsMediaPlayer(context),
@@ -311,6 +312,7 @@
smartspaceManager,
keyguardUpdateMonitor,
mediaDataLoader,
+ mediaLogger,
)
private val appChangeReceiver =
@@ -563,6 +565,42 @@
val resumeAction: Runnable? = currentEntry?.resumeAction
val hasCheckedForResume = currentEntry?.hasCheckedForResume == true
val active = currentEntry?.active ?: true
+ val mediaController = mediaControllerFactory.create(result.token!!)
+
+ val mediaData =
+ MediaData(
+ userId = sbn.normalizedUserId,
+ initialized = true,
+ app = result.appName,
+ appIcon = result.appIcon,
+ artist = result.artist,
+ song = result.song,
+ artwork = result.artworkIcon,
+ actions = result.actionIcons,
+ actionsToShowInCompact = result.actionsToShowInCompact,
+ semanticActions = result.semanticActions,
+ packageName = sbn.packageName,
+ token = result.token,
+ clickIntent = result.clickIntent,
+ device = result.device,
+ active = active,
+ resumeAction = resumeAction,
+ playbackLocation = result.playbackLocation,
+ notificationKey = key,
+ hasCheckedForResume = hasCheckedForResume,
+ isPlaying = result.isPlaying,
+ isClearable = !sbn.isOngoing,
+ lastActive = lastActive,
+ createdTimestampMillis = createdTimestampMillis,
+ instanceId = instanceId,
+ appUid = result.appUid,
+ isExplicit = result.isExplicit,
+ )
+
+ if (isSameMediaData(context, mediaController, mediaData, currentEntry)) {
+ mediaLogger.logDuplicateMediaNotification(key)
+ return@withContext
+ }
// We need to log the correct media added.
if (isNewlyActiveEntry) {
@@ -582,40 +620,7 @@
)
}
- withContext(mainDispatcher) {
- onMediaDataLoaded(
- key,
- oldKey,
- MediaData(
- userId = sbn.normalizedUserId,
- initialized = true,
- app = result.appName,
- appIcon = result.appIcon,
- artist = result.artist,
- song = result.song,
- artwork = result.artworkIcon,
- actions = result.actionIcons,
- actionsToShowInCompact = result.actionsToShowInCompact,
- semanticActions = result.semanticActions,
- packageName = sbn.packageName,
- token = result.token,
- clickIntent = result.clickIntent,
- device = result.device,
- active = active,
- resumeAction = resumeAction,
- playbackLocation = result.playbackLocation,
- notificationKey = key,
- hasCheckedForResume = hasCheckedForResume,
- isPlaying = result.isPlaying,
- isClearable = !sbn.isOngoing,
- lastActive = lastActive,
- createdTimestampMillis = createdTimestampMillis,
- instanceId = instanceId,
- appUid = result.appUid,
- isExplicit = result.isExplicit,
- )
- )
- }
+ withContext(mainDispatcher) { onMediaDataLoaded(key, oldKey, mediaData) }
}
/** Add a listener for changes in this class */
@@ -943,7 +948,7 @@
desc.subtitle,
desc.title,
artworkIcon,
- listOf(mediaAction),
+ listOf(),
listOf(0),
MediaButton(playOrPause = mediaAction),
packageName,
@@ -1074,13 +1079,13 @@
}
// Control buttons
- // If flag is enabled and controller has a PlaybackState, create actions from session info
+ // If controller has a PlaybackState, create actions from session info
// Otherwise, use the notification actions
- var actionIcons: List<MediaAction> = emptyList()
+ var actionIcons: List<MediaNotificationAction> = emptyList()
var actionsToShowCollapsed: List<Int> = emptyList()
val semanticActions = createActionsFromState(sbn.packageName, mediaController, sbn.user)
if (semanticActions == null) {
- val actions = createActionsFromNotification(context, activityStarter, sbn)
+ val actions = createActionsFromNotification(context, sbn)
actionIcons = actions.first
actionsToShowCollapsed = actions.second
}
@@ -1099,6 +1104,47 @@
val instanceId = currentEntry?.instanceId ?: logger.getNewInstanceId()
val appUid = appInfo?.uid ?: Process.INVALID_UID
+ val lastActive = systemClock.elapsedRealtime()
+ val createdTimestampMillis = currentEntry?.createdTimestampMillis ?: 0L
+ val resumeAction: Runnable? = mediaEntries[key]?.resumeAction
+ val hasCheckedForResume = mediaEntries[key]?.hasCheckedForResume == true
+ val active = mediaEntries[key]?.active ?: true
+ var mediaData =
+ MediaData(
+ sbn.normalizedUserId,
+ true,
+ appName,
+ smallIcon,
+ artist,
+ song,
+ artWorkIcon,
+ actionIcons,
+ actionsToShowCollapsed,
+ semanticActions,
+ sbn.packageName,
+ token,
+ notif.contentIntent,
+ device,
+ active,
+ resumeAction = resumeAction,
+ playbackLocation = playbackLocation,
+ notificationKey = key,
+ hasCheckedForResume = hasCheckedForResume,
+ isPlaying = isPlaying,
+ isClearable = !sbn.isOngoing,
+ lastActive = lastActive,
+ createdTimestampMillis = createdTimestampMillis,
+ instanceId = instanceId,
+ appUid = appUid,
+ isExplicit = isExplicit,
+ smartspaceId = SmallHash.hash(appUid + systemClock.currentTimeMillis().toInt()),
+ )
+
+ if (isSameMediaData(context, mediaController, mediaData, currentEntry)) {
+ mediaLogger.logDuplicateMediaNotification(key)
+ return
+ }
+
if (isNewlyActiveEntry) {
logSingleVsMultipleMediaAdded(appUid, sbn.packageName, instanceId)
logger.logActiveMediaAdded(appUid, sbn.packageName, instanceId, playbackLocation)
@@ -1106,44 +1152,17 @@
logger.logPlaybackLocationChange(appUid, sbn.packageName, instanceId, playbackLocation)
}
- val lastActive = systemClock.elapsedRealtime()
- val createdTimestampMillis = currentEntry?.createdTimestampMillis ?: 0L
foregroundExecutor.execute {
- val resumeAction: Runnable? = mediaEntries[key]?.resumeAction
- val hasCheckedForResume = mediaEntries[key]?.hasCheckedForResume == true
- val active = mediaEntries[key]?.active ?: true
- onMediaDataLoaded(
- key,
- oldKey,
- MediaData(
- sbn.normalizedUserId,
- true,
- appName,
- smallIcon,
- artist,
- song,
- artWorkIcon,
- actionIcons,
- actionsToShowCollapsed,
- semanticActions,
- sbn.packageName,
- token,
- notif.contentIntent,
- device,
- active,
- resumeAction = resumeAction,
- playbackLocation = playbackLocation,
- notificationKey = key,
- hasCheckedForResume = hasCheckedForResume,
- isPlaying = isPlaying,
- isClearable = !sbn.isOngoing,
- lastActive = lastActive,
- createdTimestampMillis = createdTimestampMillis,
- instanceId = instanceId,
- appUid = appUid,
- isExplicit = isExplicit,
+ val oldResumeAction: Runnable? = mediaEntries[key]?.resumeAction
+ val oldHasCheckedForResume = mediaEntries[key]?.hasCheckedForResume == true
+ val oldActive = mediaEntries[key]?.active ?: true
+ mediaData =
+ mediaData.copy(
+ resumeAction = oldResumeAction,
+ hasCheckedForResume = oldHasCheckedForResume,
+ active = oldActive
)
- )
+ onMediaDataLoaded(key, oldKey, mediaData)
}
}
@@ -1464,7 +1483,7 @@
val updated =
data.copy(
token = null,
- actions = actions,
+ actions = listOf(),
semanticActions = MediaButton(playOrPause = resumeAction),
actionsToShowInCompact = listOf(0),
active = false,
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaActions.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaActions.kt
index bcf748e..f2825d0 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaActions.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaActions.kt
@@ -33,6 +33,7 @@
import com.android.systemui.media.controls.shared.MediaControlDrawables
import com.android.systemui.media.controls.shared.model.MediaAction
import com.android.systemui.media.controls.shared.model.MediaButton
+import com.android.systemui.media.controls.shared.model.MediaNotificationAction
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.res.R
import com.android.systemui.statusbar.NotificationMediaManager.isConnectingState
@@ -217,11 +218,10 @@
/** Generate action buttons based on notification actions */
fun createActionsFromNotification(
context: Context,
- activityStarter: ActivityStarter,
sbn: StatusBarNotification
-): Pair<List<MediaAction>, List<Int>> {
+): Pair<List<MediaNotificationAction>, List<Int>> {
val notif = sbn.notification
- val actionIcons: MutableList<MediaAction> = ArrayList()
+ val actionIcons: MutableList<MediaNotificationAction> = ArrayList()
val actions = notif.actions
var actionsToShowCollapsed =
notif.extras.getIntArray(Notification.EXTRA_COMPACT_ACTIONS)?.toMutableList()
@@ -250,25 +250,6 @@
continue
}
- val runnable =
- action.actionIntent?.let { actionIntent ->
- Runnable {
- when {
- actionIntent.isActivity ->
- activityStarter.startPendingIntentDismissingKeyguard(
- action.actionIntent
- )
- action.isAuthenticationRequired ->
- activityStarter.dismissKeyguardThenExecute(
- { sendPendingIntent(action.actionIntent) },
- {},
- true
- )
- else -> sendPendingIntent(actionIntent)
- }
- }
- }
-
val themeText =
com.android.settingslib.Utils.getColorAttr(
context,
@@ -285,13 +266,53 @@
.setTint(themeText)
.loadDrawable(context)
- val mediaAction = MediaAction(mediaActionIcon, runnable, action.title, null)
+ val mediaAction =
+ MediaNotificationAction(
+ action.isAuthenticationRequired,
+ action.actionIntent,
+ mediaActionIcon,
+ action.title
+ )
actionIcons.add(mediaAction)
}
}
return Pair(actionIcons, actionsToShowCollapsed)
}
+/**
+ * Converts [MediaNotificationAction] list into [MediaAction] list
+ *
+ * @param actions list of [MediaNotificationAction]
+ * @param activityStarter starter for activities
+ * @return list of [MediaAction]
+ */
+fun getNotificationActions(
+ actions: List<MediaNotificationAction>,
+ activityStarter: ActivityStarter
+): List<MediaAction> {
+ return actions.map { action ->
+ val runnable =
+ action.actionIntent?.let { actionIntent ->
+ Runnable {
+ when {
+ actionIntent.isActivity ->
+ activityStarter.startPendingIntentDismissingKeyguard(
+ action.actionIntent
+ )
+ action.isAuthenticationRequired ->
+ activityStarter.dismissKeyguardThenExecute(
+ { sendPendingIntent(action.actionIntent) },
+ {},
+ true
+ )
+ else -> sendPendingIntent(actionIntent)
+ }
+ }
+ }
+ MediaAction(action.icon, runnable, action.contentDescription, background = null)
+ }
+}
+
private fun sendPendingIntent(intent: PendingIntent): Boolean {
return try {
intent.send(
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoader.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoader.kt
index f9fef8e..53cc15b 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoader.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoader.kt
@@ -54,10 +54,10 @@
import com.android.systemui.media.controls.shared.model.MediaButton
import com.android.systemui.media.controls.shared.model.MediaData
import com.android.systemui.media.controls.shared.model.MediaDeviceData
+import com.android.systemui.media.controls.shared.model.MediaNotificationAction
import com.android.systemui.media.controls.util.MediaControllerFactory
import com.android.systemui.media.controls.util.MediaDataUtils
import com.android.systemui.media.controls.util.MediaFlags
-import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.res.R
import com.android.systemui.statusbar.NotificationMediaManager.isPlayingState
import com.android.systemui.statusbar.notification.row.HybridGroupManager
@@ -80,7 +80,6 @@
@Application val context: Context,
@Main val mainDispatcher: CoroutineDispatcher,
@Background val backgroundScope: CoroutineScope,
- private val activityStarter: ActivityStarter,
private val mediaControllerFactory: MediaControllerFactory,
private val mediaFlags: MediaFlags,
private val imageLoader: ImageLoader,
@@ -209,15 +208,14 @@
val device: MediaDeviceData? = getDeviceInfoForRemoteCast(key, sbn)
// Control buttons
- // If flag is enabled and controller has a PlaybackState, create actions from session
- // info
+ // If controller has a PlaybackState, create actions from session info
// Otherwise, use the notification actions
- var actionIcons: List<MediaAction> = emptyList()
+ var actionIcons: List<MediaNotificationAction> = emptyList()
var actionsToShowCollapsed: List<Int> = emptyList()
val semanticActions = createActionsFromState(sbn.packageName, mediaController, sbn.user)
logD(TAG) { "Semantic actions: $semanticActions" }
if (semanticActions == null) {
- val actions = createActionsFromNotification(context, activityStarter, sbn)
+ val actions = createActionsFromNotification(context, sbn)
actionIcons = actions.first
actionsToShowCollapsed = actions.second
logD(TAG) { "[!!] Semantic actions: $semanticActions" }
@@ -329,7 +327,7 @@
artist = desc.subtitle,
song = desc.title,
artworkIcon = artworkIcon,
- actionIcons = listOf(mediaAction),
+ actionIcons = listOf(),
actionsToShowInCompact = listOf(0),
semanticActions = MediaButton(playOrPause = mediaAction),
token = token,
@@ -514,7 +512,7 @@
val artist: CharSequence?,
val song: CharSequence?,
val artworkIcon: Icon?,
- val actionIcons: List<MediaAction>,
+ val actionIcons: List<MediaNotificationAction>,
val actionsToShowInCompact: List<Int>,
val semanticActions: MediaButton?,
val token: MediaSession.Token?,
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessor.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessor.kt
index 4555810..5f0a9f8 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessor.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessor.kt
@@ -71,12 +71,14 @@
import com.android.systemui.media.controls.domain.pipeline.MediaDataManager.Companion.isMediaNotification
import com.android.systemui.media.controls.domain.pipeline.interactor.MediaCarouselInteractor
import com.android.systemui.media.controls.domain.resume.ResumeMediaBrowser
+import com.android.systemui.media.controls.shared.MediaLogger
import com.android.systemui.media.controls.shared.model.EXTRA_KEY_TRIGGER_SOURCE
import com.android.systemui.media.controls.shared.model.EXTRA_VALUE_TRIGGER_PERIODIC
import com.android.systemui.media.controls.shared.model.MediaAction
import com.android.systemui.media.controls.shared.model.MediaButton
import com.android.systemui.media.controls.shared.model.MediaData
import com.android.systemui.media.controls.shared.model.MediaDeviceData
+import com.android.systemui.media.controls.shared.model.MediaNotificationAction
import com.android.systemui.media.controls.shared.model.SmartspaceMediaData
import com.android.systemui.media.controls.shared.model.SmartspaceMediaDataProvider
import com.android.systemui.media.controls.ui.view.MediaViewHolder
@@ -149,6 +151,7 @@
private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
private val mediaDataRepository: MediaDataRepository,
private val mediaDataLoader: dagger.Lazy<MediaDataLoader>,
+ private val mediaLogger: MediaLogger,
) : CoreStartable, BcSmartspaceDataPlugin.SmartspaceTargetListener {
companion object {
@@ -228,6 +231,7 @@
keyguardUpdateMonitor: KeyguardUpdateMonitor,
mediaDataRepository: MediaDataRepository,
mediaDataLoader: dagger.Lazy<MediaDataLoader>,
+ mediaLogger: MediaLogger,
) : this(
context,
applicationScope,
@@ -253,6 +257,7 @@
keyguardUpdateMonitor,
mediaDataRepository,
mediaDataLoader,
+ mediaLogger,
)
private val appChangeReceiver =
@@ -794,7 +799,7 @@
desc.subtitle,
desc.title,
artworkIcon,
- listOf(mediaAction),
+ listOf(),
listOf(0),
MediaButton(playOrPause = mediaAction),
packageName,
@@ -832,12 +837,48 @@
return@withContext
}
- val currentEntry = mediaDataRepository.mediaEntries.value[key]
- val instanceId = currentEntry?.instanceId ?: logger.getNewInstanceId()
- val createdTimestampMillis = currentEntry?.createdTimestampMillis ?: 0L
- val resumeAction: Runnable? = currentEntry?.resumeAction
- val hasCheckedForResume = currentEntry?.hasCheckedForResume == true
- val active = currentEntry?.active ?: true
+ val mediaController = mediaControllerFactory.create(result.token!!)
+ val oldEntry = mediaDataRepository.mediaEntries.value[key]
+ val instanceId = oldEntry?.instanceId ?: logger.getNewInstanceId()
+ val createdTimestampMillis = oldEntry?.createdTimestampMillis ?: 0L
+ val resumeAction: Runnable? = oldEntry?.resumeAction
+ val hasCheckedForResume = oldEntry?.hasCheckedForResume == true
+ val active = oldEntry?.active ?: true
+
+ val mediaData =
+ MediaData(
+ userId = sbn.normalizedUserId,
+ initialized = true,
+ app = result.appName,
+ appIcon = result.appIcon,
+ artist = result.artist,
+ song = result.song,
+ artwork = result.artworkIcon,
+ actions = result.actionIcons,
+ actionsToShowInCompact = result.actionsToShowInCompact,
+ semanticActions = result.semanticActions,
+ packageName = sbn.packageName,
+ token = result.token,
+ clickIntent = result.clickIntent,
+ device = result.device,
+ active = active,
+ resumeAction = resumeAction,
+ playbackLocation = result.playbackLocation,
+ notificationKey = key,
+ hasCheckedForResume = hasCheckedForResume,
+ isPlaying = result.isPlaying,
+ isClearable = !sbn.isOngoing,
+ lastActive = lastActive,
+ createdTimestampMillis = createdTimestampMillis,
+ instanceId = instanceId,
+ appUid = result.appUid,
+ isExplicit = result.isExplicit,
+ )
+
+ if (isSameMediaData(context, mediaController, mediaData, oldEntry)) {
+ mediaLogger.logDuplicateMediaNotification(key)
+ return@withContext
+ }
// We need to log the correct media added.
if (isNewlyActiveEntry) {
@@ -848,7 +889,7 @@
instanceId,
result.playbackLocation
)
- } else if (result.playbackLocation != currentEntry?.playbackLocation) {
+ } else if (result.playbackLocation != oldEntry?.playbackLocation) {
logger.logPlaybackLocationChange(
result.appUid,
sbn.packageName,
@@ -857,40 +898,7 @@
)
}
- withContext(mainDispatcher) {
- onMediaDataLoaded(
- key,
- oldKey,
- MediaData(
- userId = sbn.normalizedUserId,
- initialized = true,
- app = result.appName,
- appIcon = result.appIcon,
- artist = result.artist,
- song = result.song,
- artwork = result.artworkIcon,
- actions = result.actionIcons,
- actionsToShowInCompact = result.actionsToShowInCompact,
- semanticActions = result.semanticActions,
- packageName = sbn.packageName,
- token = result.token,
- clickIntent = result.clickIntent,
- device = result.device,
- active = active,
- resumeAction = resumeAction,
- playbackLocation = result.playbackLocation,
- notificationKey = key,
- hasCheckedForResume = hasCheckedForResume,
- isPlaying = result.isPlaying,
- isClearable = !sbn.isOngoing,
- lastActive = lastActive,
- createdTimestampMillis = createdTimestampMillis,
- instanceId = instanceId,
- appUid = result.appUid,
- isExplicit = result.isExplicit,
- )
- )
- }
+ withContext(mainDispatcher) { onMediaDataLoaded(key, oldKey, mediaData) }
}
@Deprecated("Cleanup when media_load_metadata_via_media_data_loader is cleaned up")
@@ -1001,13 +1009,13 @@
}
// Control buttons
- // If flag is enabled and controller has a PlaybackState, create actions from session info
+ // If controller has a PlaybackState, create actions from session info
// Otherwise, use the notification actions
- var actionIcons: List<MediaAction> = emptyList()
+ var actionIcons: List<MediaNotificationAction> = emptyList()
var actionsToShowCollapsed: List<Int> = emptyList()
val semanticActions = createActionsFromState(sbn.packageName, mediaController, sbn.user)
if (semanticActions == null) {
- val actions = createActionsFromNotification(context, activityStarter, sbn)
+ val actions = createActionsFromNotification(context, sbn)
actionIcons = actions.first
actionsToShowCollapsed = actions.second
}
@@ -1022,57 +1030,72 @@
else MediaData.PLAYBACK_CAST_LOCAL
val isPlaying = mediaController.playbackState?.let { isPlayingState(it.state) }
- val currentEntry = mediaDataRepository.mediaEntries.value.get(key)
- val instanceId = currentEntry?.instanceId ?: logger.getNewInstanceId()
+ val oldEntry = mediaDataRepository.mediaEntries.value.get(key)
+ val instanceId = oldEntry?.instanceId ?: logger.getNewInstanceId()
val appUid = appInfo?.uid ?: Process.INVALID_UID
+ val lastActive = systemClock.elapsedRealtime()
+ val createdTimestampMillis = oldEntry?.createdTimestampMillis ?: 0L
+ val resumeAction: Runnable? = mediaDataRepository.mediaEntries.value[key]?.resumeAction
+ val hasCheckedForResume =
+ mediaDataRepository.mediaEntries.value[key]?.hasCheckedForResume == true
+ val active = mediaDataRepository.mediaEntries.value[key]?.active ?: true
+ var mediaData =
+ MediaData(
+ sbn.normalizedUserId,
+ true,
+ appName,
+ smallIcon,
+ artist,
+ song,
+ artWorkIcon,
+ actionIcons,
+ actionsToShowCollapsed,
+ semanticActions,
+ sbn.packageName,
+ token,
+ notif.contentIntent,
+ device,
+ active,
+ resumeAction = resumeAction,
+ playbackLocation = playbackLocation,
+ notificationKey = key,
+ hasCheckedForResume = hasCheckedForResume,
+ isPlaying = isPlaying,
+ isClearable = !sbn.isOngoing,
+ lastActive = lastActive,
+ createdTimestampMillis = createdTimestampMillis,
+ instanceId = instanceId,
+ appUid = appUid,
+ isExplicit = isExplicit,
+ smartspaceId = SmallHash.hash(appUid + systemClock.currentTimeMillis().toInt()),
+ )
+
+ if (isSameMediaData(context, mediaController, mediaData, oldEntry)) {
+ mediaLogger.logDuplicateMediaNotification(key)
+ return
+ }
+
if (isNewlyActiveEntry) {
logSingleVsMultipleMediaAdded(appUid, sbn.packageName, instanceId)
logger.logActiveMediaAdded(appUid, sbn.packageName, instanceId, playbackLocation)
- } else if (playbackLocation != currentEntry?.playbackLocation) {
+ } else if (playbackLocation != oldEntry?.playbackLocation) {
logger.logPlaybackLocationChange(appUid, sbn.packageName, instanceId, playbackLocation)
}
- val lastActive = systemClock.elapsedRealtime()
- val createdTimestampMillis = currentEntry?.createdTimestampMillis ?: 0L
foregroundExecutor.execute {
- val resumeAction: Runnable? = mediaDataRepository.mediaEntries.value[key]?.resumeAction
- val hasCheckedForResume =
+ val oldResumeAction: Runnable? =
+ mediaDataRepository.mediaEntries.value[key]?.resumeAction
+ val oldHasCheckedForResume =
mediaDataRepository.mediaEntries.value[key]?.hasCheckedForResume == true
- val active = mediaDataRepository.mediaEntries.value[key]?.active ?: true
- onMediaDataLoaded(
- key,
- oldKey,
- MediaData(
- sbn.normalizedUserId,
- true,
- appName,
- smallIcon,
- artist,
- song,
- artWorkIcon,
- actionIcons,
- actionsToShowCollapsed,
- semanticActions,
- sbn.packageName,
- token,
- notif.contentIntent,
- device,
- active,
- resumeAction = resumeAction,
- playbackLocation = playbackLocation,
- notificationKey = key,
- hasCheckedForResume = hasCheckedForResume,
- isPlaying = isPlaying,
- isClearable = !sbn.isOngoing,
- lastActive = lastActive,
- createdTimestampMillis = createdTimestampMillis,
- instanceId = instanceId,
- appUid = appUid,
- isExplicit = isExplicit,
- smartspaceId = SmallHash.hash(appUid + systemClock.currentTimeMillis().toInt()),
+ val oldActive = mediaDataRepository.mediaEntries.value[key]?.active ?: true
+ mediaData =
+ mediaData.copy(
+ resumeAction = oldResumeAction,
+ hasCheckedForResume = oldHasCheckedForResume,
+ active = oldActive
)
- )
+ onMediaDataLoaded(key, oldKey, mediaData)
}
}
@@ -1402,7 +1425,7 @@
val updated =
data.copy(
token = null,
- actions = actions,
+ actions = listOf(),
semanticActions = MediaButton(playOrPause = resumeAction),
actionsToShowInCompact = listOf(0),
active = false,
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceLogger.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceLogger.kt
new file mode 100644
index 0000000..f886166
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceLogger.kt
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media.controls.domain.pipeline
+
+import android.media.session.MediaController
+import com.android.settingslib.media.MediaDevice
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.core.LogLevel
+import com.android.systemui.log.dagger.MediaDeviceLog
+import com.android.systemui.media.controls.shared.model.MediaDeviceData
+import javax.inject.Inject
+
+/** A [LogBuffer] for media device changes */
+class MediaDeviceLogger @Inject constructor(@MediaDeviceLog private val buffer: LogBuffer) {
+
+ fun logBroadcastEvent(event: String, reason: Int, broadcastId: Int) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = event
+ int1 = reason
+ int2 = broadcastId
+ },
+ { "$str1, reason = $int1, broadcastId = $int2" }
+ )
+ }
+
+ fun logBroadcastEvent(event: String, reason: Int) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = event
+ int1 = reason
+ },
+ { "$str1, reason = $int1" }
+ )
+ }
+
+ fun logBroadcastMetadataChanged(broadcastId: Int, metadata: String) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ int1 = broadcastId
+ str1 = metadata
+ },
+ { "onBroadcastMetadataChanged, broadcastId = $int1, metadata = $str1" }
+ )
+ }
+
+ fun logNewDeviceName(name: String?) {
+ buffer.log(TAG, LogLevel.DEBUG, { str1 = name }, { "New device name $str1" })
+ }
+
+ fun logLocalDevice(sassDevice: MediaDeviceData?, connectedDevice: MediaDeviceData?) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = sassDevice?.name?.toString()
+ str2 = connectedDevice?.name?.toString()
+ },
+ { "Local device: $str1 or $str2" }
+ )
+ }
+
+ fun logRemoteDevice(routingSessionName: CharSequence?, connectedDevice: MediaDeviceData?) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = routingSessionName?.toString()
+ str2 = connectedDevice?.name?.toString()
+ },
+ { "Remote device: $str1 or $str2 or unknown" }
+ )
+ }
+
+ fun logDeviceName(
+ device: MediaDevice?,
+ controller: MediaController?,
+ routingSessionName: CharSequence?,
+ selectedRouteName: CharSequence?
+ ) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = "device $device, controller: $controller"
+ str2 = routingSessionName?.toString()
+ str3 = selectedRouteName?.toString()
+ },
+ { "$str1, routingSession $str2 or selected route $str3" }
+ )
+ }
+
+ companion object {
+ private const val TAG = "MediaDeviceLog"
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt
index a193f7f..49b53c2 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt
@@ -71,6 +71,7 @@
private val localBluetoothManager: Lazy<LocalBluetoothManager?>,
@Main private val fgExecutor: Executor,
@Background private val bgExecutor: Executor,
+ private val logger: MediaDeviceLogger,
) : MediaDataManager.Listener {
private val listeners: MutableSet<Listener> = mutableSetOf()
@@ -281,59 +282,38 @@
}
override fun onBroadcastStarted(reason: Int, broadcastId: Int) {
- if (DEBUG) {
- Log.d(TAG, "onBroadcastStarted(), reason = $reason , broadcastId = $broadcastId")
- }
+ logger.logBroadcastEvent("onBroadcastStarted", reason, broadcastId)
updateCurrent()
}
override fun onBroadcastStartFailed(reason: Int) {
- if (DEBUG) {
- Log.d(TAG, "onBroadcastStartFailed(), reason = $reason")
- }
+ logger.logBroadcastEvent("onBroadcastStartFailed", reason)
}
override fun onBroadcastMetadataChanged(
broadcastId: Int,
metadata: BluetoothLeBroadcastMetadata
) {
- if (DEBUG) {
- Log.d(
- TAG,
- "onBroadcastMetadataChanged(), broadcastId = $broadcastId , " +
- "metadata = $metadata"
- )
- }
+ logger.logBroadcastMetadataChanged(broadcastId, metadata.toString())
updateCurrent()
}
override fun onBroadcastStopped(reason: Int, broadcastId: Int) {
- if (DEBUG) {
- Log.d(TAG, "onBroadcastStopped(), reason = $reason , broadcastId = $broadcastId")
- }
+ logger.logBroadcastEvent("onBroadcastStopped", reason, broadcastId)
updateCurrent()
}
override fun onBroadcastStopFailed(reason: Int) {
- if (DEBUG) {
- Log.d(TAG, "onBroadcastStopFailed(), reason = $reason")
- }
+ logger.logBroadcastEvent("onBroadcastStopFailed", reason)
}
override fun onBroadcastUpdated(reason: Int, broadcastId: Int) {
- if (DEBUG) {
- Log.d(TAG, "onBroadcastUpdated(), reason = $reason , broadcastId = $broadcastId")
- }
+ logger.logBroadcastEvent("onBroadcastUpdated", reason, broadcastId)
updateCurrent()
}
override fun onBroadcastUpdateFailed(reason: Int, broadcastId: Int) {
- if (DEBUG) {
- Log.d(
- TAG,
- "onBroadcastUpdateFailed(), reason = $reason , " + "broadcastId = $broadcastId"
- )
- }
+ logger.logBroadcastEvent("onBroadcastUpdateFailed", reason, broadcastId)
}
override fun onPlaybackStarted(reason: Int, broadcastId: Int) {}
@@ -381,12 +361,16 @@
name = context.getString(R.string.media_seamless_other_device),
showBroadcastButton = false
)
+ logger.logRemoteDevice(routingSession?.name, connectedDevice)
} else {
// Prefer SASS if available when playback is local.
- activeDevice = getSassDevice() ?: connectedDevice
+ val sassDevice = getSassDevice()
+ activeDevice = sassDevice ?: connectedDevice
+ logger.logLocalDevice(sassDevice, connectedDevice)
}
current = activeDevice ?: EMPTY_AND_DISABLED_MEDIA_DEVICE_DATA
+ logger.logNewDeviceName(current?.name?.toString())
} else {
val aboutToConnect = aboutToConnectDeviceOverride
if (
@@ -407,9 +391,7 @@
val enabled = device != null && (controller == null || routingSession != null)
val name = getDeviceName(device, routingSession)
- if (DEBUG) {
- Log.d(TAG, "new device name $name")
- }
+ logger.logNewDeviceName(name)
current =
MediaDeviceData(
enabled,
@@ -463,14 +445,12 @@
): String? {
val selectedRoutes = routingSession?.let { mr2manager.get().getSelectedRoutes(it) }
- if (DEBUG) {
- Log.d(
- TAG,
- "device is $device, controller $controller," +
- " routingSession ${routingSession?.name}" +
- " or ${selectedRoutes?.firstOrNull()?.name}"
- )
- }
+ logger.logDeviceName(
+ device,
+ controller,
+ routingSession?.name,
+ selectedRoutes?.firstOrNull()?.name
+ )
if (controller == null) {
// In resume state, we don't have a controller - just use the device name
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaProcessingHelper.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaProcessingHelper.kt
new file mode 100644
index 0000000..55d7b1d
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaProcessingHelper.kt
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media.controls.domain.pipeline
+
+import android.annotation.WorkerThread
+import android.app.PendingIntent
+import android.content.Context
+import android.graphics.drawable.Icon
+import android.media.session.MediaController
+import android.media.session.PlaybackState
+import android.util.Log
+import com.android.systemui.Flags.mediaControlsPostsOptimization
+import com.android.systemui.biometrics.Utils.toBitmap
+import com.android.systemui.media.controls.shared.model.MediaData
+
+private const val TAG = "MediaProcessingHelper"
+
+/**
+ * Compares [new] media data to [old] media data.
+ *
+ * @param context Context
+ * @param newController media controller of the new media data.
+ * @param new new media data.
+ * @param old old media data.
+ * @return whether new and old contain same data
+ */
+fun isSameMediaData(
+ context: Context,
+ newController: MediaController,
+ new: MediaData,
+ old: MediaData?
+): Boolean {
+ if (old == null || !mediaControlsPostsOptimization()) return false
+
+ return new.userId == old.userId &&
+ new.app == old.app &&
+ new.artist == old.artist &&
+ new.song == old.song &&
+ new.packageName == old.packageName &&
+ new.isExplicit == old.isExplicit &&
+ new.appUid == old.appUid &&
+ new.notificationKey == old.notificationKey &&
+ new.isPlaying == old.isPlaying &&
+ new.isClearable == old.isClearable &&
+ new.playbackLocation == old.playbackLocation &&
+ new.device == old.device &&
+ new.initialized == old.initialized &&
+ new.resumption == old.resumption &&
+ new.token == old.token &&
+ new.resumeProgress == old.resumeProgress &&
+ areClickIntentsEqual(new.clickIntent, old.clickIntent) &&
+ areActionsEqual(context, newController, new, old) &&
+ areIconsEqual(context, new.artwork, old.artwork) &&
+ areIconsEqual(context, new.appIcon, old.appIcon)
+}
+
+/** Returns whether actions lists are equal. */
+fun areCustomActionListsEqual(
+ first: List<PlaybackState.CustomAction>?,
+ second: List<PlaybackState.CustomAction>?
+): Boolean {
+ // Same object, or both null
+ if (first === second) {
+ return true
+ }
+
+ // Only one null, or different number of actions
+ if ((first == null || second == null) || (first.size != second.size)) {
+ return false
+ }
+
+ // Compare individual actions
+ first.asSequence().zip(second.asSequence()).forEach { (firstAction, secondAction) ->
+ if (!areCustomActionsEqual(firstAction, secondAction)) {
+ return false
+ }
+ }
+ return true
+}
+
+private fun areCustomActionsEqual(
+ firstAction: PlaybackState.CustomAction,
+ secondAction: PlaybackState.CustomAction
+): Boolean {
+ if (
+ firstAction.action != secondAction.action ||
+ firstAction.name != secondAction.name ||
+ firstAction.icon != secondAction.icon
+ ) {
+ return false
+ }
+
+ if ((firstAction.extras == null) != (secondAction.extras == null)) {
+ return false
+ }
+ if (firstAction.extras != null) {
+ firstAction.extras.keySet().forEach { key ->
+ if (firstAction.extras[key] != secondAction.extras[key]) {
+ return false
+ }
+ }
+ }
+ return true
+}
+
+@WorkerThread
+private fun areIconsEqual(context: Context, new: Icon?, old: Icon?): Boolean {
+ if (new == old) return true
+ if (new == null || old == null || new.type != old.type) return false
+ return if (new.type == Icon.TYPE_BITMAP || new.type == Icon.TYPE_ADAPTIVE_BITMAP) {
+ if (new.bitmap.isRecycled || old.bitmap.isRecycled) {
+ Log.e(TAG, "Cannot compare recycled bitmap")
+ return false
+ }
+ new.bitmap.sameAs(old.bitmap)
+ } else {
+ val newDrawable = new.loadDrawable(context)
+ val oldDrawable = old.loadDrawable(context)
+
+ return newDrawable?.toBitmap()?.sameAs(oldDrawable?.toBitmap()) ?: false
+ }
+}
+
+private fun areActionsEqual(
+ context: Context,
+ newController: MediaController,
+ new: MediaData,
+ old: MediaData
+): Boolean {
+ val oldState = MediaController(context, old.token!!).playbackState
+ return if (
+ new.semanticActions == null &&
+ old.semanticActions == null &&
+ new.actions.size == old.actions.size
+ ) {
+ var same = true
+ new.actions.asSequence().zip(old.actions.asSequence()).forEach {
+ if (
+ it.first.actionIntent?.intent?.filterEquals(it.second.actionIntent?.intent) !=
+ true ||
+ it.first.icon != it.second.icon ||
+ it.first.contentDescription != it.second.contentDescription
+ ) {
+ same = false
+ return@forEach
+ }
+ }
+ same
+ } else if (new.semanticActions != null && old.semanticActions != null) {
+ oldState?.actions == newController.playbackState?.actions &&
+ areCustomActionListsEqual(
+ oldState?.customActions,
+ newController.playbackState?.customActions
+ )
+ } else {
+ false
+ }
+}
+
+private fun areClickIntentsEqual(newIntent: PendingIntent?, oldIntent: PendingIntent?): Boolean {
+ if ((newIntent == null && oldIntent == null) || newIntent === oldIntent) return true
+ if (newIntent == null || oldIntent == null) return false
+
+ return newIntent.intent?.filterEquals(oldIntent.intent) == true
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListener.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListener.kt
index fc31903..275f1ee 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListener.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListener.kt
@@ -16,12 +16,14 @@
package com.android.systemui.media.controls.domain.pipeline
+import android.annotation.WorkerThread
import android.media.session.MediaController
import android.media.session.MediaSession
import android.media.session.PlaybackState
import android.os.SystemProperties
import com.android.internal.annotations.VisibleForTesting
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.media.controls.shared.model.MediaData
import com.android.systemui.media.controls.shared.model.SmartspaceMediaData
@@ -32,6 +34,7 @@
import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.time.SystemClock
+import java.util.concurrent.Executor
import java.util.concurrent.TimeUnit
import javax.inject.Inject
@@ -49,6 +52,8 @@
@Inject
constructor(
private val mediaControllerFactory: MediaControllerFactory,
+ @Background private val bgExecutor: Executor,
+ @Main private val uiExecutor: Executor,
@Main private val mainExecutor: DelayableExecutor,
private val logger: MediaTimeoutLogger,
statusBarStateController: SysuiStatusBarStateController,
@@ -147,19 +152,21 @@
}
reusedListener?.let {
- val wasPlaying = it.isPlaying()
- logger.logUpdateListener(key, wasPlaying)
- it.setMediaData(data)
- it.key = key
- mediaListeners[key] = it
- if (wasPlaying != it.isPlaying()) {
- // If a player becomes active because of a migration, we'll need to broadcast
- // its state. Doing it now would lead to reentrant callbacks, so let's wait
- // until we're done.
- mainExecutor.execute {
- if (mediaListeners[key]?.isPlaying() == true) {
- logger.logDelayedUpdate(key)
- timeoutCallback.invoke(key, false /* timedOut */)
+ bgExecutor.execute {
+ val wasPlaying = it.isPlaying()
+ logger.logUpdateListener(key, wasPlaying)
+ it.setMediaData(data)
+ it.key = key
+ mediaListeners[key] = it
+ if (wasPlaying != it.isPlaying()) {
+ // If a player becomes active because of a migration, we'll need to broadcast
+ // its state. Doing it now would lead to reentrant callbacks, so let's wait
+ // until we're done.
+ mainExecutor.execute {
+ if (mediaListeners[key]?.isPlaying() == true) {
+ logger.logDelayedUpdate(key)
+ timeoutCallback.invoke(key, false /* timedOut */)
+ }
}
}
}
@@ -217,18 +224,20 @@
private set
fun Int.isPlaying() = isPlayingState(this)
+
fun isPlaying() = lastState?.state?.isPlaying() ?: false
init {
- setMediaData(data)
+ bgExecutor.execute { setMediaData(data) }
}
fun destroy() {
- mediaController?.unregisterCallback(this)
+ bgExecutor.execute { mediaController?.unregisterCallback(this) }
cancellation?.run()
destroyed = true
}
+ @WorkerThread
fun setMediaData(data: MediaData) {
sessionToken = data.token
destroyed = false
@@ -258,7 +267,7 @@
if (resumption == true) {
// Some apps create a session when MBS is queried. We should unregister the
// controller since it will no longer be valid, but don't cancel the timeout
- mediaController?.unregisterCallback(this)
+ bgExecutor.execute { mediaController?.unregisterCallback(this) }
} else {
// For active controls, if the session is destroyed, clean up everything since we
// will need to recreate it if this key is updated later
@@ -284,7 +293,7 @@
if ((!actionsSame || !playingStateSame) && state != null && dispatchEvents) {
logger.logStateCallback(key)
- stateCallback.invoke(key, state)
+ uiExecutor.execute { stateCallback.invoke(key, state) }
}
if (playingStateSame && !resumptionChanged) {
@@ -313,7 +322,7 @@
expireMediaTimeout(key, "playback started - $state, $key")
timedOut = false
if (dispatchEvents) {
- timeoutCallback(key, timedOut)
+ uiExecutor.execute { timeoutCallback(key, timedOut) }
}
}
}
@@ -337,60 +346,13 @@
}
}
- private fun areCustomActionListsEqual(
- first: List<PlaybackState.CustomAction>?,
- second: List<PlaybackState.CustomAction>?
- ): Boolean {
- // Same object, or both null
- if (first === second) {
- return true
- }
-
- // Only one null, or different number of actions
- if ((first == null || second == null) || (first.size != second.size)) {
- return false
- }
-
- // Compare individual actions
- first.asSequence().zip(second.asSequence()).forEach { (firstAction, secondAction) ->
- if (!areCustomActionsEqual(firstAction, secondAction)) {
- return false
- }
- }
- return true
- }
-
- private fun areCustomActionsEqual(
- firstAction: PlaybackState.CustomAction,
- secondAction: PlaybackState.CustomAction
- ): Boolean {
- if (
- firstAction.action != secondAction.action ||
- firstAction.name != secondAction.name ||
- firstAction.icon != secondAction.icon
- ) {
- return false
- }
-
- if ((firstAction.extras == null) != (secondAction.extras == null)) {
- return false
- }
- if (firstAction.extras != null) {
- firstAction.extras.keySet().forEach { key ->
- if (firstAction.extras.get(key) != secondAction.extras.get(key)) {
- return false
- }
- }
- }
- return true
- }
-
/** Listens to changes in recommendation card data and schedules a timeout for its expiration */
private inner class RecommendationListener(var key: String, data: SmartspaceMediaData) {
private var timedOut = false
var destroyed = false
var expiration = Long.MAX_VALUE
private set
+
var cancellation: Runnable? = null
private set
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt
index 245f6f8..130868d 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt
@@ -32,6 +32,7 @@
import com.android.systemui.bluetooth.BroadcastDialogController
import com.android.systemui.media.controls.data.repository.MediaFilterRepository
import com.android.systemui.media.controls.domain.pipeline.MediaDataProcessor
+import com.android.systemui.media.controls.domain.pipeline.getNotificationActions
import com.android.systemui.media.controls.shared.model.MediaControlModel
import com.android.systemui.media.controls.shared.model.MediaData
import com.android.systemui.media.controls.util.MediaSmartspaceLogger
@@ -102,7 +103,7 @@
artwork = artwork,
deviceData = device,
semanticActionButtons = semanticActions,
- notificationActionButtons = actions,
+ notificationActionButtons = getNotificationActions(data.actions, activityStarter),
actionsToShowInCollapsed = actionsToShowInCompact,
isDismissible = isClearable,
isResume = resumption,
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/resume/MediaResumeListener.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/resume/MediaResumeListener.kt
index e4047e5..9ee59d1 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/resume/MediaResumeListener.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/resume/MediaResumeListener.kt
@@ -80,6 +80,7 @@
field?.disconnect()
field = value
}
+
private var currentUserId: Int = context.userId
@VisibleForTesting
@@ -89,7 +90,7 @@
if (Intent.ACTION_USER_UNLOCKED == intent.action) {
val userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1)
if (userId == currentUserId) {
- loadMediaResumptionControls()
+ backgroundExecutor.execute { loadMediaResumptionControls() }
}
}
}
@@ -254,15 +255,15 @@
if (data.resumeAction == null && !data.hasCheckedForResume && isEligibleForResume) {
// TODO also check for a media button receiver intended for restarting (b/154127084)
// Set null action to prevent additional attempts to connect
- mediaDataManager.setResumeAction(key, null)
- Log.d(TAG, "Checking for service component for " + data.packageName)
- val pm = context.packageManager
- val serviceIntent = Intent(MediaBrowserService.SERVICE_INTERFACE)
- val resumeInfo = pm.queryIntentServicesAsUser(serviceIntent, 0, currentUserId)
+ backgroundExecutor.execute {
+ mediaDataManager.setResumeAction(key, null)
+ Log.d(TAG, "Checking for service component for " + data.packageName)
+ val pm = context.packageManager
+ val serviceIntent = Intent(MediaBrowserService.SERVICE_INTERFACE)
+ val resumeInfo = pm.queryIntentServicesAsUser(serviceIntent, 0, currentUserId)
- val inf = resumeInfo?.filter { it.serviceInfo.packageName == data.packageName }
- if (inf != null && inf.size > 0) {
- backgroundExecutor.execute {
+ val inf = resumeInfo?.filter { it.serviceInfo.packageName == data.packageName }
+ if (inf != null && inf.size > 0) {
tryUpdateResumptionList(key, inf!!.get(0).componentInfo.componentName)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/shared/MediaLogger.kt b/packages/SystemUI/src/com/android/systemui/media/controls/shared/MediaLogger.kt
index 2b710b5..7d20e17 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/shared/MediaLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/shared/MediaLogger.kt
@@ -114,6 +114,15 @@
)
}
+ fun logDuplicateMediaNotification(key: String) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ { str1 = key },
+ { "duplicate media notification $str1 posted" }
+ )
+ }
+
companion object {
private const val TAG = "MediaLog"
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/shared/model/MediaData.kt b/packages/SystemUI/src/com/android/systemui/media/controls/shared/model/MediaData.kt
index 40b3477..aed8609 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/shared/model/MediaData.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/shared/model/MediaData.kt
@@ -39,7 +39,7 @@
/** Album artwork. */
val artwork: Icon? = null,
/** List of generic action buttons for the media player, based on notification actions */
- val actions: List<MediaAction> = emptyList(),
+ val actions: List<MediaNotificationAction> = emptyList(),
/** Same as above, but shown on smaller versions of the player, like in QQS or keyguard. */
val actionsToShowInCompact: List<Int> = emptyList(),
/**
@@ -162,6 +162,14 @@
val rebindId: Int? = null
)
+/** State of a media action from notification. */
+data class MediaNotificationAction(
+ val isAuthenticationRequired: Boolean,
+ val actionIntent: PendingIntent?,
+ val icon: Drawable?,
+ val contentDescription: CharSequence?
+)
+
/** State of the media device. */
data class MediaDeviceData
@JvmOverloads
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt
index bf9ef8c..8505a784 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt
@@ -1202,13 +1202,17 @@
commonViewModels.forEach { viewModel ->
when (viewModel) {
is MediaCommonViewModel.MediaControl -> {
- controllerById[viewModel.instanceId.toString()]?.mediaViewHolder?.let {
- mediaContent.addView(it.player)
+ controllerById[viewModel.instanceId.toString()]?.let {
+ it.widthInSceneContainerPx = widthInSceneContainerPx
+ it.heightInSceneContainerPx = heightInSceneContainerPx
+ mediaContent.addView(it.mediaViewHolder?.player)
}
}
is MediaCommonViewModel.MediaRecommendations -> {
- controllerById[viewModel.key]?.recommendationViewHolder?.let {
- mediaContent.addView(it.recommendations)
+ controllerById[viewModel.key]?.let {
+ it.widthInSceneContainerPx = widthInSceneContainerPx
+ it.heightInSceneContainerPx = heightInSceneContainerPx
+ mediaContent.addView(it.recommendationViewHolder?.recommendations)
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java
index 87610cf..8bec46a 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java
@@ -21,6 +21,7 @@
import static com.android.settingslib.flags.Flags.legacyLeAudioSharing;
import static com.android.systemui.Flags.communalHub;
import static com.android.systemui.Flags.mediaLockscreenLaunchAnimation;
+import static com.android.systemui.media.controls.domain.pipeline.MediaActionsKt.getNotificationActions;
import static com.android.systemui.media.controls.shared.model.SmartspaceMediaDataKt.NUM_REQUIRED_RECOMMENDATIONS;
import android.animation.Animator;
@@ -1170,7 +1171,7 @@
// Set all the generic buttons
List<Integer> actionsWhenCollapsed = data.getActionsToShowInCompact();
- List<MediaAction> actions = data.getActions();
+ List<MediaAction> actions = getNotificationActions(data.getActions(), mActivityStarter);
int i = 0;
for (; i < actions.size() && i < genericButtons.size(); i++) {
boolean showInCompact = actionsWhenCollapsed.contains(i);
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/SeekBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/SeekBarViewModel.kt
index cef1e69..2a9fe83 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/SeekBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/SeekBarViewModel.kt
@@ -32,6 +32,7 @@
import androidx.core.view.GestureDetectorCompat
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
+import com.android.systemui.Flags
import com.android.systemui.classifier.Classifier.MEDIA_SEEKBAR
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.plugins.FalsingManager
@@ -102,9 +103,11 @@
}
_progress.postValue(value)
}
+
private val _progress = MutableLiveData<Progress>().apply { postValue(_data) }
val progress: LiveData<Progress>
get() = _progress
+
private var controller: MediaController? = null
set(value) {
if (field?.sessionToken != value?.sessionToken) {
@@ -113,6 +116,7 @@
field = value
}
}
+
private var playbackState: PlaybackState? = null
private var callback =
object : MediaController.Callback() {
@@ -128,6 +132,15 @@
override fun onSessionDestroyed() {
clearController()
}
+
+ override fun onMetadataChanged(metadata: MediaMetadata?) {
+ if (!Flags.mediaControlsPostsOptimization()) return
+
+ val (enabled, duration) = getEnabledStateAndDuration(metadata)
+ if (_data.duration != duration) {
+ _data = _data.copy(enabled = enabled, duration = duration)
+ }
+ }
}
private var cancel: Runnable? = null
@@ -233,22 +246,13 @@
fun updateController(mediaController: MediaController?) {
controller = mediaController
playbackState = controller?.playbackState
- val mediaMetadata = controller?.metadata
+ val (enabled, duration) = getEnabledStateAndDuration(controller?.metadata)
val seekAvailable = ((playbackState?.actions ?: 0L) and PlaybackState.ACTION_SEEK_TO) != 0L
val position = playbackState?.position?.toInt()
- val duration = mediaMetadata?.getLong(MediaMetadata.METADATA_KEY_DURATION)?.toInt() ?: 0
val playing =
NotificationMediaManager.isPlayingState(
playbackState?.state ?: PlaybackState.STATE_NONE
)
- val enabled =
- if (
- playbackState == null ||
- playbackState?.getState() == PlaybackState.STATE_NONE ||
- (duration <= 0)
- )
- false
- else true
_data = Progress(enabled, seekAvailable, playing, scrubbing, position, duration, listening)
checkIfPollingNeeded()
}
@@ -368,6 +372,16 @@
}
}
+ /** returns a pair of whether seekbar is enabled and the duration of media. */
+ private fun getEnabledStateAndDuration(metadata: MediaMetadata?): Pair<Boolean, Int> {
+ val duration = metadata?.getLong(MediaMetadata.METADATA_KEY_DURATION)?.toInt() ?: 0
+ val enabled =
+ !(playbackState == null ||
+ playbackState?.state == PlaybackState.STATE_NONE ||
+ (duration <= 0))
+ return Pair(enabled, duration)
+ }
+
/**
* This method specifies if user made a bad seekbar grab or not. If the vertical distance from
* first touch on seekbar is more than the horizontal distance, this means that the seekbar grab
diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverLogger.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverLogger.kt
index 1502df7..078d534 100644
--- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverLogger.kt
@@ -19,6 +19,7 @@
import android.app.StatusBarManager
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.core.LogLevel
import com.android.systemui.media.taptotransfer.common.MediaTttLoggerUtils
import com.android.systemui.temporarydisplay.TemporaryViewLogger
import javax.inject.Inject
@@ -50,6 +51,15 @@
MediaTttLoggerUtils.logPackageNotFound(buffer, TAG, packageName)
}
+ fun logRippleAnimationEnd(id: Int) {
+ buffer.log(
+ tag,
+ LogLevel.DEBUG,
+ { int1 = id },
+ { "ripple animation for view with id: $int1 is ended" }
+ )
+ }
+
companion object {
private const val TAG = "MediaTttReceiver"
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverRippleController.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverRippleController.kt
index fbd7fd3..a232971 100644
--- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverRippleController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttReceiverRippleController.kt
@@ -32,6 +32,7 @@
constructor(
private val context: Context,
private val windowManager: WindowManager,
+ private val mediaTttReceiverLogger: MediaTttReceiverLogger,
) {
private var maxRippleWidth: Float = 0f
@@ -90,12 +91,12 @@
/** Expands the ripple to cover the screen. */
fun expandToSuccessState(rippleView: ReceiverChipRippleView, onAnimationEnd: Runnable?) {
layoutRipple(rippleView, isFullScreen = true)
- rippleView.expandToFull(maxRippleHeight, onAnimationEnd)
+ rippleView.expandToFull(maxRippleHeight, mediaTttReceiverLogger, onAnimationEnd)
}
/** Collapses the ripple. */
fun collapseRipple(rippleView: ReceiverChipRippleView, onAnimationEnd: Runnable? = null) {
- rippleView.collapseRipple(onAnimationEnd)
+ rippleView.collapseRipple(mediaTttReceiverLogger, onAnimationEnd)
}
private fun layoutRipple(rippleView: ReceiverChipRippleView, isFullScreen: Boolean = false) {
diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ReceiverChipRippleView.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ReceiverChipRippleView.kt
index 35018f1..81059e3 100644
--- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ReceiverChipRippleView.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/ReceiverChipRippleView.kt
@@ -24,9 +24,7 @@
import com.android.systemui.surfaceeffects.ripple.RippleView
import kotlin.math.pow
-/**
- * An expanding ripple effect for the media tap-to-transfer receiver chip.
- */
+/** An expanding ripple effect for the media tap-to-transfer receiver chip. */
class ReceiverChipRippleView(context: Context?, attrs: AttributeSet?) : RippleView(context, attrs) {
// Indicates whether the ripple started expanding.
@@ -46,24 +44,34 @@
}
/** Used to animate out the ripple. No-op if the ripple was never started via [startRipple]. */
- fun collapseRipple(onAnimationEnd: Runnable? = null) {
+ fun collapseRipple(logger: MediaTttReceiverLogger, onAnimationEnd: Runnable? = null) {
if (!isStarted) {
return // Ignore if ripple is not started yet.
}
duration = DEFAULT_DURATION
// Reset all listeners to animator.
animator.removeAllListeners()
- animator.addListener(object : AnimatorListenerAdapter() {
- override fun onAnimationEnd(animation: Animator) {
- onAnimationEnd?.run()
- isStarted = false
+ animator.addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ animation?.let {
+ visibility = GONE
+ logger.logRippleAnimationEnd(id)
+ }
+ onAnimationEnd?.run()
+ isStarted = false
+ }
}
- })
+ )
animator.reverse()
}
// Expands the ripple to cover full screen.
- fun expandToFull(newHeight: Float, onAnimationEnd: Runnable? = null) {
+ fun expandToFull(
+ newHeight: Float,
+ logger: MediaTttReceiverLogger,
+ onAnimationEnd: Runnable? = null
+ ) {
if (!isStarted) {
return
}
@@ -85,13 +93,18 @@
rippleShader.time = now.toFloat()
invalidate()
}
- animator.addListener(object : AnimatorListenerAdapter() {
- override fun onAnimationEnd(animation: Animator) {
- animation?.let { visibility = GONE }
- onAnimationEnd?.run()
- isStarted = false
+ animator.addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ animation?.let {
+ visibility = GONE
+ logger.logRippleAnimationEnd(id)
+ }
+ onAnimationEnd?.run()
+ isStarted = false
+ }
}
- })
+ )
animator.start()
}
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java b/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
index 18c6f53..4251b81 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
@@ -307,7 +307,7 @@
private void setUpDialog(AlertDialog dialog) {
SystemUIDialog.registerDismissListener(dialog);
- SystemUIDialog.applyFlags(dialog);
+ SystemUIDialog.applyFlags(dialog, /* showWhenLocked= */ false);
SystemUIDialog.setDialogSize(dialog);
dialog.setOnCancelListener(this::onDialogDismissedOrCancelled);
diff --git a/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt b/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
index 7d2a1e1..db5a545 100644
--- a/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
+++ b/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
@@ -88,15 +88,11 @@
when {
it.invisibleDueToOcclusion -> false
it.scene == Scenes.Lockscreen -> true
- it.scene == Scenes.NotificationsShade -> true
it.scene == Scenes.Shade -> true
else -> false
}
},
- SYSUI_STATE_QUICK_SETTINGS_EXPANDED to
- {
- it.scene == Scenes.QuickSettingsShade || it.scene == Scenes.QuickSettings
- },
+ SYSUI_STATE_QUICK_SETTINGS_EXPANDED to { it.scene == Scenes.QuickSettings },
SYSUI_STATE_BOUNCER_SHOWING to { it.scene == Scenes.Bouncer },
SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING to
{
@@ -106,12 +102,9 @@
{
it.scene == Scenes.Lockscreen && it.invisibleDueToOcclusion
},
- SYSUI_STATE_COMMUNAL_HUB_SHOWING to { it.scene == Scenes.Communal }
+ SYSUI_STATE_COMMUNAL_HUB_SHOWING to { it.scene == Scenes.Communal },
)
}
- data class SceneContainerPluginState(
- val scene: SceneKey,
- val invisibleDueToOcclusion: Boolean,
- )
+ data class SceneContainerPluginState(val scene: SceneKey, val invisibleDueToOcclusion: Boolean)
}
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
index e44069f..b3c697e 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
@@ -425,6 +425,18 @@
}
}
+ private void appTransitionPending(boolean pending) {
+ if (mOverviewProxyService.getProxy() == null) {
+ return;
+ }
+
+ try {
+ mOverviewProxyService.getProxy().appTransitionPending(pending);
+ } catch (RemoteException e) {
+ Log.e(TAG, "appTransitionPending() failed, pending: " + pending, e);
+ }
+ }
+
@Override
public void setImeWindowStatus(int displayId, @ImeWindowVisibility int vis,
@BackDispositionMode int backDisposition, boolean showImeSwitcher) {
@@ -533,6 +545,21 @@
}
}
+ @Override
+ public void appTransitionPending(int displayId, boolean forced) {
+ appTransitionPending(true);
+ }
+
+ @Override
+ public void appTransitionCancelled(int displayId) {
+ appTransitionPending(false);
+ }
+
+ @Override
+ public void appTransitionFinished(int displayId) {
+ appTransitionPending(false);
+ }
+
private void clearTransient() {
if (mTaskbarTransientShowing) {
mTaskbarTransientShowing = false;
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java
index e8c90c1..c70a523 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/views/NavigationBar.java
@@ -34,7 +34,6 @@
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
-import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.HOME_BUTTON_LONG_PRESS_DURATION_MS;
import static com.android.systemui.navigationbar.NavBarHelper.transitionMode;
import static com.android.systemui.recents.OverviewProxyService.OverviewProxyListener;
@@ -60,7 +59,6 @@
import android.app.IActivityTaskManager;
import android.app.StatusBarManager;
import android.content.Context;
-import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Insets;
import android.graphics.PixelFormat;
@@ -105,7 +103,6 @@
import androidx.annotation.VisibleForTesting;
import com.android.app.viewcapture.ViewCaptureAwareWindowManager;
-import com.android.internal.accessibility.dialog.AccessibilityButtonChooserActivity;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEventLogger;
@@ -1625,11 +1622,9 @@
}
private boolean onAccessibilityLongClick(View v) {
- final Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- final String chooserClassName = AccessibilityButtonChooserActivity.class.getName();
- intent.setClassName(CHOOSER_PACKAGE_NAME, chooserClassName);
- mContext.startActivityAsUser(intent, mUserTracker.getUserHandle());
+ final Display display = v.getDisplay();
+ mAccessibilityManager.notifyAccessibilityButtonLongClicked(
+ display != null ? display.getDisplayId() : mDisplayTracker.getDefaultDisplayId());
return true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/notifications/ui/viewmodel/NotificationsShadeUserActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/notifications/ui/viewmodel/NotificationsShadeUserActionsViewModel.kt
index a5c07bc..11854d9 100644
--- a/packages/SystemUI/src/com/android/systemui/notifications/ui/viewmodel/NotificationsShadeUserActionsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/notifications/ui/viewmodel/NotificationsShadeUserActionsViewModel.kt
@@ -18,9 +18,13 @@
import com.android.compose.animation.scene.Back
import com.android.compose.animation.scene.Swipe
+import com.android.compose.animation.scene.SwipeDirection
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
+import com.android.compose.animation.scene.UserActionResult.ReplaceByOverlay
+import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.SceneFamilies
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge
import com.android.systemui.scene.ui.viewmodel.UserActionsViewModel
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
@@ -34,8 +38,10 @@
override suspend fun hydrateActions(setActions: (Map<UserAction, UserActionResult>) -> Unit) {
setActions(
mapOf(
- Swipe.Up to SceneFamilies.Home,
Back to SceneFamilies.Home,
+ Swipe.Up to SceneFamilies.Home,
+ Swipe(direction = SwipeDirection.Down, fromSource = SceneContainerEdge.TopRight) to
+ ReplaceByOverlay(Overlays.QuickSettingsShade),
)
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/qrcodescanner/dagger/QRCodeScannerModule.kt b/packages/SystemUI/src/com/android/systemui/qrcodescanner/dagger/QRCodeScannerModule.kt
index 3a8fe71..ef1f834 100644
--- a/packages/SystemUI/src/com/android/systemui/qrcodescanner/dagger/QRCodeScannerModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/qrcodescanner/dagger/QRCodeScannerModule.kt
@@ -19,6 +19,7 @@
import com.android.systemui.Flags
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.QRCodeScannerTile
import com.android.systemui.qs.tiles.base.interactor.QSTileAvailabilityInteractor
@@ -51,7 +52,7 @@
@IntoMap
@StringKey(QR_CODE_SCANNER_TILE_SPEC)
fun provideQrCodeScannerAvailabilityInteractor(
- impl: QRCodeScannerTileDataInteractor
+ impl: QRCodeScannerTileDataInteractor
): QSTileAvailabilityInteractor
companion object {
@@ -69,6 +70,7 @@
labelRes = R.string.qr_code_scanner_title,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.UTILITIES,
)
/** Inject QR Code Scanner Tile into tileViewModelMap in QSModule. */
diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
index 4018320..ca7b06a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
@@ -14,7 +14,10 @@
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.AttributeSet;
+import android.view.InputDevice;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
+import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
@@ -191,6 +194,34 @@
}
@Override
+ public boolean onGenericMotionEvent(MotionEvent event) {
+ if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0
+ && event.getAction() == MotionEvent.ACTION_SCROLL) {
+ // Handle mouse (or ext. device) by swiping the page depending on the scroll
+ final float vscroll;
+ final float hscroll;
+ if ((event.getMetaState() & KeyEvent.META_SHIFT_ON) != 0) {
+ vscroll = 0;
+ hscroll = event.getAxisValue(MotionEvent.AXIS_VSCROLL);
+ } else {
+ vscroll = -event.getAxisValue(MotionEvent.AXIS_VSCROLL);
+ hscroll = event.getAxisValue(MotionEvent.AXIS_HSCROLL);
+ }
+ if (hscroll != 0 || vscroll != 0) {
+ boolean isForwardScroll =
+ isLayoutRtl() ? (hscroll < 0 || vscroll < 0) : (hscroll > 0 || vscroll > 0);
+ int swipeDirection = isForwardScroll ? RIGHT : LEFT;
+ if (mScroller.isFinished()) {
+ scrollByX(getDeltaXForPageScrolling(swipeDirection),
+ SINGLE_PAGE_SCROLL_DURATION_MILLIS);
+ }
+ return true;
+ }
+ }
+ return super.onGenericMotionEvent(event);
+ }
+
+ @Override
public void setCurrentItem(int item, boolean smoothScroll) {
if (isLayoutRtl()) {
item = mPages.size() - 1 - item;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsController.java b/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsController.java
index cf1dca3..893ef7e0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsController.java
@@ -29,12 +29,6 @@
/** Sets the activation state of Reduce Bright Colors */
void setReduceBrightColorsActivated(boolean activated);
- /** Sets whether Reduce Bright Colors is enabled */
- void setReduceBrightColorsFeatureAvailable(boolean enabled);
-
- /** Gets whether Reduce Bright Colors is enabled */
- boolean isReduceBrightColorsFeatureAvailable();
-
/** Gets whether Reduce Bright Colors is being transitioned to Even Dimmer */
boolean isInUpgradeMode(Resources resources);
/**
@@ -48,12 +42,5 @@
*/
default void onActivated(boolean activated) {
}
- /**
- * Listener invoked when the feature enabled state changes.
- *
- * @param enabled {@code true} if Reduce Bright Colors feature is enabled.
- */
- default void onFeatureEnabledChanged(boolean enabled) {
- }
}
}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsControllerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsControllerImpl.java
index 4d6cf78..ca6e40d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/ReduceBrightColorsControllerImpl.java
@@ -48,7 +48,6 @@
private final ContentObserver mContentObserver;
private final SecureSettings mSecureSettings;
private final ArrayList<ReduceBrightColorsController.Listener> mListeners = new ArrayList<>();
- private boolean mAvailable = true;
@Inject
public ReduceBrightColorsControllerImpl(UserTracker userTracker,
@@ -77,7 +76,6 @@
mCurrentUserTrackerCallback = new UserTracker.Callback() {
@Override
public void onUserChanged(int newUser, Context userContext) {
- mAvailable = true;
synchronized (mListeners) {
if (mListeners.size() > 0) {
if (com.android.systemui.Flags.registerContentObserversAsync()) {
@@ -141,17 +139,6 @@
mManager.setReduceBrightColorsActivated(activated);
}
- @Override
- public void setReduceBrightColorsFeatureAvailable(boolean enabled) {
- mAvailable = enabled;
- dispatchOnEnabledChanged(enabled);
- mAvailable = true;
- }
-
- @Override
- public boolean isReduceBrightColorsFeatureAvailable() {
- return mAvailable;
- }
@Override
public boolean isInUpgradeMode(Resources resources) {
@@ -166,11 +153,4 @@
l.onActivated(activated);
}
}
-
- private void dispatchOnEnabledChanged(boolean enabled) {
- ArrayList<Listener> copy = new ArrayList<>(mListeners);
- for (Listener l : copy) {
- l.onFeatureEnabledChanged(enabled);
- }
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt b/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
index c39ff55..c2f1c3d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
@@ -19,6 +19,7 @@
import android.annotation.SuppressLint
import android.graphics.Rect
import android.os.Bundle
+import android.util.IndentingPrintWriter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -41,8 +42,8 @@
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
-import androidx.compose.ui.layout.layout
-import androidx.compose.ui.layout.onGloballyPositioned
+import androidx.compose.ui.layout.onPlaced
+import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.res.dimensionResource
@@ -59,7 +60,9 @@
import com.android.compose.modifiers.padding
import com.android.compose.modifiers.thenIf
import com.android.compose.theme.PlatformTheme
+import com.android.systemui.Dumpable
import com.android.systemui.compose.modifiers.sysuiResTag
+import com.android.systemui.dump.DumpManager
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.media.controls.ui.controller.MediaHierarchyManager
import com.android.systemui.media.controls.ui.view.MediaHost
@@ -76,6 +79,10 @@
import com.android.systemui.qs.ui.composable.ShadeBody
import com.android.systemui.res.R
import com.android.systemui.util.LifecycleFragment
+import com.android.systemui.util.asIndenting
+import com.android.systemui.util.printSection
+import com.android.systemui.util.println
+import java.io.PrintWriter
import java.util.function.Consumer
import javax.inject.Inject
import javax.inject.Named
@@ -91,9 +98,10 @@
@Inject
constructor(
private val qsFragmentComposeViewModelFactory: QSFragmentComposeViewModel.Factory,
+ private val dumpManager: DumpManager,
@Named(QUICK_QS_PANEL) private val qqsMediaHost: MediaHost,
@Named(QS_PANEL) private val qsMediaHost: MediaHost,
-) : LifecycleFragment(), QS {
+) : LifecycleFragment(), QS, Dumpable {
private val scrollListener = MutableStateFlow<QS.ScrollListener?>(null)
private val heightListener = MutableStateFlow<QS.HeightListener?>(null)
@@ -118,8 +126,24 @@
var top by mutableStateOf(0)
var bottom by mutableStateOf(0)
var radius by mutableStateOf(0)
+
+ fun dump(pw: IndentingPrintWriter) {
+ pw.printSection("NotificationScrimClippingParams") {
+ pw.println("isEnabled", isEnabled)
+ pw.println("leftInset", "${leftInset}px")
+ pw.println("rightInset", "${rightInset}px")
+ pw.println("top", "${top}px")
+ pw.println("bottom", "${bottom}px")
+ pw.println("radius", "${radius}px")
+ }
+ }
}
+ override fun onStart() {
+ super.onStart()
+ registerDumpable()
+ }
+
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -343,11 +367,11 @@
}
override fun getHeaderTop(): Int {
- return viewModel.qqsHeaderHeight.value
+ return qqsPositionOnRoot.top
}
override fun getHeaderBottom(): Int {
- return headerTop + qqsHeight.value
+ return qqsPositionOnRoot.bottom
}
override fun getHeaderLeft(): Int {
@@ -358,7 +382,7 @@
outBounds.set(qqsPositionOnRoot)
view?.getBoundsOnScreen(composeViewPositionOnScreen)
?: run { composeViewPositionOnScreen.setEmpty() }
- qqsPositionOnRoot.offset(composeViewPositionOnScreen.left, composeViewPositionOnScreen.top)
+ outBounds.offset(composeViewPositionOnScreen.left, composeViewPositionOnScreen.top)
}
override fun isHeaderShown(): Boolean {
@@ -404,37 +428,29 @@
onDispose { qqsVisible.value = false }
}
Column(modifier = Modifier.sysuiResTag("quick_qs_panel")) {
- Box(modifier = Modifier.fillMaxWidth()) {
+ Box(
+ modifier =
+ Modifier.fillMaxWidth()
+ .onPlaced { coordinates ->
+ val (leftFromRoot, topFromRoot) = coordinates.positionInRoot().round()
+ qqsPositionOnRoot.set(
+ leftFromRoot,
+ topFromRoot,
+ leftFromRoot + coordinates.size.width,
+ topFromRoot + coordinates.size.height,
+ )
+ }
+ .onSizeChanged { size -> qqsHeight.value = size.height }
+ .padding(top = { qqsPadding })
+ ) {
val qsEnabled by viewModel.qsEnabled.collectAsStateWithLifecycle()
if (qsEnabled) {
QuickQuickSettings(
viewModel = viewModel.containerViewModel.quickQuickSettingsViewModel,
modifier =
- Modifier.onGloballyPositioned { coordinates ->
- val (leftFromRoot, topFromRoot) =
- coordinates.positionInRoot().round()
- val (width, height) = coordinates.size
- qqsPositionOnRoot.set(
- leftFromRoot,
- topFromRoot,
- leftFromRoot + width,
- topFromRoot + height
- )
- }
- .layout { measurable, constraints ->
- val placeable = measurable.measure(constraints)
- qqsHeight.value = placeable.height
-
- layout(placeable.width, placeable.height) {
- placeable.place(0, 0)
- }
- }
- .padding(top = { qqsPadding })
- .collapseExpandSemanticAction(
- stringResource(
- id = R.string.accessibility_quick_settings_expand
- )
- )
+ Modifier.collapseExpandSemanticAction(
+ stringResource(id = R.string.accessibility_quick_settings_expand)
+ )
)
}
}
@@ -486,6 +502,44 @@
}
} ?: this
}
+
+ private fun registerDumpable() {
+ val instanceId = instanceProvider.getNextId()
+ // Add an instanceId because the system may have more than 1 of these when re-inflating and
+ // DumpManager doesn't like repeated identifiers. Also, put it first because DumpHandler
+ // matches by end.
+ val stringId = "$instanceId-QSFragmentCompose"
+ lifecycleScope.launch {
+ lifecycle.repeatOnLifecycle(Lifecycle.State.CREATED) {
+ try {
+ dumpManager.registerNormalDumpable(stringId, this@QSFragmentCompose)
+ awaitCancellation()
+ } finally {
+ dumpManager.unregisterDumpable(stringId)
+ }
+ }
+ }
+ }
+
+ override fun dump(pw: PrintWriter, args: Array<out String>) {
+ pw.asIndenting().run {
+ notificationScrimClippingParams.dump(this)
+ printSection("QQS positioning") {
+ println("qqsHeight", "${headerHeight}px")
+ println("qqsTop", "${headerTop}px")
+ println("qqsBottom", "${headerBottom}px")
+ println("qqsLeft", "${headerLeft}px")
+ println("qqsPositionOnRoot", qqsPositionOnRoot)
+ val rect = Rect()
+ getHeaderBoundsOnScreen(rect)
+ println("qqsPositionOnScreen", rect)
+ }
+ println("QQS visible", qqsVisible.value)
+ if (::viewModel.isInitialized) {
+ printSection("View Model") { viewModel.dump(this@run, args) }
+ }
+ }
+ }
}
private fun View.setBackPressedDispatcher() {
@@ -526,3 +580,12 @@
}
}
}
+
+private val instanceProvider =
+ object {
+ private var currentId = 0
+
+ fun getNextId(): Int {
+ return currentId++
+ }
+ }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
index 16133f4..7ab11d2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
@@ -21,6 +21,7 @@
import androidx.annotation.FloatRange
import androidx.annotation.VisibleForTesting
import androidx.lifecycle.LifecycleCoroutineScope
+import com.android.systemui.Dumpable
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.plugins.statusbar.StatusBarStateController
@@ -34,10 +35,14 @@
import com.android.systemui.statusbar.disableflags.data.repository.DisableFlagsRepository
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.util.asIndenting
+import com.android.systemui.util.printSection
+import com.android.systemui.util.println
import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
+import java.io.PrintWriter
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
@@ -62,7 +67,7 @@
private val configurationInteractor: ConfigurationInteractor,
private val largeScreenHeaderHelper: LargeScreenHeaderHelper,
@Assisted private val lifecycleScope: LifecycleCoroutineScope,
-) {
+) : Dumpable {
val footerActionsViewModel =
footerActionsViewModelFactory.create(lifecycleScope).also {
lifecycleScope.launch { footerActionsController.init() }
@@ -228,6 +233,30 @@
*/
var collapseExpandAccessibilityAction: Runnable? = null
+ override fun dump(pw: PrintWriter, args: Array<out String>) {
+ pw.asIndenting().run {
+ printSection("Quick Settings state") {
+ println("isQSExpanded", isQSExpanded)
+ println("isQSVisible", isQSVisible)
+ println("isQSEnabled", qsEnabled.value)
+ println("isCustomizing", containerViewModel.editModeViewModel.isEditing.value)
+ }
+ printSection("Expansion state") {
+ println("qsExpansion", qsExpansionValue)
+ println("panelExpansionFraction", panelExpansionFractionValue)
+ println("squishinessFraction", squishinessFractionValue)
+ println("expansionState", expansionState.value)
+ }
+ printSection("Shade state") {
+ println("stackOverscrolling", stackScrollerOverscrollingValue)
+ println("statusBarState", StatusBarState.toString(statusBarState.value))
+ println("isSmallScreen", isSmallScreenValue)
+ println("heightOverride", "${heightOverrideValue}px")
+ println("qqsHeaderHeight", "${qqsHeaderHeight.value}px")
+ }
+ }
+ }
+
@AssistedFactory
interface Factory {
fun create(lifecycleScope: LifecycleCoroutineScope): QSFragmentComposeViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
index cbcf68c..2f843ac 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
@@ -50,10 +50,12 @@
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
+import com.android.systemui.Flags;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.util.concurrency.DelayableExecutor;
+import com.android.systemui.util.time.SystemClock;
import dagger.assisted.Assisted;
import dagger.assisted.AssistedFactory;
@@ -95,6 +97,7 @@
// Bind retry control.
private static final int MAX_BIND_RETRIES = 5;
private static final long DEFAULT_BIND_RETRY_DELAY = 5 * DateUtils.SECOND_IN_MILLIS;
+ private static final long ACTIVE_TILE_BIND_RETRY_DELAY = 1 * DateUtils.SECOND_IN_MILLIS;
private static final long LOW_MEMORY_BIND_RETRY_DELAY = 20 * DateUtils.SECOND_IN_MILLIS;
private static final long TILE_SERVICE_ONCLICK_ALLOW_LIST_DEFAULT_DURATION_MS = 15_000;
private static final String PROPERTY_TILE_SERVICE_ONCLICK_ALLOW_LIST_DURATION =
@@ -107,6 +110,7 @@
private final Intent mIntent;
private final UserHandle mUser;
private final DelayableExecutor mExecutor;
+ private final SystemClock mSystemClock;
private final IBinder mToken = new Binder();
private final PackageManagerAdapter mPackageManagerAdapter;
private final BroadcastDispatcher mBroadcastDispatcher;
@@ -120,7 +124,6 @@
private IBinder mClickBinder;
private int mBindTryCount;
- private long mBindRetryDelay = DEFAULT_BIND_RETRY_DELAY;
private AtomicBoolean isDeathRebindScheduled = new AtomicBoolean(false);
private AtomicBoolean mBound = new AtomicBoolean(false);
private AtomicBoolean mPackageReceiverRegistered = new AtomicBoolean(false);
@@ -138,7 +141,8 @@
TileLifecycleManager(@Main Handler handler, Context context, IQSService service,
PackageManagerAdapter packageManagerAdapter, BroadcastDispatcher broadcastDispatcher,
@Assisted Intent intent, @Assisted UserHandle user, ActivityManager activityManager,
- IDeviceIdleController deviceIdleController, @Background DelayableExecutor executor) {
+ IDeviceIdleController deviceIdleController, @Background DelayableExecutor executor,
+ SystemClock systemClock) {
mContext = context;
mHandler = handler;
mIntent = intent;
@@ -146,6 +150,7 @@
mIntent.putExtra(TileService.EXTRA_TOKEN, mToken);
mUser = user;
mExecutor = executor;
+ mSystemClock = systemClock;
mPackageManagerAdapter = packageManagerAdapter;
mBroadcastDispatcher = broadcastDispatcher;
mActivityManager = activityManager;
@@ -436,25 +441,31 @@
// If mBound is true (meaning that we should be bound), then reschedule binding for
// later.
if (mBound.get() && checkComponentState()) {
- if (isDeathRebindScheduled.compareAndSet(false, true)) {
+ if (isDeathRebindScheduled.compareAndSet(false, true)) { // if already not scheduled
+
+
mExecutor.executeDelayed(() -> {
// Only rebind if we are supposed to, but remove the scheduling anyway.
if (mBound.get()) {
setBindService(true);
}
- isDeathRebindScheduled.set(false);
+ isDeathRebindScheduled.set(false); // allow scheduling again
}, getRebindDelay());
}
}
});
}
+ private long mLastRebind = 0;
/**
* @return the delay to automatically rebind after a service died. It provides a longer delay if
* the device is a low memory state because the service is likely to get killed again by the
* system. In this case we want to rebind later and not to cause a loop of a frequent rebinds.
+ * It also provides a longer delay if called quickly (a few seconds) after a first call.
*/
private long getRebindDelay() {
+ final long now = mSystemClock.currentTimeMillis();
+
final ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo();
mActivityManager.getMemoryInfo(info);
@@ -462,7 +473,20 @@
if (info.lowMemory) {
delay = LOW_MEMORY_BIND_RETRY_DELAY;
} else {
- delay = mBindRetryDelay;
+ if (Flags.qsQuickRebindActiveTiles()) {
+ final long elapsedTimeSinceLastRebind = now - mLastRebind;
+ final boolean justAttemptedRebind =
+ elapsedTimeSinceLastRebind < DEFAULT_BIND_RETRY_DELAY;
+ if (isActiveTile() && !justAttemptedRebind) {
+ delay = ACTIVE_TILE_BIND_RETRY_DELAY;
+ } else {
+ delay = DEFAULT_BIND_RETRY_DELAY;
+ }
+ } else {
+ delay = DEFAULT_BIND_RETRY_DELAY;
+ }
+
+ mLastRebind = now;
}
if (mDebug) Log.i(TAG, "Rebinding with a delay=" + delay + " - " + getComponent());
return delay;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
index d10471d..c5fa8cf 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
@@ -44,7 +44,7 @@
/**
* Manages the priority which lets {@link TileServices} make decisions about which tiles
* to bind. Also holds on to and manages the {@link TileLifecycleManager}, informing it
- * of when it is allowed to bind based on decisions frome the {@link TileServices}.
+ * of when it is allowed to bind based on decisions from the {@link TileServices}.
*/
public class TileServiceManager {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepository.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepository.kt
index 28c1fbf..2f054b0a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/IconAndNameCustomRepository.kt
@@ -24,10 +24,10 @@
import com.android.systemui.qs.panels.shared.model.EditTileData
import com.android.systemui.qs.pipeline.data.repository.InstalledTilesComponentRepository
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.settings.UserTracker
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
-import kotlinx.coroutines.flow.map
import kotlinx.coroutines.withContext
@SysUISingleton
@@ -60,6 +60,7 @@
Icon.Loaded(icon, ContentDescription.Loaded(label.toString())),
Text.Loaded(label.toString()),
Text.Loaded(appName.toString()),
+ TileCategory.PROVIDED_BY_APP,
)
} else {
null
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractor.kt
index 3b29422..a2cee3b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/EditTilesListInteractor.kt
@@ -24,6 +24,7 @@
import com.android.systemui.qs.panels.data.repository.StockTilesRepository
import com.android.systemui.qs.panels.domain.model.EditTilesModel
import com.android.systemui.qs.panels.shared.model.EditTileData
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tiles.viewmodel.QSTileConfigProvider
import javax.inject.Inject
@@ -53,6 +54,7 @@
),
Text.Resource(config.uiConfig.labelRes),
null,
+ category = config.category,
)
} else {
EditTileData(
@@ -62,7 +64,8 @@
ContentDescription.Loaded(it.spec)
),
Text.Loaded(it.spec),
- null
+ null,
+ category = TileCategory.UNKNOWN,
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/EditTileData.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/EditTileData.kt
index 8b70bb9..b153ef7 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/EditTileData.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/EditTileData.kt
@@ -19,12 +19,14 @@
import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.Text
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
data class EditTileData(
val tileSpec: TileSpec,
val icon: Icon,
val label: Text,
val appName: Text?,
+ val category: TileCategory,
) {
init {
check(
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
index 24af09d..93037d1 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
@@ -34,6 +34,7 @@
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.LocalOverscrollConfiguration
+import androidx.compose.foundation.background
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.border
import androidx.compose.foundation.combinedClickable
@@ -95,6 +96,8 @@
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import androidx.compose.ui.util.fastMap
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.animation.Expandable
import com.android.compose.modifiers.background
@@ -115,6 +118,7 @@
import com.android.systemui.qs.panels.ui.viewmodel.toUiState
import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.groupAndSort
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.res.R
import java.util.function.Supplier
@@ -472,31 +476,39 @@
onClick: (TileSpec) -> Unit,
dragAndDropState: DragAndDropState,
) {
- // Available tiles aren't visible during drag and drop, so the row isn't needed
- val (otherTilesStock, otherTilesCustom) =
- tiles.map { TileGridCell(it, 0) }.partition { it.tile.appName == null }
val availableTileHeight = tileHeight(true)
val availableGridHeight = gridHeight(tiles.size, availableTileHeight, columns, tilePadding)
+ // Available tiles aren't visible during drag and drop, so the row isn't needed
+ val groupedTiles =
+ remember(tiles.fastMap { it.tile.category }, tiles.fastMap { it.tile.label }) {
+ groupAndSort(tiles.fastMap { TileGridCell(it, 0) })
+ }
+ val labelColors = TileDefaults.inactiveTileColors()
// Available tiles
TileLazyGrid(
modifier = Modifier.height(availableGridHeight).testTag(AVAILABLE_TILES_GRID_TEST_TAG),
columns = GridCells.Fixed(columns)
) {
- editTiles(
- otherTilesStock,
- ClickAction.ADD,
- onClick,
- dragAndDropState = dragAndDropState,
- showLabels = true,
- )
- editTiles(
- otherTilesCustom,
- ClickAction.ADD,
- onClick,
- dragAndDropState = dragAndDropState,
- showLabels = true,
- )
+ groupedTiles.forEach { category, tiles ->
+ stickyHeader {
+ Text(
+ text = category.label.load() ?: "",
+ fontSize = 20.sp,
+ color = labelColors.label,
+ modifier =
+ Modifier.background(Color.Black)
+ .padding(start = 16.dp, bottom = 8.dp, top = 8.dp)
+ )
+ }
+ editTiles(
+ tiles,
+ ClickAction.ADD,
+ onClick,
+ dragAndDropState = dragAndDropState,
+ showLabels = true,
+ )
+ }
}
}
@@ -618,7 +630,7 @@
showLabels: Boolean,
modifier: Modifier = Modifier,
) {
- val label = tileViewModel.label.load() ?: tileViewModel.tileSpec.spec
+ val label = tileViewModel.label.text
val colors = TileDefaults.inactiveTileColors()
TileContainer(
@@ -638,7 +650,7 @@
} else {
LargeTileContent(
label = label,
- secondaryLabel = tileViewModel.appName?.load(),
+ secondaryLabel = tileViewModel.appName?.text,
icon = tileViewModel.icon,
colors = colors,
iconShape = RoundedCornerShape(TileDefaults.InactiveCornerRadius),
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/model/TileGridCell.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/model/TileGridCell.kt
index 8ca8de7..08ee856 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/model/TileGridCell.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/model/TileGridCell.kt
@@ -21,6 +21,7 @@
import com.android.systemui.qs.panels.shared.model.SizedTile
import com.android.systemui.qs.panels.shared.model.splitInRowsSequence
import com.android.systemui.qs.panels.ui.viewmodel.EditTileViewModel
+import com.android.systemui.qs.shared.model.CategoryAndName
/** Represents an item from a grid associated with a row and a span */
interface GridCell {
@@ -38,7 +39,7 @@
override val row: Int,
override val width: Int,
override val span: GridItemSpan = GridItemSpan(width)
-) : GridCell, SizedTile<EditTileViewModel> {
+) : GridCell, SizedTile<EditTileViewModel>, CategoryAndName by tile {
val key: String = "${tile.tileSpec.spec}-$row"
constructor(
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt
index 42715be..4a8aa83e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt
@@ -16,6 +16,9 @@
package com.android.systemui.qs.panels.ui.viewmodel
+import android.content.Context
+import androidx.compose.ui.util.fastMap
+import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.qs.panels.domain.interactor.EditTilesListInteractor
@@ -27,6 +30,7 @@
import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor.Companion.POSITION_AT_END
import com.android.systemui.qs.pipeline.domain.interactor.MinimumTilesInteractor
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.util.kotlin.emitOnStart
import javax.inject.Inject
import javax.inject.Named
import kotlinx.coroutines.CoroutineScope
@@ -35,6 +39,7 @@
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.map
@@ -49,6 +54,8 @@
private val currentTilesInteractor: CurrentTilesInteractor,
private val tilesAvailabilityInteractor: TilesAvailabilityInteractor,
private val minTilesInteractor: MinimumTilesInteractor,
+ private val configurationInteractor: ConfigurationInteractor,
+ @Application private val applicationContext: Context,
@Named("Default") private val defaultGridLayout: GridLayout,
@Application private val applicationScope: CoroutineScope,
gridLayoutTypeInteractor: GridLayoutTypeInteractor,
@@ -99,38 +106,45 @@
.map { it.tileSpec }
.minus(currentTilesInteractor.currentTilesSpecs.toSet())
)
- currentTilesInteractor.currentTiles.map { tiles ->
- val currentSpecs = tiles.map { it.spec }
- val canRemoveTiles = currentSpecs.size > minimumTiles
- val allTiles = editTilesData.stockTiles + editTilesData.customTiles
- val allTilesMap = allTiles.associate { it.tileSpec to it }
- val currentTiles = currentSpecs.map { allTilesMap.get(it) }.filterNotNull()
- val nonCurrentTiles = allTiles.filter { it.tileSpec !in currentSpecs }
+ currentTilesInteractor.currentTiles
+ .map { tiles ->
+ val currentSpecs = tiles.map { it.spec }
+ val canRemoveTiles = currentSpecs.size > minimumTiles
+ val allTiles = editTilesData.stockTiles + editTilesData.customTiles
+ val allTilesMap = allTiles.associate { it.tileSpec to it }
+ val currentTiles = currentSpecs.map { allTilesMap.get(it) }.filterNotNull()
+ val nonCurrentTiles = allTiles.filter { it.tileSpec !in currentSpecs }
- (currentTiles + nonCurrentTiles)
- .filterNot { it.tileSpec in unavailable }
- .map {
- val current = it.tileSpec in currentSpecs
- val availableActions = buildSet {
- if (current) {
- add(AvailableEditActions.MOVE)
- if (canRemoveTiles) {
- add(AvailableEditActions.REMOVE)
+ (currentTiles + nonCurrentTiles)
+ .filterNot { it.tileSpec in unavailable }
+ .map {
+ val current = it.tileSpec in currentSpecs
+ val availableActions = buildSet {
+ if (current) {
+ add(AvailableEditActions.MOVE)
+ if (canRemoveTiles) {
+ add(AvailableEditActions.REMOVE)
+ }
+ } else {
+ add(AvailableEditActions.ADD)
}
- } else {
- add(AvailableEditActions.ADD)
}
+ UnloadedEditTileViewModel(
+ it.tileSpec,
+ it.icon,
+ it.label,
+ it.appName,
+ current,
+ availableActions,
+ it.category,
+ )
}
- EditTileViewModel(
- it.tileSpec,
- it.icon,
- it.label,
- it.appName,
- current,
- availableActions
- )
- }
- }
+ }
+ .combine(configurationInteractor.onAnyConfigurationChange.emitOnStart()) {
+ tiles,
+ _ ->
+ tiles.fastMap { it.load(applicationContext) }
+ }
} else {
emptyFlow()
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditTileViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditTileViewModel.kt
index a4c8638..ee12736f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditTileViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditTileViewModel.kt
@@ -16,9 +16,15 @@
package com.android.systemui.qs.panels.ui.viewmodel
+import android.content.Context
+import androidx.compose.runtime.Immutable
+import androidx.compose.ui.text.AnnotatedString
import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.Text
+import com.android.systemui.common.ui.compose.toAnnotatedString
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.CategoryAndName
+import com.android.systemui.qs.shared.model.TileCategory
/**
* View model for each tile that is available to be added/removed/moved in Edit mode.
@@ -26,14 +32,41 @@
* [isCurrent] indicates whether this tile is part of the current set of tiles that the user sees in
* Quick Settings.
*/
-data class EditTileViewModel(
+data class UnloadedEditTileViewModel(
val tileSpec: TileSpec,
val icon: Icon,
val label: Text,
val appName: Text?,
val isCurrent: Boolean,
val availableEditActions: Set<AvailableEditActions>,
-)
+ val category: TileCategory,
+) {
+ fun load(context: Context): EditTileViewModel {
+ return EditTileViewModel(
+ tileSpec,
+ icon,
+ label.toAnnotatedString(context) ?: AnnotatedString(tileSpec.spec),
+ appName?.toAnnotatedString(context),
+ isCurrent,
+ availableEditActions,
+ category,
+ )
+ }
+}
+
+@Immutable
+data class EditTileViewModel(
+ val tileSpec: TileSpec,
+ val icon: Icon,
+ val label: AnnotatedString,
+ val appName: AnnotatedString?,
+ val isCurrent: Boolean,
+ val availableEditActions: Set<AvailableEditActions>,
+ override val category: TileCategory,
+) : CategoryAndName {
+ override val name
+ get() = label.text
+}
enum class AvailableEditActions {
ADD,
diff --git a/packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSTileListLog.kt b/packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSTileListLog.kt
index c56ca8c..d50374b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSTileListLog.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSTileListLog.kt
@@ -15,9 +15,7 @@
*/
package com.android.systemui.qs.pipeline.dagger
-import java.lang.annotation.Retention
-import java.lang.annotation.RetentionPolicy
import javax.inject.Qualifier
/** A [LogBuffer] for the new QS Pipeline for logging changes to the set of current tiles. */
-@Qualifier @MustBeDocumented @Retention(RetentionPolicy.RUNTIME) annotation class QSTileListLog
+@Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class QSTileListLog
diff --git a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt
index 4d823ab..bde6820 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/ReduceBrightColorsAutoAddable.kt
@@ -42,7 +42,7 @@
) :
CallbackControllerAutoAddable<
ReduceBrightColorsController.Listener,
- ReduceBrightColorsController
+ ReduceBrightColorsController,
>(controller) {
override val spec: TileSpec
@@ -55,12 +55,6 @@
sendAdd()
}
}
-
- override fun onFeatureEnabledChanged(enabled: Boolean) {
- if (!enabled) {
- available = false
- }
- }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/shared/model/TileCategory.kt b/packages/SystemUI/src/com/android/systemui/qs/shared/model/TileCategory.kt
new file mode 100644
index 0000000..59cb7d3
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/shared/model/TileCategory.kt
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.qs.shared.model
+
+import com.android.systemui.common.shared.model.Text
+import com.android.systemui.res.R
+
+/** Categories for tiles. This can be used to sort tiles in edit mode. */
+enum class TileCategory(val label: Text) {
+ CONNECTIVITY(Text.Resource(R.string.qs_edit_mode_category_connectivity)),
+ UTILITIES(Text.Resource(R.string.qs_edit_mode_category_utilities)),
+ DISPLAY(Text.Resource(R.string.qs_edit_mode_category_display)),
+ PRIVACY(Text.Resource(R.string.qs_edit_mode_category_privacy)),
+ ACCESSIBILITY(Text.Resource(R.string.qs_edit_mode_category_accessibility)),
+ PROVIDED_BY_APP(Text.Resource(R.string.qs_edit_mode_category_providedByApps)),
+ UNKNOWN(Text.Resource(R.string.qs_edit_mode_category_unknown)),
+}
+
+interface CategoryAndName {
+ val category: TileCategory
+ val name: String
+}
+
+/**
+ * Groups the elements of the list by [CategoryAndName.category] (with the keys sorted in the
+ * natural order of [TileCategory]), and sorts the elements of each group based on the
+ * [CategoryAndName.name].
+ */
+fun <T : CategoryAndName> groupAndSort(list: List<T>): Map<TileCategory, List<T>> {
+ val groupedByCategory = list.groupBy { it.category }.toSortedMap()
+ return groupedByCategory.mapValues { it.value.sortedBy { it.name } }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HearingDevicesTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HearingDevicesTile.java
index b96e83d..f723ff2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HearingDevicesTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HearingDevicesTile.java
@@ -16,6 +16,8 @@
package com.android.systemui.qs.tiles;
+import static com.android.systemui.accessibility.hearingaid.HearingDevicesUiEventLogger.LAUNCH_SOURCE_QS_TILE;
+
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
@@ -96,7 +98,7 @@
@Override
protected void handleClick(@Nullable Expandable expandable) {
- mUiHandler.post(() -> mDialogManager.showDialog(expandable));
+ mUiHandler.post(() -> mDialogManager.showDialog(expandable, LAUNCH_SOURCE_QS_TILE));
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RecordIssueTile.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/RecordIssueTile.kt
index a3feb2b..d89e73d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RecordIssueTile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RecordIssueTile.kt
@@ -43,12 +43,14 @@
import com.android.systemui.qs.logging.QSLogger
import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor
import com.android.systemui.qs.tileimpl.QSTileImpl
-import com.android.systemui.recordissue.IssueRecordingService
+import com.android.systemui.recordissue.IssueRecordingService.Companion.getStartIntent
+import com.android.systemui.recordissue.IssueRecordingService.Companion.getStopIntent
import com.android.systemui.recordissue.IssueRecordingState
import com.android.systemui.recordissue.RecordIssueDialogDelegate
import com.android.systemui.recordissue.RecordIssueModule.Companion.TILE_SPEC
import com.android.systemui.recordissue.TraceurMessageSender
import com.android.systemui.res.R
+import com.android.systemui.screenrecord.RecordingController
import com.android.systemui.screenrecord.RecordingService
import com.android.systemui.settings.UserContextProvider
import com.android.systemui.statusbar.phone.KeyguardDismissUtil
@@ -56,6 +58,9 @@
import java.util.concurrent.Executor
import javax.inject.Inject
+const val DELAY_MS: Long = 0
+const val INTERVAL_MS: Long = 1000
+
class RecordIssueTile
@Inject
constructor(
@@ -77,6 +82,7 @@
@Background private val bgExecutor: Executor,
private val issueRecordingState: IssueRecordingState,
private val delegateFactory: RecordIssueDialogDelegate.Factory,
+ private val recordingController: RecordingController,
) :
QSTileImpl<QSTile.BooleanState>(
host,
@@ -132,23 +138,25 @@
}
private fun startIssueRecordingService() =
- PendingIntent.getForegroundService(
- userContextProvider.userContext,
- RecordingService.REQUEST_CODE,
- IssueRecordingService.getStartIntent(userContextProvider.userContext),
- PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
- )
- .send(BroadcastOptions.makeBasic().apply { isInteractive = true }.toBundle())
+ recordingController.startCountdown(
+ DELAY_MS,
+ INTERVAL_MS,
+ pendingServiceIntent(getStartIntent(userContextProvider.userContext)),
+ pendingServiceIntent(getStopIntent(userContextProvider.userContext))
+ )
private fun stopIssueRecordingService() =
- PendingIntent.getService(
- userContextProvider.userContext,
- RecordingService.REQUEST_CODE,
- IssueRecordingService.getStopIntent(userContextProvider.userContext),
- PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
- )
+ pendingServiceIntent(getStopIntent(userContextProvider.userContext))
.send(BroadcastOptions.makeBasic().apply { isInteractive = true }.toBundle())
+ private fun pendingServiceIntent(action: Intent) =
+ PendingIntent.getService(
+ userContextProvider.userContext,
+ RecordingService.REQUEST_CODE,
+ action,
+ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
+ )
+
private fun showPrompt(expandable: Expandable?) {
val dialog: AlertDialog =
delegateFactory
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ReduceBrightColorsTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ReduceBrightColorsTile.java
index af5b311..d624d98 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ReduceBrightColorsTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ReduceBrightColorsTile.java
@@ -29,6 +29,7 @@
import com.android.internal.R;
import com.android.internal.logging.MetricsLogger;
+import com.android.systemui.accessibility.extradim.ExtraDimDialogManager;
import com.android.systemui.animation.Expandable;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
@@ -55,6 +56,7 @@
private final ReduceBrightColorsController mReduceBrightColorsController;
private boolean mIsListening;
private final boolean mInUpgradeMode;
+ private final ExtraDimDialogManager mExtraDimDialogManager;
@Inject
public ReduceBrightColorsTile(
@@ -68,12 +70,14 @@
MetricsLogger metricsLogger,
StatusBarStateController statusBarStateController,
ActivityStarter activityStarter,
- QSLogger qsLogger
+ QSLogger qsLogger,
+ ExtraDimDialogManager extraDimDialogManager
) {
super(host, uiEventLogger, backgroundLooper, mainHandler, falsingManager, metricsLogger,
statusBarStateController, activityStarter, qsLogger);
mReduceBrightColorsController = reduceBrightColorsController;
mReduceBrightColorsController.observe(getLifecycle(), this);
+ mExtraDimDialogManager = extraDimDialogManager;
mInUpgradeMode = reduceBrightColorsController.isInUpgradeMode(mContext.getResources());
mIsAvailable = isAvailable || mInUpgradeMode;
@@ -102,19 +106,24 @@
private boolean goToEvenDimmer() {
if (mInUpgradeMode) {
- mHost.removeTile(getTileSpec());
- mIsAvailable = false;
return true;
}
return false;
}
@Override
- protected void handleClick(@Nullable Expandable expandable) {
-
+ protected void handleLongClick(@Nullable Expandable expandable) {
if (goToEvenDimmer()) {
- mActivityStarter.postStartActivityDismissingKeyguard(
- new Intent(Settings.ACTION_DISPLAY_SETTINGS), 0);
+ mExtraDimDialogManager.dismissKeyguardIfNeededAndShowDialog(expandable);
+ } else {
+ super.handleLongClick(expandable);
+ }
+ }
+
+ @Override
+ protected void handleClick(@Nullable Expandable expandable) {
+ if (goToEvenDimmer()) {
+ mExtraDimDialogManager.dismissKeyguardIfNeededAndShowDialog(expandable);
} else {
mReduceBrightColorsController.setReduceBrightColorsActivated(!mState.value);
}
@@ -146,9 +155,4 @@
public void onActivated(boolean activated) {
refreshState();
}
-
- @Override
- public void onFeatureEnabledChanged(boolean enabled) {
- refreshState();
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractor.kt
index 4971fef..0c8a375 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractor.kt
@@ -19,6 +19,7 @@
import android.app.AlertDialog
import android.app.BroadcastOptions
import android.app.PendingIntent
+import android.content.Intent
import android.util.Log
import com.android.internal.jank.InteractionJankMonitor
import com.android.systemui.animation.DialogCuj
@@ -27,12 +28,16 @@
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor
+import com.android.systemui.qs.tiles.DELAY_MS
+import com.android.systemui.qs.tiles.INTERVAL_MS
import com.android.systemui.qs.tiles.base.interactor.QSTileInput
import com.android.systemui.qs.tiles.base.interactor.QSTileUserActionInteractor
import com.android.systemui.qs.tiles.viewmodel.QSTileUserAction
-import com.android.systemui.recordissue.IssueRecordingService
+import com.android.systemui.recordissue.IssueRecordingService.Companion.getStartIntent
+import com.android.systemui.recordissue.IssueRecordingService.Companion.getStopIntent
import com.android.systemui.recordissue.RecordIssueDialogDelegate
import com.android.systemui.recordissue.RecordIssueModule.Companion.TILE_SPEC
+import com.android.systemui.screenrecord.RecordingController
import com.android.systemui.screenrecord.RecordingService
import com.android.systemui.settings.UserContextProvider
import com.android.systemui.statusbar.phone.KeyguardDismissUtil
@@ -53,6 +58,7 @@
private val panelInteractor: PanelInteractor,
private val userContextProvider: UserContextProvider,
private val delegateFactory: RecordIssueDialogDelegate.Factory,
+ private val recordingController: RecordingController,
) : QSTileUserActionInteractor<IssueRecordingModel> {
override suspend fun handleInput(input: QSTileInput<IssueRecordingModel>) {
@@ -95,20 +101,22 @@
}
private fun startIssueRecordingService() =
- PendingIntent.getForegroundService(
- userContextProvider.userContext,
- RecordingService.REQUEST_CODE,
- IssueRecordingService.getStartIntent(userContextProvider.userContext),
- PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
- )
- .send(BroadcastOptions.makeBasic().apply { isInteractive = true }.toBundle())
+ recordingController.startCountdown(
+ DELAY_MS,
+ INTERVAL_MS,
+ pendingServiceIntent(getStartIntent(userContextProvider.userContext)),
+ pendingServiceIntent(getStopIntent(userContextProvider.userContext))
+ )
private fun stopIssueRecordingService() =
- PendingIntent.getService(
- userContextProvider.userContext,
- RecordingService.REQUEST_CODE,
- IssueRecordingService.getStopIntent(userContextProvider.userContext),
- PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
- )
+ pendingServiceIntent(getStopIntent(userContextProvider.userContext))
.send(BroadcastOptions.makeBasic().apply { isInteractive = true }.toBundle())
+
+ private fun pendingServiceIntent(action: Intent) =
+ PendingIntent.getService(
+ userContextProvider.userContext,
+ RecordingService.REQUEST_CODE,
+ action,
+ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
+ )
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt
index c2d112e..483373d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt
@@ -20,13 +20,16 @@
import android.content.Context
import android.os.UserHandle
import com.android.app.tracing.coroutines.flow.map
+import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.asIcon
import com.android.systemui.dagger.qualifiers.Background
+import com.android.systemui.qs.tiles.ModesTile
import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger
import com.android.systemui.qs.tiles.base.interactor.QSTileDataInteractor
import com.android.systemui.qs.tiles.impl.modes.domain.model.ModesTileModel
import com.android.systemui.statusbar.policy.domain.interactor.ZenModeInteractor
import com.android.systemui.statusbar.policy.domain.model.ActiveZenModes
+import com.android.systemui.statusbar.policy.domain.model.ZenModeInfo
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
@@ -61,28 +64,39 @@
suspend fun getCurrentTileModel() = buildTileData(zenModeInteractor.getActiveModes())
private fun buildTileData(activeModes: ActiveZenModes): ModesTileModel {
- val modesIconResId = com.android.internal.R.drawable.ic_zen_priority_modes
-
if (usesModeIcons()) {
- val mainModeDrawable = activeModes.mainMode?.icon?.drawable
- val iconResId = if (mainModeDrawable == null) modesIconResId else null
-
+ val tileIcon = getTileIcon(activeModes.mainMode)
return ModesTileModel(
isActivated = activeModes.isAnyActive(),
- icon = (mainModeDrawable ?: context.getDrawable(modesIconResId)!!).asIcon(),
- iconResId = iconResId,
+ icon = tileIcon.icon,
+ iconResId = tileIcon.resId,
activeModes = activeModes.modeNames
)
} else {
return ModesTileModel(
isActivated = activeModes.isAnyActive(),
- icon = context.getDrawable(modesIconResId)!!.asIcon(),
- iconResId = modesIconResId,
+ icon = context.getDrawable(ModesTile.ICON_RES_ID)!!.asIcon(),
+ iconResId = ModesTile.ICON_RES_ID,
activeModes = activeModes.modeNames
)
}
}
+ private data class TileIcon(val icon: Icon.Loaded, val resId: Int?)
+
+ private fun getTileIcon(activeMode: ZenModeInfo?): TileIcon {
+ return if (activeMode != null) {
+ // ZenIconKey.resPackage is null if its resId is a system icon.
+ if (activeMode.icon.key.resPackage == null) {
+ TileIcon(activeMode.icon.drawable.asIcon(), activeMode.icon.key.resId)
+ } else {
+ TileIcon(activeMode.icon.drawable.asIcon(), null)
+ }
+ } else {
+ TileIcon(context.getDrawable(ModesTile.ICON_RES_ID)!!.asIcon(), ModesTile.ICON_RES_ID)
+ }
+ }
+
override fun availability(user: UserHandle): Flow<Boolean> = flowOf(Flags.modesUi())
private fun usesModeIcons() = Flags.modesApi() && Flags.modesUi() && Flags.modesUiIcons()
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt
index 7f571b1..69da313 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt
@@ -36,9 +36,7 @@
) : QSTileDataToStateMapper<ModesTileModel> {
override fun map(config: QSTileConfig, data: ModesTileModel): QSTileState =
QSTileState.build(resources, theme, config.uiConfig) {
- if (!android.app.Flags.modesUiIcons()) {
- iconRes = data.iconResId
- }
+ iconRes = data.iconResId
icon = { data.icon }
activationState =
if (data.isActivated) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractor.kt
index 00b1e41..536c5f1 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractor.kt
@@ -23,13 +23,13 @@
import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger
import com.android.systemui.qs.tiles.base.interactor.QSTileDataInteractor
import com.android.systemui.qs.tiles.impl.reducebrightness.domain.model.ReduceBrightColorsTileModel
-import com.android.systemui.util.kotlin.isAvailable
import com.android.systemui.util.kotlin.isEnabled
import javax.inject.Inject
import javax.inject.Named
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.distinctUntilChanged
+import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
@@ -44,7 +44,7 @@
override fun tileData(
user: UserHandle,
- triggers: Flow<DataUpdateTrigger>
+ triggers: Flow<DataUpdateTrigger>,
): Flow<ReduceBrightColorsTileModel> {
return reduceBrightColorsController
.isEnabled()
@@ -53,6 +53,5 @@
.flowOn(bgCoroutineContext)
}
- override fun availability(user: UserHandle): Flow<Boolean> =
- reduceBrightColorsController.isAvailable()
+ override fun availability(user: UserHandle): Flow<Boolean> = flowOf(isAvailable)
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractor.kt
index de49e70..15c9901 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractor.kt
@@ -19,6 +19,7 @@
import android.content.Intent
import android.content.res.Resources
import android.provider.Settings
+import com.android.systemui.accessibility.extradim.ExtraDimDialogManager
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.qs.ReduceBrightColorsController
import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandler
@@ -35,6 +36,7 @@
@Main private val resources: Resources,
private val qsTileIntentUserActionHandler: QSTileIntentUserInputHandler,
private val reduceBrightColorsController: ReduceBrightColorsController,
+ private val extraDimDialogManager: ExtraDimDialogManager,
) : QSTileUserActionInteractor<ReduceBrightColorsTileModel> {
val isInUpgradeMode: Boolean = reduceBrightColorsController.isInUpgradeMode(resources)
@@ -44,12 +46,9 @@
when (action) {
is QSTileUserAction.Click -> {
if (isInUpgradeMode) {
- reduceBrightColorsController.setReduceBrightColorsFeatureAvailable(false)
- qsTileIntentUserActionHandler.handle(
- action.expandable,
- Intent(Settings.ACTION_DISPLAY_SETTINGS)
+ extraDimDialogManager.dismissKeyguardIfNeededAndShowDialog(
+ action.expandable
)
- // TODO(b/349458355): show dialog
return@with
}
reduceBrightColorsController.setReduceBrightColorsActivated(
@@ -58,17 +57,14 @@
}
is QSTileUserAction.LongClick -> {
if (isInUpgradeMode) {
- reduceBrightColorsController.setReduceBrightColorsFeatureAvailable(false)
- qsTileIntentUserActionHandler.handle(
- action.expandable,
- Intent(Settings.ACTION_DISPLAY_SETTINGS)
+ extraDimDialogManager.dismissKeyguardIfNeededAndShowDialog(
+ action.expandable
)
- // TODO(b/349458355): show dialog
return@with
}
qsTileIntentUserActionHandler.handle(
action.expandable,
- Intent(Settings.ACTION_REDUCE_BRIGHT_COLORS_SETTINGS)
+ Intent(Settings.ACTION_REDUCE_BRIGHT_COLORS_SETTINGS),
)
}
is QSTileUserAction.ToggleClick -> {}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfig.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfig.kt
index cdcefdb..3a9cb17 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfig.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfig.kt
@@ -21,6 +21,7 @@
import androidx.annotation.StringRes
import com.android.internal.logging.InstanceId
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
data class QSTileConfig
@JvmOverloads
@@ -28,6 +29,7 @@
val tileSpec: TileSpec,
val uiConfig: QSTileUIConfig,
val instanceId: InstanceId,
+ val category: TileCategory,
val metricsSpec: String = tileSpec.spec,
val policy: QSTilePolicy = QSTilePolicy.NoRestrictions,
val autoRemoveOnUnavailable: Boolean = true,
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigProvider.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigProvider.kt
index 0609e79..4dbddd9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigProvider.kt
@@ -20,6 +20,7 @@
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import javax.inject.Inject
interface QSTileConfigProvider {
@@ -73,6 +74,7 @@
spec,
QSTileUIConfig.Empty,
qsEventLogger.getNewInstanceId(),
+ category = TileCategory.PROVIDED_BY_APP,
)
is TileSpec.Invalid ->
throw IllegalArgumentException("TileSpec.Invalid doesn't support configs")
diff --git a/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsShadeUserActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsShadeUserActionsViewModel.kt
index d3dc302..bd1872d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsShadeUserActionsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsShadeUserActionsViewModel.kt
@@ -18,9 +18,13 @@
import com.android.compose.animation.scene.Back
import com.android.compose.animation.scene.Swipe
+import com.android.compose.animation.scene.SwipeDirection
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
+import com.android.compose.animation.scene.UserActionResult.ReplaceByOverlay
+import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.SceneFamilies
+import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge
import com.android.systemui.scene.ui.viewmodel.UserActionsViewModel
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
@@ -43,6 +47,13 @@
.map { editing ->
buildMap {
put(Swipe.Up, UserActionResult(SceneFamilies.Home))
+ put(
+ Swipe(
+ direction = SwipeDirection.Down,
+ fromSource = SceneContainerEdge.TopLeft
+ ),
+ ReplaceByOverlay(Overlays.NotificationsShade)
+ )
if (!editing) {
put(Back, UserActionResult(SceneFamilies.Home))
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
index 000781a..a402a9d 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
@@ -25,7 +25,6 @@
import static android.view.MotionEvent.ACTION_UP;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON;
-import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER;
@@ -76,7 +75,6 @@
import androidx.annotation.NonNull;
-import com.android.internal.accessibility.dialog.AccessibilityButtonChooserActivity;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.AssistUtils;
import com.android.internal.app.IVoiceInteractionSessionListener;
@@ -404,23 +402,16 @@
@Override
public void notifyAccessibilityButtonClicked(int displayId) {
verifyCallerAndClearCallingIdentity("notifyAccessibilityButtonClicked", () ->
- AccessibilityManager.getInstance(mContext)
- .notifyAccessibilityButtonClicked(displayId));
+ AccessibilityManager.getInstance(mContext).notifyAccessibilityButtonClicked(
+ displayId));
}
@Override
public void notifyAccessibilityButtonLongClicked() {
- verifyCallerAndClearCallingIdentity("notifyAccessibilityButtonLongClicked",
- () -> {
- final Intent intent =
- new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
- final String chooserClassName = AccessibilityButtonChooserActivity
- .class.getName();
- intent.setClassName(CHOOSER_PACKAGE_NAME, chooserClassName);
- intent.addFlags(
- Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- mContext.startActivityAsUser(intent, mUserTracker.getUserHandle());
- });
+ verifyCallerAndClearCallingIdentity("notifyAccessibilityButtonLongClicked", () ->
+ AccessibilityManager.getInstance(mContext)
+ .notifyAccessibilityButtonLongClicked(
+ mDisplayTracker.getDefaultDisplayId()));
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingService.kt b/packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingService.kt
index 3d6d00e..a5f4a89 100644
--- a/packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingService.kt
+++ b/packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingService.kt
@@ -23,8 +23,6 @@
import android.content.res.Resources
import android.net.Uri
import android.os.Handler
-import android.os.UserHandle
-import android.provider.Settings
import android.util.Log
import com.android.internal.logging.UiEventLogger
import com.android.systemui.animation.DialogTransitionAnimator
@@ -50,11 +48,11 @@
notificationManager: NotificationManager,
userContextProvider: UserContextProvider,
keyguardDismissUtil: KeyguardDismissUtil,
- private val dialogTransitionAnimator: DialogTransitionAnimator,
- private val panelInteractor: PanelInteractor,
- private val traceurMessageSender: TraceurMessageSender,
+ dialogTransitionAnimator: DialogTransitionAnimator,
+ panelInteractor: PanelInteractor,
+ traceurMessageSender: TraceurMessageSender,
private val issueRecordingState: IssueRecordingState,
- private val iActivityManager: IActivityManager,
+ iActivityManager: IActivityManager,
) :
RecordingService(
controller,
@@ -66,6 +64,18 @@
keyguardDismissUtil
) {
+ private val commandHandler =
+ IssueRecordingServiceCommandHandler(
+ bgExecutor,
+ dialogTransitionAnimator,
+ panelInteractor,
+ traceurMessageSender,
+ issueRecordingState,
+ iActivityManager,
+ notificationManager,
+ userContextProvider,
+ )
+
override fun getTag(): String = TAG
override fun getChannelId(): String = CHANNEL_ID
@@ -76,10 +86,7 @@
Log.d(getTag(), "handling action: ${intent?.action}")
when (intent?.action) {
ACTION_START -> {
- bgExecutor.execute {
- traceurMessageSender.startTracing(issueRecordingState.traceConfig)
- }
- issueRecordingState.isRecording = true
+ commandHandler.handleStartCommand()
if (!issueRecordingState.recordScreen) {
// If we don't want to record the screen, the ACTION_SHOW_START_NOTIF action
// will circumvent the RecordingService's screen recording start code.
@@ -87,41 +94,13 @@
}
}
ACTION_STOP,
- ACTION_STOP_NOTIF -> {
- // ViewCapture needs to save it's data before it is disabled, or else the data will
- // be lost. This is expected to change in the near future, and when that happens
- // this line should be removed.
- bgExecutor.execute {
- if (issueRecordingState.traceConfig.longTrace) {
- Settings.Global.putInt(
- contentResolver,
- NOTIFY_SESSION_ENDED_SETTING,
- DISABLED
- )
- }
- traceurMessageSender.stopTracing()
- }
- issueRecordingState.isRecording = false
- }
+ ACTION_STOP_NOTIF -> commandHandler.handleStopCommand(contentResolver)
ACTION_SHARE -> {
- bgExecutor.execute {
- mNotificationManager.cancelAsUser(
- null,
- intent.getIntExtra(EXTRA_NOTIFICATION_ID, mNotificationId),
- UserHandle(mUserContextTracker.userContext.userId)
- )
-
- val screenRecording = intent.getParcelableExtra(EXTRA_PATH, Uri::class.java)
- if (issueRecordingState.takeBugreport) {
- iActivityManager.requestBugReportWithExtraAttachment(screenRecording)
- } else {
- traceurMessageSender.shareTraces(applicationContext, screenRecording)
- }
- }
-
- dialogTransitionAnimator.disableAllCurrentDialogsExitAnimations()
- panelInteractor.collapsePanels()
-
+ commandHandler.handleShareCommand(
+ intent.getIntExtra(EXTRA_NOTIFICATION_ID, mNotificationId),
+ intent.getParcelableExtra(EXTRA_PATH, Uri::class.java),
+ this
+ )
// Unlike all other actions, action_share has different behavior for the screen
// recording qs tile than it does for the record issue qs tile. Return sticky to
// avoid running any of the base class' code for this action.
@@ -135,8 +114,6 @@
companion object {
private const val TAG = "IssueRecordingService"
private const val CHANNEL_ID = "issue_record"
- private const val NOTIFY_SESSION_ENDED_SETTING = "should_notify_trace_session_ended"
- private const val DISABLED = 0
/**
* Get an intent to stop the issue recording service.
diff --git a/packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingServiceCommandHandler.kt b/packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingServiceCommandHandler.kt
new file mode 100644
index 0000000..32de0f3
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingServiceCommandHandler.kt
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.recordissue
+
+import android.app.IActivityManager
+import android.app.NotificationManager
+import android.content.ContentResolver
+import android.content.Context
+import android.net.Uri
+import android.os.UserHandle
+import android.provider.Settings
+import com.android.systemui.animation.DialogTransitionAnimator
+import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor
+import com.android.systemui.settings.UserContextProvider
+import java.util.concurrent.Executor
+
+private const val NOTIFY_SESSION_ENDED_SETTING = "should_notify_trace_session_ended"
+private const val DISABLED = 0
+
+/**
+ * This class exists to unit test the business logic encapsulated in IssueRecordingService. Android
+ * specifically calls out that there is no supported way to test IntentServices here:
+ * https://developer.android.com/training/testing/other-components/services
+ */
+class IssueRecordingServiceCommandHandler(
+ private val bgExecutor: Executor,
+ private val dialogTransitionAnimator: DialogTransitionAnimator,
+ private val panelInteractor: PanelInteractor,
+ private val traceurMessageSender: TraceurMessageSender,
+ private val issueRecordingState: IssueRecordingState,
+ private val iActivityManager: IActivityManager,
+ private val notificationManager: NotificationManager,
+ private val userContextProvider: UserContextProvider,
+) {
+
+ fun handleStartCommand() {
+ bgExecutor.execute { traceurMessageSender.startTracing(issueRecordingState.traceConfig) }
+ issueRecordingState.isRecording = true
+ }
+
+ fun handleStopCommand(contentResolver: ContentResolver) {
+ bgExecutor.execute {
+ if (issueRecordingState.traceConfig.longTrace) {
+ Settings.Global.putInt(contentResolver, NOTIFY_SESSION_ENDED_SETTING, DISABLED)
+ }
+ traceurMessageSender.stopTracing()
+ }
+ issueRecordingState.isRecording = false
+ }
+
+ fun handleShareCommand(notificationId: Int, screenRecording: Uri?, context: Context) {
+ bgExecutor.execute {
+ notificationManager.cancelAsUser(
+ null,
+ notificationId,
+ UserHandle(userContextProvider.userContext.userId)
+ )
+
+ if (issueRecordingState.takeBugreport) {
+ iActivityManager.requestBugReportWithExtraAttachment(screenRecording)
+ } else {
+ traceurMessageSender.shareTraces(context, screenRecording)
+ }
+ }
+
+ dialogTransitionAnimator.disableAllCurrentDialogsExitAnimations()
+ panelInteractor.collapsePanels()
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/recordissue/RecordIssueModule.kt b/packages/SystemUI/src/com/android/systemui/recordissue/RecordIssueModule.kt
index 907b92c..c092c2f 100644
--- a/packages/SystemUI/src/com/android/systemui/recordissue/RecordIssueModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/recordissue/RecordIssueModule.kt
@@ -19,6 +19,7 @@
import com.android.systemui.Flags
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.RecordIssueTile
import com.android.systemui.qs.tiles.base.viewmodel.QSTileViewModelFactory
@@ -61,6 +62,7 @@
labelRes = R.string.qs_record_issue_label
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.UTILITIES,
)
/** Inject FlashlightTile into tileViewModelMap in QSModule */
diff --git a/packages/SystemUI/src/com/android/systemui/rotationlock/RotationLockNewModule.kt b/packages/SystemUI/src/com/android/systemui/rotationlock/RotationLockNewModule.kt
index 0589e6c..c9712fc 100644
--- a/packages/SystemUI/src/com/android/systemui/rotationlock/RotationLockNewModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/rotationlock/RotationLockNewModule.kt
@@ -19,6 +19,7 @@
import com.android.systemui.camera.CameraRotationModule
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tiles.base.interactor.QSTileAvailabilityInteractor
import com.android.systemui.qs.tiles.base.viewmodel.QSTileViewModelFactory
import com.android.systemui.qs.tiles.impl.rotation.domain.interactor.RotationLockTileDataInteractor
@@ -42,8 +43,9 @@
@IntoMap
@StringKey(ROTATION_TILE_SPEC)
fun provideRotationAvailabilityInteractor(
- impl: RotationLockTileDataInteractor
+ impl: RotationLockTileDataInteractor
): QSTileAvailabilityInteractor
+
companion object {
private const val ROTATION_TILE_SPEC = "rotation"
@@ -60,6 +62,7 @@
labelRes = R.string.quick_settings_rotation_unlocked_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.DISPLAY,
)
/** Inject Rotation tile into tileViewModelMap in QSModule */
diff --git a/packages/SystemUI/src/com/android/systemui/scene/KeyguardlessSceneContainerFrameworkModule.kt b/packages/SystemUI/src/com/android/systemui/scene/KeyguardlessSceneContainerFrameworkModule.kt
index 00944b8..1aa982f 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/KeyguardlessSceneContainerFrameworkModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/KeyguardlessSceneContainerFrameworkModule.kt
@@ -16,6 +16,7 @@
package com.android.systemui.scene
+import androidx.compose.ui.unit.dp
import com.android.systemui.CoreStartable
import com.android.systemui.notifications.ui.composable.NotificationsShadeSessionModule
import com.android.systemui.scene.domain.SceneDomainModule
@@ -30,6 +31,8 @@
import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.SceneContainerConfig
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.scene.ui.viewmodel.SplitEdgeDetector
+import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.flag.DualShade
import dagger.Binds
import dagger.Module
@@ -55,7 +58,7 @@
HomeSceneFamilyResolverModule::class,
NotifShadeSceneFamilyResolverModule::class,
QuickSettingsSceneFamilyResolverModule::class,
- ],
+ ]
)
interface KeyguardlessSceneContainerFrameworkModule {
@@ -97,8 +100,6 @@
listOfNotNull(
Scenes.Gone,
Scenes.QuickSettings.takeUnless { DualShade.isEnabled },
- Scenes.QuickSettingsShade.takeIf { DualShade.isEnabled },
- Scenes.NotificationsShade.takeIf { DualShade.isEnabled },
Scenes.Shade.takeUnless { DualShade.isEnabled },
),
initialSceneKey = Scenes.Gone,
@@ -110,13 +111,21 @@
navigationDistances =
mapOf(
Scenes.Gone to 0,
- Scenes.NotificationsShade to 1.takeIf { DualShade.isEnabled },
Scenes.Shade to 1.takeUnless { DualShade.isEnabled },
- Scenes.QuickSettingsShade to 2.takeIf { DualShade.isEnabled },
Scenes.QuickSettings to 2.takeUnless { DualShade.isEnabled },
)
.filterValues { it != null }
- .mapValues { checkNotNull(it.value) }
+ .mapValues { checkNotNull(it.value) },
+ )
+ }
+
+ @Provides
+ fun splitEdgeDetector(shadeInteractor: ShadeInteractor): SplitEdgeDetector {
+ return SplitEdgeDetector(
+ topEdgeSplitFraction = shadeInteractor::getTopEdgeSplitFraction,
+ // TODO(b/338577208): This should be 60dp at the top in the dual-shade UI. Better to
+ // replace this constant with dynamic window insets.
+ edgeSize = 40.dp,
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/SceneContainerFrameworkModule.kt b/packages/SystemUI/src/com/android/systemui/scene/SceneContainerFrameworkModule.kt
index 4061ad8..7f0cf86 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/SceneContainerFrameworkModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/SceneContainerFrameworkModule.kt
@@ -16,6 +16,7 @@
package com.android.systemui.scene
+import androidx.compose.ui.unit.dp
import com.android.systemui.CoreStartable
import com.android.systemui.notifications.ui.composable.NotificationsShadeSessionModule
import com.android.systemui.scene.domain.SceneDomainModule
@@ -30,6 +31,8 @@
import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.SceneContainerConfig
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.scene.ui.viewmodel.SplitEdgeDetector
+import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.flag.DualShade
import dagger.Binds
import dagger.Module
@@ -59,7 +62,7 @@
HomeSceneFamilyResolverModule::class,
NotifShadeSceneFamilyResolverModule::class,
QuickSettingsSceneFamilyResolverModule::class,
- ],
+ ]
)
interface SceneContainerFrameworkModule {
@@ -104,8 +107,6 @@
Scenes.Lockscreen,
Scenes.Bouncer,
Scenes.QuickSettings.takeUnless { DualShade.isEnabled },
- Scenes.QuickSettingsShade.takeIf { DualShade.isEnabled },
- Scenes.NotificationsShade.takeIf { DualShade.isEnabled },
Scenes.Shade.takeUnless { DualShade.isEnabled },
),
initialSceneKey = Scenes.Lockscreen,
@@ -119,14 +120,22 @@
Scenes.Gone to 0,
Scenes.Lockscreen to 0,
Scenes.Communal to 1,
- Scenes.NotificationsShade to 2.takeIf { DualShade.isEnabled },
Scenes.Shade to 2.takeUnless { DualShade.isEnabled },
- Scenes.QuickSettingsShade to 3.takeIf { DualShade.isEnabled },
Scenes.QuickSettings to 3.takeUnless { DualShade.isEnabled },
Scenes.Bouncer to 4,
)
.filterValues { it != null }
- .mapValues { checkNotNull(it.value) }
+ .mapValues { checkNotNull(it.value) },
+ )
+ }
+
+ @Provides
+ fun splitEdgeDetector(shadeInteractor: ShadeInteractor): SplitEdgeDetector {
+ return SplitEdgeDetector(
+ topEdgeSplitFraction = shadeInteractor::getTopEdgeSplitFraction,
+ // TODO(b/338577208): This should be 60dp at the top in the dual-shade UI. Better to
+ // replace this constant with dynamic window insets.
+ edgeSize = 40.dp,
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneBackInteractor.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneBackInteractor.kt
index 2d40845..afb72f0 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneBackInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneBackInteractor.kt
@@ -71,6 +71,12 @@
logger.logSceneBackStack(backStack.value.asIterable())
}
+ /** Applies the given [transform] to the back stack. */
+ fun updateBackStack(transform: (SceneStack) -> SceneStack) {
+ _backStack.update { stack -> transform(stack) }
+ logger.logSceneBackStack(backStack.value.asIterable())
+ }
+
private fun stackOperation(from: SceneKey, to: SceneKey, stack: SceneStack): StackOperation? {
val fromDistance =
checkNotNull(sceneContainerConfig.navigationDistances[from]) {
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneContainerOcclusionInteractor.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneContainerOcclusionInteractor.kt
index 04620d6..429b47b 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneContainerOcclusionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneContainerOcclusionInteractor.kt
@@ -137,9 +137,7 @@
Scenes.Communal -> true
Scenes.Gone -> true
Scenes.Lockscreen -> true
- Scenes.NotificationsShade -> false
Scenes.QuickSettings -> false
- Scenes.QuickSettingsShade -> false
Scenes.Shade -> false
else -> error("SceneKey \"$this\" doesn't have a mapping for canBeOccluded!")
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractor.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractor.kt
index 738b184..e477efe 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractor.kt
@@ -25,6 +25,7 @@
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.scene.data.repository.WindowRootViewVisibilityRepository
import com.android.systemui.scene.shared.flag.SceneContainerFlag
+import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.statusbar.NotificationPresenter
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
@@ -34,6 +35,7 @@
import javax.inject.Inject
import javax.inject.Provider
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
@@ -45,6 +47,7 @@
import kotlinx.coroutines.launch
/** Business logic about the visibility of various parts of the window root view. */
+@OptIn(ExperimentalCoroutinesApi::class)
@SysUISingleton
class WindowRootViewVisibilityInteractor
@Inject
@@ -80,9 +83,9 @@
is ObservableTransitionState.Idle ->
flowOf(
state.currentScene == Scenes.Shade ||
- state.currentScene == Scenes.NotificationsShade ||
- state.currentScene == Scenes.QuickSettingsShade ||
- state.currentScene == Scenes.Lockscreen
+ state.currentScene == Scenes.Lockscreen ||
+ Overlays.NotificationsShade in state.currentOverlays ||
+ Overlays.QuickSettingsShade in state.currentOverlays
)
is ObservableTransitionState.Transition ->
if (
@@ -94,12 +97,12 @@
} else {
flowOf(
state.toContent == Scenes.Shade ||
- state.toContent == Scenes.NotificationsShade ||
- state.toContent == Scenes.QuickSettingsShade ||
+ state.toContent == Overlays.NotificationsShade ||
+ state.toContent == Overlays.QuickSettingsShade ||
state.toContent == Scenes.Lockscreen ||
state.fromContent == Scenes.Shade ||
- state.fromContent == Scenes.NotificationsShade ||
- state.fromContent == Scenes.QuickSettingsShade ||
+ state.fromContent == Overlays.NotificationsShade ||
+ state.fromContent == Overlays.QuickSettingsShade ||
state.fromContent == Scenes.Lockscreen
)
}
@@ -115,10 +118,9 @@
* false if the device is asleep.
*/
val isLockscreenOrShadeVisibleAndInteractive: StateFlow<Boolean> =
- combine(
- isLockscreenOrShadeVisible,
- powerInteractor.isAwake,
- ) { isKeyguardAodOrShadeVisible, isAwake ->
+ combine(isLockscreenOrShadeVisible, powerInteractor.isAwake) {
+ isKeyguardAodOrShadeVisible,
+ isAwake ->
isKeyguardAodOrShadeVisible && isAwake
}
.stateIn(scope, SharingStarted.Eagerly, initialValue = false)
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/NotifShadeSceneFamilyResolver.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/NotifShadeSceneFamilyResolver.kt
index 99e554e..a313273 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/NotifShadeSceneFamilyResolver.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/NotifShadeSceneFamilyResolver.kt
@@ -21,7 +21,7 @@
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.scene.shared.model.SceneFamilies
import com.android.systemui.scene.shared.model.Scenes
-import com.android.systemui.shade.domain.interactor.ShadeInteractor
+import com.android.systemui.shade.domain.interactor.ShadeModeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
import dagger.Binds
import dagger.Module
@@ -38,17 +38,17 @@
@Inject
constructor(
@Application applicationScope: CoroutineScope,
- shadeInteractor: ShadeInteractor,
+ shadeModeInteractor: ShadeModeInteractor,
) : SceneResolver {
override val targetFamily: SceneKey = SceneFamilies.NotifShade
override val resolvedScene: StateFlow<SceneKey> =
- shadeInteractor.shadeMode
+ shadeModeInteractor.shadeMode
.map(::notifShadeScene)
.stateIn(
applicationScope,
started = SharingStarted.Eagerly,
- initialValue = notifShadeScene(shadeInteractor.shadeMode.value),
+ initialValue = notifShadeScene(shadeModeInteractor.shadeMode.value),
)
override fun includesScene(scene: SceneKey): Boolean = scene in notifShadeScenes
@@ -61,11 +61,7 @@
}
companion object {
- val notifShadeScenes =
- setOf(
- Scenes.NotificationsShade,
- Scenes.Shade,
- )
+ val notifShadeScenes = setOf(Scenes.NotificationsShade, Scenes.Shade)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/QuickSettingsSceneFamilyResolver.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/QuickSettingsSceneFamilyResolver.kt
index 2962a3e..923e712a 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/QuickSettingsSceneFamilyResolver.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/resolver/QuickSettingsSceneFamilyResolver.kt
@@ -21,7 +21,7 @@
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.scene.shared.model.SceneFamilies
import com.android.systemui.scene.shared.model.Scenes
-import com.android.systemui.shade.domain.interactor.ShadeInteractor
+import com.android.systemui.shade.domain.interactor.ShadeModeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
import dagger.Binds
import dagger.Module
@@ -38,17 +38,17 @@
@Inject
constructor(
@Application applicationScope: CoroutineScope,
- shadeInteractor: ShadeInteractor,
+ shadeModeInteractor: ShadeModeInteractor,
) : SceneResolver {
override val targetFamily: SceneKey = SceneFamilies.QuickSettings
override val resolvedScene: StateFlow<SceneKey> =
- shadeInteractor.shadeMode
+ shadeModeInteractor.shadeMode
.map(::quickSettingsScene)
.stateIn(
applicationScope,
started = SharingStarted.Eagerly,
- initialValue = quickSettingsScene(shadeInteractor.shadeMode.value),
+ initialValue = quickSettingsScene(shadeModeInteractor.shadeMode.value),
)
override fun includesScene(scene: SceneKey): Boolean = scene in quickSettingsScenes
@@ -62,11 +62,7 @@
companion object {
val quickSettingsScenes =
- setOf(
- Scenes.QuickSettings,
- Scenes.QuickSettingsShade,
- Scenes.Shade,
- )
+ setOf(Scenes.QuickSettings, Scenes.QuickSettingsShade, Scenes.Shade)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
index e251c9e..b11d8ed 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
@@ -22,7 +22,9 @@
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.compose.animation.scene.SceneKey
import com.android.internal.logging.UiEventLogger
+import com.android.keyguard.AuthInteractionProperties
import com.android.systemui.CoreStartable
+import com.android.systemui.Flags
import com.android.systemui.authentication.domain.interactor.AuthenticationInteractor
import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
@@ -43,7 +45,6 @@
import com.android.systemui.keyguard.DismissCallbackRegistry
import com.android.systemui.keyguard.domain.interactor.KeyguardEnabledInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
-import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.domain.interactor.WindowManagerLockscreenVisibilityInteractor
import com.android.systemui.model.SceneContainerPlugin
import com.android.systemui.model.SysUiState
@@ -53,6 +54,7 @@
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.scene.data.model.asIterable
+import com.android.systemui.scene.data.model.sceneStackOf
import com.android.systemui.scene.domain.interactor.SceneBackInteractor
import com.android.systemui.scene.domain.interactor.SceneContainerOcclusionInteractor
import com.android.systemui.scene.domain.interactor.SceneInteractor
@@ -73,6 +75,8 @@
import com.android.systemui.util.kotlin.sample
import com.android.systemui.util.printSection
import com.android.systemui.util.println
+import com.google.android.msdl.data.model.MSDLToken
+import com.google.android.msdl.domain.MSDLPlayer
import dagger.Lazy
import java.io.PrintWriter
import java.util.Optional
@@ -114,7 +118,6 @@
private val deviceUnlockedInteractor: DeviceUnlockedInteractor,
private val bouncerInteractor: BouncerInteractor,
private val keyguardInteractor: KeyguardInteractor,
- private val keyguardTransitionInteractor: KeyguardTransitionInteractor,
private val sysUiState: SysUiState,
@DisplayId private val displayId: Int,
private val sceneLogger: SceneLogger,
@@ -139,10 +142,13 @@
private val statusBarStateController: SysuiStatusBarStateController,
private val alternateBouncerInteractor: AlternateBouncerInteractor,
private val vibratorHelper: VibratorHelper,
+ private val msdlPlayer: MSDLPlayer,
) : CoreStartable {
private val centralSurfaces: CentralSurfaces?
get() = centralSurfacesOptLazy.get().getOrNull()
+ private val authInteractionProperties = AuthInteractionProperties()
+
override fun start() {
if (SceneContainerFlag.isEnabled) {
sceneLogger.logFrameworkEnabled(isEnabled = true)
@@ -198,7 +204,7 @@
is ObservableTransitionState.Transition -> state.fromContent
}.let { it == Scenes.Shade || it == Scenes.QuickSettings }
}
- .distinctUntilChanged()
+ .distinctUntilChanged(),
) { inBackStack, isCurrentScene ->
inBackStack || isCurrentScene
}
@@ -241,8 +247,7 @@
visibilityForTransitionState,
isHeadsUpOrAnimatingAway,
invisibleDueToOcclusion,
- isAlternateBouncerVisible,
- ->
+ isAlternateBouncerVisible ->
when {
isHeadsUpOrAnimatingAway -> true to "showing a HUN"
isAlternateBouncerVisible -> true to "showing alternate bouncer"
@@ -315,7 +320,7 @@
switchToScene(
// TODO(b/336581871): add sceneState?
targetSceneKey = Scenes.Bouncer,
- loggingReason = "Need to authenticate locked SIM card."
+ loggingReason = "Need to authenticate locked SIM card.",
)
}
unlockStatus.isUnlocked &&
@@ -325,7 +330,7 @@
targetSceneKey = Scenes.Gone,
loggingReason =
"All SIM cards unlocked and device already unlocked and " +
- "lockscreen doesn't require a swipe to dismiss."
+ "lockscreen doesn't require a swipe to dismiss.",
)
}
else -> {
@@ -334,7 +339,7 @@
targetSceneKey = Scenes.Lockscreen,
loggingReason =
"All SIM cards unlocked and device still locked" +
- " or lockscreen still requires a swipe to dismiss."
+ " or lockscreen still requires a swipe to dismiss.",
)
}
}
@@ -356,10 +361,7 @@
when (val transitionState = sceneInteractor.transitionState.value) {
is ObservableTransitionState.Idle -> setOf(transitionState.currentScene)
is ObservableTransitionState.Transition ->
- setOf(
- transitionState.fromContent,
- transitionState.toContent,
- )
+ setOf(transitionState.fromContent, transitionState.toContent)
}
val isOnLockscreen = renderedScenes.contains(Scenes.Lockscreen)
val isAlternateBouncerVisible = alternateBouncerInteractor.isVisibleState()
@@ -416,7 +418,20 @@
" didn't need to be left open"
} else {
val prevScene = previousScene.value
- (prevScene ?: Scenes.Gone) to
+ val targetScene = prevScene ?: Scenes.Gone
+ if (targetScene != Scenes.Gone) {
+ sceneBackInteractor.updateBackStack { stack ->
+ val list = stack.asIterable().toMutableList()
+ check(list.last() == Scenes.Lockscreen) {
+ "The bottommost/last SceneKey of the back stack isn't" +
+ " the Lockscreen scene like expected. The back" +
+ " stack is $stack."
+ }
+ list[list.size - 1] = Scenes.Gone
+ sceneStackOf(*list.toTypedArray())
+ }
+ }
+ targetScene to
"device was unlocked with primary bouncer showing," +
" from sceneKey=$prevScene"
}
@@ -444,10 +459,7 @@
}
}
.collect { (targetSceneKey, loggingReason) ->
- switchToScene(
- targetSceneKey = targetSceneKey,
- loggingReason = loggingReason,
- )
+ switchToScene(targetSceneKey = targetSceneKey, loggingReason = loggingReason)
}
}
}
@@ -541,9 +553,16 @@
deviceEntryHapticsInteractor.playSuccessHaptic
.sample(sceneInteractor.currentScene)
.collect { currentScene ->
- vibratorHelper.vibrateAuthSuccess(
- "$TAG, $currentScene device-entry::success"
- )
+ if (Flags.msdlFeedback()) {
+ msdlPlayer.playToken(
+ MSDLToken.UNLOCK,
+ authInteractionProperties,
+ )
+ } else {
+ vibratorHelper.vibrateAuthSuccess(
+ "$TAG, $currentScene device-entry::success"
+ )
+ }
}
}
@@ -551,9 +570,16 @@
deviceEntryHapticsInteractor.playErrorHaptic
.sample(sceneInteractor.currentScene)
.collect { currentScene ->
- vibratorHelper.vibrateAuthError(
- "$TAG, $currentScene device-entry::error"
- )
+ if (Flags.msdlFeedback()) {
+ msdlPlayer.playToken(
+ MSDLToken.FAILURE,
+ authInteractionProperties,
+ )
+ } else {
+ vibratorHelper.vibrateAuthError(
+ "$TAG, $currentScene device-entry::error"
+ )
+ }
}
}
}
@@ -697,7 +723,6 @@
Scenes.Lockscreen -> true
Scenes.Bouncer -> false
Scenes.Shade -> false
- Scenes.NotificationsShade -> false
else -> null
}
}
@@ -791,7 +816,7 @@
private fun switchToScene(
targetSceneKey: SceneKey,
loggingReason: String,
- sceneState: Any? = null
+ sceneState: Any? = null,
) {
sceneInteractor.changeScene(
toScene = targetSceneKey,
@@ -810,10 +835,9 @@
private fun notifyKeyguardDismissCancelledCallbacks() {
applicationScope.launch {
- combine(
- deviceEntryInteractor.isUnlocked,
- sceneInteractor.currentScene.pairwise(),
- ) { isUnlocked, (from, to) ->
+ combine(deviceEntryInteractor.isUnlocked, sceneInteractor.currentScene.pairwise()) {
+ isUnlocked,
+ (from, to) ->
when {
from != Scenes.Bouncer -> false
to != Scenes.Gone && !isUnlocked -> true
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/ScrimStartable.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/ScrimStartable.kt
index d1629c7..e352bfe 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/ScrimStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/ScrimStartable.kt
@@ -19,7 +19,9 @@
package com.android.systemui.scene.domain.startable
import androidx.annotation.VisibleForTesting
+import com.android.compose.animation.scene.ContentKey
import com.android.compose.animation.scene.ObservableTransitionState
+import com.android.compose.animation.scene.OverlayKey
import com.android.compose.animation.scene.SceneKey
import com.android.systemui.CoreStartable
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
@@ -33,6 +35,7 @@
import com.android.systemui.scene.domain.interactor.SceneContainerOcclusionInteractor
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.flag.SceneContainerFlag
+import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.settings.brightness.domain.interactor.BrightnessMirrorShowingInteractor
import com.android.systemui.statusbar.phone.DozeServiceHost
@@ -74,6 +77,7 @@
deviceEntryInteractor.isDeviceEntered,
occlusionInteractor.invisibleDueToOcclusion,
sceneInteractor.currentScene,
+ sceneInteractor.currentOverlays,
sceneInteractor.transitionState,
keyguardInteractor.isDozing,
keyguardInteractor.isDreaming,
@@ -95,34 +99,29 @@
val isDeviceEntered = flowValues[0] as Boolean
val isOccluded = flowValues[1] as Boolean
val currentScene = flowValues[2] as SceneKey
- val transitionState = flowValues[3] as ObservableTransitionState
- val isDozing = flowValues[4] as Boolean
- val isDreaming = flowValues[5] as Boolean
- val biometricUnlockState = flowValues[6] as BiometricUnlockModel
- val isBrightnessMirrorVisible = flowValues[7] as Boolean
- val isPulsing = flowValues[8] as Boolean
- val hasPendingScreenOffCallback = flowValues[9] as Boolean
+ val currentOverlays = flowValues[3] as Set<OverlayKey>
+ val transitionState = flowValues[4] as ObservableTransitionState
+ val isDozing = flowValues[5] as Boolean
+ val isDreaming = flowValues[6] as Boolean
+ val biometricUnlockState = flowValues[7] as BiometricUnlockModel
+ val isBrightnessMirrorVisible = flowValues[8] as Boolean
+ val isPulsing = flowValues[9] as Boolean
+ val hasPendingScreenOffCallback = flowValues[10] as Boolean
// This is true when the lockscreen scene is either the current scene or somewhere
- // in the
- // navigation back stack of scenes.
+ // in the navigation back stack of scenes.
val isOnKeyguard = !isDeviceEntered
val isCurrentSceneBouncer = currentScene == Scenes.Bouncer
// This is true when moving away from one of the keyguard scenes to the gone scene.
- // It
- // happens only when unlocking or when dismissing a dismissible lockscreen.
+ // It happens only when unlocking or when dismissing a dismissible lockscreen.
val isTransitioningAwayFromKeyguard =
transitionState is ObservableTransitionState.Transition.ChangeScene &&
transitionState.fromScene.isKeyguard() &&
transitionState.toScene == Scenes.Gone
- // This is true when any of the shade scenes is the current scene.
- val isCurrentSceneShade = currentScene.isShade()
- // This is true when moving into one of the shade scenes when a non-shade scene.
- val isTransitioningToShade =
- transitionState is ObservableTransitionState.Transition.ChangeScene &&
- !transitionState.fromScene.isShade() &&
- transitionState.toScene.isShade()
+ // This is true when any of the shade scenes or overlays is the current content.
+ val isCurrentContentShade =
+ currentScene.isShade() || currentOverlays.any { it.isShade() }
// This is true after completing a transition to communal.
val isIdleOnCommunal = transitionState.isIdle(Scenes.Communal)
@@ -137,10 +136,10 @@
if (alternateBouncerInteractor.isVisibleState()) {
// This will cancel the keyguardFadingAway animation if it is running. We need
- // to do
- // this as otherwise it can remain pending and leave keyguard in a weird state.
+ // to do this as otherwise it can remain pending and leave keyguard in a weird
+ // state.
onKeyguardFadedAway(isTransitioningAwayFromKeyguard)
- if (!isTransitioningToShade) {
+ if (!transitionState.isTransitioningToShade()) {
// Safeguard which prevents the scrim from being stuck in the wrong
// state
Model(scrimState = ScrimState.KEYGUARD, unlocking = unlocking)
@@ -163,7 +162,7 @@
)
} else if (isBrightnessMirrorVisible) {
Model(scrimState = ScrimState.BRIGHTNESS_MIRROR, unlocking = unlocking)
- } else if (isCurrentSceneShade && !isDeviceEntered) {
+ } else if (isCurrentContentShade && !isDeviceEntered) {
Model(scrimState = ScrimState.SHADE_LOCKED, unlocking = unlocking)
} else if (isPulsing) {
Model(scrimState = ScrimState.PULSING, unlocking = unlocking)
@@ -171,8 +170,8 @@
Model(scrimState = ScrimState.OFF, unlocking = unlocking)
} else if (isDozing && !unlocking) {
// This will cancel the keyguardFadingAway animation if it is running. We need
- // to do
- // this as otherwise it can remain pending and leave keyguard in a weird state.
+ // to do this as otherwise it can remain pending and leave keyguard in a weird
+ // state.
onKeyguardFadedAway(isTransitioningAwayFromKeyguard)
Model(scrimState = ScrimState.AOD, unlocking = false)
} else if (isIdleOnCommunal) {
@@ -222,15 +221,24 @@
return this == Scenes.Lockscreen || this == Scenes.Bouncer
}
- private fun SceneKey.isShade(): Boolean {
+ private fun ContentKey.isShade(): Boolean {
return this == Scenes.Shade ||
this == Scenes.QuickSettings ||
- this == Scenes.NotificationsShade ||
- this == Scenes.QuickSettingsShade
+ this == Overlays.NotificationsShade ||
+ this == Overlays.QuickSettingsShade
}
- private data class Model(
- val scrimState: ScrimState,
- val unlocking: Boolean,
- )
+ private fun ObservableTransitionState.isTransitioningToShade(): Boolean {
+ return when (this) {
+ is ObservableTransitionState.Idle -> false
+ is ObservableTransitionState.Transition.ChangeScene ->
+ !fromScene.isShade() && toScene.isShade()
+ is ObservableTransitionState.Transition.ReplaceOverlay ->
+ !fromOverlay.isShade() && toOverlay.isShade()
+ is ObservableTransitionState.Transition.ShowOrHideOverlay ->
+ !fromContent.isShade() && toContent.isShade()
+ }
+ }
+
+ private data class Model(val scrimState: ScrimState, val unlocking: Boolean)
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModel.kt
index ea4122a..7bf2b63 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/GoneUserActionsViewModel.kt
@@ -19,52 +19,49 @@
import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.Swipe
import com.android.compose.animation.scene.SwipeDirection
+import com.android.compose.animation.scene.TransitionKey
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
-import com.android.systemui.scene.shared.model.SceneFamilies
+import com.android.systemui.scene.shared.model.Overlays
+import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.TransitionKeys.ToSplitShade
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
-import kotlinx.coroutines.flow.map
class GoneUserActionsViewModel
@AssistedInject
-constructor(
- private val shadeInteractor: ShadeInteractor,
-) : UserActionsViewModel() {
+constructor(private val shadeInteractor: ShadeInteractor) : UserActionsViewModel() {
override suspend fun hydrateActions(setActions: (Map<UserAction, UserActionResult>) -> Unit) {
- shadeInteractor.shadeMode
- .map { shadeMode ->
- buildMap<UserAction, UserActionResult> {
- if (
- shadeMode is ShadeMode.Single ||
- // TODO(b/338577208): Remove this once we add Dual Shade invocation
- // zones.
- shadeMode is ShadeMode.Dual
- ) {
- put(
- Swipe(
- pointerCount = 2,
- fromSource = Edge.Top,
- direction = SwipeDirection.Down,
- ),
- UserActionResult(SceneFamilies.QuickSettings)
- )
- }
-
- put(
- Swipe.Down,
- UserActionResult(
- SceneFamilies.NotifShade,
- ToSplitShade.takeIf { shadeMode is ShadeMode.Split }
- )
- )
+ shadeInteractor.shadeMode.collect { shadeMode ->
+ setActions(
+ when (shadeMode) {
+ ShadeMode.Single -> fullscreenShadeActions()
+ ShadeMode.Split -> fullscreenShadeActions(transitionKey = ToSplitShade)
+ ShadeMode.Dual -> dualShadeActions()
}
- }
- .collect { setActions(it) }
+ )
+ }
+ }
+
+ private fun fullscreenShadeActions(
+ transitionKey: TransitionKey? = null
+ ): Map<UserAction, UserActionResult> {
+ return mapOf(
+ Swipe.Down to UserActionResult(Scenes.Shade, transitionKey),
+ Swipe(direction = SwipeDirection.Down, pointerCount = 2, fromSource = Edge.Top) to
+ UserActionResult(Scenes.Shade, transitionKey),
+ )
+ }
+
+ private fun dualShadeActions(): Map<UserAction, UserActionResult> {
+ return mapOf(
+ Swipe.Down to Overlays.NotificationsShade,
+ Swipe(direction = SwipeDirection.Down, fromSource = SceneContainerEdge.TopRight) to
+ Overlays.QuickSettingsShade,
+ )
}
@AssistedFactory
diff --git a/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt
index 4c6341b..c451704 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt
@@ -19,9 +19,11 @@
import android.view.MotionEvent
import androidx.compose.runtime.getValue
import com.android.compose.animation.scene.ContentKey
+import com.android.compose.animation.scene.DefaultEdgeDetector
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.compose.animation.scene.OverlayKey
import com.android.compose.animation.scene.SceneKey
+import com.android.compose.animation.scene.SwipeSourceDetector
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
import com.android.systemui.classifier.Classifier
@@ -33,12 +35,15 @@
import com.android.systemui.scene.shared.logger.SceneLogger
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.ui.composable.Overlay
+import com.android.systemui.shade.domain.interactor.ShadeInteractor
+import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.map
/** Models UI state for the scene container. */
class SceneContainerViewModel
@@ -47,6 +52,8 @@
private val sceneInteractor: SceneInteractor,
private val falsingInteractor: FalsingInteractor,
private val powerInteractor: PowerInteractor,
+ private val shadeInteractor: ShadeInteractor,
+ private val splitEdgeDetector: SplitEdgeDetector,
private val logger: SceneLogger,
@Assisted private val motionEventHandlerReceiver: (MotionEventHandler?) -> Unit,
) : ExclusiveActivatable() {
@@ -59,6 +66,20 @@
/** Whether the container is visible. */
val isVisible: Boolean by hydrator.hydratedStateOf("isVisible", sceneInteractor.isVisible)
+ /**
+ * The [SwipeSourceDetector] to use for defining which edges of the screen can be defined in the
+ * [UserAction]s for this container.
+ */
+ val edgeDetector: SwipeSourceDetector by
+ hydrator.hydratedStateOf(
+ traceName = "edgeDetector",
+ initialValue = DefaultEdgeDetector,
+ source =
+ shadeInteractor.shadeMode.map {
+ if (it is ShadeMode.Dual) splitEdgeDetector else DefaultEdgeDetector
+ },
+ )
+
override suspend fun onActivated(): Nothing {
try {
// Sends a MotionEventHandler to the owner of the view-model so they can report
@@ -142,10 +163,8 @@
when (toScene) {
Scenes.Bouncer -> Classifier.BOUNCER_UNLOCK
Scenes.Gone -> Classifier.UNLOCK
- Scenes.NotificationsShade -> Classifier.NOTIFICATION_DRAG_DOWN
Scenes.Shade -> Classifier.NOTIFICATION_DRAG_DOWN
Scenes.QuickSettings -> Classifier.QUICK_SETTINGS
- Scenes.QuickSettingsShade -> Classifier.QUICK_SETTINGS
else -> null
}
@@ -179,7 +198,7 @@
* resolution target.
*/
fun resolveSceneFamilies(
- actionResultMap: Map<UserAction, UserActionResult>,
+ actionResultMap: Map<UserAction, UserActionResult>
): Map<UserAction, UserActionResult> {
return actionResultMap.mapValues { (_, actionResult) ->
when (actionResult) {
@@ -238,7 +257,7 @@
@AssistedFactory
interface Factory {
fun create(
- motionEventHandlerReceiver: (MotionEventHandler?) -> Unit,
+ motionEventHandlerReceiver: (MotionEventHandler?) -> Unit
): SceneContainerViewModel
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetector.kt b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetector.kt
new file mode 100644
index 0000000..f88bcb5
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetector.kt
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.scene.ui.viewmodel
+
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.IntOffset
+import androidx.compose.ui.unit.IntSize
+import androidx.compose.ui.unit.LayoutDirection
+import com.android.compose.animation.scene.Edge
+import com.android.compose.animation.scene.FixedSizeEdgeDetector
+import com.android.compose.animation.scene.SwipeSource
+import com.android.compose.animation.scene.SwipeSourceDetector
+
+/**
+ * The edge of a [SceneContainer]. It differs from a standard [Edge] by splitting the top edge into
+ * top-left and top-right.
+ */
+enum class SceneContainerEdge(private val resolveEdge: (LayoutDirection) -> Resolved) :
+ SwipeSource {
+ TopLeft(resolveEdge = { Resolved.TopLeft }),
+ TopRight(resolveEdge = { Resolved.TopRight }),
+ TopStart(
+ resolveEdge = { if (it == LayoutDirection.Ltr) Resolved.TopLeft else Resolved.TopRight }
+ ),
+ TopEnd(
+ resolveEdge = { if (it == LayoutDirection.Ltr) Resolved.TopRight else Resolved.TopLeft }
+ ),
+ Bottom(resolveEdge = { Resolved.Bottom }),
+ Left(resolveEdge = { Resolved.Left }),
+ Right(resolveEdge = { Resolved.Right }),
+ Start(resolveEdge = { if (it == LayoutDirection.Ltr) Resolved.Left else Resolved.Right }),
+ End(resolveEdge = { if (it == LayoutDirection.Ltr) Resolved.Right else Resolved.Left });
+
+ override fun resolve(layoutDirection: LayoutDirection): Resolved {
+ return resolveEdge(layoutDirection)
+ }
+
+ enum class Resolved : SwipeSource.Resolved {
+ TopLeft,
+ TopRight,
+ Bottom,
+ Left,
+ Right,
+ }
+}
+
+/**
+ * A [SwipeSourceDetector] that detects edges similarly to [FixedSizeEdgeDetector], except that the
+ * top edge is split in two: top-left and top-right. The split point between the two is dynamic and
+ * may change during runtime.
+ *
+ * Callers who need to detect the start and end edges based on the layout direction (LTR vs RTL)
+ * should subscribe to [SceneContainerEdge.TopStart] and [SceneContainerEdge.TopEnd] instead. These
+ * will be resolved at runtime to [SceneContainerEdge.Resolved.TopLeft] and
+ * [SceneContainerEdge.Resolved.TopRight] appropriately. Similarly, [SceneContainerEdge.Start] and
+ * [SceneContainerEdge.End] will be resolved appropriately to [SceneContainerEdge.Resolved.Left] and
+ * [SceneContainerEdge.Resolved.Right].
+ *
+ * @param topEdgeSplitFraction A function which returns the fraction between [0..1] (i.e.,
+ * percentage) of screen width to consider the split point between "top-left" and "top-right"
+ * edges. It is called on each source detection event.
+ * @param edgeSize The fixed size of each edge.
+ */
+class SplitEdgeDetector(
+ val topEdgeSplitFraction: () -> Float,
+ val edgeSize: Dp,
+) : SwipeSourceDetector {
+
+ private val fixedEdgeDetector = FixedSizeEdgeDetector(edgeSize)
+
+ override fun source(
+ layoutSize: IntSize,
+ position: IntOffset,
+ density: Density,
+ orientation: Orientation,
+ ): SceneContainerEdge.Resolved? {
+ val fixedEdge =
+ fixedEdgeDetector.source(
+ layoutSize,
+ position,
+ density,
+ orientation,
+ )
+ return when (fixedEdge) {
+ Edge.Resolved.Top -> {
+ val topEdgeSplitFraction = topEdgeSplitFraction()
+ require(topEdgeSplitFraction in 0f..1f) {
+ "topEdgeSplitFraction must return a value between 0.0 and 1.0"
+ }
+ val isLeftSide = position.x < layoutSize.width * topEdgeSplitFraction
+ if (isLeftSide) SceneContainerEdge.Resolved.TopLeft
+ else SceneContainerEdge.Resolved.TopRight
+ }
+ Edge.Resolved.Left -> SceneContainerEdge.Resolved.Left
+ Edge.Resolved.Bottom -> SceneContainerEdge.Resolved.Bottom
+ Edge.Resolved.Right -> SceneContainerEdge.Resolved.Right
+ null -> null
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordModule.kt b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordModule.kt
index a830e1b..9a9c576 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordModule.kt
@@ -21,6 +21,7 @@
import com.android.systemui.log.LogBufferFactory
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.ScreenRecordTile
import com.android.systemui.qs.tiles.base.interactor.QSTileAvailabilityInteractor
@@ -74,6 +75,7 @@
labelRes = R.string.quick_settings_screen_record_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.DISPLAY,
)
/** Inject ScreenRecord Tile into tileViewModelMap in QSModule */
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/LegacyScreenshotController.java b/packages/SystemUI/src/com/android/systemui/screenshot/LegacyScreenshotController.java
index a77375c..f69b0cb 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/LegacyScreenshotController.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/LegacyScreenshotController.java
@@ -19,7 +19,6 @@
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.view.WindowManager.LayoutParams.TYPE_SCREENSHOT;
-import static com.android.systemui.Flags.screenshotSaveImageExporter;
import static com.android.systemui.screenshot.LogConfig.DEBUG_ANIM;
import static com.android.systemui.screenshot.LogConfig.DEBUG_CALLBACK;
import static com.android.systemui.screenshot.LogConfig.DEBUG_INPUT;
@@ -133,7 +132,6 @@
private final MessageContainerController mMessageContainerController;
private final AnnouncementResolver mAnnouncementResolver;
private Bitmap mScreenBitmap;
- private SaveImageInBackgroundTask mSaveInBgTask;
private boolean mScreenshotTakenInPortrait;
private boolean mAttachRequested;
private boolean mDetachRequested;
@@ -393,10 +391,6 @@
// Any cleanup needed when the service is being destroyed.
@Override
public void onDestroy() {
- if (mSaveInBgTask != null) {
- // just log success/failure for the pre-existing screenshot
- mSaveInBgTask.setActionsReadyListener(this::logSuccessOnActionsReady);
- }
removeWindow();
releaseMediaPlayer();
releaseContext();
@@ -598,36 +592,12 @@
// Play the shutter sound to notify that we've taken a screenshot
playCameraSoundIfNeeded();
- if (screenshotSaveImageExporter()) {
- saveScreenshotInBackground(screenshot, UUID.randomUUID(), finisher, result -> {
- if (result.uri != null) {
- mScreenshotHandler.post(() -> Toast.makeText(mContext,
- R.string.screenshot_saved_title, Toast.LENGTH_SHORT).show());
- }
- });
- } else {
- saveScreenshotInWorkerThread(
- screenshot.getUserHandle(),
- /* onComplete */ finisher,
- /* actionsReadyListener */ imageData -> {
- if (DEBUG_CALLBACK) {
- Log.d(TAG,
- "returning URI to finisher (Consumer<URI>): " + imageData.uri);
- }
- finisher.accept(imageData.uri);
- if (imageData.uri == null) {
- mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_NOT_SAVED, 0,
- mPackageName);
- mNotificationsController.notifyScreenshotError(
- R.string.screenshot_failed_to_save_text);
- } else {
- mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SAVED, 0, mPackageName);
- mScreenshotHandler.post(() -> Toast.makeText(mContext,
- R.string.screenshot_saved_title, Toast.LENGTH_SHORT).show());
- }
- },
- null);
- }
+ saveScreenshotInBackground(screenshot, UUID.randomUUID(), finisher, result -> {
+ if (result.uri != null) {
+ mScreenshotHandler.post(() -> Toast.makeText(mContext,
+ R.string.screenshot_saved_title, Toast.LENGTH_SHORT).show());
+ }
+ });
}
/**
@@ -700,35 +670,6 @@
}
/**
- * Creates a new worker thread and saves the screenshot to the media store.
- */
- private void saveScreenshotInWorkerThread(
- UserHandle owner,
- @NonNull Consumer<Uri> finisher,
- @Nullable SaveImageInBackgroundTask.ActionsReadyListener actionsReadyListener,
- @Nullable SaveImageInBackgroundTask.QuickShareActionReadyListener
- quickShareActionsReadyListener) {
- SaveImageInBackgroundTask.SaveImageInBackgroundData
- data = new SaveImageInBackgroundTask.SaveImageInBackgroundData();
- data.image = mScreenBitmap;
- data.finisher = finisher;
- data.mActionsReadyListener = actionsReadyListener;
- data.mQuickShareActionsReadyListener = quickShareActionsReadyListener;
- data.owner = owner;
- data.displayId = mDisplay.getDisplayId();
-
- if (mSaveInBgTask != null) {
- // just log success/failure for the pre-existing screenshot
- mSaveInBgTask.setActionsReadyListener(this::logSuccessOnActionsReady);
- }
-
- mSaveInBgTask = new SaveImageInBackgroundTask(mContext, mFlags, mImageExporter,
- mScreenshotSmartActions, data,
- mScreenshotNotificationSmartActionsProvider);
- mSaveInBgTask.execute();
- }
-
- /**
* Logs success/failure of the screenshot saving task, and shows an error if it failed.
*/
private void logScreenshotResultStatus(Uri uri, UserHandle owner) {
@@ -745,13 +686,6 @@
}
}
- /**
- * Logs success/failure of the screenshot saving task, and shows an error if it failed.
- */
- private void logSuccessOnActionsReady(SaveImageInBackgroundTask.SavedImageData imageData) {
- logScreenshotResultStatus(imageData.uri, imageData.owner);
- }
-
private boolean isUserSetupComplete(UserHandle owner) {
return Settings.Secure.getInt(mContext.createContextAsUser(owner, 0)
.getContentResolver(), SETTINGS_SECURE_USER_SETUP_COMPLETE, 0) == 1;
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java b/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
deleted file mode 100644
index 9bc3bd8..0000000
--- a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.screenshot;
-
-import static com.android.systemui.screenshot.LogConfig.DEBUG_CALLBACK;
-import static com.android.systemui.screenshot.LogConfig.DEBUG_STORAGE;
-import static com.android.systemui.screenshot.LogConfig.logTag;
-import static com.android.systemui.screenshot.ScreenshotNotificationSmartActionsProvider.ScreenshotSmartActionType;
-
-import android.app.Notification;
-import android.app.PendingIntent;
-import android.content.ClipData;
-import android.content.ClipDescription;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.os.AsyncTask;
-import android.os.Bundle;
-import android.os.Process;
-import android.os.UserHandle;
-import android.provider.DeviceConfig;
-import android.util.Log;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
-import com.android.systemui.flags.FeatureFlags;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Random;
-import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
-import java.util.function.Consumer;
-
-/**
- * An AsyncTask that saves an image to the media store in the background.
- */
-class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
- private static final String TAG = logTag(SaveImageInBackgroundTask.class);
-
- private static final String SCREENSHOT_ID_TEMPLATE = "Screenshot_%s";
- private static final String SCREENSHOT_SHARE_SUBJECT_TEMPLATE = "Screenshot (%s)";
-
- /**
- * POD used in the AsyncTask which saves an image in the background.
- */
- static class SaveImageInBackgroundData {
- public Bitmap image;
- public Consumer<Uri> finisher;
- public ActionsReadyListener mActionsReadyListener;
- public QuickShareActionReadyListener mQuickShareActionsReadyListener;
- public UserHandle owner;
- public int displayId;
-
- void clearImage() {
- image = null;
- }
- }
-
- /**
- * Structure returned by the SaveImageInBackgroundTask
- */
- public static class SavedImageData {
- public Uri uri;
- public List<Notification.Action> smartActions;
- public Notification.Action quickShareAction;
- public UserHandle owner;
- public String subject; // Title for sharing
- public Long imageTime; // Time at which screenshot was saved
-
- /**
- * Used to reset the return data on error
- */
- public void reset() {
- uri = null;
- smartActions = null;
- quickShareAction = null;
- subject = null;
- imageTime = null;
- }
- }
-
- /**
- * Structure returned by the QueryQuickShareInBackgroundTask
- */
- static class QuickShareData {
- public Notification.Action quickShareAction;
-
- /**
- * Used to reset the return data on error
- */
- public void reset() {
- quickShareAction = null;
- }
- }
-
- interface ActionsReadyListener {
- void onActionsReady(SavedImageData imageData);
- }
-
- interface QuickShareActionReadyListener {
- void onActionsReady(QuickShareData quickShareData);
- }
-
- private final Context mContext;
- private FeatureFlags mFlags;
- private final ScreenshotSmartActions mScreenshotSmartActions;
- private final SaveImageInBackgroundData mParams;
- private final SavedImageData mImageData;
- private final QuickShareData mQuickShareData;
-
- private final ScreenshotNotificationSmartActionsProvider mSmartActionsProvider;
- private String mScreenshotId;
- private final Random mRandom = new Random();
- private final ImageExporter mImageExporter;
- private long mImageTime;
-
- SaveImageInBackgroundTask(
- Context context,
- FeatureFlags flags,
- ImageExporter exporter,
- ScreenshotSmartActions screenshotSmartActions,
- SaveImageInBackgroundData data,
- ScreenshotNotificationSmartActionsProvider
- screenshotNotificationSmartActionsProvider
- ) {
- mContext = context;
- mFlags = flags;
- mScreenshotSmartActions = screenshotSmartActions;
- mImageData = new SavedImageData();
- mQuickShareData = new QuickShareData();
- mImageExporter = exporter;
-
- // Prepare all the output metadata
- mParams = data;
-
- // Initialize screenshot notification smart actions provider.
- mSmartActionsProvider = screenshotNotificationSmartActionsProvider;
- }
-
- @Override
- protected Void doInBackground(Void... paramsUnused) {
- if (isCancelled()) {
- if (DEBUG_STORAGE) {
- Log.d(TAG, "cancelled! returning null");
- }
- return null;
- }
- // TODO: move to constructor / from ScreenshotRequest
- final UUID requestId = UUID.randomUUID();
-
- Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
-
- Bitmap image = mParams.image;
- mScreenshotId = String.format(SCREENSHOT_ID_TEMPLATE, requestId);
-
- boolean savingToOtherUser = mParams.owner != Process.myUserHandle();
- // Smart actions don't yet work for cross-user saves.
- boolean smartActionsEnabled = !savingToOtherUser
- && DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
- SystemUiDeviceConfigFlags.ENABLE_SCREENSHOT_NOTIFICATION_SMART_ACTIONS,
- true);
- try {
- if (smartActionsEnabled && mParams.mQuickShareActionsReadyListener != null) {
- // Since Quick Share target recommendation does not rely on image URL, it is
- // queried and surfaced before image compress/export. Action intent would not be
- // used, because it does not contain image URL.
- Notification.Action quickShare =
- queryQuickShareAction(mScreenshotId, image, mParams.owner, null);
- if (quickShare != null) {
- mQuickShareData.quickShareAction = quickShare;
- mParams.mQuickShareActionsReadyListener.onActionsReady(mQuickShareData);
- }
- }
-
- // Call synchronously here since already on a background thread.
- ListenableFuture<ImageExporter.Result> future =
- mImageExporter.export(Runnable::run, requestId, image, mParams.owner,
- mParams.displayId);
- ImageExporter.Result result = future.get();
- Log.d(TAG, "Saved screenshot: " + result);
- final Uri uri = result.uri;
- mImageTime = result.timestamp;
-
- CompletableFuture<List<Notification.Action>> smartActionsFuture =
- mScreenshotSmartActions.getSmartActionsFuture(
- mScreenshotId, uri, image, mSmartActionsProvider,
- ScreenshotSmartActionType.REGULAR_SMART_ACTIONS,
- smartActionsEnabled, mParams.owner);
- List<Notification.Action> smartActions = new ArrayList<>();
- if (smartActionsEnabled) {
- int timeoutMs = DeviceConfig.getInt(
- DeviceConfig.NAMESPACE_SYSTEMUI,
- SystemUiDeviceConfigFlags.SCREENSHOT_NOTIFICATION_SMART_ACTIONS_TIMEOUT_MS,
- 1000);
- smartActions.addAll(buildSmartActions(
- mScreenshotSmartActions.getSmartActions(
- mScreenshotId, smartActionsFuture, timeoutMs,
- mSmartActionsProvider,
- ScreenshotSmartActionType.REGULAR_SMART_ACTIONS),
- mContext));
- }
-
- mImageData.uri = uri;
- mImageData.owner = mParams.owner;
- mImageData.smartActions = smartActions;
- mImageData.quickShareAction = createQuickShareAction(
- mQuickShareData.quickShareAction, mScreenshotId, uri, mImageTime, image,
- mParams.owner);
- mImageData.subject = getSubjectString(mImageTime);
- mImageData.imageTime = mImageTime;
-
- mParams.mActionsReadyListener.onActionsReady(mImageData);
- if (DEBUG_CALLBACK) {
- Log.d(TAG, "finished background processing, Calling (Consumer<Uri>) "
- + "finisher.accept(\"" + mImageData.uri + "\"");
- }
- mParams.finisher.accept(mImageData.uri);
- mParams.image = null;
- } catch (Exception e) {
- // IOException/UnsupportedOperationException may be thrown if external storage is
- // not mounted
- Log.d(TAG, "Failed to store screenshot", e);
- mParams.clearImage();
- mImageData.reset();
- mQuickShareData.reset();
- mParams.mActionsReadyListener.onActionsReady(mImageData);
- if (DEBUG_CALLBACK) {
- Log.d(TAG, "Calling (Consumer<Uri>) finisher.accept(null)");
- }
- mParams.finisher.accept(null);
- }
-
- return null;
- }
-
- /**
- * Update the listener run when the saving task completes. Used to avoid showing UI for the
- * first screenshot when a second one is taken.
- */
- void setActionsReadyListener(ActionsReadyListener listener) {
- mParams.mActionsReadyListener = listener;
- }
-
- @Override
- protected void onCancelled(Void params) {
- // If we are cancelled while the task is running in the background, we may get null
- // params. The finisher is expected to always be called back, so just use the baked-in
- // params from the ctor in any case.
- mImageData.reset();
- mQuickShareData.reset();
- mParams.mActionsReadyListener.onActionsReady(mImageData);
- if (DEBUG_CALLBACK) {
- Log.d(TAG, "onCancelled, calling (Consumer<Uri>) finisher.accept(null)");
- }
- mParams.finisher.accept(null);
- mParams.clearImage();
- }
-
- private List<Notification.Action> buildSmartActions(
- List<Notification.Action> actions, Context context) {
- List<Notification.Action> broadcastActions = new ArrayList<>();
- for (Notification.Action action : actions) {
- // Proxy smart actions through {@link SmartActionsReceiver} for logging smart actions.
- Bundle extras = action.getExtras();
- String actionType = extras.getString(
- ScreenshotNotificationSmartActionsProvider.ACTION_TYPE,
- ScreenshotNotificationSmartActionsProvider.DEFAULT_ACTION_TYPE);
- Intent intent = new Intent(context, SmartActionsReceiver.class)
- .putExtra(SmartActionsReceiver.EXTRA_ACTION_INTENT, action.actionIntent)
- .addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
- addIntentExtras(mScreenshotId, intent, actionType, true /* smartActionsEnabled */);
- PendingIntent broadcastIntent = PendingIntent.getBroadcast(context,
- mRandom.nextInt(),
- intent,
- PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
- broadcastActions.add(new Notification.Action.Builder(action.getIcon(), action.title,
- broadcastIntent).setContextual(true).addExtras(extras).build());
- }
- return broadcastActions;
- }
-
- private static void addIntentExtras(String screenshotId, Intent intent, String actionType,
- boolean smartActionsEnabled) {
- intent
- .putExtra(SmartActionsReceiver.EXTRA_ACTION_TYPE, actionType)
- .putExtra(SmartActionsReceiver.EXTRA_ID, screenshotId)
- .putExtra(SmartActionsReceiver.EXTRA_SMART_ACTIONS_ENABLED, smartActionsEnabled);
- }
-
- /**
- * Wrap the quickshare intent and populate the fillin intent with the URI
- */
- @VisibleForTesting
- Notification.Action createQuickShareAction(
- Notification.Action quickShare, String screenshotId, Uri uri, long imageTime,
- Bitmap image, UserHandle user) {
- if (quickShare == null) {
- return null;
- } else if (quickShare.actionIntent.isImmutable()) {
- Notification.Action quickShareWithUri =
- queryQuickShareAction(screenshotId, image, user, uri);
- if (quickShareWithUri == null
- || !quickShareWithUri.title.toString().contentEquals(quickShare.title)) {
- return null;
- }
- quickShare = quickShareWithUri;
- }
-
- Intent wrappedIntent = new Intent(mContext, SmartActionsReceiver.class)
- .putExtra(SmartActionsReceiver.EXTRA_ACTION_INTENT, quickShare.actionIntent)
- .putExtra(SmartActionsReceiver.EXTRA_ACTION_INTENT_FILLIN,
- createFillInIntent(uri, imageTime))
- .addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
- Bundle extras = quickShare.getExtras();
- String actionType = extras.getString(
- ScreenshotNotificationSmartActionsProvider.ACTION_TYPE,
- ScreenshotNotificationSmartActionsProvider.DEFAULT_ACTION_TYPE);
- // We only query for quick share actions when smart actions are enabled, so we can assert
- // that it's true here.
- addIntentExtras(screenshotId, wrappedIntent, actionType, true /* smartActionsEnabled */);
- PendingIntent broadcastIntent =
- PendingIntent.getBroadcast(mContext, mRandom.nextInt(), wrappedIntent,
- PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
- return new Notification.Action.Builder(quickShare.getIcon(), quickShare.title,
- broadcastIntent)
- .setContextual(true)
- .addExtras(extras)
- .build();
- }
-
- private Intent createFillInIntent(Uri uri, long imageTime) {
- Intent fillIn = new Intent();
- fillIn.setType("image/png");
- fillIn.putExtra(Intent.EXTRA_STREAM, uri);
- fillIn.putExtra(Intent.EXTRA_SUBJECT, getSubjectString(imageTime));
- // Include URI in ClipData also, so that grantPermission picks it up.
- // We don't use setData here because some apps interpret this as "to:".
- ClipData clipData = new ClipData(
- new ClipDescription("content", new String[]{"image/png"}),
- new ClipData.Item(uri));
- fillIn.setClipData(clipData);
- fillIn.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- return fillIn;
- }
-
- /**
- * Query and surface Quick Share chip if it is available. Action intent would not be used,
- * because it does not contain image URL which would be populated in {@link
- * #createQuickShareAction(Notification.Action, String, Uri, long, Bitmap, UserHandle)}
- */
-
- @VisibleForTesting
- Notification.Action queryQuickShareAction(
- String screenshotId, Bitmap image, UserHandle user, Uri uri) {
- CompletableFuture<List<Notification.Action>> quickShareActionsFuture =
- mScreenshotSmartActions.getSmartActionsFuture(
- screenshotId, uri, image, mSmartActionsProvider,
- ScreenshotSmartActionType.QUICK_SHARE_ACTION,
- true /* smartActionsEnabled */, user);
- int timeoutMs = DeviceConfig.getInt(
- DeviceConfig.NAMESPACE_SYSTEMUI,
- SystemUiDeviceConfigFlags.SCREENSHOT_NOTIFICATION_QUICK_SHARE_ACTIONS_TIMEOUT_MS,
- 500);
- List<Notification.Action> quickShareActions =
- mScreenshotSmartActions.getSmartActions(
- screenshotId, quickShareActionsFuture, timeoutMs,
- mSmartActionsProvider,
- ScreenshotSmartActionType.QUICK_SHARE_ACTION);
- if (!quickShareActions.isEmpty()) {
- return quickShareActions.get(0);
- }
- return null;
- }
-
- private static String getSubjectString(long imageTime) {
- String subjectDate = DateFormat.getDateTimeInstance().format(new Date(imageTime));
- return String.format(SCREENSHOT_SHARE_SUBJECT_TEMPLATE, subjectDate);
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
index 7b802a2..fe58bc9 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
@@ -18,7 +18,6 @@
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
-import static com.android.systemui.Flags.screenshotSaveImageExporter;
import static com.android.systemui.screenshot.LogConfig.DEBUG_ANIM;
import static com.android.systemui.screenshot.LogConfig.DEBUG_CALLBACK;
import static com.android.systemui.screenshot.LogConfig.DEBUG_INPUT;
@@ -124,7 +123,6 @@
private final MessageContainerController mMessageContainerController;
private final AnnouncementResolver mAnnouncementResolver;
private Bitmap mScreenBitmap;
- private SaveImageInBackgroundTask mSaveInBgTask;
private boolean mScreenshotTakenInPortrait;
private Animator mScreenshotAnimation;
private RequestCallback mCurrentRequestCallback;
@@ -373,10 +371,6 @@
// Any cleanup needed when the service is being destroyed.
@Override
public void onDestroy() {
- if (mSaveInBgTask != null) {
- // just log success/failure for the pre-existing screenshot
- mSaveInBgTask.setActionsReadyListener(this::logSuccessOnActionsReady);
- }
removeWindow();
releaseMediaPlayer();
releaseContext();
@@ -525,36 +519,12 @@
// Play the shutter sound to notify that we've taken a screenshot
playCameraSoundIfNeeded();
- if (screenshotSaveImageExporter()) {
- saveScreenshotInBackground(screenshot, UUID.randomUUID(), finisher, result -> {
- if (result.uri != null) {
- mScreenshotHandler.post(() -> Toast.makeText(mContext,
- R.string.screenshot_saved_title, Toast.LENGTH_SHORT).show());
- }
- });
- } else {
- saveScreenshotInWorkerThread(
- screenshot.getUserHandle(),
- /* onComplete */ finisher,
- /* actionsReadyListener */ imageData -> {
- if (DEBUG_CALLBACK) {
- Log.d(TAG,
- "returning URI to finisher (Consumer<URI>): " + imageData.uri);
- }
- finisher.accept(imageData.uri);
- if (imageData.uri == null) {
- mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_NOT_SAVED, 0,
- mPackageName);
- mNotificationsController.notifyScreenshotError(
- R.string.screenshot_failed_to_save_text);
- } else {
- mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SAVED, 0, mPackageName);
- mScreenshotHandler.post(() -> Toast.makeText(mContext,
- R.string.screenshot_saved_title, Toast.LENGTH_SHORT).show());
- }
- },
- null);
- }
+ saveScreenshotInBackground(screenshot, UUID.randomUUID(), finisher, result -> {
+ if (result.uri != null) {
+ mScreenshotHandler.post(() -> Toast.makeText(mContext,
+ R.string.screenshot_saved_title, Toast.LENGTH_SHORT).show());
+ }
+ });
}
/**
@@ -627,35 +597,6 @@
}
/**
- * Creates a new worker thread and saves the screenshot to the media store.
- */
- private void saveScreenshotInWorkerThread(
- UserHandle owner,
- @NonNull Consumer<Uri> finisher,
- @Nullable SaveImageInBackgroundTask.ActionsReadyListener actionsReadyListener,
- @Nullable SaveImageInBackgroundTask.QuickShareActionReadyListener
- quickShareActionsReadyListener) {
- SaveImageInBackgroundTask.SaveImageInBackgroundData
- data = new SaveImageInBackgroundTask.SaveImageInBackgroundData();
- data.image = mScreenBitmap;
- data.finisher = finisher;
- data.mActionsReadyListener = actionsReadyListener;
- data.mQuickShareActionsReadyListener = quickShareActionsReadyListener;
- data.owner = owner;
- data.displayId = mDisplay.getDisplayId();
-
- if (mSaveInBgTask != null) {
- // just log success/failure for the pre-existing screenshot
- mSaveInBgTask.setActionsReadyListener(this::logSuccessOnActionsReady);
- }
-
- mSaveInBgTask = new SaveImageInBackgroundTask(mContext, mFlags, mImageExporter,
- mScreenshotSmartActions, data,
- mScreenshotNotificationSmartActionsProvider);
- mSaveInBgTask.execute();
- }
-
- /**
* Logs success/failure of the screenshot saving task, and shows an error if it failed.
*/
private void logScreenshotResultStatus(Uri uri, UserHandle owner) {
@@ -672,13 +613,6 @@
}
}
- /**
- * Logs success/failure of the screenshot saving task, and shows an error if it failed.
- */
- private void logSuccessOnActionsReady(SaveImageInBackgroundTask.SavedImageData imageData) {
- logScreenshotResultStatus(imageData.uri, imageData.owner);
- }
-
private boolean isUserSetupComplete(UserHandle owner) {
return Settings.Secure.getInt(mContext.createContextAsUser(owner, 0)
.getContentResolver(), SETTINGS_SECURE_USER_SETUP_COMPLETE, 0) == 1;
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/appclips/AppClipsViewModel.java b/packages/SystemUI/src/com/android/systemui/screenshot/appclips/AppClipsViewModel.java
index 9a38358..4b1504f 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/appclips/AppClipsViewModel.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/appclips/AppClipsViewModel.java
@@ -28,9 +28,9 @@
import android.app.WindowConfiguration;
import android.app.assist.AssistContent;
import android.content.ClipData;
-import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
@@ -249,7 +249,6 @@
.map(taskInfo -> new InternalTaskInfo(taskInfo.topActivityInfo,
taskInfo.taskId, taskInfo.userId,
getPackageManagerForUser(taskInfo.userId)))
- .filter(this::canAppStartThroughLauncher)
.map(this::getBacklinksDataForTaskInfo)
.toList(),
mBgExecutor);
@@ -257,6 +256,17 @@
return Futures.transformAsync(backlinksNestedListFuture, Futures::allAsList, mBgExecutor);
}
+ private PackageManager getPackageManagerForUser(int userId) {
+ // If app clips was launched as the same user, then reuse the available PM from mContext.
+ if (mContext.getUserId() == userId) {
+ return mContext.getPackageManager();
+ }
+
+ // PackageManager required for a different user, create its context and return its PM.
+ UserHandle userHandle = UserHandle.of(userId);
+ return mContext.createContextAsUser(userHandle, /* flags= */ 0).getPackageManager();
+ }
+
/**
* Returns all tasks on a given display after querying {@link IActivityTaskManager} from the
* {@link #mBgExecutor}.
@@ -311,17 +321,6 @@
}
/**
- * Returns whether the app represented by the {@link InternalTaskInfo} can be launched through
- * the all apps tray by a user.
- */
- private boolean canAppStartThroughLauncher(InternalTaskInfo internalTaskInfo) {
- // Use Intent.resolveActivity API to check if the intent resolves as that is what Android
- // uses internally when apps use Context.startActivity.
- return getMainLauncherIntentForTask(internalTaskInfo)
- .resolveActivity(internalTaskInfo.getPackageManager()) != null;
- }
-
- /**
* Returns an {@link InternalBacklinksData} that represents the Backlink data internally, which
* is captured by querying the system using {@link TaskInfo#taskId}.
*/
@@ -390,11 +389,14 @@
internalTaskInfo.getTaskId(),
internalTaskInfo.getTopActivityNameForDebugLogging()));
- String appName = internalTaskInfo.getTopActivityAppName();
- Drawable appIcon = internalTaskInfo.getTopActivityAppIcon();
- ClipData mainLauncherIntent = ClipData.newIntent(appName,
- getMainLauncherIntentForTask(internalTaskInfo));
- InternalBacklinksData fallback = new BacklinksData(mainLauncherIntent, appIcon);
+ String screenshottedAppName = internalTaskInfo.getTopActivityAppName();
+ Drawable screenshottedAppIcon = internalTaskInfo.getTopActivityAppIcon();
+ Intent screenshottedAppMainLauncherIntent = getMainLauncherIntentForTask(
+ internalTaskInfo.getTopActivityPackageName(), internalTaskInfo.getPackageManager());
+ ClipData screenshottedAppMainLauncherClipData =
+ ClipData.newIntent(screenshottedAppName, screenshottedAppMainLauncherIntent);
+ InternalBacklinksData fallback =
+ new BacklinksData(screenshottedAppMainLauncherClipData, screenshottedAppIcon);
if (content == null) {
return fallback;
}
@@ -406,10 +408,14 @@
Uri uri = content.getWebUri();
Intent backlinksIntent = new Intent(ACTION_VIEW).setData(uri);
- if (doesIntentResolveToSameTask(backlinksIntent, internalTaskInfo)) {
+ BacklinkDisplayInfo backlinkDisplayInfo = getInfoThatResolvesIntent(backlinksIntent,
+ internalTaskInfo);
+ if (backlinkDisplayInfo != null) {
DebugLogger.INSTANCE.logcatMessage(this,
() -> "getBacklinksDataFromAssistContent: using app provided uri");
- return new BacklinksData(ClipData.newRawUri(appName, uri), appIcon);
+ return new BacklinksData(
+ ClipData.newRawUri(backlinkDisplayInfo.getDisplayLabel(), uri),
+ backlinkDisplayInfo.getAppIcon());
}
}
@@ -419,10 +425,14 @@
() -> "getBacklinksDataFromAssistContent: app has provided an intent");
Intent backlinksIntent = content.getIntent();
- if (doesIntentResolveToSameTask(backlinksIntent, internalTaskInfo)) {
+ BacklinkDisplayInfo backlinkDisplayInfo = getInfoThatResolvesIntent(backlinksIntent,
+ internalTaskInfo);
+ if (backlinkDisplayInfo != null) {
DebugLogger.INSTANCE.logcatMessage(this,
() -> "getBacklinksDataFromAssistContent: using app provided intent");
- return new BacklinksData(ClipData.newIntent(appName, backlinksIntent), appIcon);
+ return new BacklinksData(
+ ClipData.newIntent(backlinkDisplayInfo.getDisplayLabel(), backlinksIntent),
+ backlinkDisplayInfo.getAppIcon());
}
}
@@ -431,27 +441,76 @@
return fallback;
}
- private boolean doesIntentResolveToSameTask(Intent intentToResolve,
- InternalTaskInfo requiredTaskInfo) {
- PackageManager packageManager = requiredTaskInfo.getPackageManager();
- ComponentName resolvedComponent = intentToResolve.resolveActivity(packageManager);
- if (resolvedComponent == null) {
- return false;
+ /**
+ * Returns {@link BacklinkDisplayInfo} for the app that would resolve the provided backlink
+ * {@link Intent}.
+ *
+ * <p>The method uses the {@link PackageManager} available in the provided
+ * {@link InternalTaskInfo}.
+ *
+ * <p>This method returns {@code null} if Android is not able to resolve the backlink intent or
+ * if the resolved app does not have an icon in the launcher.
+ */
+ @Nullable
+ private BacklinkDisplayInfo getInfoThatResolvesIntent(Intent backlinkIntent,
+ InternalTaskInfo internalTaskInfo) {
+ PackageManager packageManager = internalTaskInfo.getPackageManager();
+
+ // Query for all available activities as there is a chance that multiple apps could resolve
+ // the intent. In such cases the normal `intent.resolveActivity` API returns the activity
+ // resolver info which isn't helpful for further checks. Also, using MATCH_DEFAULT_ONLY flag
+ // is required as that flag will be used when the notes app builds the intent and calls
+ // startActivity with the intent.
+ List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(backlinkIntent,
+ PackageManager.MATCH_DEFAULT_ONLY);
+ if (resolveInfos.isEmpty()) {
+ DebugLogger.INSTANCE.logcatMessage(this,
+ () -> "getInfoThatResolvesIntent: could not resolve backlink intent");
+ return null;
}
- String requiredPackageName = requiredTaskInfo.getTopActivityPackageName();
- return resolvedComponent.getPackageName().equals(requiredPackageName);
+ // Only use the first result as the list is ordered from best match to worst and Android
+ // will also use the best match with `intent.startActivity` API which notes app will use.
+ ActivityInfo activityInfo = resolveInfos.get(0).activityInfo;
+ if (activityInfo == null) {
+ DebugLogger.INSTANCE.logcatMessage(this,
+ () -> "getInfoThatResolvesIntent: could not find activity info for backlink "
+ + "intent");
+ return null;
+ }
+
+ // Ignore resolved backlink app if users cannot start it through all apps tray.
+ if (!canAppStartThroughLauncher(activityInfo.packageName, packageManager)) {
+ DebugLogger.INSTANCE.logcatMessage(this,
+ () -> "getInfoThatResolvesIntent: ignoring resolved backlink app as it cannot"
+ + " start through launcher");
+ return null;
+ }
+
+ Drawable appIcon = InternalBacklinksDataKt.getAppIcon(activityInfo, packageManager);
+ String appName = InternalBacklinksDataKt.getAppName(activityInfo, packageManager);
+ return new BacklinkDisplayInfo(appIcon, appName);
}
- private Intent getMainLauncherIntentForTask(InternalTaskInfo internalTaskInfo) {
- String pkgName = internalTaskInfo.getTopActivityPackageName();
+ /**
+ * Returns whether the app represented by the provided {@code pkgName} can be launched through
+ * the all apps tray by the user.
+ */
+ private static boolean canAppStartThroughLauncher(String pkgName, PackageManager pkgManager) {
+ // Use Intent.resolveActivity API to check if the intent resolves as that is what Android
+ // uses internally when apps use Context.startActivity.
+ return getMainLauncherIntentForTask(pkgName, pkgManager)
+ .resolveActivity(pkgManager) != null;
+ }
+
+ private static Intent getMainLauncherIntentForTask(String pkgName,
+ PackageManager packageManager) {
Intent intent = new Intent(ACTION_MAIN).addCategory(CATEGORY_LAUNCHER).setPackage(pkgName);
// Not all apps use DEFAULT_CATEGORY for their main launcher activity so the exact component
// needs to be queried and set on the Intent in order for note-taking apps to be able to
// start this intent. When starting an activity with an implicit intent, Android adds the
// DEFAULT_CATEGORY flag otherwise it fails to resolve the intent.
- PackageManager packageManager = internalTaskInfo.getPackageManager();
ResolveInfo resolvedActivity = packageManager.resolveActivity(intent, /* flags= */ 0);
if (resolvedActivity != null) {
intent.setComponent(resolvedActivity.getComponentInfo().getComponentName());
@@ -460,17 +519,6 @@
return intent;
}
- private PackageManager getPackageManagerForUser(int userId) {
- // If app clips was launched as the same user, then reuse the available PM from mContext.
- if (mContext.getUserId() == userId) {
- return mContext.getPackageManager();
- }
-
- // PackageManager required for a different user, create its context and return its PM.
- UserHandle userHandle = UserHandle.of(userId);
- return mContext.createContextAsUser(userHandle, /* flags= */ 0).getPackageManager();
- }
-
/** Helper factory to help with injecting {@link AppClipsViewModel}. */
static final class Factory implements ViewModelProvider.Factory {
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/appclips/InternalBacklinksData.kt b/packages/SystemUI/src/com/android/systemui/screenshot/appclips/InternalBacklinksData.kt
index 234692e..f4faa36 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/appclips/InternalBacklinksData.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/appclips/InternalBacklinksData.kt
@@ -27,16 +27,27 @@
* represent error when necessary.
*/
internal sealed class InternalBacklinksData(
- open val appIcon: Drawable,
- open var displayLabel: String
+ // Fields from this object are made accessible through accessors to keep call sites simpler.
+ private val backlinkDisplayInfo: BacklinkDisplayInfo,
) {
- data class BacklinksData(val clipData: ClipData, override val appIcon: Drawable) :
- InternalBacklinksData(appIcon, clipData.description.label.toString())
+ // Use separate field to access display label so that callers don't have to access through
+ // internal object.
+ var displayLabel: String
+ get() = backlinkDisplayInfo.displayLabel
+ set(value) {
+ backlinkDisplayInfo.displayLabel = value
+ }
- data class CrossProfileError(
- override val appIcon: Drawable,
- override var displayLabel: String
- ) : InternalBacklinksData(appIcon, displayLabel)
+ // Use separate field to access app icon so that callers don't have to access through internal
+ // object.
+ val appIcon: Drawable
+ get() = backlinkDisplayInfo.appIcon
+
+ data class BacklinksData(val clipData: ClipData, private val icon: Drawable) :
+ InternalBacklinksData(BacklinkDisplayInfo(icon, clipData.description.label.toString()))
+
+ data class CrossProfileError(private val icon: Drawable, private var label: String) :
+ InternalBacklinksData(BacklinkDisplayInfo(icon, label))
}
/**
@@ -54,11 +65,16 @@
val userId: Int,
val packageManager: PackageManager
) {
- fun getTopActivityNameForDebugLogging(): String = topActivityInfo.name
-
- fun getTopActivityPackageName(): String = topActivityInfo.packageName
-
- fun getTopActivityAppName(): String = topActivityInfo.loadLabel(packageManager).toString()
-
- fun getTopActivityAppIcon(): Drawable = topActivityInfo.loadIcon(packageManager)
+ val topActivityNameForDebugLogging: String = topActivityInfo.name
+ val topActivityPackageName: String = topActivityInfo.packageName
+ val topActivityAppName: String by lazy { topActivityInfo.getAppName(packageManager) }
+ val topActivityAppIcon: Drawable by lazy { topActivityInfo.loadIcon(packageManager) }
}
+
+internal fun ActivityInfo.getAppName(packageManager: PackageManager) =
+ loadLabel(packageManager).toString()
+
+internal fun ActivityInfo.getAppIcon(packageManager: PackageManager) = loadIcon(packageManager)
+
+/** A class to hold data that is used for displaying backlink to user in SysUI activity. */
+internal data class BacklinkDisplayInfo(val appIcon: Drawable, var displayLabel: String)
diff --git a/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt b/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt
index ed590c3..553d1f5 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt
@@ -103,11 +103,8 @@
override val userContentResolver: ContentResolver
get() = userContext.contentResolver
- override val userInfo: UserInfo
- get() {
- val user = userId
- return userProfiles.first { it.id == user }
- }
+ override var userInfo: UserInfo by SynchronizedDelegate(UserInfo(context.userId, "", 0))
+ protected set
/**
* Returns a [List<UserInfo>] of all profiles associated with the current user.
@@ -187,6 +184,7 @@
userHandle = handle
userContext = ctx
userProfiles = profiles.map { UserInfo(it) }
+ userInfo = profiles.first { it.id == user }
}
return ctx to profiles
}
diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderController.java
index 083cee7..75165cb 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderController.java
@@ -16,8 +16,6 @@
package com.android.systemui.settings.brightness;
-import static com.android.systemui.Flags.hapticBrightnessSlider;
-
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
@@ -317,9 +315,7 @@
SeekbarHapticPlugin plugin = new SeekbarHapticPlugin(
mVibratorHelper,
mSystemClock);
- if (hapticBrightnessSlider()) {
- HapticSliderViewBinder.bind(viewRoot, plugin);
- }
+ HapticSliderViewBinder.bind(viewRoot, plugin);
return new BrightnessSliderController(
root, mFalsingManager, mUiEventLogger, plugin, mActivityStarter);
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java
index 830649b..4ed4af6 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java
@@ -42,6 +42,7 @@
import android.util.MathUtils;
import android.view.MotionEvent;
import android.view.VelocityTracker;
+import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.WindowInsets;
@@ -463,6 +464,9 @@
mJavaAdapter.alwaysCollectFlow(
mCommunalTransitionViewModelLazy.get().isUmoOnCommunal(),
this::setShouldUpdateSquishinessOnMedia);
+ mJavaAdapter.alwaysCollectFlow(
+ mShadeInteractor.isAnyExpanded(),
+ this::onAnyExpandedChanged);
}
private void initNotificationStackScrollLayoutController() {
@@ -482,6 +486,10 @@
}
}
+ private void onAnyExpandedChanged(boolean isAnyExpanded) {
+ mQsFrame.setVisibility(isAnyExpanded ? View.VISIBLE : View.INVISIBLE);
+ }
+
private void onNotificationScrolled(int newScrollPosition) {
updateExpansionEnabledAmbient();
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeEmptyImplModule.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeEmptyImplModule.kt
index 7425807..99ff946 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeEmptyImplModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeEmptyImplModule.kt
@@ -28,6 +28,8 @@
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.domain.interactor.ShadeInteractorEmptyImpl
import com.android.systemui.shade.domain.interactor.ShadeLockscreenInteractor
+import com.android.systemui.shade.domain.interactor.ShadeModeInteractor
+import com.android.systemui.shade.domain.interactor.ShadeModeInteractorEmptyImpl
import dagger.Binds
import dagger.Module
@@ -75,4 +77,8 @@
@Binds
@SysUISingleton
abstract fun bindsPrivacyChipRepository(impl: PrivacyChipRepositoryImpl): PrivacyChipRepository
+
+ @Binds
+ @SysUISingleton
+ abstract fun bindShadeModeInteractor(impl: ShadeModeInteractorEmptyImpl): ShadeModeInteractor
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt
index da2024b..2348a11 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt
@@ -41,6 +41,8 @@
import com.android.systemui.shade.domain.interactor.ShadeInteractorSceneContainerImpl
import com.android.systemui.shade.domain.interactor.ShadeLockscreenInteractor
import com.android.systemui.shade.domain.interactor.ShadeLockscreenInteractorImpl
+import com.android.systemui.shade.domain.interactor.ShadeModeInteractor
+import com.android.systemui.shade.domain.interactor.ShadeModeInteractorImpl
import dagger.Binds
import dagger.Module
import dagger.Provides
@@ -54,7 +56,7 @@
@SysUISingleton
fun provideBaseShadeInteractor(
sceneContainerOn: Provider<ShadeInteractorSceneContainerImpl>,
- sceneContainerOff: Provider<ShadeInteractorLegacyImpl>
+ sceneContainerOff: Provider<ShadeInteractorLegacyImpl>,
): BaseShadeInteractor {
return if (SceneContainerFlag.isEnabled) {
sceneContainerOn.get()
@@ -67,7 +69,7 @@
@SysUISingleton
fun provideShadeController(
sceneContainerOn: Provider<ShadeControllerSceneImpl>,
- sceneContainerOff: Provider<ShadeControllerImpl>
+ sceneContainerOff: Provider<ShadeControllerImpl>,
): ShadeController {
return if (SceneContainerFlag.isEnabled) {
sceneContainerOn.get()
@@ -80,7 +82,7 @@
@SysUISingleton
fun provideShadeAnimationInteractor(
sceneContainerOn: Provider<ShadeAnimationInteractorSceneContainerImpl>,
- sceneContainerOff: Provider<ShadeAnimationInteractorLegacyImpl>
+ sceneContainerOff: Provider<ShadeAnimationInteractorLegacyImpl>,
): ShadeAnimationInteractor {
return if (SceneContainerFlag.isEnabled) {
sceneContainerOn.get()
@@ -93,7 +95,7 @@
@SysUISingleton
fun provideShadeBackActionInteractor(
sceneContainerOn: Provider<ShadeBackActionInteractorImpl>,
- sceneContainerOff: Provider<NotificationPanelViewController>
+ sceneContainerOff: Provider<NotificationPanelViewController>,
): ShadeBackActionInteractor {
return if (SceneContainerFlag.isEnabled) {
sceneContainerOn.get()
@@ -106,7 +108,7 @@
@SysUISingleton
fun provideShadeLockscreenInteractor(
sceneContainerOn: Provider<ShadeLockscreenInteractorImpl>,
- sceneContainerOff: Provider<NotificationPanelViewController>
+ sceneContainerOff: Provider<NotificationPanelViewController>,
): ShadeLockscreenInteractor {
return if (SceneContainerFlag.isEnabled) {
sceneContainerOn.get()
@@ -119,7 +121,7 @@
@SysUISingleton
fun providePanelExpansionInteractor(
sceneContainerOn: Provider<PanelExpansionInteractorImpl>,
- sceneContainerOff: Provider<NotificationPanelViewController>
+ sceneContainerOff: Provider<NotificationPanelViewController>,
): PanelExpansionInteractor {
return if (SceneContainerFlag.isEnabled) {
sceneContainerOn.get()
@@ -170,4 +172,8 @@
@Binds
@SysUISingleton
abstract fun bindsPrivacyChipRepository(impl: PrivacyChipRepositoryImpl): PrivacyChipRepository
+
+ @Binds
+ @SysUISingleton
+ abstract fun bindShadeModeInteractor(impl: ShadeModeInteractorImpl): ShadeModeInteractor
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt
index 73e86a2..6fb96da 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt
@@ -16,6 +16,7 @@
package com.android.systemui.shade.domain.interactor
+import androidx.annotation.FloatRange
import com.android.systemui.shade.shared.model.ShadeMode
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
@@ -69,6 +70,20 @@
* wide as the entire screen.
*/
val isShadeLayoutWide: StateFlow<Boolean>
+
+ /**
+ * The fraction between [0..1] (i.e., percentage) of screen width to consider the threshold
+ * between "top-left" and "top-right" for the purposes of dual-shade invocation.
+ *
+ * When the dual-shade is not wide, this always returns 0.5 (the top edge is evenly split). On
+ * wide layouts however, a larger fraction is returned because only the area of the system
+ * status icons is considered top-right.
+ *
+ * Note that this fraction only determines the split between the absolute left and right
+ * directions. In RTL layouts, the "top-start" edge will resolve to "top-right", and "top-end"
+ * will resolve to "top-left".
+ */
+ @FloatRange(from = 0.0, to = 1.0) fun getTopEdgeSplitFraction(): Float
}
/** ShadeInteractor methods with implementations that differ between non-empty impls. */
@@ -130,7 +145,7 @@
fun createAnyExpansionFlow(
scope: CoroutineScope,
shadeExpansion: Flow<Float>,
- qsExpansion: Flow<Float>
+ qsExpansion: Flow<Float>,
): StateFlow<Float> {
return combine(shadeExpansion, qsExpansion) { shadeExp, qsExp -> maxOf(shadeExp, qsExp) }
.stateIn(scope, SharingStarted.Eagerly, 0f)
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt
index d51fd28..6c0b55a 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt
@@ -47,4 +47,6 @@
override val isExpandToQsEnabled: Flow<Boolean> = inactiveFlowBoolean
override val shadeMode: StateFlow<ShadeMode> = MutableStateFlow(ShadeMode.Single)
override val isShadeLayoutWide: StateFlow<Boolean> = inactiveFlowBoolean
+
+ override fun getTopEdgeSplitFraction(): Float = 0.5f
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt
index 3552092..3eab02a 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt
@@ -24,9 +24,6 @@
import com.android.systemui.keyguard.shared.model.Edge
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.power.domain.interactor.PowerInteractor
-import com.android.systemui.shade.data.repository.ShadeRepository
-import com.android.systemui.shade.shared.flag.DualShade
-import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.statusbar.disableflags.data.repository.DisableFlagsRepository
import com.android.systemui.statusbar.phone.DozeParameters
import com.android.systemui.statusbar.policy.data.repository.UserSetupRepository
@@ -54,11 +51,14 @@
keyguardRepository: KeyguardRepository,
keyguardTransitionInteractor: KeyguardTransitionInteractor,
powerInteractor: PowerInteractor,
- private val shadeRepository: ShadeRepository,
userSetupRepository: UserSetupRepository,
userSwitcherInteractor: UserSwitcherInteractor,
private val baseShadeInteractor: BaseShadeInteractor,
-) : ShadeInteractor, BaseShadeInteractor by baseShadeInteractor {
+ shadeModeInteractor: ShadeModeInteractor,
+) :
+ ShadeInteractor,
+ BaseShadeInteractor by baseShadeInteractor,
+ ShadeModeInteractor by shadeModeInteractor {
override val isShadeEnabled: StateFlow<Boolean> =
disableFlagsRepository.disableFlags
.map { it.isShadeEnabled() }
@@ -102,17 +102,6 @@
}
}
- override val isShadeLayoutWide: StateFlow<Boolean> = shadeRepository.isShadeLayoutWide
-
- override val shadeMode: StateFlow<ShadeMode> =
- isShadeLayoutWide
- .map(this::determineShadeMode)
- .stateIn(
- scope,
- SharingStarted.Eagerly,
- initialValue = determineShadeMode(isShadeLayoutWide.value)
- )
-
override val isExpandToQsEnabled: Flow<Boolean> =
combine(
disableFlagsRepository.disableFlags,
@@ -129,12 +118,4 @@
disableFlags.isQuickSettingsEnabled() &&
!isDozing
}
-
- private fun determineShadeMode(isShadeLayoutWide: Boolean): ShadeMode {
- return when {
- DualShade.isEnabled -> ShadeMode.Dual
- isShadeLayoutWide -> ShadeMode.Split
- else -> ShadeMode.Single
- }
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt
new file mode 100644
index 0000000..77ae679
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shade.domain.interactor
+
+import androidx.annotation.FloatRange
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.shade.data.repository.ShadeRepository
+import com.android.systemui.shade.shared.flag.DualShade
+import com.android.systemui.shade.shared.model.ShadeMode
+import javax.inject.Inject
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.flow.stateIn
+
+/**
+ * Defines interface for classes that can provide state and business logic related to the mode of
+ * the shade.
+ */
+interface ShadeModeInteractor {
+
+ /**
+ * The version of the shade layout to use.
+ *
+ * Note: Most likely, you want to read [isShadeLayoutWide] instead of this.
+ */
+ val shadeMode: StateFlow<ShadeMode>
+
+ /**
+ * Whether the shade layout should be wide (true) or narrow (false).
+ *
+ * In a wide layout, notifications and quick settings each take up only half the screen width
+ * (whether they are shown at the same time or not). In a narrow layout, they can each be as
+ * wide as the entire screen.
+ */
+ val isShadeLayoutWide: StateFlow<Boolean>
+
+ /**
+ * The fraction between [0..1] (i.e., percentage) of screen width to consider the threshold
+ * between "top-left" and "top-right" for the purposes of dual-shade invocation.
+ *
+ * When the dual-shade is not wide, this always returns 0.5 (the top edge is evenly split). On
+ * wide layouts however, a larger fraction is returned because only the area of the system
+ * status icons is considered top-right.
+ *
+ * Note that this fraction only determines the split between the absolute left and right
+ * directions. In RTL layouts, the "top-start" edge will resolve to "top-right", and "top-end"
+ * will resolve to "top-left".
+ */
+ @FloatRange(from = 0.0, to = 1.0) fun getTopEdgeSplitFraction(): Float
+}
+
+class ShadeModeInteractorImpl
+@Inject
+constructor(
+ @Application applicationScope: CoroutineScope,
+ private val repository: ShadeRepository,
+) : ShadeModeInteractor {
+
+ override val isShadeLayoutWide: StateFlow<Boolean> = repository.isShadeLayoutWide
+
+ override val shadeMode: StateFlow<ShadeMode> =
+ isShadeLayoutWide
+ .map(this::determineShadeMode)
+ .stateIn(
+ applicationScope,
+ SharingStarted.Eagerly,
+ initialValue = determineShadeMode(isShadeLayoutWide.value),
+ )
+
+ @FloatRange(from = 0.0, to = 1.0)
+ override fun getTopEdgeSplitFraction(): Float {
+ // Note: this implicitly relies on isShadeLayoutWide being hot (i.e. collected). This
+ // assumption allows us to query its value on demand (during swipe source detection) instead
+ // of running another infinite coroutine.
+ // TODO(b/338577208): Instead of being fixed at 0.8f, this should dynamically updated based
+ // on the position of system-status icons in the status bar.
+ return if (repository.isShadeLayoutWide.value) 0.8f else 0.5f
+ }
+
+ private fun determineShadeMode(isShadeLayoutWide: Boolean): ShadeMode {
+ return when {
+ DualShade.isEnabled -> ShadeMode.Dual
+ isShadeLayoutWide -> ShadeMode.Split
+ else -> ShadeMode.Single
+ }
+ }
+}
+
+class ShadeModeInteractorEmptyImpl @Inject constructor() : ShadeModeInteractor {
+
+ override val shadeMode: StateFlow<ShadeMode> = MutableStateFlow(ShadeMode.Single)
+
+ override val isShadeLayoutWide: StateFlow<Boolean> = MutableStateFlow(false)
+
+ override fun getTopEdgeSplitFraction(): Float = 0.5f
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index f88fd7d..862f33bb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -63,6 +63,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
+import com.android.internal.annotations.KeepForWeakReference;
import com.android.internal.os.SomeArgs;
import com.android.internal.statusbar.IAddTileResultCallback;
import com.android.internal.statusbar.IStatusBar;
@@ -192,10 +193,10 @@
private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey";
private final Object mLock = new Object();
- private ArrayList<Callbacks> mCallbacks = new ArrayList<>();
- private Handler mHandler = new H(Looper.getMainLooper());
+ private final ArrayList<Callbacks> mCallbacks = new ArrayList<>();
+ private final Handler mHandler = new H(Looper.getMainLooper());
/** A map of display id - disable flag pair */
- private SparseArray<Pair<Integer, Integer>> mDisplayDisabled = new SparseArray<>();
+ private final SparseArray<Pair<Integer, Integer>> mDisplayDisabled = new SparseArray<>();
/**
* The last ID of the display where IME window for which we received setImeWindowStatus
* event.
@@ -207,6 +208,21 @@
private final @Nullable DumpHandler mDumpHandler;
private final @Nullable Lazy<PowerInteractor> mPowerInteractor;
+ @KeepForWeakReference
+ private final DisplayTracker.Callback mDisplayTrackerCallback = new DisplayTracker.Callback() {
+ @Override
+ public void onDisplayRemoved(int displayId) {
+ synchronized (mLock) {
+ mDisplayDisabled.remove(displayId);
+ }
+ // This callback is registered with {@link #mHandler} that already posts to run on
+ // main thread, so it is safe to dispatch directly.
+ for (int i = mCallbacks.size() - 1; i >= 0; i--) {
+ mCallbacks.get(i).onDisplayRemoved(displayId);
+ }
+ }
+ };
+
/**
* These methods are called back on the main thread.
*/
@@ -576,19 +592,8 @@
mDisplayTracker = displayTracker;
mRegistry = registry;
mDumpHandler = dumpHandler;
- mDisplayTracker.addDisplayChangeCallback(new DisplayTracker.Callback() {
- @Override
- public void onDisplayRemoved(int displayId) {
- synchronized (mLock) {
- mDisplayDisabled.remove(displayId);
- }
- // This callback is registered with {@link #mHandler} that already posts to run on
- // main thread, so it is safe to dispatch directly.
- for (int i = mCallbacks.size() - 1; i >= 0; i--) {
- mCallbacks.get(i).onDisplayRemoved(displayId);
- }
- }
- }, new HandlerExecutor(mHandler));
+ mDisplayTracker.addDisplayChangeCallback(mDisplayTrackerCallback,
+ new HandlerExecutor(mHandler));
// We always have default display.
setDisabled(mDisplayTracker.getDefaultDisplayId(), DISABLE_NONE, DISABLE2_NONE);
mPowerInteractor = powerInteractor;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
index 3422c67..7f55512 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
@@ -723,9 +723,7 @@
Scenes.Bouncer, StatusBarState.KEYGUARD,
Scenes.Communal, StatusBarState.KEYGUARD,
Scenes.Shade, StatusBarState.SHADE_LOCKED,
- Scenes.NotificationsShade, StatusBarState.SHADE_LOCKED,
Scenes.QuickSettings, StatusBarState.SHADE_LOCKED,
- Scenes.QuickSettingsShade, StatusBarState.SHADE_LOCKED,
Scenes.Gone, StatusBarState.SHADE
);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/shared/StatusBarRonChips.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/shared/StatusBarRonChips.kt
new file mode 100644
index 0000000..4c0c461
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/shared/StatusBarRonChips.kt
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.chips.shared
+
+import com.android.systemui.Flags
+import com.android.systemui.flags.FlagToken
+import com.android.systemui.flags.RefactorFlagUtils
+
+/** Helper for reading or using the status bar ron chips flag state. */
+@Suppress("NOTHING_TO_INLINE")
+object StatusBarRonChips {
+ /** The aconfig flag name */
+ const val FLAG_NAME = Flags.FLAG_STATUS_BAR_RON_CHIPS
+
+ /** A token used for dependency declaration */
+ val token: FlagToken
+ get() = FlagToken(FLAG_NAME, isEnabled)
+
+ /** Is the refactor enabled */
+ @JvmStatic
+ inline val isEnabled
+ get() = Flags.statusBarRonChips()
+
+ /**
+ * Called to ensure code is only run when the flag is enabled. This protects users from the
+ * unintended behaviors caused by accidentally running new logic, while also crashing on an eng
+ * build to ensure that the refactor author catches issues in testing.
+ */
+ @JvmStatic
+ inline fun isUnexpectedlyInLegacyMode() =
+ RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)
+
+ /**
+ * Called to ensure code is only run when the flag is disabled. This will throw an exception if
+ * the flag is not enabled to ensure that the refactor author catches issues in testing.
+ * Caution!! Using this check incorrectly will cause crashes in nextfood builds!
+ */
+ @JvmStatic
+ inline fun assertInNewMode() = RefactorFlagUtils.assertInNewMode(isEnabled, FLAG_NAME)
+
+ /**
+ * Called to ensure code is only run when the flag is disabled. This will throw an exception if
+ * the flag is enabled to ensure that the refactor author catches issues in testing.
+ */
+ @JvmStatic
+ inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME)
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/MultipleOngoingActivityChipsModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/MultipleOngoingActivityChipsModel.kt
new file mode 100644
index 0000000..d2555b0
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/MultipleOngoingActivityChipsModel.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.chips.ui.model
+
+/** Models multiple active ongoing activity chips at once. */
+data class MultipleOngoingActivityChipsModel(
+ /** The primary chip to show. This will *always* be shown. */
+ val primary: OngoingActivityChipModel = OngoingActivityChipModel.Hidden(),
+ /**
+ * The secondary chip to show. If there's not enough room in the status bar, this chip will
+ * *not* be shown.
+ */
+ val secondary: OngoingActivityChipModel = OngoingActivityChipModel.Hidden(),
+) {
+ init {
+ if (
+ primary is OngoingActivityChipModel.Hidden &&
+ secondary is OngoingActivityChipModel.Shown
+ ) {
+ throw IllegalArgumentException("`secondary` cannot be Shown if `primary` is Hidden")
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt
index 199eb06..24c1b87 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.chips.ui.viewmodel
+import com.android.systemui.Flags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.log.LogBuffer
@@ -27,6 +28,7 @@
import com.android.systemui.statusbar.chips.ron.shared.StatusBarRonChips
import com.android.systemui.statusbar.chips.screenrecord.ui.viewmodel.ScreenRecordChipViewModel
import com.android.systemui.statusbar.chips.sharetoapp.ui.viewmodel.ShareToAppChipViewModel
+import com.android.systemui.statusbar.chips.ui.model.MultipleOngoingActivityChipsModel
import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
import com.android.systemui.util.kotlin.pairwise
import javax.inject.Inject
@@ -87,68 +89,58 @@
) : InternalChipModel
}
- private val internalChip: Flow<InternalChipModel> =
+ private data class ChipBundle(
+ val screenRecord: OngoingActivityChipModel = OngoingActivityChipModel.Hidden(),
+ val shareToApp: OngoingActivityChipModel = OngoingActivityChipModel.Hidden(),
+ val castToOtherDevice: OngoingActivityChipModel = OngoingActivityChipModel.Hidden(),
+ val call: OngoingActivityChipModel = OngoingActivityChipModel.Hidden(),
+ val demoRon: OngoingActivityChipModel = OngoingActivityChipModel.Hidden(),
+ )
+
+ /** Bundles all the incoming chips into one object to easily pass to various flows. */
+ private val incomingChipBundle =
combine(
- screenRecordChipViewModel.chip,
- shareToAppChipViewModel.chip,
- castToOtherDeviceChipViewModel.chip,
- callChipViewModel.chip,
- demoRonChipViewModel.chip,
- ) { screenRecord, shareToApp, castToOtherDevice, call, demoRon ->
- logger.log(
- TAG,
- LogLevel.INFO,
- {
- str1 = screenRecord.logName
- str2 = shareToApp.logName
- str3 = castToOtherDevice.logName
- },
- { "Chips: ScreenRecord=$str1 > ShareToApp=$str2 > CastToOther=$str3..." },
- )
- logger.log(
- TAG,
- LogLevel.INFO,
- {
- str1 = call.logName
- str2 = demoRon.logName
- },
- { "... > Call=$str1 > DemoRon=$str2" }
- )
- // This `when` statement shows the priority order of the chips.
- when {
- // Screen recording also activates the media projection APIs, so whenever the
- // screen recording chip is active, the media projection chip would also be
- // active. We want the screen-recording-specific chip shown in this case, so we
- // give the screen recording chip priority. See b/296461748.
- screenRecord is OngoingActivityChipModel.Shown ->
- InternalChipModel.Shown(ChipType.ScreenRecord, screenRecord)
- shareToApp is OngoingActivityChipModel.Shown ->
- InternalChipModel.Shown(ChipType.ShareToApp, shareToApp)
- castToOtherDevice is OngoingActivityChipModel.Shown ->
- InternalChipModel.Shown(ChipType.CastToOtherDevice, castToOtherDevice)
- call is OngoingActivityChipModel.Shown ->
- InternalChipModel.Shown(ChipType.Call, call)
- demoRon is OngoingActivityChipModel.Shown -> {
- StatusBarRonChips.assertInNewMode()
- InternalChipModel.Shown(ChipType.DemoRon, demoRon)
- }
- else -> {
- // We should only get here if all chip types are hidden
- check(screenRecord is OngoingActivityChipModel.Hidden)
- check(shareToApp is OngoingActivityChipModel.Hidden)
- check(castToOtherDevice is OngoingActivityChipModel.Hidden)
- check(call is OngoingActivityChipModel.Hidden)
- check(demoRon is OngoingActivityChipModel.Hidden)
- InternalChipModel.Hidden(
- screenRecord = screenRecord,
- shareToApp = shareToApp,
- castToOtherDevice = castToOtherDevice,
- call = call,
- demoRon = demoRon,
- )
- }
+ screenRecordChipViewModel.chip,
+ shareToAppChipViewModel.chip,
+ castToOtherDeviceChipViewModel.chip,
+ callChipViewModel.chip,
+ demoRonChipViewModel.chip,
+ ) { screenRecord, shareToApp, castToOtherDevice, call, demoRon ->
+ logger.log(
+ TAG,
+ LogLevel.INFO,
+ {
+ str1 = screenRecord.logName
+ str2 = shareToApp.logName
+ str3 = castToOtherDevice.logName
+ },
+ { "Chips: ScreenRecord=$str1 > ShareToApp=$str2 > CastToOther=$str3..." },
+ )
+ logger.log(
+ TAG,
+ LogLevel.INFO,
+ {
+ str1 = call.logName
+ str2 = demoRon.logName
+ },
+ { "... > Call=$str1 > DemoRon=$str2" }
+ )
+ ChipBundle(
+ screenRecord = screenRecord,
+ shareToApp = shareToApp,
+ castToOtherDevice = castToOtherDevice,
+ call = call,
+ demoRon = demoRon,
+ )
}
- }
+ // Some of the chips could have timers in them and we don't want the start time
+ // for those timers to get reset for any reason. So, as soon as any subscriber has
+ // requested the chip information, we maintain it forever by using
+ // [SharingStarted.Lazily]. See b/347726238.
+ .stateIn(scope, SharingStarted.Lazily, ChipBundle())
+
+ private val internalChip: Flow<InternalChipModel> =
+ incomingChipBundle.map { bundle -> pickMostImportantChip(bundle).mostImportantChip }
/**
* A flow modeling the primary chip that should be shown in the status bar after accounting for
@@ -160,38 +152,189 @@
val primaryChip: StateFlow<OngoingActivityChipModel> =
internalChip
.pairwise(initialValue = DEFAULT_INTERNAL_HIDDEN_MODEL)
- .map { (old, new) ->
- if (old is InternalChipModel.Shown && new is InternalChipModel.Hidden) {
- // If we're transitioning from showing the chip to hiding the chip, different
- // chips require different animation behaviors. For example, the screen share
- // chips shouldn't animate if the user stopped the screen share from the dialog
- // (see b/353249803#comment4), but the call chip should always animate.
- //
- // This `when` block makes sure that when we're transitioning from Shown to
- // Hidden, we check what chip type was previously showing and we use that chip
- // type's hide animation behavior.
- when (old.type) {
- ChipType.ScreenRecord -> new.screenRecord
- ChipType.ShareToApp -> new.shareToApp
- ChipType.CastToOtherDevice -> new.castToOtherDevice
- ChipType.Call -> new.call
- ChipType.DemoRon -> new.demoRon
- }
- } else if (new is InternalChipModel.Shown) {
- // If we have a chip to show, always show it.
- new.model
- } else {
- // In the Hidden -> Hidden transition, it shouldn't matter which hidden model we
- // choose because no animation should happen regardless.
- OngoingActivityChipModel.Hidden()
- }
- }
- // Some of the chips could have timers in them and we don't want the start time
- // for those timers to get reset for any reason. So, as soon as any subscriber has
- // requested the chip information, we maintain it forever by using
- // [SharingStarted.Lazily]. See b/347726238.
+ .map { (old, new) -> createOutputModel(old, new) }
.stateIn(scope, SharingStarted.Lazily, OngoingActivityChipModel.Hidden())
+ /**
+ * Equivalent to [MultipleOngoingActivityChipsModel] but using the internal models to do some
+ * state tracking before we get the final output.
+ */
+ private data class InternalMultipleOngoingActivityChipsModel(
+ val primary: InternalChipModel,
+ val secondary: InternalChipModel,
+ )
+
+ private val internalChips: Flow<InternalMultipleOngoingActivityChipsModel> =
+ incomingChipBundle.map { bundle ->
+ // First: Find the most important chip.
+ val primaryChipResult = pickMostImportantChip(bundle)
+ val primaryChip = primaryChipResult.mostImportantChip
+ if (primaryChip is InternalChipModel.Hidden) {
+ // If the primary chip is hidden, the secondary chip will also be hidden, so just
+ // pass the same Hidden model for both.
+ InternalMultipleOngoingActivityChipsModel(primaryChip, primaryChip)
+ } else {
+ // Then: Find the next most important chip.
+ val secondaryChip =
+ pickMostImportantChip(primaryChipResult.remainingChips).mostImportantChip
+ InternalMultipleOngoingActivityChipsModel(primaryChip, secondaryChip)
+ }
+ }
+
+ /**
+ * A flow modeling the primary chip that should be shown in the status bar after accounting for
+ * possibly multiple ongoing activities and animation requirements.
+ *
+ * [com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment] is responsible for
+ * actually displaying the chip.
+ */
+ val chips: StateFlow<MultipleOngoingActivityChipsModel> =
+ if (!Flags.statusBarRonChips()) {
+ // Multiple chips are only allowed with RONs. If the flag isn't on, use just the
+ // primary chip.
+ primaryChip
+ .map {
+ MultipleOngoingActivityChipsModel(
+ primary = it,
+ secondary = OngoingActivityChipModel.Hidden(),
+ )
+ }
+ .stateIn(
+ scope,
+ SharingStarted.Lazily,
+ MultipleOngoingActivityChipsModel(),
+ )
+ } else {
+ internalChips
+ .pairwise(initialValue = DEFAULT_MULTIPLE_INTERNAL_HIDDEN_MODEL)
+ .map { (old, new) ->
+ val correctPrimary = createOutputModel(old.primary, new.primary)
+ val correctSecondary = createOutputModel(old.secondary, new.secondary)
+ MultipleOngoingActivityChipsModel(correctPrimary, correctSecondary)
+ }
+ .stateIn(
+ scope,
+ SharingStarted.Lazily,
+ MultipleOngoingActivityChipsModel(),
+ )
+ }
+
+ /** A data class representing the return result of [pickMostImportantChip]. */
+ private data class MostImportantChipResult(
+ val mostImportantChip: InternalChipModel,
+ val remainingChips: ChipBundle,
+ )
+
+ /**
+ * Finds the most important chip from the given [bundle].
+ *
+ * This function returns that most important chip, and it also returns any remaining chips that
+ * still want to be shown after filtering out the most important chip.
+ */
+ private fun pickMostImportantChip(bundle: ChipBundle): MostImportantChipResult {
+ // This `when` statement shows the priority order of the chips.
+ return when {
+ bundle.screenRecord is OngoingActivityChipModel.Shown ->
+ MostImportantChipResult(
+ mostImportantChip =
+ InternalChipModel.Shown(ChipType.ScreenRecord, bundle.screenRecord),
+ remainingChips =
+ bundle.copy(
+ screenRecord = OngoingActivityChipModel.Hidden(),
+ // Screen recording also activates the media projection APIs, which
+ // means that whenever the screen recording chip is active, the
+ // share-to-app chip would also be active. (Screen recording is a
+ // special case of share-to-app, where the app receiving the share is
+ // specifically System UI.)
+ // We want only the screen-recording-specific chip to be shown in this
+ // case. If we did have screen recording as the primary chip, we need to
+ // suppress the share-to-app chip to make sure they don't both show.
+ // See b/296461748.
+ shareToApp = OngoingActivityChipModel.Hidden(),
+ )
+ )
+ bundle.shareToApp is OngoingActivityChipModel.Shown ->
+ MostImportantChipResult(
+ mostImportantChip =
+ InternalChipModel.Shown(ChipType.ShareToApp, bundle.shareToApp),
+ remainingChips = bundle.copy(shareToApp = OngoingActivityChipModel.Hidden()),
+ )
+ bundle.castToOtherDevice is OngoingActivityChipModel.Shown ->
+ MostImportantChipResult(
+ mostImportantChip =
+ InternalChipModel.Shown(
+ ChipType.CastToOtherDevice,
+ bundle.castToOtherDevice,
+ ),
+ remainingChips =
+ bundle.copy(castToOtherDevice = OngoingActivityChipModel.Hidden()),
+ )
+ bundle.call is OngoingActivityChipModel.Shown ->
+ MostImportantChipResult(
+ mostImportantChip = InternalChipModel.Shown(ChipType.Call, bundle.call),
+ remainingChips = bundle.copy(call = OngoingActivityChipModel.Hidden()),
+ )
+ bundle.demoRon is OngoingActivityChipModel.Shown -> {
+ StatusBarRonChips.assertInNewMode()
+ MostImportantChipResult(
+ mostImportantChip = InternalChipModel.Shown(ChipType.DemoRon, bundle.demoRon),
+ remainingChips = bundle.copy(demoRon = OngoingActivityChipModel.Hidden()),
+ )
+ }
+ else -> {
+ // We should only get here if all chip types are hidden
+ check(bundle.screenRecord is OngoingActivityChipModel.Hidden)
+ check(bundle.shareToApp is OngoingActivityChipModel.Hidden)
+ check(bundle.castToOtherDevice is OngoingActivityChipModel.Hidden)
+ check(bundle.call is OngoingActivityChipModel.Hidden)
+ check(bundle.demoRon is OngoingActivityChipModel.Hidden)
+ MostImportantChipResult(
+ mostImportantChip =
+ InternalChipModel.Hidden(
+ screenRecord = bundle.screenRecord,
+ shareToApp = bundle.shareToApp,
+ castToOtherDevice = bundle.castToOtherDevice,
+ call = bundle.call,
+ demoRon = bundle.demoRon,
+ ),
+ // All the chips are already hidden, so no need to filter anything out of the
+ // bundle.
+ remainingChips = bundle,
+ )
+ }
+ }
+ }
+
+ private fun createOutputModel(
+ old: InternalChipModel,
+ new: InternalChipModel,
+ ): OngoingActivityChipModel {
+ return if (old is InternalChipModel.Shown && new is InternalChipModel.Hidden) {
+ // If we're transitioning from showing the chip to hiding the chip, different
+ // chips require different animation behaviors. For example, the screen share
+ // chips shouldn't animate if the user stopped the screen share from the dialog
+ // (see b/353249803#comment4), but the call chip should always animate.
+ //
+ // This `when` block makes sure that when we're transitioning from Shown to
+ // Hidden, we check what chip type was previously showing and we use that chip
+ // type's hide animation behavior.
+ return when (old.type) {
+ ChipType.ScreenRecord -> new.screenRecord
+ ChipType.ShareToApp -> new.shareToApp
+ ChipType.CastToOtherDevice -> new.castToOtherDevice
+ ChipType.Call -> new.call
+ ChipType.DemoRon -> new.demoRon
+ }
+ } else if (new is InternalChipModel.Shown) {
+ // If we have a chip to show, always show it.
+ new.model
+ } else {
+ // In the Hidden -> Hidden transition, it shouldn't matter which hidden model we
+ // choose because no animation should happen regardless.
+ OngoingActivityChipModel.Hidden()
+ }
+ }
+
companion object {
private const val TAG = "ChipsViewModel"
@@ -203,5 +346,11 @@
call = OngoingActivityChipModel.Hidden(),
demoRon = OngoingActivityChipModel.Hidden(),
)
+
+ private val DEFAULT_MULTIPLE_INTERNAL_HIDDEN_MODEL =
+ InternalMultipleOngoingActivityChipsModel(
+ primary = DEFAULT_INTERNAL_HIDDEN_MODEL,
+ secondary = DEFAULT_INTERNAL_HIDDEN_MODEL,
+ )
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/ConnectivityModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/ConnectivityModule.kt
index 400f8af..dac0102 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/ConnectivityModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/ConnectivityModule.kt
@@ -21,6 +21,7 @@
import com.android.systemui.flags.Flags.SIGNAL_CALLBACK_DEPRECATION
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.AirplaneModeTile
import com.android.systemui.qs.tiles.BluetoothTile
@@ -95,21 +96,21 @@
@IntoMap
@StringKey(AIRPLANE_MODE_TILE_SPEC)
fun provideAirplaneModeAvailabilityInteractor(
- impl: AirplaneModeTileDataInteractor
+ impl: AirplaneModeTileDataInteractor
): QSTileAvailabilityInteractor
@Binds
@IntoMap
@StringKey(DATA_SAVER_TILE_SPEC)
fun provideDataSaverAvailabilityInteractor(
- impl: DataSaverTileDataInteractor
+ impl: DataSaverTileDataInteractor
): QSTileAvailabilityInteractor
@Binds
@IntoMap
@StringKey(INTERNET_TILE_SPEC)
fun provideInternetAvailabilityInteractor(
- impl: InternetTileDataInteractor
+ impl: InternetTileDataInteractor
): QSTileAvailabilityInteractor
companion object {
@@ -149,6 +150,7 @@
),
instanceId = uiEventLogger.getNewInstanceId(),
policy = QSTilePolicy.Restricted(listOf(UserManager.DISALLOW_AIRPLANE_MODE)),
+ category = TileCategory.CONNECTIVITY,
)
/** Inject AirplaneModeTile into tileViewModelMap in QSModule */
@@ -180,6 +182,7 @@
labelRes = R.string.data_saver,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.CONNECTIVITY,
)
/** Inject DataSaverTile into tileViewModelMap in QSModule */
@@ -211,6 +214,7 @@
labelRes = R.string.quick_settings_internet_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.CONNECTIVITY,
)
/** Inject InternetTile into tileViewModelMap in QSModule */
@@ -242,6 +246,7 @@
labelRes = R.string.quick_settings_hotspot_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.CONNECTIVITY,
)
@Provides
@@ -256,6 +261,7 @@
labelRes = R.string.quick_settings_cast_title,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.CONNECTIVITY,
)
@Provides
@@ -270,6 +276,7 @@
labelRes = R.string.quick_settings_bluetooth_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.CONNECTIVITY,
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/NotificationSettingsRepositoryModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/NotificationSettingsRepositoryModule.kt
index af21e75..d36412c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/NotificationSettingsRepositoryModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/NotificationSettingsRepositoryModule.kt
@@ -16,17 +16,23 @@
package com.android.systemui.statusbar.notification.data
+import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.settings.SecureSettingsRepositoryModule
import com.android.systemui.settings.SystemSettingsRepositoryModule
import com.android.systemui.shared.notifications.data.repository.NotificationSettingsRepository
import com.android.systemui.shared.settings.data.repository.SecureSettingsRepository
import com.android.systemui.shared.settings.data.repository.SystemSettingsRepository
+import com.android.systemui.statusbar.notification.interruption.VisualInterruptionDecisionLogger
import dagger.Module
import dagger.Provides
+import dagger.multibindings.ClassKey
+import dagger.multibindings.IntoMap
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
@Module(includes = [SecureSettingsRepositoryModule::class, SystemSettingsRepositoryModule::class])
object NotificationSettingsRepositoryModule {
@@ -42,6 +48,19 @@
backgroundScope,
backgroundDispatcher,
secureSettingsRepository,
- systemSettingsRepository
- )
+ systemSettingsRepository)
+
+ @Provides
+ @IntoMap
+ @ClassKey(NotificationSettingsRepository::class)
+ @SysUISingleton
+ fun provideCoreStartable(
+ @Application applicationScope: CoroutineScope,
+ repository: NotificationSettingsRepository,
+ logger: VisualInterruptionDecisionLogger
+ ) = CoreStartable {
+ applicationScope.launch {
+ repository.isCooldownEnabled.collect { value -> logger.logCooldownSetting(value) }
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt
index 0efd5f1..ec0827b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt
@@ -61,6 +61,7 @@
import com.android.systemui.statusbar.policy.HeadsUpManager
import com.android.systemui.util.NotificationChannels
import com.android.systemui.util.settings.GlobalSettings
+import com.android.systemui.util.settings.SystemSettings
import com.android.systemui.util.time.SystemClock
import com.android.wm.shell.bubbles.Bubbles
import java.util.Optional
@@ -279,7 +280,8 @@
private val uiEventLogger: UiEventLogger,
private val context: Context,
private val notificationManager: NotificationManager,
- private val logger: VisualInterruptionDecisionLogger
+ private val logger: VisualInterruptionDecisionLogger,
+ private val systemSettings: SystemSettings,
) :
VisualInterruptionFilter(
types = setOf(PEEK, PULSE),
@@ -300,6 +302,11 @@
// education HUNs.
private var hasShownOnceForDebug = false
+ // Sometimes the kotlin flow value is false even when the cooldown setting is true (b/356768397)
+ // so let's directly check settings until we confirm that the flow is initialized and in sync
+ // with the real settings value.
+ private var isCooldownFlowInSync = false
+
private fun shouldShowEdu(): Boolean {
val forceShowOnce = SystemProperties.get(FORCE_SHOW_AVALANCHE_EDU_ONCE, "").equals("1")
return !hasSeenEdu || (forceShowOnce && !hasShownOnceForDebug)
@@ -479,6 +486,15 @@
}
private fun isCooldownEnabled(): Boolean {
- return settingsInteractor.isCooldownEnabled.value
+ val isEnabledFromFlow = settingsInteractor.isCooldownEnabled.value
+ if (isCooldownFlowInSync) {
+ return isEnabledFromFlow
+ }
+ val isEnabled =
+ systemSettings.getInt(Settings.System.NOTIFICATION_COOLDOWN_ENABLED, /* def */ 1) == 1
+ if (isEnabled == isEnabledFromFlow) {
+ isCooldownFlowInSync = true
+ }
+ return isEnabled
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionLogger.kt
index b83259d..38cab82 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionLogger.kt
@@ -102,6 +102,15 @@
{ "AvalancheSuppressor: $str1" }
)
}
+
+ fun logCooldownSetting(isEnabled: Boolean) {
+ buffer.log(
+ TAG,
+ INFO,
+ { bool1 = isEnabled },
+ { "Cooldown enabled: $bool1" }
+ )
+ }
}
private const val TAG = "VisualInterruptionDecisionProvider"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt
index 2f8711a..d4466f8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt
@@ -195,7 +195,8 @@
uiEventLogger,
context,
notificationManager,
- logger
+ logger,
+ systemSettings
)
)
avalancheProvider.register()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 8ff1ab6..1214440a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -5404,7 +5404,9 @@
println(pw, "intrinsicContentHeight", mIntrinsicContentHeight);
println(pw, "contentHeight", mContentHeight);
println(pw, "intrinsicPadding", mIntrinsicPadding);
- println(pw, "topPadding", getTopPadding());
+ if (!SceneContainerFlag.isEnabled()) {
+ println(pw, "topPadding", getTopPadding());
+ }
println(pw, "bottomPadding", mBottomPadding);
dumpRoundedRectClipping(pw);
println(pw, "requestedClipBounds", mRequestedClipBounds);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
index 580431a..969ff1b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
@@ -68,6 +68,7 @@
if (mLabelTextId != null) {
mLabelView.setText(mLabelTextId);
}
+ mLabelView.setAccessibilityHeading(true);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
index ef1bcfc..cccac4b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -682,7 +682,10 @@
// doesn't get updated quickly enough and can cause the footer to flash when
// closing the shade. As such, we temporarily also check the ambientState directly.
if (((FooterView) view).shouldBeHidden() || !ambientState.isShadeExpanded()) {
- viewState.hidden = true;
+ // Note: This is no longer necessary in flexiglass.
+ if (!SceneContainerFlag.isEnabled()) {
+ viewState.hidden = true;
+ }
} else {
final float footerEnd = algorithmState.mCurrentExpandedYPosition
+ view.getIntrinsicHeight();
@@ -691,7 +694,6 @@
noSpaceForFooter || (ambientState.isClearAllInProgress()
&& !hasNonClearableNotifs(algorithmState));
}
-
} else {
final boolean shadeClosed = !ambientState.isShadeExpanded();
final boolean isShelfShowing = algorithmState.firstViewInShelf != null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt
index d770b20..dc9615c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationListViewBinder.kt
@@ -188,15 +188,26 @@
.startHistoryIntent(view, /* showHistory= */ true)
},
)
- launch {
- viewModel.shouldIncludeFooterView.collect { animatedVisibility ->
- footerView.setVisible(
- /* visible = */ animatedVisibility.value,
- /* animate = */ animatedVisibility.isAnimating,
- )
+ if (SceneContainerFlag.isEnabled) {
+ launch {
+ viewModel.shouldShowFooterView.collect { animatedVisibility ->
+ footerView.setVisible(
+ /* visible = */ animatedVisibility.value,
+ /* animate = */ animatedVisibility.isAnimating,
+ )
+ }
}
+ } else {
+ launch {
+ viewModel.shouldIncludeFooterView.collect { animatedVisibility ->
+ footerView.setVisible(
+ /* visible = */ animatedVisibility.value,
+ /* animate = */ animatedVisibility.isAnimating,
+ )
+ }
+ }
+ launch { viewModel.shouldHideFooterView.collect { footerView.setShouldBeHidden(it) } }
}
- launch { viewModel.shouldHideFooterView.collect { footerView.setShouldBeHidden(it) } }
disposableHandle.awaitCancellationThenDispose()
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt
index aa1911e..5ae5a32 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt
@@ -62,7 +62,6 @@
viewModel: SharedNotificationContainerViewModel,
): DisposableHandle {
val disposables = DisposableHandles()
-
disposables +=
view.repeatWhenAttached {
repeatOnLifecycle(Lifecycle.State.CREATED) {
@@ -87,10 +86,7 @@
}
val burnInParams = MutableStateFlow(BurnInParameters())
- val viewState =
- ViewStateAccessor(
- alpha = { controller.getAlpha() },
- )
+ val viewState = ViewStateAccessor(alpha = { controller.getAlpha() })
/*
* For animation sensitive coroutines, immediately run just like applicationScope does
@@ -108,7 +104,7 @@
addUpdateListener { animation ->
controller.setMaxAlphaForKeyguard(
animation.animatedFraction,
- "SharedNotificationContainerVB (collapseFadeIn)"
+ "SharedNotificationContainerVB (collapseFadeIn)",
)
}
start()
@@ -153,7 +149,7 @@
launch { viewModel.translationX.collect { x -> controller.translationX = x } }
launch {
- viewModel.keyguardAlpha(viewState).collect {
+ viewModel.keyguardAlpha(viewState, this).collect {
controller.setMaxAlphaForKeyguard(it, "SharedNotificationContainerVB")
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt
index e55492e6..4e2a46d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt
@@ -32,6 +32,7 @@
import com.android.systemui.statusbar.policy.domain.interactor.UserSetupInteractor
import com.android.systemui.statusbar.policy.domain.interactor.ZenModeInteractor
import com.android.systemui.util.kotlin.FlowDumperImpl
+import com.android.systemui.util.kotlin.combine
import com.android.systemui.util.kotlin.sample
import com.android.systemui.util.ui.AnimatableEvent
import com.android.systemui.util.ui.AnimatedValue
@@ -120,6 +121,7 @@
* This essentially corresponds to having the view set to INVISIBLE.
*/
val shouldHideFooterView: Flow<Boolean> by lazy {
+ SceneContainerFlag.assertInLegacyMode()
if (FooterViewRefactor.isUnexpectedlyInLegacyMode()) {
flowOf(false)
} else {
@@ -143,6 +145,7 @@
* be hidden by another condition (see [shouldHideFooterView] above).
*/
val shouldIncludeFooterView: Flow<AnimatedValue<Boolean>> by lazy {
+ SceneContainerFlag.assertInLegacyMode()
if (FooterViewRefactor.isUnexpectedlyInLegacyMode()) {
flowOf(AnimatedValue.NotAnimating(false))
} else {
@@ -207,6 +210,76 @@
}
}
+ // This flow replaces shouldHideFooterView+shouldIncludeFooterView in flexiglass.
+ val shouldShowFooterView: Flow<AnimatedValue<Boolean>> by lazy {
+ if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) {
+ flowOf(AnimatedValue.NotAnimating(false))
+ } else {
+ combine(
+ activeNotificationsInteractor.areAnyNotificationsPresent,
+ userSetupInteractor.isUserSetUp,
+ notificationStackInteractor.isShowingOnLockscreen,
+ shadeInteractor.isQsFullscreen,
+ remoteInputInteractor.isRemoteInputActive,
+ shadeInteractor.shadeExpansion.map { it < 0.5f }.distinctUntilChanged(),
+ ) {
+ hasNotifications,
+ isUserSetUp,
+ isShowingOnLockscreen,
+ qsFullScreen,
+ isRemoteInputActive,
+ shadeLessThanHalfwayExpanded ->
+ when {
+ !hasNotifications -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
+ // Hide the footer until the user setup is complete, to prevent access
+ // to settings (b/193149550).
+ !isUserSetUp -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
+ // Do not show the footer if the lockscreen is visible (incl. AOD),
+ // except if the shade is opened on top. See also b/219680200.
+ // Do not animate, as that makes the footer appear briefly when
+ // transitioning between the shade and keyguard.
+ isShowingOnLockscreen -> VisibilityChange.DISAPPEAR_WITHOUT_ANIMATION
+ // Do not show the footer if quick settings are fully expanded (except
+ // for the foldable split shade view). See b/201427195 && b/222699879.
+ qsFullScreen -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
+ // Hide the footer if remote input is active (i.e. user is replying to a
+ // notification). See b/75984847.
+ isRemoteInputActive -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
+ // If the shade is not expanded enough, the footer shouldn't be visible.
+ shadeLessThanHalfwayExpanded -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
+ else -> VisibilityChange.APPEAR_WITH_ANIMATION
+ }
+ }
+ .distinctUntilChanged(
+ // Equivalent unless visibility changes
+ areEquivalent = { a: VisibilityChange, b: VisibilityChange ->
+ a.visible == b.visible
+ }
+ )
+ // Should we animate the visibility change?
+ .sample(
+ // TODO(b/322167853): This check is currently duplicated in FooterViewModel,
+ // but instead it should be a field in ShadeAnimationInteractor.
+ combine(
+ shadeInteractor.isShadeFullyExpanded,
+ shadeInteractor.isShadeTouchable,
+ ::Pair
+ )
+ .onStart { emit(Pair(false, false)) }
+ ) { visibilityChange, (isShadeFullyExpanded, animationsEnabled) ->
+ // Animate if the shade is interactive, but NOT on the lockscreen. Having
+ // animations enabled while on the lockscreen makes the footer appear briefly
+ // when transitioning between the shade and keyguard.
+ val shouldAnimate =
+ isShadeFullyExpanded && animationsEnabled && visibilityChange.canAnimate
+ AnimatableEvent(visibilityChange.visible, shouldAnimate)
+ }
+ .toAnimatedValueFlow()
+ .dumpWhileCollecting("shouldShowFooterView")
+ .flowOn(bgDispatcher)
+ }
+ }
+
enum class VisibilityChange(val visible: Boolean, val canAnimate: Boolean) {
DISAPPEAR_WITHOUT_ANIMATION(visible = false, canAnimate = false),
DISAPPEAR_WITH_ANIMATION(visible = false, canAnimate = true),
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
index aed00d8..e34eb61 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
@@ -20,7 +20,6 @@
package com.android.systemui.statusbar.notification.stack.ui.viewmodel
import androidx.annotation.VisibleForTesting
-import com.android.compose.animation.scene.SceneKey
import com.android.systemui.common.shared.model.NotificationContainerBounds
import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor
import com.android.systemui.dagger.SysUISingleton
@@ -29,7 +28,6 @@
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.shared.model.Edge
-import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.KeyguardState.ALTERNATE_BOUNCER
import com.android.systemui.keyguard.shared.model.KeyguardState.AOD
import com.android.systemui.keyguard.shared.model.KeyguardState.DOZING
@@ -41,7 +39,6 @@
import com.android.systemui.keyguard.shared.model.KeyguardState.PRIMARY_BOUNCER
import com.android.systemui.keyguard.shared.model.StatusBarState.SHADE
import com.android.systemui.keyguard.shared.model.StatusBarState.SHADE_LOCKED
-import com.android.systemui.keyguard.shared.model.TransitionState.RUNNING
import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerToGoneTransitionViewModel
import com.android.systemui.keyguard.ui.viewmodel.AodBurnInViewModel
import com.android.systemui.keyguard.ui.viewmodel.AodToGoneTransitionViewModel
@@ -73,7 +70,6 @@
import com.android.systemui.statusbar.notification.stack.domain.interactor.NotificationStackAppearanceInteractor
import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor
import com.android.systemui.unfold.domain.interactor.UnfoldTransitionInteractor
-import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf
import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf
import com.android.systemui.util.kotlin.FlowDumperImpl
import com.android.systemui.util.kotlin.Utils.Companion.sample as sampleCombine
@@ -166,10 +162,9 @@
* before the other.
*/
private val isShadeLocked: Flow<Boolean> =
- combine(
- keyguardInteractor.statusBarState.map { it == SHADE_LOCKED },
- isAnyExpanded,
- ) { isShadeLocked, isAnyExpanded ->
+ combine(keyguardInteractor.statusBarState.map { it == SHADE_LOCKED }, isAnyExpanded) {
+ isShadeLocked,
+ isAnyExpanded ->
isShadeLocked && isAnyExpanded
}
.stateIn(
@@ -220,23 +215,20 @@
keyguardTransitionInteractor.isFinishedIn(ALTERNATE_BOUNCER),
keyguardTransitionInteractor.isFinishedIn(
scene = Scenes.Bouncer,
- stateWithoutSceneContainer = PRIMARY_BOUNCER
+ stateWithoutSceneContainer = PRIMARY_BOUNCER,
),
keyguardTransitionInteractor.transitionValue(LOCKSCREEN).map { it > 0f },
)
.stateIn(
scope = applicationScope,
started = SharingStarted.Eagerly,
- initialValue = false
+ initialValue = false,
)
.dumpValue("isOnLockscreen")
/** Are we purely on the keyguard without the shade/qs? */
val isOnLockscreenWithoutShade: Flow<Boolean> =
- combine(
- isOnLockscreen,
- isAnyExpanded,
- ) { isKeyguard, isAnyExpanded ->
+ combine(isOnLockscreen, isAnyExpanded) { isKeyguard, isAnyExpanded ->
isKeyguard && !isAnyExpanded
}
.stateIn(
@@ -251,16 +243,16 @@
combine(
keyguardTransitionInteractor.isFinishedIn(
scene = Scenes.Communal,
- stateWithoutSceneContainer = GLANCEABLE_HUB
+ stateWithoutSceneContainer = GLANCEABLE_HUB,
),
anyOf(
keyguardTransitionInteractor.isInTransition(
edge = Edge.create(to = Scenes.Communal),
- edgeWithoutSceneContainer = Edge.create(to = GLANCEABLE_HUB)
+ edgeWithoutSceneContainer = Edge.create(to = GLANCEABLE_HUB),
),
keyguardTransitionInteractor.isInTransition(
edge = Edge.create(from = Scenes.Communal),
- edgeWithoutSceneContainer = Edge.create(from = GLANCEABLE_HUB)
+ edgeWithoutSceneContainer = Edge.create(from = GLANCEABLE_HUB),
),
),
) { isOnGlanceableHub, transitioningToOrFromHub ->
@@ -271,10 +263,7 @@
/** Are we purely on the glanceable hub without the shade/qs? */
val isOnGlanceableHubWithoutShade: Flow<Boolean> =
- combine(
- isOnGlanceableHub,
- isAnyExpanded,
- ) { isGlanceableHub, isAnyExpanded ->
+ combine(isOnGlanceableHub, isAnyExpanded) { isGlanceableHub, isAnyExpanded ->
isGlanceableHub && !isAnyExpanded
}
.stateIn(
@@ -286,10 +275,9 @@
/** Are we on the dream without the shade/qs? */
private val isDreamingWithoutShade: Flow<Boolean> =
- combine(
- keyguardTransitionInteractor.isFinishedIn(DREAMING),
- isAnyExpanded,
- ) { isDreaming, isAnyExpanded ->
+ combine(keyguardTransitionInteractor.isFinishedIn(DREAMING), isAnyExpanded) {
+ isDreaming,
+ isAnyExpanded ->
isDreaming && !isAnyExpanded
}
.stateIn(
@@ -310,7 +298,7 @@
keyguardTransitionInteractor.isInTransition(
edge = Edge.create(from = LOCKSCREEN, to = AOD)
),
- ::Pair
+ ::Pair,
)
.transformWhile { (isOnLockscreenWithoutShade, aodTransitionIsRunning) ->
// Wait until the AOD transition is complete before terminating
@@ -375,7 +363,7 @@
keyguardTransitionInteractor.isInTransition,
shadeInteractor.qsExpansion,
)
- .onStart { emit(Triple(0f, false, 0f)) }
+ .onStart { emit(Triple(0f, false, 0f)) },
) { onLockscreen, bounds, paddingTop, (top, isInTransitionToAnyState, qsExpansion) ->
if (onLockscreen) {
bounds.copy(top = bounds.top - paddingTop)
@@ -383,10 +371,7 @@
// When QS expansion > 0, it should directly set the top padding so do not
// animate it
val animate = qsExpansion == 0f && !isInTransitionToAnyState
- bounds.copy(
- top = top,
- isAnimated = animate,
- )
+ bounds.copy(top = top, isAnimated = animate)
}
}
.stateIn(
@@ -404,10 +389,9 @@
private val alphaForShadeAndQsExpansion: Flow<Float> =
interactor.configurationBasedDimensions
.flatMapLatest { configurationBasedDimensions ->
- combineTransform(
- shadeInteractor.shadeExpansion,
- shadeInteractor.qsExpansion,
- ) { shadeExpansion, qsExpansion ->
+ combineTransform(shadeInteractor.shadeExpansion, shadeInteractor.qsExpansion) {
+ shadeExpansion,
+ qsExpansion ->
if (shadeExpansion > 0f || qsExpansion > 0f) {
if (configurationBasedDimensions.useSplitShade) {
emit(1f)
@@ -424,47 +408,6 @@
.onStart { emit(1f) }
.dumpWhileCollecting("alphaForShadeAndQsExpansion")
- private val isTransitioningToHiddenKeyguard: Flow<Boolean> =
- flow {
- while (currentCoroutineContext().isActive) {
- emit(false)
- // Ensure states are inactive to start
- allOf(isNotOnState(OCCLUDED), isNotOnState(GONE, Scenes.Gone)).first { it }
- // Wait for a qualifying transition to begin
- anyOf(
- transitionToIsRunning(Edge.create(to = OCCLUDED)),
- transitionToIsRunning(
- edge = Edge.create(to = Scenes.Gone),
- edgeWithoutSceneContainer = Edge.create(to = GONE)
- )
- )
- .first { it }
- emit(true)
- // Now await the signal that SHADE state has been reached or the transition was
- // reversed. Until SHADE state has been replaced it is the only source of when
- // it is considered safe to reset alpha to 1f for HUNs.
- combine(
- keyguardInteractor.statusBarState,
- allOf(isNotOnState(OCCLUDED), isNotOnState(GONE, Scenes.Gone))
- ) { statusBarState, stateIsReversed ->
- statusBarState == SHADE || stateIsReversed
- }
- .first { it }
- }
- }
- .dumpWhileCollecting("isTransitioningToHiddenKeyguard")
-
- private fun isNotOnState(stateWithoutSceneContainer: KeyguardState, scene: SceneKey? = null) =
- keyguardTransitionInteractor
- .transitionValue(scene = scene, stateWithoutSceneContainer = stateWithoutSceneContainer)
- .map { it == 0f }
-
- private fun transitionToIsRunning(edge: Edge, edgeWithoutSceneContainer: Edge? = null) =
- keyguardTransitionInteractor
- .transition(edge = edge, edgeWithoutSceneContainer = edgeWithoutSceneContainer)
- .map { it.value > 0f && it.transitionState == RUNNING }
- .onStart { emit(false) }
-
val panelAlpha = keyguardInteractor.panelAlpha
private fun bouncerToGoneNotificationAlpha(viewState: ViewStateAccessor): Flow<Float> =
@@ -478,49 +421,72 @@
}
.dumpWhileCollecting("bouncerToGoneNotificationAlpha")
- fun keyguardAlpha(viewState: ViewStateAccessor): Flow<Float> {
- // All transition view models are mututally exclusive, and safe to merge
- val alphaTransitions =
- merge(
- keyguardInteractor.dismissAlpha.dumpWhileCollecting(
- "keyguardInteractor.dismissAlpha"
- ),
- bouncerToGoneNotificationAlpha(viewState),
- aodToGoneTransitionViewModel.notificationAlpha(viewState),
- aodToLockscreenTransitionViewModel.notificationAlpha,
- aodToOccludedTransitionViewModel.lockscreenAlpha(viewState),
- dozingToLockscreenTransitionViewModel.lockscreenAlpha,
- dozingToOccludedTransitionViewModel.lockscreenAlpha(viewState),
- dreamingToLockscreenTransitionViewModel.lockscreenAlpha,
- goneToAodTransitionViewModel.notificationAlpha,
- goneToDreamingTransitionViewModel.lockscreenAlpha,
- goneToDozingTransitionViewModel.notificationAlpha,
- goneToLockscreenTransitionViewModel.lockscreenAlpha,
- lockscreenToDreamingTransitionViewModel.lockscreenAlpha,
- lockscreenToGoneTransitionViewModel.notificationAlpha(viewState),
- lockscreenToOccludedTransitionViewModel.lockscreenAlpha,
- lockscreenToPrimaryBouncerTransitionViewModel.lockscreenAlpha,
- occludedToAodTransitionViewModel.lockscreenAlpha,
- occludedToGoneTransitionViewModel.notificationAlpha(viewState),
- occludedToLockscreenTransitionViewModel.lockscreenAlpha,
- primaryBouncerToLockscreenTransitionViewModel.lockscreenAlpha(viewState),
- glanceableHubToLockscreenTransitionViewModel.keyguardAlpha,
- lockscreenToGlanceableHubTransitionViewModel.keyguardAlpha,
- )
-
+ private fun alphaForTransitions(viewState: ViewStateAccessor): Flow<Float> {
return merge(
- alphaTransitions,
- // These remaining cases handle alpha changes within an existing state, such as
- // shade expansion or swipe to dismiss
- combineTransform(
- isTransitioningToHiddenKeyguard,
- alphaForShadeAndQsExpansion,
- ) { isTransitioningToHiddenKeyguard, alphaForShadeAndQsExpansion ->
- if (!isTransitioningToHiddenKeyguard) {
- emit(alphaForShadeAndQsExpansion)
- }
- },
- )
+ keyguardInteractor.dismissAlpha.dumpWhileCollecting("keyguardInteractor.dismissAlpha"),
+ // All transition view models are mututally exclusive, and safe to merge
+ bouncerToGoneNotificationAlpha(viewState),
+ aodToGoneTransitionViewModel.notificationAlpha(viewState),
+ aodToLockscreenTransitionViewModel.notificationAlpha,
+ aodToOccludedTransitionViewModel.lockscreenAlpha(viewState),
+ dozingToLockscreenTransitionViewModel.lockscreenAlpha,
+ dozingToOccludedTransitionViewModel.lockscreenAlpha(viewState),
+ dreamingToLockscreenTransitionViewModel.lockscreenAlpha,
+ goneToAodTransitionViewModel.notificationAlpha,
+ goneToDreamingTransitionViewModel.lockscreenAlpha,
+ goneToDozingTransitionViewModel.notificationAlpha,
+ goneToLockscreenTransitionViewModel.lockscreenAlpha,
+ lockscreenToDreamingTransitionViewModel.lockscreenAlpha,
+ lockscreenToGoneTransitionViewModel.notificationAlpha(viewState),
+ lockscreenToOccludedTransitionViewModel.lockscreenAlpha,
+ lockscreenToPrimaryBouncerTransitionViewModel.lockscreenAlpha,
+ occludedToAodTransitionViewModel.lockscreenAlpha,
+ occludedToGoneTransitionViewModel.notificationAlpha(viewState),
+ occludedToLockscreenTransitionViewModel.lockscreenAlpha,
+ primaryBouncerToLockscreenTransitionViewModel.lockscreenAlpha(viewState),
+ glanceableHubToLockscreenTransitionViewModel.keyguardAlpha,
+ lockscreenToGlanceableHubTransitionViewModel.keyguardAlpha,
+ )
+ }
+
+ fun keyguardAlpha(viewState: ViewStateAccessor, scope: CoroutineScope): Flow<Float> {
+ // Transitions are not (yet) authoritative for NSSL; they still rely on StatusBarState to
+ // help determine when the device has fully moved to GONE or OCCLUDED state. Once SHADE
+ // state has been set, let shade alpha take over
+ val isKeyguardNotVisible =
+ combine(
+ anyOf(
+ keyguardTransitionInteractor.transitionValue(OCCLUDED).map { it == 1f },
+ keyguardTransitionInteractor
+ .transitionValue(scene = Scenes.Gone, stateWithoutSceneContainer = GONE)
+ .map { it == 1f },
+ ),
+ keyguardInteractor.statusBarState,
+ ) { isKeyguardNotVisibleInState, statusBarState ->
+ isKeyguardNotVisibleInState && statusBarState == SHADE
+ }
+
+ // This needs to continue collecting the current value so that when it is selected in the
+ // flatMapLatest below, the last value gets emitted, to avoid the randomness of `merge`.
+ val alphaForTransitionsAndShade =
+ merge(alphaForTransitions(viewState), alphaForShadeAndQsExpansion)
+ .stateIn(
+ // Use view-level scope instead of ApplicationScope, to prevent collection that
+ // never stops
+ scope = scope,
+ started = SharingStarted.Eagerly,
+ initialValue = 1f,
+ )
+ .dumpValue("alphaForTransitionsAndShade")
+
+ return isKeyguardNotVisible
+ .flatMapLatest { isKeyguardNotVisible ->
+ if (isKeyguardNotVisible) {
+ alphaForShadeAndQsExpansion
+ } else {
+ alphaForTransitionsAndShade
+ }
+ }
.distinctUntilChanged()
.dumpWhileCollecting("keyguardAlpha")
}
@@ -543,9 +509,8 @@
)
// Manually emit on start because [notificationAlpha] only starts emitting
// when transitions start.
- .onStart { emit(1f) }
- ) { isOnGlanceableHubWithoutShade, isOnLockscreen, isDreamingWithoutShade, alpha,
- ->
+ .onStart { emit(1f) },
+ ) { isOnGlanceableHubWithoutShade, isOnLockscreen, isDreamingWithoutShade, alpha ->
if ((isOnGlanceableHubWithoutShade || isDreamingWithoutShade) && !isOnLockscreen) {
// Notifications should not be visible on the glanceable hub.
// TODO(b/321075734): implement a way to actually set the notifications to
@@ -580,7 +545,7 @@
merge(
keyguardInteractor.keyguardTranslationY,
occludedToLockscreenTransitionViewModel.lockscreenTranslationY,
- )
+ ),
) { burnInY, isOnLockscreenWithoutShade, translationY ->
if (isOnLockscreenWithoutShade) {
burnInY + translationY
@@ -604,7 +569,7 @@
unfoldTransitionInteractor.unfoldTranslationX(isOnStartSide = false)
} else {
emptyFlow()
- }
+ },
)
.dumpWhileCollecting("translationX")
@@ -634,7 +599,7 @@
primaryBouncerToGoneTransitionViewModel.showAllNotifications,
alternateBouncerToGoneTransitionViewModel.showAllNotifications,
)
- .onStart { emit(false) }
+ .onStart { emit(false) },
) { isOnLockscreen, statusBarState, showAllNotifications ->
statusBarState == SHADE_LOCKED || !isOnLockscreen || showAllNotifications
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt
index d4ef42c..5b37468 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt
@@ -470,9 +470,6 @@
if (dismissShade) {
shadeControllerLazy.get().collapseShadeForActivityStart()
}
- if (Flags.communalHub()) {
- communalSceneInteractor.changeSceneForActivityStartOnDismissKeyguard()
- }
return deferred
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java
index 1efad3b..0e7beb9d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java
@@ -262,6 +262,9 @@
releaseAllImmediately();
mReleaseOnExpandFinish = false;
} else {
+ for (NotificationEntry entry: getAllEntries().toList()) {
+ entry.setSeenInShade(true);
+ }
for (NotificationEntry entry : mEntriesToRemoveAfterExpand) {
if (isHeadsUpEntry(entry.getKey())) {
// Maybe the heads-up was removed already
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index dd4b000..1ea26e5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -61,6 +61,7 @@
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerCallbackInteractor;
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerCallbackInteractor.PrimaryBouncerExpansionCallback;
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor;
+import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags;
import com.android.systemui.bouncer.ui.BouncerView;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
@@ -70,8 +71,8 @@
import com.android.systemui.dreams.DreamOverlayStateController;
import com.android.systemui.keyguard.DismissCallbackRegistry;
import com.android.systemui.keyguard.KeyguardWmStateRefactor;
-import com.android.systemui.keyguard.domain.interactor.KeyguardDismissTransitionInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissActionInteractor;
+import com.android.systemui.keyguard.domain.interactor.KeyguardDismissTransitionInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.shared.model.DismissAction;
import com.android.systemui.keyguard.shared.model.Edge;
@@ -182,6 +183,7 @@
private boolean mBouncerShowingOverDream;
private int mAttemptsToShowBouncer = 0;
private DelayableExecutor mExecutor;
+ private boolean mIsSleeping = false;
private final PrimaryBouncerExpansionCallback mExpansionCallback =
new PrimaryBouncerExpansionCallback() {
@@ -713,7 +715,11 @@
* {@link #needsFullscreenBouncer()}.
*/
protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing, boolean isFalsingReset) {
- if (needsFullscreenBouncer() && !mDozing) {
+ boolean showBouncer = needsFullscreenBouncer() && !mDozing;
+ if (Flags.simPinRaceConditionOnRestart()) {
+ showBouncer = showBouncer && !mIsSleeping;
+ }
+ if (showBouncer) {
// The keyguard might be showing (already). So we need to hide it.
if (!primaryBouncerIsShowing()) {
if (SceneContainerFlag.isEnabled()) {
@@ -834,7 +840,7 @@
public void dismissWithAction(OnDismissAction r, Runnable cancelAction,
boolean afterKeyguardGone, String message) {
- if (SceneContainerFlag.isEnabled()) {
+ if (ComposeBouncerFlags.INSTANCE.isEnabled()) {
if (r == null) {
return;
}
@@ -886,7 +892,7 @@
return;
}
- if (!SceneContainerFlag.isEnabled()) {
+ if (!ComposeBouncerFlags.INSTANCE.isEnabled()) {
mAfterKeyguardGoneAction = r;
mKeyguardGoneCancelAction = cancelAction;
mDismissActionWillAnimateOnKeyguard = r != null
@@ -960,7 +966,7 @@
* Adds a {@param runnable} to be executed after Keyguard is gone.
*/
public void addAfterKeyguardGoneRunnable(Runnable runnable) {
- if (SceneContainerFlag.isEnabled()) {
+ if (ComposeBouncerFlags.INSTANCE.isEnabled()) {
if (runnable != null) {
mKeyguardDismissActionInteractor.get().runAfterKeyguardGone(runnable);
}
@@ -1041,6 +1047,7 @@
@Override
public void onStartedWakingUp() {
+ mIsSleeping = false;
setRootViewAnimationDisabled(false);
NavigationBarView navBarView = mCentralSurfaces.getNavigationBarView();
if (navBarView != null) {
@@ -1054,6 +1061,7 @@
@Override
public void onStartedGoingToSleep() {
+ mIsSleeping = true;
setRootViewAnimationDisabled(true);
NavigationBarView navBarView = mCentralSurfaces.getNavigationBarView();
if (navBarView != null) {
@@ -1173,7 +1181,7 @@
// We update the state (which will show the keyguard) only if an animation will run on
// the keyguard. If there is no animation, we wait before updating the state so that we
// go directly from bouncer to launcher/app.
- if (SceneContainerFlag.isEnabled()) {
+ if (ComposeBouncerFlags.INSTANCE.isEnabled()) {
if (mKeyguardDismissActionInteractor.get().runDismissAnimationOnKeyguard()) {
updateStates();
}
@@ -1300,7 +1308,7 @@
}
private void executeAfterKeyguardGoneAction() {
- if (SceneContainerFlag.isEnabled()) {
+ if (ComposeBouncerFlags.INSTANCE.isEnabled()) {
return;
}
if (mAfterKeyguardGoneAction != null) {
@@ -1696,6 +1704,8 @@
pw.println(" Registered KeyguardViewManagerCallbacks:");
pw.println(" SceneContainerFlag enabled:"
+ SceneContainerFlag.isEnabled());
+ pw.println(" ComposeBouncerFlags enabled:"
+ + ComposeBouncerFlags.INSTANCE.isEnabled());
for (KeyguardViewManagerCallback callback : mCallbacks) {
pw.println(" " + callback);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java
index c046168..0ad1042a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java
@@ -480,10 +480,16 @@
}
public static AlertDialog applyFlags(AlertDialog dialog) {
+ return applyFlags(dialog, true);
+ }
+
+ public static AlertDialog applyFlags(AlertDialog dialog, boolean showWhenLocked) {
final Window window = dialog.getWindow();
window.setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL);
- window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM
- | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
+ window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
+ if (showWhenLocked) {
+ window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
+ }
window.getAttributes().setFitInsetsTypes(
window.getAttributes().getFitInsetsTypes() & ~Type.statusBars());
return dialog;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
index 4a0fdee..659cee3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
@@ -55,6 +55,7 @@
import com.android.systemui.statusbar.OperatorNameView;
import com.android.systemui.statusbar.OperatorNameViewController;
import com.android.systemui.statusbar.StatusBarState;
+import com.android.systemui.statusbar.chips.shared.StatusBarRonChips;
import com.android.systemui.statusbar.disableflags.DisableFlagsLogger.DisableState;
import com.android.systemui.statusbar.events.SystemStatusAnimationCallback;
import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
@@ -122,6 +123,7 @@
private LinearLayout mEndSideContent;
private View mClockView;
private View mPrimaryOngoingActivityChip;
+ private View mSecondaryOngoingActivityChip;
private View mNotificationIconAreaInner;
// Visibilities come in from external system callers via disable flags, but we also sometimes
// modify the visibilities internally. We need to store both so that we don't accidentally
@@ -212,9 +214,16 @@
private boolean mHomeStatusBarAllowedByScene = true;
/**
- * True if there's an active ongoing activity that should be showing a chip and false otherwise.
+ * True if there's a primary active ongoing activity that should be showing a chip and false
+ * otherwise.
*/
- private boolean mHasOngoingActivity;
+ private boolean mHasPrimaryOngoingActivity;
+
+ /**
+ * True if there's a secondary active ongoing activity that should be showing a chip and false
+ * otherwise.
+ */
+ private boolean mHasSecondaryOngoingActivity;
/**
* Listener that updates {@link #mWaitingForWindowStateChangeAfterCameraLaunch} when it receives
@@ -355,6 +364,8 @@
mEndSideAlphaController = new MultiSourceMinAlphaController(mEndSideContent);
mClockView = mStatusBar.findViewById(R.id.clock);
mPrimaryOngoingActivityChip = mStatusBar.findViewById(R.id.ongoing_activity_chip_primary);
+ mSecondaryOngoingActivityChip =
+ mStatusBar.findViewById(R.id.ongoing_activity_chip_secondary);
showEndSideContent(false);
showClock(false);
initOperatorName();
@@ -508,8 +519,11 @@
@Override
public void onOngoingActivityStatusChanged(
- boolean hasOngoingActivity, boolean shouldAnimate) {
- mHasOngoingActivity = hasOngoingActivity;
+ boolean hasPrimaryOngoingActivity,
+ boolean hasSecondaryOngoingActivity,
+ boolean shouldAnimate) {
+ mHasPrimaryOngoingActivity = hasPrimaryOngoingActivity;
+ mHasSecondaryOngoingActivity = hasSecondaryOngoingActivity;
updateStatusBarVisibilities(shouldAnimate);
}
@@ -554,7 +568,7 @@
boolean notifsChanged =
newModel.getShowNotificationIcons() != previousModel.getShowNotificationIcons();
boolean ongoingActivityChanged =
- newModel.getShowOngoingActivityChip() != previousModel.getShowOngoingActivityChip();
+ newModel.isOngoingActivityStatusDifferentFrom(previousModel);
if (notifsChanged || ongoingActivityChanged) {
updateNotificationIconAreaAndOngoingActivityChip(animate);
}
@@ -597,21 +611,26 @@
boolean showClock = externalModel.getShowClock() && !headsUpVisible;
- boolean showOngoingActivityChip;
+ boolean showPrimaryOngoingActivityChip;
if (Flags.statusBarScreenSharingChips()) {
// If this flag is on, the ongoing activity status comes from
- // CollapsedStatusBarViewBinder, which updates the mHasOngoingActivity variable.
- showOngoingActivityChip = mHasOngoingActivity;
+ // CollapsedStatusBarViewBinder, which updates the mHasPrimaryOngoingActivity variable.
+ showPrimaryOngoingActivityChip = mHasPrimaryOngoingActivity;
} else {
// If this flag is off, the only ongoing activity is the ongoing call, and we pull it
// from the controller directly.
- showOngoingActivityChip = mOngoingCallController.hasOngoingCall();
+ showPrimaryOngoingActivityChip = mOngoingCallController.hasOngoingCall();
}
+ boolean showSecondaryOngoingActivityChip =
+ Flags.statusBarScreenSharingChips()
+ && StatusBarRonChips.isEnabled()
+ && mHasSecondaryOngoingActivity;
return new StatusBarVisibilityModel(
showClock,
externalModel.getShowNotificationIcons(),
- showOngoingActivityChip && !headsUpVisible,
+ showPrimaryOngoingActivityChip && !headsUpVisible,
+ showSecondaryOngoingActivityChip && !headsUpVisible,
externalModel.getShowSystemInfo());
}
@@ -622,7 +641,7 @@
private void updateNotificationIconAreaAndOngoingActivityChip(boolean animate) {
StatusBarVisibilityModel visibilityModel = mLastModifiedVisibility;
boolean disableNotifications = !visibilityModel.getShowNotificationIcons();
- boolean hasOngoingActivity = visibilityModel.getShowOngoingActivityChip();
+ boolean hasOngoingActivity = visibilityModel.getShowPrimaryOngoingActivityChip();
// Hide notifications if the disable flag is set or we have an ongoing activity.
if (disableNotifications || hasOngoingActivity) {
@@ -634,12 +653,24 @@
// Show the ongoing activity chip only if there is an ongoing activity *and* notification
// icons are allowed. (The ongoing activity chip occupies the same area as the notification,
// icons so if the icons are disabled then the activity chip should be, too.)
- boolean showOngoingActivityChip = hasOngoingActivity && !disableNotifications;
- if (showOngoingActivityChip) {
+ boolean showPrimaryOngoingActivityChip =
+ visibilityModel.getShowPrimaryOngoingActivityChip() && !disableNotifications;
+ if (showPrimaryOngoingActivityChip) {
showPrimaryOngoingActivityChip(animate);
} else {
hidePrimaryOngoingActivityChip(animate);
}
+
+ boolean showSecondaryOngoingActivityChip =
+ // Secondary chips are only supported when RONs are enabled.
+ StatusBarRonChips.isEnabled()
+ && visibilityModel.getShowSecondaryOngoingActivityChip()
+ && !disableNotifications;
+ if (showSecondaryOngoingActivityChip) {
+ showSecondaryOngoingActivityChip(animate);
+ } else {
+ hideSecondaryOngoingActivityChip(animate);
+ }
}
private boolean shouldHideStatusBar() {
@@ -745,6 +776,15 @@
animateShow(mPrimaryOngoingActivityChip, animate);
}
+ private void hideSecondaryOngoingActivityChip(boolean animate) {
+ animateHiddenState(mSecondaryOngoingActivityChip, View.GONE, animate);
+ }
+
+ private void showSecondaryOngoingActivityChip(boolean animate) {
+ StatusBarRonChips.assertInNewMode();
+ animateShow(mSecondaryOngoingActivityChip, animate);
+ }
+
/**
* If panel is expanded/expanding it usually means QS shade is opening, so
* don't set the clock GONE otherwise it'll mess up the animation.
@@ -850,6 +890,7 @@
private void initOngoingCallChip() {
mOngoingCallController.addCallback(mOngoingCallListener);
+ // TODO(b/364653005): Do we also need to set the secondary activity chip?
mOngoingCallController.setChipView(mPrimaryOngoingActivityChip);
}
@@ -908,7 +949,8 @@
@Override
public void dump(PrintWriter printWriter, String[] args) {
IndentingPrintWriter pw = new IndentingPrintWriter(printWriter, /* singleIndent= */" ");
- pw.println("mHasOngoingActivity=" + mHasOngoingActivity);
+ pw.println("mHasPrimaryOngoingActivity=" + mHasPrimaryOngoingActivity);
+ pw.println("mHasSecondaryOngoingActivity=" + mHasSecondaryOngoingActivity);
pw.println("mAnimationsEnabled=" + mAnimationsEnabled);
StatusBarFragmentComponent component = mStatusBarFragmentComponent;
if (component == null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLogger.kt
index 0a19023..deef886 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLogger.kt
@@ -16,16 +16,18 @@
package com.android.systemui.statusbar.phone.fragment
-import com.android.systemui.log.dagger.CollapsedSbFragmentLog
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.core.LogLevel
+import com.android.systemui.log.dagger.CollapsedSbFragmentLog
import com.android.systemui.statusbar.disableflags.DisableFlagsLogger
import javax.inject.Inject
/** Used by [CollapsedStatusBarFragment] to log messages to a [LogBuffer]. */
-class CollapsedStatusBarFragmentLogger @Inject constructor(
- @CollapsedSbFragmentLog private val buffer: LogBuffer,
- private val disableFlagsLogger: DisableFlagsLogger,
+class CollapsedStatusBarFragmentLogger
+@Inject
+constructor(
+ @CollapsedSbFragmentLog private val buffer: LogBuffer,
+ private val disableFlagsLogger: DisableFlagsLogger,
) {
/**
@@ -38,17 +40,17 @@
new: DisableFlagsLogger.DisableState,
) {
buffer.log(
- TAG,
- LogLevel.INFO,
- {
- int1 = new.disable1
- int2 = new.disable2
- },
- {
- disableFlagsLogger.getDisableFlagsString(
- DisableFlagsLogger.DisableState(int1, int2),
- )
- }
+ TAG,
+ LogLevel.INFO,
+ {
+ int1 = new.disable1
+ int2 = new.disable2
+ },
+ {
+ disableFlagsLogger.getDisableFlagsString(
+ DisableFlagsLogger.DisableState(int1, int2),
+ )
+ }
)
}
@@ -59,13 +61,16 @@
{
bool1 = model.showClock
bool2 = model.showNotificationIcons
- bool3 = model.showOngoingActivityChip
+ bool3 = model.showPrimaryOngoingActivityChip
+ int1 = if (model.showSecondaryOngoingActivityChip) 1 else 0
bool4 = model.showSystemInfo
},
- { "New visibilities calculated internally. " +
+ {
+ "New visibilities calculated internally. " +
"showClock=$bool1 " +
"showNotificationIcons=$bool2 " +
- "showOngoingActivityChip=$bool3 " +
+ "showPrimaryOngoingActivityChip=$bool3 " +
+ "showSecondaryOngoingActivityChip=${if (int1 == 1) "true" else "false"}" +
"showSystemInfo=$bool4"
}
)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModel.kt
index 9255e63..e9e9a4e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModel.kt
@@ -26,9 +26,15 @@
data class StatusBarVisibilityModel(
val showClock: Boolean,
val showNotificationIcons: Boolean,
- val showOngoingActivityChip: Boolean,
+ val showPrimaryOngoingActivityChip: Boolean,
+ val showSecondaryOngoingActivityChip: Boolean,
val showSystemInfo: Boolean,
) {
+ fun isOngoingActivityStatusDifferentFrom(other: StatusBarVisibilityModel): Boolean {
+ return this.showPrimaryOngoingActivityChip != other.showPrimaryOngoingActivityChip ||
+ this.showSecondaryOngoingActivityChip != other.showSecondaryOngoingActivityChip
+ }
+
companion object {
/** Creates the default model. */
@JvmStatic
@@ -42,7 +48,8 @@
return StatusBarVisibilityModel(
showClock = false,
showNotificationIcons = false,
- showOngoingActivityChip = false,
+ showPrimaryOngoingActivityChip = false,
+ showSecondaryOngoingActivityChip = false,
showSystemInfo = false,
)
}
@@ -59,7 +66,8 @@
showNotificationIcons = (disabled1 and DISABLE_NOTIFICATION_ICONS) == 0,
// TODO(b/279899176): [CollapsedStatusBarFragment] always overwrites this with the
// value of [OngoingCallController]. Do we need to process the flag here?
- showOngoingActivityChip = (disabled1 and DISABLE_ONGOING_CALL_CHIP) == 0,
+ showPrimaryOngoingActivityChip = (disabled1 and DISABLE_ONGOING_CALL_CHIP) == 0,
+ showSecondaryOngoingActivityChip = (disabled1 and DISABLE_ONGOING_CALL_CHIP) == 0,
showSystemInfo =
(disabled1 and DISABLE_SYSTEM_INFO) == 0 &&
(disabled2 and DISABLE2_SYSTEM_ICONS) == 0
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt
index 85bbe7e..d601319 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt
@@ -100,7 +100,14 @@
val showSpn = getBooleanExtra(EXTRA_SHOW_SPN, false)
val spn =
if (statusBarSwitchToSpnFromDataSpn()) {
- getStringExtra(EXTRA_SPN)
+ // Context: b/358669494. Use DATA_SPN if it exists, since that allows carriers to
+ // customize the display name. Otherwise, fall back to the SPN
+ val dataSpn = getStringExtra(EXTRA_DATA_SPN)
+ if (dataSpn.isNullOrEmpty()) {
+ getStringExtra(EXTRA_SPN)
+ } else {
+ dataSpn
+ }
} else {
getStringExtra(EXTRA_DATA_SPN)
}
@@ -109,10 +116,8 @@
val plmn = getStringExtra(EXTRA_PLMN)
val str = StringBuilder()
- val strData = StringBuilder()
if (showPlmn && plmn != null) {
str.append(plmn)
- strData.append(plmn)
}
if (showSpn && spn != null) {
if (str.isNotEmpty()) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/CollapsedStatusBarViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/CollapsedStatusBarViewBinder.kt
index 87d0e64..49eabba 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/CollapsedStatusBarViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/CollapsedStatusBarViewBinder.kt
@@ -80,7 +80,7 @@
}
}
- if (Flags.statusBarScreenSharingChips()) {
+ if (Flags.statusBarScreenSharingChips() && !Flags.statusBarRonChips()) {
val primaryChipView: View =
view.requireViewById(R.id.ongoing_activity_chip_primary)
launch {
@@ -89,12 +89,14 @@
when (primaryChipModel) {
is OngoingActivityChipModel.Shown ->
listener.onOngoingActivityStatusChanged(
- hasOngoingActivity = true,
+ hasPrimaryOngoingActivity = true,
+ hasSecondaryOngoingActivity = false,
shouldAnimate = true,
)
is OngoingActivityChipModel.Hidden ->
listener.onOngoingActivityStatusChanged(
- hasOngoingActivity = false,
+ hasPrimaryOngoingActivity = false,
+ hasSecondaryOngoingActivity = false,
shouldAnimate = primaryChipModel.shouldAnimate,
)
}
@@ -102,6 +104,29 @@
}
}
+ if (Flags.statusBarScreenSharingChips() && Flags.statusBarRonChips()) {
+ val primaryChipView: View =
+ view.requireViewById(R.id.ongoing_activity_chip_primary)
+ val secondaryChipView: View =
+ view.requireViewById(R.id.ongoing_activity_chip_secondary)
+ launch {
+ viewModel.ongoingActivityChips.collect { chips ->
+ OngoingActivityChipBinder.bind(chips.primary, primaryChipView)
+ // TODO(b/364653005): Don't show the secondary chip if there isn't
+ // enough space for it.
+ OngoingActivityChipBinder.bind(chips.secondary, secondaryChipView)
+ listener.onOngoingActivityStatusChanged(
+ hasPrimaryOngoingActivity =
+ chips.primary is OngoingActivityChipModel.Shown,
+ hasSecondaryOngoingActivity =
+ chips.secondary is OngoingActivityChipModel.Shown,
+ // TODO(b/364653005): Figure out the animation story here.
+ shouldAnimate = true,
+ )
+ }
+ }
+ }
+
if (SceneContainerFlag.isEnabled) {
launch {
viewModel.isHomeStatusBarAllowedByScene.collect {
@@ -161,7 +186,11 @@
* @param shouldAnimate true if the chip should animate in/out, and false if the chip should
* immediately appear/disappear.
*/
- fun onOngoingActivityStatusChanged(hasOngoingActivity: Boolean, shouldAnimate: Boolean)
+ fun onOngoingActivityStatusChanged(
+ hasPrimaryOngoingActivity: Boolean,
+ hasSecondaryOngoingActivity: Boolean,
+ shouldAnimate: Boolean,
+ )
/**
* Called when the scene state has changed such that the home status bar is newly allowed or no
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModel.kt
index 5474231..9cce2b8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModel.kt
@@ -27,6 +27,7 @@
import com.android.systemui.scene.domain.interactor.SceneContainerOcclusionInteractor
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.statusbar.chips.ui.model.MultipleOngoingActivityChipsModel
import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
import com.android.systemui.statusbar.chips.ui.viewmodel.OngoingActivityChipsViewModel
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
@@ -71,6 +72,12 @@
val primaryOngoingActivityChip: StateFlow<OngoingActivityChipModel>
/**
+ * The multiple ongoing activity chips that should be shown on the left-hand side of the status
+ * bar.
+ */
+ val ongoingActivityChips: StateFlow<MultipleOngoingActivityChipsModel>
+
+ /**
* True if the current scene can show the home status bar (aka this status bar), and false if
* the current scene should never show the home status bar.
*/
@@ -113,6 +120,8 @@
override val primaryOngoingActivityChip = ongoingActivityChipsViewModel.primaryChip
+ override val ongoingActivityChips = ongoingActivityChipsViewModel.chips
+
override val isHomeStatusBarAllowedByScene: StateFlow<Boolean> =
combine(
sceneInteractor.currentScene,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepository.kt
index fc7a672..bc7d376 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepository.kt
@@ -64,9 +64,6 @@
const val COL_NAME_IS_ENABLED = "isEnabled"
/** Column name to use for [isWifiDefault] for table logging. */
const val COL_NAME_IS_DEFAULT = "isDefault"
-
- const val CARRIER_MERGED_INVALID_SUB_ID_REASON =
- "Wifi network was carrier merged but had invalid sub ID"
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/demo/DemoWifiRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/demo/DemoWifiRepository.kt
index 7163e67..f4bb1a3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/demo/DemoWifiRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/demo/DemoWifiRepository.kt
@@ -46,7 +46,7 @@
private val _isWifiDefault = MutableStateFlow(false)
override val isWifiDefault: StateFlow<Boolean> = _isWifiDefault
- private val _wifiNetwork = MutableStateFlow<WifiNetworkModel>(WifiNetworkModel.Inactive)
+ private val _wifiNetwork = MutableStateFlow<WifiNetworkModel>(WifiNetworkModel.Inactive())
override val wifiNetwork: StateFlow<WifiNetworkModel> = _wifiNetwork
private val _secondaryNetworks = MutableStateFlow<List<WifiNetworkModel>>(emptyList())
@@ -82,7 +82,7 @@
_isWifiEnabled.value = false
_isWifiDefault.value = false
_wifiActivity.value = DataActivityModel(hasActivityIn = false, hasActivityOut = false)
- _wifiNetwork.value = WifiNetworkModel.Inactive
+ _wifiNetwork.value = WifiNetworkModel.Inactive()
}
private fun processEnabledWifiState(event: FakeWifiEventModel.Wifi) {
@@ -100,7 +100,7 @@
}
private fun FakeWifiEventModel.Wifi.toWifiNetworkModel(): WifiNetworkModel =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
isValidated = validated ?: true,
level = level ?: 0,
ssid = ssid ?: DEMO_NET_SSID,
@@ -108,7 +108,7 @@
)
private fun FakeWifiEventModel.CarrierMerged.toCarrierMergedModel(): WifiNetworkModel =
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = subscriptionId,
level = level,
numberOfLevels = numberOfLevels,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImpl.kt
index b6e73e0..76024cd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImpl.kt
@@ -19,7 +19,6 @@
import android.annotation.SuppressLint
import android.net.wifi.ScanResult
import android.net.wifi.WifiManager
-import android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
@@ -39,18 +38,14 @@
import com.android.systemui.statusbar.pipeline.shared.data.model.DataActivityModel
import com.android.systemui.statusbar.pipeline.shared.data.model.toWifiDataActivityModel
import com.android.systemui.statusbar.pipeline.wifi.data.repository.RealWifiRepository
-import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository.Companion.CARRIER_MERGED_INVALID_SUB_ID_REASON
import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository.Companion.COL_NAME_IS_DEFAULT
import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository.Companion.COL_NAME_IS_ENABLED
import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel
-import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel.Inactive.toHotspotDeviceType
+import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel.Unavailable.toHotspotDeviceType
import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiScanEntry
import com.android.wifitrackerlib.HotspotNetworkEntry
import com.android.wifitrackerlib.MergedCarrierEntry
import com.android.wifitrackerlib.WifiEntry
-import com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_MAX
-import com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_MIN
-import com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_UNREACHABLE
import com.android.wifitrackerlib.WifiPickerTracker
import java.util.concurrent.Executor
import javax.inject.Inject
@@ -246,36 +241,28 @@
}
private fun MergedCarrierEntry.convertCarrierMergedToModel(): WifiNetworkModel {
- return if (this.subscriptionId == INVALID_SUBSCRIPTION_ID) {
- WifiNetworkModel.Invalid(CARRIER_MERGED_INVALID_SUB_ID_REASON)
- } else {
- WifiNetworkModel.CarrierMerged(
- subscriptionId = this.subscriptionId,
- level = this.level,
- // WifiManager APIs to calculate the signal level start from 0, so
- // maxSignalLevel + 1 represents the total level buckets count.
- numberOfLevels = wifiManager.maxSignalLevel + 1,
- )
- }
+ // WifiEntry instance values aren't guaranteed to be stable between method calls
+ // because
+ // WifiPickerTracker is continuously updating the same object. Save the level in a
+ // local
+ // variable so that checking the level validity here guarantees that the level will
+ // still be
+ // valid when we create the `WifiNetworkModel.Active` instance later. Otherwise, the
+ // level
+ // could be valid here but become invalid later, and `WifiNetworkModel.Active` will
+ // throw
+ // an exception. See b/362384551.
+
+ return WifiNetworkModel.CarrierMerged.of(
+ subscriptionId = this.subscriptionId,
+ level = this.level,
+ // WifiManager APIs to calculate the signal level start from 0, so
+ // maxSignalLevel + 1 represents the total level buckets count.
+ numberOfLevels = wifiManager.maxSignalLevel + 1,
+ )
}
private fun WifiEntry.convertNormalToModel(): WifiNetworkModel {
- // WifiEntry instance values aren't guaranteed to be stable between method calls because
- // WifiPickerTracker is continuously updating the same object. Save the level in a local
- // variable so that checking the level validity here guarantees that the level will still be
- // valid when we create the `WifiNetworkModel.Active` instance later. Otherwise, the level
- // could be valid here but become invalid later, and `WifiNetworkModel.Active` will throw
- // an exception. See b/362384551.
- val currentLevel = this.level
- if (
- currentLevel == WIFI_LEVEL_UNREACHABLE ||
- currentLevel !in WIFI_LEVEL_MIN..WIFI_LEVEL_MAX
- ) {
- // If our level means the network is unreachable or the level is otherwise invalid, we
- // don't have an active network.
- return WifiNetworkModel.Inactive
- }
-
val hotspotDeviceType =
if (this is HotspotNetworkEntry) {
this.deviceType.toHotspotDeviceType()
@@ -283,9 +270,9 @@
WifiNetworkModel.HotspotDeviceType.NONE
}
- return WifiNetworkModel.Active(
+ return WifiNetworkModel.Active.of(
isValidated = this.hasInternetAccess(),
- level = currentLevel,
+ level = this.level,
ssid = this.title,
hotspotDeviceType = hotspotDeviceType,
)
@@ -421,7 +408,7 @@
companion object {
// Start out with no known wifi network.
- @VisibleForTesting val WIFI_NETWORK_DEFAULT = WifiNetworkModel.Inactive
+ @VisibleForTesting val WIFI_NETWORK_DEFAULT = WifiNetworkModel.Inactive()
private const val WIFI_STATE_DEFAULT = WifiManager.WIFI_STATE_DISABLED
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModel.kt
index 39842fb..3220377 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModel.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.pipeline.wifi.shared.model
+import android.net.wifi.WifiManager
import android.net.wifi.WifiManager.UNKNOWN_SSID
import android.net.wifi.sharedconnectivity.app.NetworkProviderInfo
import android.telephony.SubscriptionManager
@@ -23,8 +24,12 @@
import com.android.systemui.log.table.Diffable
import com.android.systemui.log.table.TableRowLogger
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionRepository
+import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel.Active.Companion.MAX_VALID_LEVEL
+import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel.Active.Companion.isValid
+import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel.Active.Companion.of
import com.android.wifitrackerlib.HotspotNetworkEntry.DeviceType
import com.android.wifitrackerlib.WifiEntry
+import com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_UNREACHABLE
/** Provides information about the current wifi network. */
sealed class WifiNetworkModel : Diffable<WifiNetworkModel> {
@@ -64,7 +69,7 @@
/** A description of why the wifi information was invalid. */
val invalidReason: String,
) : WifiNetworkModel() {
- override fun toString() = "WifiNetwork.Invalid[$invalidReason]"
+ override fun toString() = "WifiNetwork.Invalid[reason=$invalidReason]"
override fun logDiffs(prevVal: WifiNetworkModel, row: TableRowLogger) {
if (prevVal !is Invalid) {
@@ -73,12 +78,12 @@
}
if (invalidReason != prevVal.invalidReason) {
- row.logChange(COL_NETWORK_TYPE, "$TYPE_UNAVAILABLE $invalidReason")
+ row.logChange(COL_NETWORK_TYPE, "$TYPE_UNAVAILABLE[reason=$invalidReason]")
}
}
override fun logFull(row: TableRowLogger) {
- row.logChange(COL_NETWORK_TYPE, "$TYPE_UNAVAILABLE $invalidReason")
+ row.logChange(COL_NETWORK_TYPE, "$TYPE_UNAVAILABLE[reason=$invalidReason]")
row.logChange(COL_SUB_ID, SUB_ID_DEFAULT)
row.logChange(COL_VALIDATED, false)
row.logChange(COL_LEVEL, LEVEL_DEFAULT)
@@ -89,20 +94,25 @@
}
/** A model representing that we have no active wifi network. */
- object Inactive : WifiNetworkModel() {
- override fun toString() = "WifiNetwork.Inactive"
+ data class Inactive(
+ /** An optional description of why the wifi information was inactive. */
+ val inactiveReason: String? = null,
+ ) : WifiNetworkModel() {
+ override fun toString() = "WifiNetwork.Inactive[reason=$inactiveReason]"
override fun logDiffs(prevVal: WifiNetworkModel, row: TableRowLogger) {
- if (prevVal is Inactive) {
+ if (prevVal !is Inactive) {
+ logFull(row)
return
}
- // When changing to Inactive, we need to log diffs to all the fields.
- logFull(row)
+ if (inactiveReason != prevVal.inactiveReason) {
+ row.logChange(COL_NETWORK_TYPE, "$TYPE_INACTIVE[reason=$inactiveReason]")
+ }
}
override fun logFull(row: TableRowLogger) {
- row.logChange(COL_NETWORK_TYPE, TYPE_INACTIVE)
+ row.logChange(COL_NETWORK_TYPE, "$TYPE_INACTIVE[reason=$inactiveReason]")
row.logChange(COL_SUB_ID, SUB_ID_DEFAULT)
row.logChange(COL_VALIDATED, false)
row.logChange(COL_LEVEL, LEVEL_DEFAULT)
@@ -117,31 +127,71 @@
* treated as more of a mobile network.
*
* See [android.net.wifi.WifiInfo.isCarrierMerged] for more information.
+ *
+ * IMPORTANT: Do *not* call [copy] on this class. Instead, use the factory [of] methods. [of]
+ * will verify preconditions correctly.
*/
- data class CarrierMerged(
+ data class CarrierMerged
+ private constructor(
/**
* The subscription ID that this connection represents.
*
* Comes from [android.net.wifi.WifiInfo.getSubscriptionId].
*
- * Per that method, this value must not be [INVALID_SUBSCRIPTION_ID] (if it was invalid,
- * then this is *not* a carrier merged network).
+ * Per that method, this value must not be [SubscriptionManager.INVALID_SUBSCRIPTION_ID] (if
+ * it was invalid, then this is *not* a carrier merged network).
*/
val subscriptionId: Int,
- /** The signal level, guaranteed to be 0 <= level <= numberOfLevels. */
+ /** The signal level, required to be 0 <= level <= numberOfLevels. */
val level: Int,
/** The maximum possible level. */
- val numberOfLevels: Int = MobileConnectionRepository.DEFAULT_NUM_LEVELS,
+ val numberOfLevels: Int,
) : WifiNetworkModel() {
- init {
- require(level in MIN_VALID_LEVEL..numberOfLevels) {
- "CarrierMerged: $MIN_VALID_LEVEL <= wifi level <= $numberOfLevels required; " +
+ companion object {
+ /**
+ * Creates a [CarrierMerged] instance, or an [Invalid] instance if any of the arguments
+ * are invalid.
+ */
+ fun of(
+ subscriptionId: Int,
+ level: Int,
+ numberOfLevels: Int = MobileConnectionRepository.DEFAULT_NUM_LEVELS
+ ): WifiNetworkModel {
+ if (!subscriptionId.isSubscriptionIdValid()) {
+ return Invalid(INVALID_SUB_ID_ERROR_STRING)
+ }
+ if (!level.isLevelValid(numberOfLevels)) {
+ return Invalid(getInvalidLevelErrorString(level, numberOfLevels))
+ }
+ return CarrierMerged(subscriptionId, level, numberOfLevels)
+ }
+
+ private fun Int.isLevelValid(maxLevel: Int): Boolean {
+ return this != WIFI_LEVEL_UNREACHABLE && this in MIN_VALID_LEVEL..maxLevel
+ }
+
+ private fun getInvalidLevelErrorString(level: Int, maxLevel: Int): String {
+ return "Wifi network was carrier merged but had invalid level. " +
+ "$MIN_VALID_LEVEL <= wifi level <= $maxLevel required; " +
"level was $level"
}
- require(subscriptionId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
- "subscription ID cannot be invalid"
+
+ private fun Int.isSubscriptionIdValid(): Boolean {
+ return this != SubscriptionManager.INVALID_SUBSCRIPTION_ID
+ }
+
+ private const val INVALID_SUB_ID_ERROR_STRING =
+ "Wifi network was carrier merged but had invalid sub ID"
+ }
+
+ init {
+ require(level.isLevelValid(numberOfLevels)) {
+ "${getInvalidLevelErrorString(level, numberOfLevels)}. $DO_NOT_USE_COPY_ERROR"
+ }
+ require(subscriptionId.isSubscriptionIdValid()) {
+ "$INVALID_SUB_ID_ERROR_STRING. $DO_NOT_USE_COPY_ERROR"
}
}
@@ -173,28 +223,64 @@
}
}
- /** Provides information about an active wifi network. */
- data class Active(
+ /**
+ * Provides information about an active wifi network.
+ *
+ * IMPORTANT: Do *not* call [copy] on this class. Instead, use the factory [of] method. [of]
+ * will verify preconditions correctly.
+ */
+ data class Active
+ private constructor(
/** See [android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED]. */
- val isValidated: Boolean = false,
+ val isValidated: Boolean,
- /** The wifi signal level, guaranteed to be 0 <= level <= 4. */
+ /** The wifi signal level, required to be 0 <= level <= 4. */
val level: Int,
/** See [android.net.wifi.WifiInfo.ssid]. */
- val ssid: String? = null,
+ val ssid: String?,
/**
* The type of device providing a hotspot connection, or [HotspotDeviceType.NONE] if this
* isn't a hotspot connection.
*/
- val hotspotDeviceType: HotspotDeviceType = WifiNetworkModel.HotspotDeviceType.NONE,
+ val hotspotDeviceType: HotspotDeviceType,
) : WifiNetworkModel() {
- init {
- require(level in MIN_VALID_LEVEL..MAX_VALID_LEVEL) {
- "Active: $MIN_VALID_LEVEL <= wifi level <= $MAX_VALID_LEVEL required; " +
+ companion object {
+ /**
+ * Creates an [Active] instance, or an [Inactive] instance if any of the arguments are
+ * invalid.
+ */
+ @JvmStatic
+ fun of(
+ isValidated: Boolean = false,
+ level: Int,
+ ssid: String? = null,
+ hotspotDeviceType: HotspotDeviceType = HotspotDeviceType.NONE,
+ ): WifiNetworkModel {
+ if (!level.isValid()) {
+ return Inactive(getInvalidLevelErrorString(level))
+ }
+ return Active(isValidated, level, ssid, hotspotDeviceType)
+ }
+
+ private fun Int.isValid(): Boolean {
+ return this != WIFI_LEVEL_UNREACHABLE && this in MIN_VALID_LEVEL..MAX_VALID_LEVEL
+ }
+
+ private fun getInvalidLevelErrorString(level: Int): String {
+ return "Wifi network was active but had invalid level. " +
+ "$MIN_VALID_LEVEL <= wifi level <= $MAX_VALID_LEVEL required; " +
"level was $level"
}
+
+ @VisibleForTesting internal const val MAX_VALID_LEVEL = WifiEntry.WIFI_LEVEL_MAX
+ }
+
+ init {
+ require(level.isValid()) {
+ "${getInvalidLevelErrorString(level)}. $DO_NOT_USE_COPY_ERROR"
+ }
}
/** Returns true if this network has a valid SSID and false otherwise. */
@@ -231,10 +317,6 @@
row.logChange(COL_SSID, ssid)
row.logChange(COL_HOTSPOT, hotspotDeviceType.name)
}
-
- companion object {
- @VisibleForTesting internal const val MAX_VALID_LEVEL = WifiEntry.WIFI_LEVEL_MAX
- }
}
companion object {
@@ -292,3 +374,7 @@
val LEVEL_DEFAULT: String? = null
val NUM_LEVELS_DEFAULT: String? = null
val SUB_ID_DEFAULT: String? = null
+
+private const val DO_NOT_USE_COPY_ERROR =
+ "This should only be an issue if the caller incorrectly used `copy` to get a new instance. " +
+ "Please use the `of` method instead."
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/PolicyModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/PolicyModule.kt
index 591d7af..cf9f9f4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/PolicyModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/PolicyModule.kt
@@ -23,6 +23,7 @@
import com.android.systemui.Flags
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.AlarmTile
import com.android.systemui.qs.tiles.CameraToggleTile
@@ -157,6 +158,7 @@
labelRes = R.string.quick_settings_flashlight_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.UTILITIES,
)
/** Inject FlashlightTile into tileViewModelMap in QSModule */
@@ -192,7 +194,8 @@
policy =
QSTilePolicy.Restricted(
listOf(DISALLOW_SHARE_LOCATION, DISALLOW_CONFIG_LOCATION)
- )
+ ),
+ category = TileCategory.PRIVACY,
)
/** Inject LocationTile into tileViewModelMap in QSModule */
@@ -225,6 +228,7 @@
labelRes = R.string.status_bar_alarm,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.UTILITIES,
)
/** Inject AlarmTile into tileViewModelMap in QSModule */
@@ -257,6 +261,7 @@
labelRes = R.string.quick_settings_ui_mode_night_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.DISPLAY,
)
/** Inject uimodenight into tileViewModelMap in QSModule */
@@ -290,6 +295,7 @@
),
instanceId = uiEventLogger.getNewInstanceId(),
autoRemoveOnUnavailable = false,
+ category = TileCategory.PRIVACY,
)
/** Inject work mode into tileViewModelMap in QSModule */
@@ -323,6 +329,7 @@
),
instanceId = uiEventLogger.getNewInstanceId(),
policy = QSTilePolicy.Restricted(listOf(DISALLOW_CAMERA_TOGGLE)),
+ category = TileCategory.PRIVACY,
)
/** Inject camera toggle tile into tileViewModelMap in QSModule */
@@ -365,6 +372,7 @@
),
instanceId = uiEventLogger.getNewInstanceId(),
policy = QSTilePolicy.Restricted(listOf(DISALLOW_MICROPHONE_TOGGLE)),
+ category = TileCategory.PRIVACY,
)
/** Inject microphone toggle tile into tileViewModelMap in QSModule */
@@ -407,6 +415,7 @@
labelRes = R.string.quick_settings_modes_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.CONNECTIVITY,
)
} else {
QSTileConfig(
@@ -417,6 +426,7 @@
labelRes = R.string.quick_settings_dnd_label,
),
instanceId = uiEventLogger.getNewInstanceId(),
+ category = TileCategory.CONNECTIVITY,
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/telephony/domain/interactor/TelephonyInteractor.kt b/packages/SystemUI/src/com/android/systemui/telephony/domain/interactor/TelephonyInteractor.kt
index 4b0e5d1..6d99183 100644
--- a/packages/SystemUI/src/com/android/systemui/telephony/domain/interactor/TelephonyInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/telephony/domain/interactor/TelephonyInteractor.kt
@@ -29,11 +29,12 @@
class TelephonyInteractor
@Inject
constructor(
- repository: TelephonyRepository,
+ private val repository: TelephonyRepository,
) {
@Annotation.CallState val callState: Flow<Int> = repository.callState
val isInCall: StateFlow<Boolean> = repository.isInCall
- val hasTelephonyRadio: Boolean = repository.hasTelephonyRadio
+ val hasTelephonyRadio: Boolean
+ get() = repository.hasTelephonyRadio
}
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/BackGestureMonitor.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/BackGestureMonitor.kt
index e3666ce..084da2c 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/BackGestureMonitor.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/BackGestureMonitor.kt
@@ -23,7 +23,7 @@
override val gestureDistanceThresholdPx: Int,
override val gestureStateChangedCallback: (GestureState) -> Unit
) :
- TouchpadGestureMonitor by ThreeFingerGestureMonitor(
+ TouchpadGestureMonitor by ThreeFingerDistanceBasedGestureMonitor(
gestureDistanceThresholdPx = gestureDistanceThresholdPx,
gestureStateChangedCallback = gestureStateChangedCallback,
donePredicate =
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/HomeGestureMonitor.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/HomeGestureMonitor.kt
index a410f99..a9aa5c8 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/HomeGestureMonitor.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/HomeGestureMonitor.kt
@@ -21,7 +21,7 @@
override val gestureDistanceThresholdPx: Int,
override val gestureStateChangedCallback: (GestureState) -> Unit
) :
- TouchpadGestureMonitor by ThreeFingerGestureMonitor(
+ TouchpadGestureMonitor by ThreeFingerDistanceBasedGestureMonitor(
gestureDistanceThresholdPx = gestureDistanceThresholdPx,
gestureStateChangedCallback = gestureStateChangedCallback,
donePredicate =
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/RecentAppsGestureMonitor.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/RecentAppsGestureMonitor.kt
new file mode 100644
index 0000000..5828239
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/RecentAppsGestureMonitor.kt
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.touchpad.tutorial.ui.gesture
+
+import android.view.MotionEvent
+import androidx.compose.ui.input.pointer.util.VelocityTracker1D
+import kotlin.math.abs
+
+/**
+ * Monitors recent apps gesture completion. That is - using three fingers on touchpad - swipe up
+ * over some distance threshold and then slow down gesture before fingers are lifted. Implementation
+ * is based on [com.android.quickstep.util.TriggerSwipeUpTouchTracker]
+ */
+class RecentAppsGestureMonitor(
+ override val gestureDistanceThresholdPx: Int,
+ override val gestureStateChangedCallback: (GestureState) -> Unit,
+ private val velocityThresholdPxPerMs: Float,
+ private val velocityTracker: VelocityTracker1D = VelocityTracker1D(isDataDifferential = false),
+) : TouchpadGestureMonitor {
+
+ private var xStart = 0f
+ private var yStart = 0f
+
+ override fun processTouchpadEvent(event: MotionEvent) {
+ val action = event.actionMasked
+ velocityTracker.addDataPoint(event.eventTime, event.y)
+ when (action) {
+ MotionEvent.ACTION_DOWN -> {
+ if (isThreeFingerTouchpadSwipe(event)) {
+ xStart = event.x
+ yStart = event.y
+ gestureStateChangedCallback(GestureState.IN_PROGRESS)
+ }
+ }
+ MotionEvent.ACTION_UP -> {
+ if (isThreeFingerTouchpadSwipe(event) && isRecentAppsGesture(event)) {
+ gestureStateChangedCallback(GestureState.FINISHED)
+ } else {
+ gestureStateChangedCallback(GestureState.NOT_STARTED)
+ }
+ velocityTracker.resetTracking()
+ }
+ MotionEvent.ACTION_CANCEL -> {
+ velocityTracker.resetTracking()
+ }
+ }
+ }
+
+ private fun isRecentAppsGesture(event: MotionEvent): Boolean {
+ // below is trying to mirror behavior of TriggerSwipeUpTouchTracker#onGestureEnd.
+ // We're diving velocity by 1000, to have the same unit of measure: pixels/ms.
+ val swipeDistance = yStart - event.y
+ val velocity = velocityTracker.calculateVelocity() / 1000
+ return swipeDistance >= gestureDistanceThresholdPx &&
+ abs(velocity) <= velocityThresholdPxPerMs
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/ThreeFingerGestureMonitor.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/ThreeFingerDistanceBasedGestureMonitor.kt
similarity index 87%
rename from packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/ThreeFingerGestureMonitor.kt
rename to packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/ThreeFingerDistanceBasedGestureMonitor.kt
index 377977c..9bf0fe9 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/ThreeFingerGestureMonitor.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/gesture/ThreeFingerDistanceBasedGestureMonitor.kt
@@ -25,8 +25,12 @@
fun wasGestureDone(startX: Float, startY: Float, endX: Float, endY: Float): Boolean
}
-/** Common implementation for all three-finger gesture monitors */
-class ThreeFingerGestureMonitor(
+/**
+ * Common implementation for three-finger gesture monitors that are only distance-based. E.g. recent
+ * apps gesture is not only distance-based because it requires going over threshold distance and
+ * slowing down the movement.
+ */
+class ThreeFingerDistanceBasedGestureMonitor(
override val gestureDistanceThresholdPx: Int,
override val gestureStateChangedCallback: (GestureState) -> Unit,
private val donePredicate: GestureDonePredicate
diff --git a/packages/SystemUI/src/com/android/systemui/util/kotlin/ReduceBrightColorsControllerExt.kt b/packages/SystemUI/src/com/android/systemui/util/kotlin/ReduceBrightColorsControllerExt.kt
index e6e2a07..ee00e8b 100644
--- a/packages/SystemUI/src/com/android/systemui/util/kotlin/ReduceBrightColorsControllerExt.kt
+++ b/packages/SystemUI/src/com/android/systemui/util/kotlin/ReduceBrightColorsControllerExt.kt
@@ -35,17 +35,3 @@
}
.onStart { emit(isReduceBrightColorsActivated) }
}
-
-fun ReduceBrightColorsController.isAvailable(): Flow<Boolean> {
- return conflatedCallbackFlow {
- val callback =
- object : ReduceBrightColorsController.Listener {
- override fun onFeatureEnabledChanged(enabled: Boolean) {
- trySend(enabled)
- }
- }
- addCallback(callback)
- awaitClose { removeCallback(callback) }
- }
- .onStart { emit(isReduceBrightColorsFeatureAvailable) }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/util/ui/AnimatedValue.kt b/packages/SystemUI/src/com/android/systemui/util/ui/AnimatedValue.kt
index 1112d6f..a5c8af5 100644
--- a/packages/SystemUI/src/com/android/systemui/util/ui/AnimatedValue.kt
+++ b/packages/SystemUI/src/com/android/systemui/util/ui/AnimatedValue.kt
@@ -26,7 +26,7 @@
/**
* A state comprised of a [value] of type [T] paired with a boolean indicating whether or not the
- * [value] [isAnimating] in the UI.
+ * value [isAnimating][isAnimating] in the UI.
*/
sealed interface AnimatedValue<out T> {
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
index 8934d8f..030a20a 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
@@ -391,11 +391,7 @@
}
public void notifyVisible(boolean visible) {
- if (Flags.useVolumeController()) {
- mVolumeControllerAdapter.notifyVolumeControllerVisible(visible);
- } else {
- mWorker.obtainMessage(W.NOTIFY_VISIBLE, visible ? 1 : 0, 0).sendToTarget();
- }
+ mWorker.obtainMessage(W.NOTIFY_VISIBLE, visible ? 1 : 0, 0).sendToTarget();
}
public void userActivity() {
@@ -457,7 +453,11 @@
}
private void onNotifyVisibleW(boolean visible) {
- mAudio.notifyVolumeControllerVisible(mVolumeController, visible);
+ if (Flags.useVolumeController()) {
+ mVolumeControllerAdapter.notifyVolumeControllerVisible(visible);
+ } else {
+ mAudio.notifyVolumeControllerVisible(mVolumeController, visible);
+ }
if (!visible) {
if (updateActiveStreamW(-1)) {
mCallbacks.onStateChanged(mState);
@@ -1305,13 +1305,12 @@
if (action.equals(AudioManager.VOLUME_CHANGED_ACTION)) {
final int stream = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE,
STREAM_UNKNOWN);
- final int level = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, -1);
final int oldLevel = intent
.getIntExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE, -1);
if (D.BUG) Log.d(TAG, "onReceive VOLUME_CHANGED_ACTION stream=" + stream
- + " level=" + level + " oldLevel=" + oldLevel);
+ + " oldLevel=" + oldLevel);
if (stream != STREAM_UNKNOWN) {
- changed = updateStreamLevelW(stream, level);
+ changed |= onVolumeChangedW(stream, 0);
}
} else if (action.equals(AudioManager.STREAM_DEVICES_CHANGED_ACTION)) {
final int stream = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE,
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index 7786453..db4f9ef 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -1991,7 +1991,7 @@
: R.drawable.ic_volume_media_bt;
}
} else if (isStreamMuted(ss)) {
- iconRes = (ss.muted && isTv()) ? R.drawable.ic_volume_media_off : row.iconMuteRes;
+ iconRes = row.iconMuteRes;
} else {
iconRes = mShowLowMediaVolumeIcon && ss.level * 2 < (ss.levelMax + ss.levelMin)
? R.drawable.ic_volume_media_low : row.iconRes;
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dagger/CaptioningModule.kt b/packages/SystemUI/src/com/android/systemui/volume/dagger/CaptioningModule.kt
index 9715772..28a43df 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dagger/CaptioningModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dagger/CaptioningModule.kt
@@ -16,35 +16,16 @@
package com.android.systemui.volume.dagger
-import android.view.accessibility.CaptioningManager
import com.android.systemui.accessibility.data.repository.CaptioningRepository
import com.android.systemui.accessibility.data.repository.CaptioningRepositoryImpl
-import com.android.systemui.accessibility.domain.interactor.CaptioningInteractor
import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.dagger.qualifiers.Application
-import com.android.systemui.dagger.qualifiers.Background
+import dagger.Binds
import dagger.Module
-import dagger.Provides
-import kotlin.coroutines.CoroutineContext
-import kotlinx.coroutines.CoroutineScope
@Module
interface CaptioningModule {
- companion object {
-
- @Provides
- @SysUISingleton
- fun provideCaptioningRepository(
- captioningManager: CaptioningManager,
- @Background coroutineContext: CoroutineContext,
- @Application coroutineScope: CoroutineScope,
- ): CaptioningRepository =
- CaptioningRepositoryImpl(captioningManager, coroutineContext, coroutineScope)
-
- @Provides
- @SysUISingleton
- fun provideCaptioningInteractor(repository: CaptioningRepository): CaptioningInteractor =
- CaptioningInteractor(repository)
- }
+ @Binds
+ @SysUISingleton
+ fun bindCaptioningRepository(impl: CaptioningRepositoryImpl): CaptioningRepository
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/captioning/domain/CaptioningAvailabilityCriteria.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/captioning/domain/CaptioningAvailabilityCriteria.kt
index 52f2ce6..2e5e389 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/captioning/domain/CaptioningAvailabilityCriteria.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/captioning/domain/CaptioningAvailabilityCriteria.kt
@@ -26,7 +26,7 @@
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.onEach
-import kotlinx.coroutines.flow.shareIn
+import kotlinx.coroutines.flow.stateIn
@VolumePanelScope
class CaptioningAvailabilityCriteria
@@ -45,7 +45,7 @@
else VolumePanelUiEvent.VOLUME_PANEL_LIVE_CAPTION_TOGGLE_GONE
)
}
- .shareIn(scope, SharingStarted.WhileSubscribed(), replay = 1)
+ .stateIn(scope, SharingStarted.WhileSubscribed(), false)
override fun isAvailable(): Flow<Boolean> = availability
}
diff --git a/packages/SystemUI/src/com/android/systemui/wallet/dagger/WalletModule.java b/packages/SystemUI/src/com/android/systemui/wallet/dagger/WalletModule.java
index ea213cb..dd1c11d 100644
--- a/packages/SystemUI/src/com/android/systemui/wallet/dagger/WalletModule.java
+++ b/packages/SystemUI/src/com/android/systemui/wallet/dagger/WalletModule.java
@@ -25,6 +25,7 @@
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.qs.QsEventLogger;
import com.android.systemui.qs.pipeline.shared.TileSpec;
+import com.android.systemui.qs.shared.model.TileCategory;
import com.android.systemui.qs.tileimpl.QSTileImpl;
import com.android.systemui.qs.tiles.QuickAccessWalletTile;
import com.android.systemui.qs.tiles.viewmodel.QSTileConfig;
@@ -34,8 +35,6 @@
import com.android.systemui.wallet.controller.WalletContextualLocationsService;
import com.android.systemui.wallet.ui.WalletActivity;
-import java.util.concurrent.Executor;
-
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
@@ -43,6 +42,8 @@
import dagger.multibindings.IntoMap;
import dagger.multibindings.StringKey;
+import java.util.concurrent.Executor;
+
/**
* Module for injecting classes in Wallet.
*/
@@ -90,6 +91,7 @@
R.string.wallet_title
),
uiEventLogger.getNewInstanceId(),
+ TileCategory.UTILITIES,
tileSpec.getSpec(),
QSTilePolicy.NoRestrictions.INSTANCE
);
diff --git a/packages/SystemUI/tests/Android.bp b/packages/SystemUI/tests/Android.bp
index f601387..3e7596c 100644
--- a/packages/SystemUI/tests/Android.bp
+++ b/packages/SystemUI/tests/Android.bp
@@ -35,9 +35,9 @@
"libstaticjvmtiagent",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
"telephony-common",
- "android.test.base",
+ "android.test.base.stubs.system",
],
aaptflags: [
"--extra-packages com.android.systemui",
diff --git a/packages/SystemUI/tests/goldens/bouncerPredictiveBackMotion.json b/packages/SystemUI/tests/goldens/bouncerPredictiveBackMotion.json
new file mode 100644
index 0000000..f37580d
--- /dev/null
+++ b/packages/SystemUI/tests/goldens/bouncerPredictiveBackMotion.json
@@ -0,0 +1,831 @@
+{
+ "frame_ids": [
+ "before",
+ 0,
+ 16,
+ 32,
+ 48,
+ 64,
+ 80,
+ 96,
+ 112,
+ 128,
+ 144,
+ 160,
+ 176,
+ 192,
+ 208,
+ 224,
+ 240,
+ 256,
+ 272,
+ 288,
+ 304,
+ 320,
+ 336,
+ 352,
+ 368,
+ 384,
+ 400,
+ 416,
+ 432,
+ 448,
+ 464,
+ 480,
+ 496,
+ 512,
+ 528,
+ 544,
+ 560,
+ 576,
+ 592,
+ 608,
+ 624,
+ 640,
+ 656,
+ 672,
+ 688,
+ 704,
+ 720,
+ 736,
+ 752,
+ 768,
+ 784,
+ 800,
+ 816,
+ 832,
+ 848,
+ 864,
+ 880,
+ 896,
+ 912,
+ 928,
+ 944,
+ 960,
+ 976,
+ 992,
+ 1008,
+ 1024,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "content_alpha",
+ "type": "float",
+ "data_points": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 0.9954499,
+ 0.9805035,
+ 0.9527822,
+ 0.9092045,
+ 0.84588075,
+ 0.7583043,
+ 0.6424476,
+ 0.49766344,
+ 0.33080608,
+ 0.15650165,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ {
+ "type": "not_found"
+ }
+ ]
+ },
+ {
+ "name": "content_scale",
+ "type": "scale",
+ "data_points": [
+ "default",
+ {
+ "x": 0.9995097,
+ "y": 0.9995097,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.997352,
+ "y": 0.997352,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.990635,
+ "y": 0.990635,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.97249764,
+ "y": 0.97249764,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.94287145,
+ "y": 0.94287145,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.9128026,
+ "y": 0.9128026,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8859569,
+ "y": 0.8859569,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8629254,
+ "y": 0.8629254,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8442908,
+ "y": 0.8442908,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8303209,
+ "y": 0.8303209,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8205137,
+ "y": 0.8205137,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.81387186,
+ "y": 0.81387186,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80941653,
+ "y": 0.80941653,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80641484,
+ "y": 0.80641484,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80437464,
+ "y": 0.80437464,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80297637,
+ "y": 0.80297637,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80201286,
+ "y": 0.80201286,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8013477,
+ "y": 0.8013477,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8008894,
+ "y": 0.8008894,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8005756,
+ "y": 0.8005756,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80036324,
+ "y": 0.80036324,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8002219,
+ "y": 0.8002219,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80012995,
+ "y": 0.80012995,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8000721,
+ "y": 0.8000721,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.80003715,
+ "y": 0.80003715,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8000173,
+ "y": 0.8000173,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.800007,
+ "y": 0.800007,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8000022,
+ "y": 0.8000022,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8000004,
+ "y": 0.8000004,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.79999995,
+ "y": 0.79999995,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "x": 0.8,
+ "y": 0.8,
+ "pivot": "unspecified"
+ },
+ {
+ "type": "not_found"
+ }
+ ]
+ },
+ {
+ "name": "content_offset",
+ "type": "dpOffset",
+ "data_points": [
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "x": 0,
+ "y": 0.5714286
+ },
+ {
+ "x": 0,
+ "y": 2.857143
+ },
+ {
+ "x": 0,
+ "y": 7.142857
+ },
+ {
+ "x": 0,
+ "y": 13.714286
+ },
+ {
+ "x": 0,
+ "y": 23.142857
+ },
+ {
+ "x": 0,
+ "y": 36.285713
+ },
+ {
+ "x": 0,
+ "y": 53.714287
+ },
+ {
+ "x": 0,
+ "y": 75.42857
+ },
+ {
+ "x": 0,
+ "y": 100.28571
+ },
+ {
+ "x": 0,
+ "y": 126.57143
+ },
+ {
+ "x": 0,
+ "y": 151.42857
+ },
+ {
+ "x": 0,
+ "y": 174
+ },
+ {
+ "x": 0,
+ "y": 193.42857
+ },
+ {
+ "x": 0,
+ "y": 210.28572
+ },
+ {
+ "x": 0,
+ "y": 224.85715
+ },
+ {
+ "x": 0,
+ "y": 237.14285
+ },
+ {
+ "x": 0,
+ "y": 247.71428
+ },
+ {
+ "x": 0,
+ "y": 256.85715
+ },
+ {
+ "x": 0,
+ "y": 264.57144
+ },
+ {
+ "x": 0,
+ "y": 271.42856
+ },
+ {
+ "x": 0,
+ "y": 277.14285
+ },
+ {
+ "x": 0,
+ "y": 282
+ },
+ {
+ "x": 0,
+ "y": 286.2857
+ },
+ {
+ "x": 0,
+ "y": 289.7143
+ },
+ {
+ "x": 0,
+ "y": 292.57144
+ },
+ {
+ "x": 0,
+ "y": 294.85715
+ },
+ {
+ "x": 0,
+ "y": 296.85715
+ },
+ {
+ "x": 0,
+ "y": 298.2857
+ },
+ {
+ "x": 0,
+ "y": 299.14285
+ },
+ {
+ "x": 0,
+ "y": 299.7143
+ },
+ {
+ "x": 0,
+ "y": 300
+ },
+ {
+ "x": 0,
+ "y": 0
+ },
+ {
+ "type": "not_found"
+ }
+ ]
+ },
+ {
+ "name": "background_alpha",
+ "type": "float",
+ "data_points": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 0.9900334,
+ 0.8403853,
+ 0.71002257,
+ 0.5979084,
+ 0.50182605,
+ 0.41945767,
+ 0.34874845,
+ 0.28797746,
+ 0.23573697,
+ 0.19087732,
+ 0.1524564,
+ 0.11970067,
+ 0.091962695,
+ 0.068702936,
+ 0.049464583,
+ 0.033859253,
+ 0.021552086,
+ 0.012255073,
+ 0.005717635,
+ 0.0017191172,
+ 6.711483e-05,
+ 0,
+ {
+ "type": "not_found"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextManagerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextManagerTest.java
index d85b774..bf13ceb 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextManagerTest.java
@@ -445,7 +445,7 @@
assertFalse(mWifiRepository.isWifiConnectedWithValidSsid());
mWifiRepository.setWifiNetwork(
- new WifiNetworkModel.Active(
+ WifiNetworkModel.Active.Companion.of(
/* isValidated= */ false,
/* level= */ 0,
/* ssid= */ "",
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/EmergencyButtonControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/EmergencyButtonControllerTest.kt
index 43a78035..c42e25b 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/EmergencyButtonControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/EmergencyButtonControllerTest.kt
@@ -29,7 +29,7 @@
import com.android.internal.widget.LockPatternUtils
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
-import com.android.systemui.haptics.msdl.FakeMSDLPlayer
+import com.android.systemui.haptics.msdl.fakeMSDLPlayer
import com.android.systemui.haptics.msdl.msdlPlayer
import com.android.systemui.shade.ShadeController
import com.android.systemui.statusbar.policy.ConfigurationController
@@ -72,7 +72,7 @@
val mainExecutor = FakeExecutor(fakeSystemClock)
val backgroundExecutor = FakeExecutor(fakeSystemClock)
private val kosmos = testKosmos()
- private val msdlPlayer: FakeMSDLPlayer = kosmos.msdlPlayer
+ private val msdlPlayer = kosmos.fakeMSDLPlayer
lateinit var underTest: EmergencyButtonController
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java
index c0d8be3..4bb01ec 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java
@@ -43,6 +43,7 @@
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.systemui.Flags;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.classifier.FalsingCollectorFake;
import com.android.systemui.flags.FakeFeatureFlags;
@@ -96,6 +97,8 @@
private UserActivityNotifier mUserActivityNotifier;
private KeyguardAbsKeyInputViewController mKeyguardAbsKeyInputViewController;
private KosmosJavaAdapter mKosmosJavaAdapter = new KosmosJavaAdapter(this);
+ private final BouncerHapticPlayer mBouncerHapticPlayer =
+ mKosmosJavaAdapter.getBouncerHapticHelper();
private final FakeMSDLPlayer mMSDLPlayer = mKosmosJavaAdapter.getMsdlPlayer();
@Before
@@ -119,8 +122,8 @@
return new KeyguardAbsKeyInputViewController(mAbsKeyInputView,
mKeyguardUpdateMonitor, mSecurityMode, mLockPatternUtils, mKeyguardSecurityCallback,
mKeyguardMessageAreaControllerFactory, mLatencyTracker, mFalsingCollector,
- mEmergencyButtonController, mFeatureFlags, mSelectedUserInteractor, mMSDLPlayer,
- mUserActivityNotifier) {
+ mEmergencyButtonController, mFeatureFlags, mSelectedUserInteractor,
+ mBouncerHapticPlayer, mUserActivityNotifier) {
@Override
void resetState() {
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
index 873bc2c..2c1dacd 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
@@ -35,11 +35,13 @@
import com.android.systemui.classifier.FalsingCollectorFake
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.haptics.msdl.bouncerHapticPlayer
import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository
import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.DevicePostureController
import com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_HALF_OPENED
import com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_OPENED
+import com.android.systemui.testKosmos
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
@@ -107,6 +109,8 @@
@Captor lateinit var postureCallbackCaptor: ArgumentCaptor<DevicePostureController.Callback>
+ private val kosmos = testKosmos()
+
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
@@ -151,8 +155,8 @@
mSelectedUserInteractor,
uiEventLogger,
keyguardKeyboardInteractor,
- null,
- mUserActivityNotifier
+ kosmos.bouncerHapticPlayer,
+ mUserActivityNotifier,
)
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt
index f141a49..9cd5215 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt
@@ -28,8 +28,10 @@
import com.android.systemui.SysuiTestCase
import com.android.systemui.classifier.FalsingCollector
import com.android.systemui.flags.FakeFeatureFlags
+import com.android.systemui.haptics.msdl.bouncerHapticPlayer
import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository
import com.android.systemui.res.R
+import com.android.systemui.testKosmos
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.mock
@@ -73,6 +75,8 @@
private val updateMonitorCallbackArgumentCaptor =
ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback::class.java)
+ private val kosmos = testKosmos()
+
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
@@ -103,8 +107,8 @@
fakeFeatureFlags,
mSelectedUserInteractor,
keyguardKeyboardInteractor,
- null,
- mUserActivityNotifier
+ kosmos.bouncerHapticPlayer,
+ mUserActivityNotifier,
)
underTest.init()
underTest.onViewAttached()
@@ -162,14 +166,14 @@
updateMonitorCallbackArgumentCaptor.value.onSimStateChanged(
/* subId= */ 0,
/* slotId= */ 0,
- TelephonyManager.SIM_STATE_PIN_REQUIRED
+ TelephonyManager.SIM_STATE_PIN_REQUIRED,
)
verify(keyguardSecurityCallback, never()).showCurrentSecurityScreen()
updateMonitorCallbackArgumentCaptor.value.onSimStateChanged(
/* subId= */ 0,
/* slotId= */ 0,
- TelephonyManager.SIM_STATE_PUK_REQUIRED
+ TelephonyManager.SIM_STATE_PUK_REQUIRED,
)
verify(keyguardSecurityCallback).showCurrentSecurityScreen()
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt
index a03c839..3c22997 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt
@@ -29,8 +29,10 @@
import com.android.systemui.SysuiTestCase
import com.android.systemui.classifier.FalsingCollector
import com.android.systemui.flags.FakeFeatureFlags
+import com.android.systemui.haptics.msdl.bouncerHapticPlayer
import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository
import com.android.systemui.res.R
+import com.android.systemui.testKosmos
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import com.android.systemui.util.mockito.any
import org.junit.Before
@@ -65,6 +67,8 @@
KeyguardMessageAreaController<BouncerKeyguardMessageArea>
@Mock private lateinit var mUserActivityNotifier: UserActivityNotifier
+ private val kosmos = testKosmos()
+
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
@@ -98,8 +102,8 @@
fakeFeatureFlags,
mSelectedUserInteractor,
keyguardKeyboardInteractor,
- null,
- mUserActivityNotifier
+ kosmos.bouncerHapticPlayer,
+ mUserActivityNotifier,
)
underTest.init()
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonModeObserverTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonModeObserverTest.java
index 4a5c1be..038ec40 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonModeObserverTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonModeObserverTest.java
@@ -32,12 +32,14 @@
import com.android.systemui.SysuiTestCase;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
@@ -66,7 +68,7 @@
Settings.Secure.ACCESSIBILITY_BUTTON_MODE,
Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR, MY_USER_ID);
mAccessibilityButtonModeObserver = new AccessibilityButtonModeObserver(mContext,
- mUserTracker);
+ mUserTracker, Mockito.mock(SecureSettings.class));
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserverTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserverTest.java
index a5a7a4a..f564926 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserverTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityButtonTargetsObserverTest.java
@@ -31,12 +31,14 @@
import com.android.systemui.SysuiTestCase;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
@@ -62,7 +64,7 @@
public void setUp() {
when(mUserTracker.getUserId()).thenReturn(MY_USER_ID);
mAccessibilityButtonTargetsObserver = new AccessibilityButtonTargetsObserver(mContext,
- mUserTracker);
+ mUserTracker, Mockito.mock(SecureSettings.class));
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserverTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserverTest.java
index ba990ef..afed12f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserverTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/AccessibilityGestureTargetsObserverTest.java
@@ -31,12 +31,14 @@
import com.android.systemui.SysuiTestCase;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
@@ -62,7 +64,7 @@
public void setUp() {
when(mUserTracker.getUserId()).thenReturn(MY_USER_ID);
mAccessibilityGestureTargetsObserver = new AccessibilityGestureTargetsObserver(mContext,
- mUserTracker);
+ mUserTracker, Mockito.mock(SecureSettings.class));
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/SecureSettingsContentObserverTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/SecureSettingsContentObserverTest.java
index 9222fc2..1d88b90 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/SecureSettingsContentObserverTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/SecureSettingsContentObserverTest.java
@@ -27,6 +27,7 @@
import com.android.systemui.SysuiTestCase;
import com.android.systemui.settings.UserTracker;
+import com.android.systemui.util.settings.SecureSettings;
import org.junit.Before;
import org.junit.Test;
@@ -72,7 +73,7 @@
protected FakeSecureSettingsContentObserver(Context context, UserTracker userTracker,
String secureSettingsKey) {
- super(context, userTracker, secureSettingsKey);
+ super(context, userTracker, Mockito.mock(SecureSettings.class), secureSettingsKey);
}
@Override
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java
index d3b7d22..662815e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java
@@ -52,7 +52,6 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
-import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.bluetooth.BluetoothEventManager;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
@@ -92,6 +91,7 @@
@Rule
public MockitoRule mockito = MockitoJUnit.rule();
+ private static final int TEST_LAUNCH_SOURCE_ID = 1;
private static final String DEVICE_ADDRESS = "AA:BB:CC:DD:EE:FF";
private static final String DEVICE_NAME = "test_name";
private static final String TEST_PKG = "pkg";
@@ -124,7 +124,7 @@
@Mock
private AudioManager mAudioManager;
@Mock
- private UiEventLogger mUiEventLogger;
+ private HearingDevicesUiEventLogger mUiEventLogger;
@Mock
private CachedBluetoothDevice mCachedDevice;
@Mock
@@ -182,7 +182,8 @@
anyInt(), any());
assertThat(intentCaptor.getValue().getAction()).isEqualTo(
Settings.ACTION_HEARING_DEVICE_PAIRING_SETTINGS);
- verify(mUiEventLogger).log(HearingDevicesUiEvent.HEARING_DEVICES_PAIR);
+ verify(mUiEventLogger).log(HearingDevicesUiEvent.HEARING_DEVICES_PAIR,
+ TEST_LAUNCH_SOURCE_ID);
}
@Test
@@ -196,7 +197,8 @@
anyInt(), any());
assertThat(intentCaptor.getValue().getAction()).isEqualTo(
HearingDevicesDialogDelegate.ACTION_BLUETOOTH_DEVICE_DETAILS);
- verify(mUiEventLogger).log(HearingDevicesUiEvent.HEARING_DEVICES_GEAR_CLICK);
+ verify(mUiEventLogger).log(HearingDevicesUiEvent.HEARING_DEVICES_GEAR_CLICK,
+ TEST_LAUNCH_SOURCE_ID);
}
@Test
@@ -207,7 +209,8 @@
mDialogDelegate.onDeviceItemClicked(mHearingDeviceItem, new View(mContext));
verify(mCachedDevice).disconnect();
- verify(mUiEventLogger).log(HearingDevicesUiEvent.HEARING_DEVICES_DISCONNECT);
+ verify(mUiEventLogger).log(HearingDevicesUiEvent.HEARING_DEVICES_DISCONNECT,
+ TEST_LAUNCH_SOURCE_ID);
}
@Test
@@ -304,6 +307,7 @@
mDialogDelegate = new HearingDevicesDialogDelegate(
mContext,
true,
+ TEST_LAUNCH_SOURCE_ID,
mDialogFactory,
mActivityStarter,
mDialogTransitionAnimator,
@@ -327,6 +331,7 @@
mDialogDelegate = new HearingDevicesDialogDelegate(
mContext,
false,
+ TEST_LAUNCH_SOURCE_ID,
mDialogFactory,
mActivityStarter,
mDialogTransitionAnimator,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
index 55fd344..4850510 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
@@ -54,6 +54,7 @@
import com.android.systemui.biometrics.data.repository.fakeFingerprintPropertyRepository
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor
import com.android.systemui.biometrics.domain.interactor.promptSelectorInteractor
+import com.android.systemui.biometrics.domain.interactor.sideFpsOverlayInteractor
import com.android.systemui.biometrics.domain.interactor.udfpsOverlayInteractor
import com.android.systemui.biometrics.extractAuthenticatorTypes
import com.android.systemui.biometrics.faceSensorPropertiesInternal
@@ -1453,11 +1454,15 @@
@Test
fun switch_to_credential_fallback() = runGenericTest {
val size by collectLastValue(kosmos.promptViewModel.size)
+ val isShowingSfpsIndicator by collectLastValue(kosmos.sideFpsOverlayInteractor.isShowing)
// TODO(b/251476085): remove Spaghetti, migrate logic, and update this test
kosmos.promptViewModel.onSwitchToCredential()
assertThat(size).isEqualTo(PromptSize.LARGE)
+ if (testCase.modalities.hasSfps) {
+ assertThat(isShowingSfpsIndicator).isFalse()
+ }
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerPredictiveBackTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerPredictiveBackTest.kt
new file mode 100644
index 0000000..22946c8
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerPredictiveBackTest.kt
@@ -0,0 +1,348 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.bouncer.ui.composable
+
+import android.app.AlertDialog
+import android.platform.test.annotations.MotionTest
+import android.testing.TestableLooper.RunWithLooper
+import androidx.activity.BackEventCompat
+import androidx.compose.animation.core.Animatable
+import androidx.compose.animation.core.tween
+import androidx.compose.foundation.layout.Box
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.isFinite
+import androidx.compose.ui.geometry.isUnspecified
+import androidx.compose.ui.semantics.SemanticsNode
+import androidx.compose.ui.test.junit4.AndroidComposeTestRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import com.android.compose.animation.scene.ObservableTransitionState
+import com.android.compose.animation.scene.Scale
+import com.android.compose.animation.scene.SceneKey
+import com.android.compose.animation.scene.SceneScope
+import com.android.compose.animation.scene.UserAction
+import com.android.compose.animation.scene.UserActionResult
+import com.android.compose.animation.scene.isElement
+import com.android.compose.animation.scene.testing.lastAlphaForTesting
+import com.android.compose.animation.scene.testing.lastScaleForTesting
+import com.android.compose.theme.PlatformTheme
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.bouncer.domain.interactor.bouncerInteractor
+import com.android.systemui.bouncer.ui.BouncerDialogFactory
+import com.android.systemui.bouncer.ui.viewmodel.BouncerSceneContentViewModel
+import com.android.systemui.bouncer.ui.viewmodel.BouncerUserActionsViewModel
+import com.android.systemui.bouncer.ui.viewmodel.bouncerSceneContentViewModel
+import com.android.systemui.classifier.domain.interactor.falsingInteractor
+import com.android.systemui.flags.EnableSceneContainer
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.Kosmos.Fixture
+import com.android.systemui.lifecycle.ExclusiveActivatable
+import com.android.systemui.lifecycle.rememberViewModel
+import com.android.systemui.motion.createSysUiComposeMotionTestRule
+import com.android.systemui.power.domain.interactor.powerInteractor
+import com.android.systemui.scene.domain.interactor.sceneInteractor
+import com.android.systemui.scene.domain.startable.sceneContainerStartable
+import com.android.systemui.scene.shared.logger.sceneLogger
+import com.android.systemui.scene.shared.model.SceneContainerConfig
+import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.scene.shared.model.sceneDataSourceDelegator
+import com.android.systemui.scene.ui.composable.Scene
+import com.android.systemui.scene.ui.composable.SceneContainer
+import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel
+import com.android.systemui.scene.ui.viewmodel.splitEdgeDetector
+import com.android.systemui.shade.domain.interactor.shadeInteractor
+import com.android.systemui.testKosmos
+import kotlinx.coroutines.awaitCancellation
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.flowOf
+import org.json.JSONObject
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.MockitoAnnotations
+import platform.test.motion.compose.ComposeFeatureCaptures.positionInRoot
+import platform.test.motion.compose.ComposeRecordingSpec
+import platform.test.motion.compose.MotionControl
+import platform.test.motion.compose.feature
+import platform.test.motion.compose.recordMotion
+import platform.test.motion.compose.runTest
+import platform.test.motion.golden.DataPoint
+import platform.test.motion.golden.DataPointType
+import platform.test.motion.golden.DataPointTypes
+import platform.test.motion.golden.FeatureCapture
+import platform.test.motion.golden.UnknownTypeException
+import platform.test.screenshot.DeviceEmulationSpec
+import platform.test.screenshot.Displays.Phone
+
+/** MotionTest for the Bouncer Predictive Back animation */
+@LargeTest
+@RunWith(AndroidJUnit4::class)
+@RunWithLooper
+@EnableSceneContainer
+@MotionTest
+class BouncerPredictiveBackTest : SysuiTestCase() {
+
+ private val deviceSpec = DeviceEmulationSpec(Phone)
+ private val kosmos = testKosmos()
+
+ @get:Rule val motionTestRule = createSysUiComposeMotionTestRule(kosmos, deviceSpec)
+ private val androidComposeTestRule =
+ motionTestRule.toolkit.composeContentTestRule as AndroidComposeTestRule<*, *>
+
+ private val sceneInteractor by lazy { kosmos.sceneInteractor }
+ private val Kosmos.sceneKeys by Fixture { listOf(Scenes.Lockscreen, Scenes.Bouncer) }
+ private val Kosmos.initialSceneKey by Fixture { Scenes.Bouncer }
+ private val Kosmos.sceneContainerConfig by Fixture {
+ val navigationDistances =
+ mapOf(
+ Scenes.Lockscreen to 1,
+ Scenes.Bouncer to 0,
+ )
+ SceneContainerConfig(sceneKeys, initialSceneKey, emptyList(), navigationDistances)
+ }
+
+ private val transitionState by lazy {
+ MutableStateFlow<ObservableTransitionState>(
+ ObservableTransitionState.Idle(kosmos.sceneContainerConfig.initialSceneKey)
+ )
+ }
+ private val sceneContainerViewModel by lazy {
+ SceneContainerViewModel(
+ sceneInteractor = kosmos.sceneInteractor,
+ falsingInteractor = kosmos.falsingInteractor,
+ powerInteractor = kosmos.powerInteractor,
+ shadeInteractor = kosmos.shadeInteractor,
+ splitEdgeDetector = kosmos.splitEdgeDetector,
+ logger = kosmos.sceneLogger,
+ motionEventHandlerReceiver = {},
+ )
+ .apply { setTransitionState(transitionState) }
+ }
+
+ private val bouncerDialogFactory =
+ object : BouncerDialogFactory {
+ override fun invoke(): AlertDialog {
+ throw AssertionError()
+ }
+ }
+ private val bouncerSceneActionsViewModelFactory =
+ object : BouncerUserActionsViewModel.Factory {
+ override fun create() = BouncerUserActionsViewModel(kosmos.bouncerInteractor)
+ }
+ private lateinit var bouncerSceneContentViewModel: BouncerSceneContentViewModel
+ private val bouncerSceneContentViewModelFactory =
+ object : BouncerSceneContentViewModel.Factory {
+ override fun create() = bouncerSceneContentViewModel
+ }
+ private val bouncerScene =
+ BouncerScene(
+ bouncerSceneActionsViewModelFactory,
+ bouncerSceneContentViewModelFactory,
+ bouncerDialogFactory
+ )
+
+ @Before
+ fun setUp() {
+ MockitoAnnotations.initMocks(this)
+
+ bouncerSceneContentViewModel = kosmos.bouncerSceneContentViewModel
+
+ val startable = kosmos.sceneContainerStartable
+ startable.start()
+ }
+
+ @Test
+ fun bouncerPredictiveBackMotion() =
+ motionTestRule.runTest {
+ val motion =
+ recordMotion(
+ content = { play ->
+ PlatformTheme {
+ BackGestureAnimation(play)
+ SceneContainer(
+ viewModel =
+ rememberViewModel("BouncerPredictiveBackTest") {
+ sceneContainerViewModel
+ },
+ sceneByKey =
+ mapOf(
+ Scenes.Lockscreen to FakeLockscreen(),
+ Scenes.Bouncer to bouncerScene
+ ),
+ initialSceneKey = Scenes.Bouncer,
+ overlayByKey = emptyMap(),
+ dataSourceDelegator = kosmos.sceneDataSourceDelegator
+ )
+ }
+ },
+ ComposeRecordingSpec(
+ MotionControl(
+ delayRecording = {
+ awaitCondition {
+ sceneInteractor.transitionState.value.isTransitioning()
+ }
+ }
+ ) {
+ awaitCondition {
+ sceneInteractor.transitionState.value.isIdle(Scenes.Lockscreen)
+ }
+ }
+ ) {
+ feature(isElement(Bouncer.Elements.Content), elementAlpha, "content_alpha")
+ feature(isElement(Bouncer.Elements.Content), elementScale, "content_scale")
+ feature(
+ isElement(Bouncer.Elements.Content),
+ positionInRoot,
+ "content_offset"
+ )
+ feature(
+ isElement(Bouncer.Elements.Background),
+ elementAlpha,
+ "background_alpha"
+ )
+ }
+ )
+
+ assertThat(motion).timeSeriesMatchesGolden()
+ }
+
+ @Composable
+ private fun BackGestureAnimation(play: Boolean) {
+ val backProgress = remember { Animatable(0f) }
+
+ LaunchedEffect(play) {
+ if (play) {
+ val dispatcher = androidComposeTestRule.activity.onBackPressedDispatcher
+ androidComposeTestRule.runOnUiThread {
+ dispatcher.dispatchOnBackStarted(backEvent())
+ }
+ backProgress.animateTo(
+ targetValue = 1f,
+ animationSpec = tween(durationMillis = 500)
+ ) {
+ androidComposeTestRule.runOnUiThread {
+ dispatcher.dispatchOnBackProgressed(
+ backEvent(progress = backProgress.value)
+ )
+ if (backProgress.value == 1f) {
+ dispatcher.onBackPressed()
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private fun backEvent(progress: Float = 0f): BackEventCompat {
+ return BackEventCompat(
+ touchX = 0f,
+ touchY = 0f,
+ progress = progress,
+ swipeEdge = BackEventCompat.EDGE_LEFT,
+ )
+ }
+
+ private class FakeLockscreen : ExclusiveActivatable(), Scene {
+ override val key: SceneKey = Scenes.Lockscreen
+ override val userActions: Flow<Map<UserAction, UserActionResult>> = flowOf()
+
+ @Composable
+ override fun SceneScope.Content(modifier: Modifier) {
+ Box(modifier = modifier, contentAlignment = Alignment.Center) {
+ Text(text = "Fake Lockscreen")
+ }
+ }
+
+ override suspend fun onActivated() = awaitCancellation()
+ }
+
+ companion object {
+ private val elementAlpha =
+ FeatureCapture<SemanticsNode, Float>("alpha") {
+ DataPoint.of(it.lastAlphaForTesting, DataPointTypes.float)
+ }
+
+ private val elementScale =
+ FeatureCapture<SemanticsNode, Scale>("scale") {
+ DataPoint.of(it.lastScaleForTesting, scale)
+ }
+
+ private val scale: DataPointType<Scale> =
+ DataPointType(
+ "scale",
+ jsonToValue = {
+ when (it) {
+ "unspecified" -> Scale.Unspecified
+ "default" -> Scale.Default
+ "zero" -> Scale.Zero
+ is JSONObject -> {
+ val pivot = it.get("pivot")
+ Scale(
+ scaleX = it.getDouble("x").toFloat(),
+ scaleY = it.getDouble("y").toFloat(),
+ pivot =
+ when (pivot) {
+ "unspecified" -> Offset.Unspecified
+ "infinite" -> Offset.Infinite
+ is JSONObject ->
+ Offset(
+ pivot.getDouble("x").toFloat(),
+ pivot.getDouble("y").toFloat()
+ )
+ else -> throw UnknownTypeException()
+ }
+ )
+ }
+ else -> throw UnknownTypeException()
+ }
+ },
+ valueToJson = {
+ when (it) {
+ Scale.Unspecified -> "unspecified"
+ Scale.Default -> "default"
+ Scale.Zero -> "zero"
+ else -> {
+ JSONObject().apply {
+ put("x", it.scaleX)
+ put("y", it.scaleY)
+ put(
+ "pivot",
+ when {
+ it.pivot.isUnspecified -> "unspecified"
+ !it.pivot.isFinite -> "infinite"
+ else ->
+ JSONObject().apply {
+ put("x", it.pivot.x)
+ put("y", it.pivot.y)
+ }
+ }
+ )
+ }
+ }
+ }
+ }
+ )
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
index a1bea06..6377717 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
@@ -104,6 +104,7 @@
when(mFalsingDataProvider.getRecentMotionEvents()).thenReturn(mMotionEventList);
when(mKeyguardStateController.isShowing()).thenReturn(true);
when(mFalsingDataProvider.isUnfolded()).thenReturn(false);
+ when(mFalsingDataProvider.isTouchScreenSource()).thenReturn(true);
mBrightLineFalsingManager = new BrightLineFalsingManager(mFalsingDataProvider,
mMetricsLogger, mClassifiers, mSingleTapClassfier, mLongTapClassifier,
mDoubleTapClassifier, mHistoryTracker, mKeyguardStateController,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/inputdevice/tutorial/KeyboardTouchpadTutorialCoreStartableTest.kt b/packages/SystemUI/tests/src/com/android/systemui/inputdevice/tutorial/KeyboardTouchpadTutorialCoreStartableTest.kt
new file mode 100644
index 0000000..9da6885
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/inputdevice/tutorial/KeyboardTouchpadTutorialCoreStartableTest.kt
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.inputdevice.tutorial
+
+import android.content.Context
+import android.content.Intent
+import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.broadcast.broadcastDispatcher
+import com.android.systemui.inputdevice.tutorial.ui.TutorialNotificationCoordinator
+import com.android.systemui.testKosmos
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class KeyboardTouchpadTutorialCoreStartableTest : SysuiTestCase() {
+
+ private val kosmos = testKosmos()
+ private val broadcastDispatcher = kosmos.broadcastDispatcher
+ private val context = mock<Context>()
+ private val underTest =
+ KeyboardTouchpadTutorialCoreStartable(
+ { mock<TutorialNotificationCoordinator>() },
+ broadcastDispatcher,
+ context
+ )
+
+ @Test
+ fun registersBroadcastReceiverStartingActivityAsSystemUser() {
+ underTest.start()
+
+ broadcastDispatcher.sendIntentToMatchingReceiversOnly(
+ context,
+ Intent("com.android.systemui.action.KEYBOARD_TOUCHPAD_TUTORIAL")
+ )
+
+ verify(context).startActivityAsUser(any(), eq(UserHandle.SYSTEM))
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorTest.kt
index 3cbbb64..1981a2d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorTest.kt
@@ -22,8 +22,8 @@
import com.android.systemui.SysuiTestCase
import com.android.systemui.authentication.data.repository.fakeAuthenticationRepository
import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
-import com.android.systemui.bouncer.domain.interactor.alternateBouncerInteractor
import com.android.systemui.bouncer.data.repository.fakeKeyguardBouncerRepository
+import com.android.systemui.bouncer.domain.interactor.alternateBouncerInteractor
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
import com.android.systemui.flags.EnableSceneContainer
@@ -42,6 +42,7 @@
import com.android.systemui.scene.domain.resolver.notifShadeSceneFamilyResolver
import com.android.systemui.scene.domain.resolver.quickSettingsSceneFamilyResolver
import com.android.systemui.scene.shared.model.Scenes
+import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -77,12 +78,14 @@
transitionInteractor = kosmos.keyguardTransitionInteractor,
dismissInteractor = dismissInteractor,
applicationScope = testScope.backgroundScope,
- sceneInteractor = kosmos.sceneInteractor,
- deviceEntryInteractor = kosmos.deviceEntryInteractor,
- quickSettingsSceneFamilyResolver = kosmos.quickSettingsSceneFamilyResolver,
- notifShadeSceneFamilyResolver = kosmos.notifShadeSceneFamilyResolver,
+ sceneInteractor = { kosmos.sceneInteractor },
+ deviceEntryInteractor = { kosmos.deviceEntryInteractor },
+ quickSettingsSceneFamilyResolver = { kosmos.quickSettingsSceneFamilyResolver },
+ notifShadeSceneFamilyResolver = { kosmos.notifShadeSceneFamilyResolver },
powerInteractor = kosmos.powerInteractor,
alternateBouncerInteractor = kosmos.alternateBouncerInteractor,
+ keyguardInteractor = { kosmos.keyguardInteractor },
+ shadeInteractor = { kosmos.shadeInteractor },
)
}
@@ -223,11 +226,7 @@
assertThat(resetDismissAction).isNull()
kosmos.setSceneTransition(
- Transition(
- from = Scenes.Bouncer,
- to = Scenes.NotificationsShade,
- progress = flowOf(1f),
- )
+ Transition(from = Scenes.Bouncer, to = Scenes.Shade, progress = flowOf(1f))
)
assertThat(resetDismissAction).isNull()
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySectionTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySectionTest.kt
index 7cc9185..bfb8a57 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySectionTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySectionTest.kt
@@ -34,6 +34,7 @@
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryBackgroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryForegroundViewModel
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryIconViewModel
+import com.android.systemui.log.logcatLogBuffer
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.res.R
import com.android.systemui.shade.NotificationPanelView
@@ -86,6 +87,7 @@
{ mock(DeviceEntryBackgroundViewModel::class.java) },
{ falsingManager },
{ mock(VibratorHelper::class.java) },
+ logcatLogBuffer(),
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImplTest.kt
index ad7a5b6..823a23d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImplTest.kt
@@ -38,6 +38,8 @@
import android.media.session.PlaybackState
import android.net.Uri
import android.os.Bundle
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
import android.platform.test.flag.junit.FlagsParameterization
import android.provider.Settings
import android.service.notification.StatusBarNotification
@@ -61,6 +63,8 @@
import com.android.systemui.kosmos.testScope
import com.android.systemui.media.controls.domain.resume.MediaResumeListener
import com.android.systemui.media.controls.domain.resume.ResumeMediaBrowser
+import com.android.systemui.media.controls.shared.mediaLogger
+import com.android.systemui.media.controls.shared.mockMediaLogger
import com.android.systemui.media.controls.shared.model.EXTRA_KEY_TRIGGER_SOURCE
import com.android.systemui.media.controls.shared.model.EXTRA_VALUE_TRIGGER_PERIODIC
import com.android.systemui.media.controls.shared.model.MediaData
@@ -69,7 +73,6 @@
import com.android.systemui.media.controls.util.MediaUiEventLogger
import com.android.systemui.media.controls.util.fakeMediaControllerFactory
import com.android.systemui.media.controls.util.mediaFlags
-import com.android.systemui.plugins.activityStarter
import com.android.systemui.res.R
import com.android.systemui.statusbar.SbnBuilder
import com.android.systemui.testKosmos
@@ -186,11 +189,10 @@
mSetFlagsRule.setFlagsParameterization(flags)
}
- private val kosmos = testKosmos()
+ private val kosmos = testKosmos().apply { mediaLogger = mockMediaLogger }
private val testDispatcher = kosmos.testDispatcher
private val testScope = kosmos.testScope
private val fakeFeatureFlags = kosmos.fakeFeatureFlagsClassic
- private val activityStarter = kosmos.activityStarter
private val mediaControllerFactory = kosmos.fakeMediaControllerFactory
private val instanceIdSequence = InstanceIdSequenceFake(1 shl 20)
@@ -240,7 +242,6 @@
mediaDeviceManager = mediaDeviceManager,
mediaDataCombineLatest = mediaDataCombineLatest,
mediaDataFilter = mediaDataFilter,
- activityStarter = activityStarter,
smartspaceMediaDataProvider = smartspaceMediaDataProvider,
useMediaResumption = true,
useQsMediaPlayer = true,
@@ -251,6 +252,7 @@
smartspaceManager = smartspaceManager,
keyguardUpdateMonitor = keyguardUpdateMonitor,
mediaDataLoader = { kosmos.mediaDataLoader },
+ mediaLogger = kosmos.mediaLogger,
)
verify(tunerService)
.addTunable(capture(tunableCaptor), eq(Settings.Secure.MEDIA_CONTROLS_RECOMMENDATION))
@@ -967,7 +969,8 @@
assertThat(data.resumption).isTrue()
assertThat(data.song).isEqualTo(SESSION_TITLE)
assertThat(data.app).isEqualTo(APP_NAME)
- assertThat(data.actions).hasSize(1)
+ // resume button is a semantic action.
+ assertThat(data.actions).hasSize(0)
assertThat(data.semanticActions!!.playOrPause).isNotNull()
assertThat(data.lastActive).isAtLeast(currentTime)
verify(logger).logResumeMediaAdded(anyInt(), eq(PACKAGE_NAME), eq(data.instanceId))
@@ -994,7 +997,8 @@
assertThat(data.resumption).isTrue()
assertThat(data.song).isEqualTo(SESSION_TITLE)
assertThat(data.app).isEqualTo(APP_NAME)
- assertThat(data.actions).hasSize(1)
+ // resume button is a semantic action.
+ assertThat(data.actions).hasSize(0)
assertThat(data.semanticActions!!.playOrPause).isNotNull()
assertThat(data.lastActive).isAtLeast(currentTime)
assertThat(data.isExplicit).isTrue()
@@ -2402,6 +2406,45 @@
assertThat(mediaDataCaptor.value.artwork).isNull()
}
+ @Test
+ @EnableFlags(Flags.FLAG_MEDIA_CONTROLS_POSTS_OPTIMIZATION)
+ fun postDuplicateNotification_doesNotCallListeners() {
+ addNotificationAndLoad()
+ reset(listener)
+ mediaDataManager.onNotificationAdded(KEY, mediaNotification)
+
+ testScope.assertRunAllReady(foreground = 0, background = 1)
+ verify(listener, never())
+ .onMediaDataLoaded(
+ eq(KEY),
+ eq(KEY),
+ capture(mediaDataCaptor),
+ eq(true),
+ eq(0),
+ eq(false)
+ )
+ verify(kosmos.mediaLogger).logDuplicateMediaNotification(eq(KEY))
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MEDIA_CONTROLS_POSTS_OPTIMIZATION)
+ fun postDuplicateNotification_callsListeners() {
+ addNotificationAndLoad()
+ reset(listener)
+ mediaDataManager.onNotificationAdded(KEY, mediaNotification)
+ testScope.assertRunAllReady(foreground = 1, background = 1)
+ verify(listener)
+ .onMediaDataLoaded(
+ eq(KEY),
+ eq(KEY),
+ capture(mediaDataCaptor),
+ eq(true),
+ eq(0),
+ eq(false)
+ )
+ verify(kosmos.mediaLogger, never()).logDuplicateMediaNotification(eq(KEY))
+ }
+
private fun TestScope.assertRunAllReady(foreground: Int = 0, background: Int = 0) {
runCurrent()
if (Flags.mediaLoadMetadataViaMediaDataLoader()) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorTest.kt
index c0f503d..4cf7de3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorTest.kt
@@ -69,6 +69,8 @@
import com.android.systemui.media.controls.domain.pipeline.interactor.MediaCarouselInteractor
import com.android.systemui.media.controls.domain.resume.MediaResumeListener
import com.android.systemui.media.controls.domain.resume.ResumeMediaBrowser
+import com.android.systemui.media.controls.shared.mediaLogger
+import com.android.systemui.media.controls.shared.mockMediaLogger
import com.android.systemui.media.controls.shared.model.EXTRA_KEY_TRIGGER_SOURCE
import com.android.systemui.media.controls.shared.model.EXTRA_VALUE_TRIGGER_PERIODIC
import com.android.systemui.media.controls.shared.model.MediaData
@@ -140,7 +142,7 @@
@RunWith(ParameterizedAndroidJunit4::class)
@EnableSceneContainer
class MediaDataProcessorTest(flags: FlagsParameterization) : SysuiTestCase() {
- private val kosmos = testKosmos()
+ private val kosmos = testKosmos().apply { mediaLogger = mockMediaLogger }
private val testDispatcher = kosmos.testDispatcher
private val testScope = kosmos.testScope
private val settings = kosmos.fakeSettings
@@ -257,6 +259,7 @@
keyguardUpdateMonitor = keyguardUpdateMonitor,
mediaDataRepository = kosmos.mediaDataRepository,
mediaDataLoader = { kosmos.mediaDataLoader },
+ mediaLogger = kosmos.mediaLogger,
)
mediaDataProcessor.start()
testScope.runCurrent()
@@ -984,7 +987,8 @@
assertThat(data.resumption).isTrue()
assertThat(data.song).isEqualTo(SESSION_TITLE)
assertThat(data.app).isEqualTo(APP_NAME)
- assertThat(data.actions).hasSize(1)
+ // resume button is a semantic action.
+ assertThat(data.actions).hasSize(0)
assertThat(data.semanticActions!!.playOrPause).isNotNull()
assertThat(data.lastActive).isAtLeast(currentTime)
verify(logger).logResumeMediaAdded(anyInt(), eq(PACKAGE_NAME), eq(data.instanceId))
@@ -1011,7 +1015,8 @@
assertThat(data.resumption).isTrue()
assertThat(data.song).isEqualTo(SESSION_TITLE)
assertThat(data.app).isEqualTo(APP_NAME)
- assertThat(data.actions).hasSize(1)
+ // resume button is a semantic action.
+ assertThat(data.actions).hasSize(0)
assertThat(data.semanticActions!!.playOrPause).isNotNull()
assertThat(data.lastActive).isAtLeast(currentTime)
assertThat(data.isExplicit).isTrue()
@@ -2476,6 +2481,55 @@
assertThat(mediaDataCaptor.value.artwork).isNull()
}
+ @Test
+ @EnableFlags(Flags.FLAG_MEDIA_CONTROLS_POSTS_OPTIMIZATION)
+ fun postDuplicateNotification_doesNotCallListeners() {
+ whenever(notificationLockscreenUserManager.isCurrentProfile(USER_ID)).thenReturn(true)
+ whenever(notificationLockscreenUserManager.isProfileAvailable(USER_ID)).thenReturn(true)
+
+ mediaDataProcessor.addInternalListener(mediaDataFilter)
+ mediaDataFilter.mediaDataProcessor = mediaDataProcessor
+ addNotificationAndLoad()
+ reset(listener)
+ mediaDataProcessor.onNotificationAdded(KEY, mediaNotification)
+
+ testScope.assertRunAllReady(foreground = 0, background = 1)
+ verify(listener, never())
+ .onMediaDataLoaded(
+ eq(KEY),
+ eq(KEY),
+ capture(mediaDataCaptor),
+ eq(true),
+ eq(0),
+ eq(false)
+ )
+ verify(kosmos.mediaLogger).logDuplicateMediaNotification(eq(KEY))
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_MEDIA_CONTROLS_POSTS_OPTIMIZATION)
+ fun postDuplicateNotification_callsListeners() {
+ whenever(notificationLockscreenUserManager.isCurrentProfile(USER_ID)).thenReturn(true)
+ whenever(notificationLockscreenUserManager.isProfileAvailable(USER_ID)).thenReturn(true)
+
+ mediaDataProcessor.addInternalListener(mediaDataFilter)
+ mediaDataFilter.mediaDataProcessor = mediaDataProcessor
+ addNotificationAndLoad()
+ reset(listener)
+ mediaDataProcessor.onNotificationAdded(KEY, mediaNotification)
+ testScope.assertRunAllReady(foreground = 1, background = 1)
+ verify(listener)
+ .onMediaDataLoaded(
+ eq(KEY),
+ eq(KEY),
+ capture(mediaDataCaptor),
+ eq(true),
+ eq(0),
+ eq(false)
+ )
+ verify(kosmos.mediaLogger, never()).logDuplicateMediaNotification(eq(KEY))
+ }
+
private fun TestScope.assertRunAllReady(foreground: Int = 0, background: Int = 0) {
runCurrent()
if (Flags.mediaLoadMetadataViaMediaDataLoader()) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerTest.kt
index 6a66c40..0c8d880 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerTest.kt
@@ -54,6 +54,7 @@
import com.android.systemui.media.muteawait.MediaMuteAwaitConnectionManagerFactory
import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.testKosmos
import com.android.systemui.util.concurrency.FakeExecutor
import com.android.systemui.util.time.FakeSystemClock
import com.google.common.truth.Truth.assertThat
@@ -125,6 +126,8 @@
private lateinit var mediaData: MediaData
@JvmField @Rule val mockito = MockitoJUnit.rule()
+ private val kosmos = testKosmos()
+
@Before
fun setUp() {
fakeFgExecutor = FakeExecutor(FakeSystemClock())
@@ -141,6 +144,7 @@
{ localBluetoothManager },
fakeFgExecutor,
fakeBgExecutor,
+ kosmos.mediaDeviceLogger,
)
manager.addListener(listener)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt
index c1bba4d..680df15 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerTest.kt
@@ -72,7 +72,6 @@
@Mock private lateinit var mediaController: MediaController
@Mock private lateinit var logger: MediaTimeoutLogger
@Mock private lateinit var statusBarStateController: SysuiStatusBarStateController
- private lateinit var executor: FakeExecutor
@Mock private lateinit var timeoutCallback: (String, Boolean) -> Unit
@Mock private lateinit var stateCallback: (String, PlaybackState) -> Unit
@Mock private lateinit var sessionCallback: (String) -> Unit
@@ -88,6 +87,9 @@
private lateinit var resumeData: MediaData
private lateinit var mediaTimeoutListener: MediaTimeoutListener
private var clock = FakeSystemClock()
+ private lateinit var mainExecutor: FakeExecutor
+ private lateinit var bgExecutor: FakeExecutor
+ private lateinit var uiExecutor: FakeExecutor
@Mock private lateinit var mediaFlags: MediaFlags
@Mock private lateinit var smartspaceData: SmartspaceMediaData
@@ -95,11 +97,15 @@
fun setup() {
whenever(mediaControllerFactory.create(any())).thenReturn(mediaController)
whenever(mediaFlags.isPersistentSsCardEnabled()).thenReturn(false)
- executor = FakeExecutor(clock)
+ mainExecutor = FakeExecutor(clock)
+ bgExecutor = FakeExecutor(clock)
+ uiExecutor = FakeExecutor(clock)
mediaTimeoutListener =
MediaTimeoutListener(
mediaControllerFactory,
- executor,
+ bgExecutor,
+ uiExecutor,
+ mainExecutor,
logger,
statusBarStateController,
clock,
@@ -143,30 +149,31 @@
whenever(playingState.state).thenReturn(PlaybackState.STATE_PLAYING)
whenever(mediaController.playbackState).thenReturn(playingState)
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(KEY, null, mediaData)
verify(mediaController).registerCallback(capture(mediaCallbackCaptor))
verify(logger).logPlaybackState(eq(KEY), eq(playingState))
// Ignores if same key
clearInvocations(mediaController)
- mediaTimeoutListener.onMediaDataLoaded(KEY, KEY, mediaData)
+ loadMediaData(KEY, KEY, mediaData)
verify(mediaController, never()).registerCallback(anyObject())
}
@Test
fun testOnMediaDataLoaded_registersTimeout_whenPaused() {
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(KEY, null, mediaData)
verify(mediaController).registerCallback(capture(mediaCallbackCaptor))
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
verify(timeoutCallback, never()).invoke(anyString(), anyBoolean())
verify(logger).logScheduleTimeout(eq(KEY), eq(false), eq(false))
- assertThat(executor.advanceClockToNext()).isEqualTo(PAUSED_MEDIA_TIMEOUT)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(PAUSED_MEDIA_TIMEOUT)
}
@Test
fun testOnMediaDataRemoved_unregistersPlaybackListener() {
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(KEY, null, mediaData)
mediaTimeoutListener.onMediaDataRemoved(KEY, false)
+ assertThat(bgExecutor.runAllReady()).isEqualTo(1)
verify(mediaController).unregisterCallback(anyObject())
// Ignores duplicate requests
@@ -178,50 +185,50 @@
@Test
fun testOnMediaDataRemoved_clearsTimeout() {
// GIVEN media that is paused
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
- assertThat(executor.numPending()).isEqualTo(1)
+ loadMediaData(KEY, null, mediaData)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// WHEN the media is removed
mediaTimeoutListener.onMediaDataRemoved(KEY, false)
// THEN the timeout runnable is cancelled
- assertThat(executor.numPending()).isEqualTo(0)
+ assertThat(mainExecutor.numPending()).isEqualTo(0)
}
@Test
fun testOnMediaDataLoaded_migratesKeys() {
val newKey = "NEWKEY"
// From not playing
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(KEY, null, mediaData)
clearInvocations(mediaController)
// To playing
val playingState = mock(android.media.session.PlaybackState::class.java)
whenever(playingState.state).thenReturn(PlaybackState.STATE_PLAYING)
whenever(mediaController.playbackState).thenReturn(playingState)
- mediaTimeoutListener.onMediaDataLoaded(newKey, KEY, mediaData)
+ loadMediaData(newKey, KEY, mediaData)
verify(mediaController).unregisterCallback(anyObject())
verify(mediaController).registerCallback(anyObject())
verify(logger).logMigrateListener(eq(KEY), eq(newKey), eq(true))
// Enqueues callback
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
}
@Test
fun testOnMediaDataLoaded_migratesKeys_noTimeoutExtension() {
val newKey = "NEWKEY"
// From not playing
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(KEY, null, mediaData)
clearInvocations(mediaController)
// Migrate, still not playing
val playingState = mock(android.media.session.PlaybackState::class.java)
whenever(playingState.state).thenReturn(PlaybackState.STATE_PAUSED)
whenever(mediaController.playbackState).thenReturn(playingState)
- mediaTimeoutListener.onMediaDataLoaded(newKey, KEY, mediaData)
+ loadMediaData(newKey, KEY, mediaData)
// The number of queued timeout tasks remains the same. The timeout task isn't cancelled nor
// is another scheduled
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
verify(logger).logUpdateListener(eq(newKey), eq(false))
}
@@ -233,8 +240,8 @@
mediaCallbackCaptor.value.onPlaybackStateChanged(
PlaybackState.Builder().setState(PlaybackState.STATE_PAUSED, 0L, 0f).build()
)
- assertThat(executor.numPending()).isEqualTo(1)
- assertThat(executor.advanceClockToNext()).isEqualTo(PAUSED_MEDIA_TIMEOUT)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(PAUSED_MEDIA_TIMEOUT)
}
@Test
@@ -245,7 +252,7 @@
mediaCallbackCaptor.value.onPlaybackStateChanged(
PlaybackState.Builder().setState(PlaybackState.STATE_PLAYING, 0L, 0f).build()
)
- assertThat(executor.numPending()).isEqualTo(0)
+ assertThat(mainExecutor.numPending()).isEqualTo(0)
verify(logger).logTimeoutCancelled(eq(KEY), any())
}
@@ -257,7 +264,7 @@
mediaCallbackCaptor.value.onPlaybackStateChanged(
PlaybackState.Builder().setState(PlaybackState.STATE_STOPPED, 0L, 0f).build()
)
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
}
@Test
@@ -265,7 +272,7 @@
// Assuming we're have a pending timeout
testOnPlaybackStateChanged_schedulesTimeout_whenPaused()
- with(executor) {
+ with(mainExecutor) {
advanceClockToNext()
runAllReady()
}
@@ -274,7 +281,7 @@
@Test
fun testIsTimedOut() {
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(KEY, null, mediaData)
assertThat(mediaTimeoutListener.isTimedOut(KEY)).isFalse()
}
@@ -282,16 +289,17 @@
fun testOnSessionDestroyed_active_clearsTimeout() {
// GIVEN media that is paused
val mediaPaused = mediaData.copy(isPlaying = false)
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaPaused)
+ loadMediaData(KEY, null, mediaPaused)
verify(mediaController).registerCallback(capture(mediaCallbackCaptor))
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// WHEN the session is destroyed
mediaCallbackCaptor.value.onSessionDestroyed()
// THEN the controller is unregistered and timeout run
+ assertThat(bgExecutor.runAllReady()).isEqualTo(1)
verify(mediaController).unregisterCallback(anyObject())
- assertThat(executor.numPending()).isEqualTo(0)
+ assertThat(mainExecutor.numPending()).isEqualTo(0)
verify(logger).logSessionDestroyed(eq(KEY))
verify(sessionCallback).invoke(eq(KEY))
}
@@ -306,11 +314,11 @@
whenever(playingState.state).thenReturn(PlaybackState.STATE_PLAYING)
whenever(mediaController.playbackState).thenReturn(playingState)
val mediaPlaying = mediaData.copy(isPlaying = true)
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaPlaying)
+ loadMediaData(KEY, null, mediaPlaying)
// THEN the timeout runnable will update the state
- assertThat(executor.numPending()).isEqualTo(1)
- with(executor) {
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
+ with(mainExecutor) {
advanceClockToNext()
runAllReady()
}
@@ -322,31 +330,32 @@
fun testOnSessionDestroyed_resume_continuesTimeout() {
// GIVEN resume media with session info
val resumeWithSession = resumeData.copy(token = session.sessionToken)
- mediaTimeoutListener.onMediaDataLoaded(PACKAGE, null, resumeWithSession)
+ loadMediaData(PACKAGE, null, resumeWithSession)
verify(mediaController).registerCallback(capture(mediaCallbackCaptor))
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// WHEN the session is destroyed
mediaCallbackCaptor.value.onSessionDestroyed()
// THEN the controller is unregistered, but the timeout is still scheduled
+ assertThat(bgExecutor.runAllReady()).isEqualTo(1)
verify(mediaController).unregisterCallback(anyObject())
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
verify(sessionCallback, never()).invoke(eq(KEY))
}
@Test
fun testOnMediaDataLoaded_activeToResume_registersTimeout() {
// WHEN a regular media is loaded
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(KEY, null, mediaData)
// AND it turns into a resume control
- mediaTimeoutListener.onMediaDataLoaded(PACKAGE, KEY, resumeData)
+ loadMediaData(PACKAGE, KEY, resumeData)
// THEN we register a timeout
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
verify(timeoutCallback, never()).invoke(anyString(), anyBoolean())
- assertThat(executor.advanceClockToNext()).isEqualTo(RESUME_MEDIA_TIMEOUT)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(RESUME_MEDIA_TIMEOUT)
}
@Test
@@ -355,42 +364,42 @@
val pausedState =
PlaybackState.Builder().setState(PlaybackState.STATE_PAUSED, 0L, 0f).build()
whenever(mediaController.playbackState).thenReturn(pausedState)
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
- assertThat(executor.numPending()).isEqualTo(1)
+ loadMediaData(KEY, null, mediaData)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// AND it turns into a resume control
- mediaTimeoutListener.onMediaDataLoaded(PACKAGE, KEY, resumeData)
+ loadMediaData(PACKAGE, KEY, resumeData)
// THEN we update the timeout length
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
verify(timeoutCallback, never()).invoke(anyString(), anyBoolean())
- assertThat(executor.advanceClockToNext()).isEqualTo(RESUME_MEDIA_TIMEOUT)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(RESUME_MEDIA_TIMEOUT)
}
@Test
fun testOnMediaDataLoaded_resumption_registersTimeout() {
// WHEN a resume media is loaded
- mediaTimeoutListener.onMediaDataLoaded(PACKAGE, null, resumeData)
+ loadMediaData(PACKAGE, null, resumeData)
// THEN we register a timeout
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
verify(timeoutCallback, never()).invoke(anyString(), anyBoolean())
- assertThat(executor.advanceClockToNext()).isEqualTo(RESUME_MEDIA_TIMEOUT)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(RESUME_MEDIA_TIMEOUT)
}
@Test
fun testOnMediaDataLoaded_resumeToActive_updatesTimeout() {
// WHEN we have a resume control
- mediaTimeoutListener.onMediaDataLoaded(PACKAGE, null, resumeData)
+ loadMediaData(PACKAGE, null, resumeData)
// AND that media is resumed
val playingState =
PlaybackState.Builder().setState(PlaybackState.STATE_PAUSED, 0L, 0f).build()
whenever(mediaController.playbackState).thenReturn(playingState)
- mediaTimeoutListener.onMediaDataLoaded(KEY, PACKAGE, mediaData)
+ loadMediaData(oldKey = PACKAGE, data = mediaData)
// THEN the timeout length is changed to a regular media control
- assertThat(executor.advanceClockToNext()).isEqualTo(PAUSED_MEDIA_TIMEOUT)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(PAUSED_MEDIA_TIMEOUT)
}
@Test
@@ -401,7 +410,7 @@
mediaTimeoutListener.onMediaDataRemoved(PACKAGE, false)
// THEN the timeout runnable is cancelled
- assertThat(executor.numPending()).isEqualTo(0)
+ assertThat(mainExecutor.numPending()).isEqualTo(0)
}
@Test
@@ -427,6 +436,7 @@
// When the playback state changes, and has different actions
val playingState = PlaybackState.Builder().setActions(PlaybackState.ACTION_PLAY).build()
mediaCallbackCaptor.value.onPlaybackStateChanged(playingState)
+ assertThat(uiExecutor.runAllReady()).isEqualTo(1)
// Then the callback is invoked
verify(stateCallback).invoke(eq(KEY), eq(playingState!!))
@@ -463,6 +473,7 @@
.addCustomAction(customTwo)
.build()
mediaCallbackCaptor.value.onPlaybackStateChanged(pausedStateTwoActions)
+ assertThat(uiExecutor.runAllReady()).isEqualTo(1)
// Then the callback is invoked
verify(stateCallback).invoke(eq(KEY), eq(pausedStateTwoActions!!))
@@ -534,6 +545,7 @@
val playingState =
PlaybackState.Builder().setState(PlaybackState.STATE_PLAYING, 0L, 1f).build()
mediaCallbackCaptor.value.onPlaybackStateChanged(playingState)
+ uiExecutor.runAllReady()
// Then the callback is invoked
verify(stateCallback).invoke(eq(KEY), eq(playingState!!))
@@ -567,7 +579,7 @@
// And we doze past the scheduled timeout
val time = clock.currentTimeMillis()
clock.setElapsedRealtime(time + PAUSED_MEDIA_TIMEOUT)
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// Then when no longer dozing, the timeout runs immediately
dozingCallbackCaptor.value.onDozingChanged(false)
@@ -576,7 +588,7 @@
// and cancel any later scheduled timeout
verify(logger).logTimeoutCancelled(eq(KEY), any())
- assertThat(executor.numPending()).isEqualTo(0)
+ assertThat(mainExecutor.numPending()).isEqualTo(0)
}
@Test
@@ -592,12 +604,12 @@
// And we doze, but not past the scheduled timeout
clock.setElapsedRealtime(time + PAUSED_MEDIA_TIMEOUT / 2L)
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// Then when no longer dozing, the timeout remains scheduled
dozingCallbackCaptor.value.onDozingChanged(false)
verify(timeoutCallback, never()).invoke(eq(KEY), eq(true))
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
}
@Test
@@ -610,8 +622,8 @@
whenever(smartspaceData.expiryTimeMs).thenReturn(expireTime)
mediaTimeoutListener.onSmartspaceMediaDataLoaded(SMARTSPACE_KEY, smartspaceData)
- assertThat(executor.numPending()).isEqualTo(1)
- assertThat(executor.advanceClockToNext()).isEqualTo(duration)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(duration)
}
@Test
@@ -619,7 +631,7 @@
// Given a pending timeout
testSmartspaceDataLoaded_schedulesTimeout()
- executor.runAllReady()
+ mainExecutor.runAllReady()
verify(timeoutCallback).invoke(eq(SMARTSPACE_KEY), eq(true))
}
@@ -634,14 +646,14 @@
whenever(smartspaceData.expiryTimeMs).thenReturn(expireTime)
mediaTimeoutListener.onSmartspaceMediaDataLoaded(SMARTSPACE_KEY, smartspaceData)
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
val expiryLonger = expireTime + duration
whenever(smartspaceData.expiryTimeMs).thenReturn(expiryLonger)
mediaTimeoutListener.onSmartspaceMediaDataLoaded(SMARTSPACE_KEY, smartspaceData)
- assertThat(executor.numPending()).isEqualTo(1)
- assertThat(executor.advanceClockToNext()).isEqualTo(duration * 2)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.advanceClockToNext()).isEqualTo(duration * 2)
}
@Test
@@ -649,10 +661,10 @@
whenever(mediaFlags.isPersistentSsCardEnabled()).thenReturn(true)
mediaTimeoutListener.onSmartspaceMediaDataLoaded(SMARTSPACE_KEY, smartspaceData)
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
mediaTimeoutListener.onSmartspaceMediaDataRemoved(SMARTSPACE_KEY)
- assertThat(executor.numPending()).isEqualTo(0)
+ assertThat(mainExecutor.numPending()).isEqualTo(0)
}
@Test
@@ -667,12 +679,12 @@
whenever(smartspaceData.expiryTimeMs).thenReturn(expireTime)
mediaTimeoutListener.onSmartspaceMediaDataLoaded(SMARTSPACE_KEY, smartspaceData)
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// And we doze past the scheduled timeout
val time = clock.currentTimeMillis()
clock.setElapsedRealtime(time + duration * 2)
- assertThat(executor.numPending()).isEqualTo(1)
+ assertThat(mainExecutor.numPending()).isEqualTo(1)
// Then when no longer dozing, the timeout runs immediately
dozingCallbackCaptor.value.onDozingChanged(false)
@@ -680,12 +692,18 @@
verify(logger).logTimeout(eq(SMARTSPACE_KEY))
// and cancel any later scheduled timeout
- assertThat(executor.numPending()).isEqualTo(0)
+ assertThat(mainExecutor.numPending()).isEqualTo(0)
}
private fun loadMediaDataWithPlaybackState(state: PlaybackState) {
whenever(mediaController.playbackState).thenReturn(state)
- mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
+ loadMediaData(data = mediaData)
verify(mediaController).registerCallback(capture(mediaCallbackCaptor))
}
+
+ private fun loadMediaData(key: String = KEY, oldKey: String? = null, data: MediaData) {
+ mediaTimeoutListener.onMediaDataLoaded(key, oldKey, data)
+ bgExecutor.runAllReady()
+ uiExecutor.runAllReady()
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/resume/MediaResumeListenerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/resume/MediaResumeListenerTest.kt
index 02d7413..bc29d2a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/resume/MediaResumeListenerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/domain/resume/MediaResumeListenerTest.kt
@@ -138,6 +138,7 @@
whenever(mockContext.packageManager).thenReturn(context.packageManager)
whenever(mockContext.contentResolver).thenReturn(context.contentResolver)
whenever(mockContext.userId).thenReturn(context.userId)
+ whenever(mockContext.resources).thenReturn(context.resources)
whenever(mediaFlags.isRemoteResumeAllowed()).thenReturn(false)
executor = FakeExecutor(clock)
@@ -210,7 +211,7 @@
@Test
fun testOnLoad_checksForResume_noService() {
// When media data is loaded that has not been checked yet, and does not have a MBS
- resumeListener.onMediaDataLoaded(KEY, null, data)
+ onMediaDataLoaded(KEY, null, data)
// Then we report back to the manager
verify(mediaDataManager).setResumeAction(KEY, null)
@@ -223,8 +224,7 @@
whenever(resumeBrowser.testConnection()).thenAnswer { callbackCaptor.value.onError() }
// When media data is loaded that has not been checked yet, and does not have a MBS
- resumeListener.onMediaDataLoaded(KEY, null, data)
- executor.runAllReady()
+ onMediaDataLoaded(KEY, null, data)
// Then we report back to the manager
verify(mediaDataManager).setResumeAction(eq(KEY), eq(null))
@@ -234,7 +234,7 @@
fun testOnLoad_localCast_doesNotCheck() {
// When media data is loaded that has not been checked yet, and is a local cast
val dataCast = data.copy(playbackLocation = MediaData.PLAYBACK_CAST_LOCAL)
- resumeListener.onMediaDataLoaded(KEY, null, dataCast)
+ onMediaDataLoaded(KEY, null, dataCast, false)
// Then we do not take action
verify(mediaDataManager, never()).setResumeAction(any(), any())
@@ -244,7 +244,7 @@
fun testOnload_remoteCast_doesNotCheck() {
// When media data is loaded that has not been checked yet, and is a remote cast
val dataRcn = data.copy(playbackLocation = MediaData.PLAYBACK_CAST_REMOTE)
- resumeListener.onMediaDataLoaded(KEY, null, dataRcn)
+ onMediaDataLoaded(KEY, null, dataRcn, resume = false)
// Then we do not take action
verify(mediaDataManager, never()).setResumeAction(any(), any())
@@ -257,7 +257,7 @@
// When media data is loaded that has not been checked yet, and is a local cast
val dataCast = data.copy(playbackLocation = MediaData.PLAYBACK_CAST_LOCAL)
- resumeListener.onMediaDataLoaded(KEY, null, dataCast)
+ onMediaDataLoaded(KEY, null, dataCast)
// Then we report back to the manager
verify(mediaDataManager).setResumeAction(KEY, null)
@@ -270,7 +270,7 @@
// When media data is loaded that has not been checked yet, and is a remote cast
val dataRcn = data.copy(playbackLocation = MediaData.PLAYBACK_CAST_REMOTE)
- resumeListener.onMediaDataLoaded(KEY, null, dataRcn)
+ onMediaDataLoaded(KEY, null, dataRcn, false)
// Then we do not take action
verify(mediaDataManager, never()).setResumeAction(any(), any())
@@ -288,10 +288,9 @@
// When media data is loaded that has not been checked yet, and does have a MBS
val dataCopy = data.copy(resumeAction = null, hasCheckedForResume = false)
- resumeListener.onMediaDataLoaded(KEY, null, dataCopy)
+ onMediaDataLoaded(KEY, null, dataCopy)
// Then we test whether the service is valid
- executor.runAllReady()
verify(mediaDataManager).setResumeAction(eq(KEY), eq(null))
verify(resumeBrowser).testConnection()
@@ -307,7 +306,7 @@
fun testOnLoad_doesNotCheckAgain() {
// When a media data is loaded that has been checked already
var dataCopy = data.copy(hasCheckedForResume = true)
- resumeListener.onMediaDataLoaded(KEY, null, dataCopy)
+ onMediaDataLoaded(KEY, null, dataCopy, resume = false)
// Then we should not check it again
verify(resumeBrowser, never()).testConnection()
@@ -320,17 +319,15 @@
setUpMbsWithValidResolveInfo()
resumeListener.onMediaDataLoaded(KEY, null, data)
- // We notify the manager to set a null action
- verify(mediaDataManager).setResumeAction(KEY, null)
-
// If we then get another update from the app before the first check completes
assertThat(executor.numPending()).isEqualTo(1)
var dataWithCheck = data.copy(hasCheckedForResume = true)
resumeListener.onMediaDataLoaded(KEY, null, dataWithCheck)
// We do not try to start another check
- assertThat(executor.numPending()).isEqualTo(1)
+ executor.runAllReady()
verify(mediaDataManager).setResumeAction(KEY, null)
+ verify(resumeBrowserFactory, times(1)).create(any(), any(), anyInt())
}
@Test
@@ -363,6 +360,7 @@
resumeListener.userUnlockReceiver.onReceive(context, intent)
// Then we should attempt to find recent media for each saved component
+ executor.runAllReady()
verify(resumeBrowser, times(3)).findRecentMedia()
// Then since the mock service found media, the manager should be informed
@@ -382,10 +380,9 @@
// When media data is loaded that has not been checked yet, and does have a MBS
val dataCopy = data.copy(resumeAction = null, hasCheckedForResume = false)
- resumeListener.onMediaDataLoaded(KEY, null, dataCopy)
+ onMediaDataLoaded(KEY, null, dataCopy)
// Then we test whether the service is valid and set the resume action
- executor.runAllReady()
verify(mediaDataManager).setResumeAction(eq(KEY), eq(null))
verify(resumeBrowser).testConnection()
verify(mediaDataManager, times(2)).setResumeAction(eq(KEY), capture(actionCaptor))
@@ -455,6 +452,7 @@
resumeListener.userUnlockReceiver.onReceive(mockContext, intent)
// We add its resume controls
+ executor.runAllReady()
verify(resumeBrowser).findRecentMedia()
verify(mediaDataManager)
.addResumptionControls(anyInt(), any(), any(), any(), any(), any(), eq(PACKAGE_NAME))
@@ -527,7 +525,7 @@
// When media data is loaded that has not been checked yet, and does have a MBS
val dataCopy = data.copy(resumeAction = null, hasCheckedForResume = false)
- resumeListener.onMediaDataLoaded(KEY, null, dataCopy)
+ onMediaDataLoaded(KEY, null, dataCopy)
// Then we store the new lastPlayed time
verify(sharedPrefsEditor).putString(any(), (capture(componentCaptor)))
@@ -546,10 +544,9 @@
fun testOnMediaDataLoaded_newKeyDifferent_oldMediaBrowserDisconnected() {
setUpMbsWithValidResolveInfo()
- resumeListener.onMediaDataLoaded(key = KEY, oldKey = null, data)
- executor.runAllReady()
+ onMediaDataLoaded(key = KEY, oldKey = null, data)
- resumeListener.onMediaDataLoaded(key = "newKey", oldKey = KEY, data)
+ onMediaDataLoaded(key = "newKey", oldKey = KEY, data)
verify(resumeBrowser).disconnect()
}
@@ -561,8 +558,7 @@
// Set up mocks to return with an error
whenever(resumeBrowser.testConnection()).thenAnswer { callbackCaptor.value.onError() }
- resumeListener.onMediaDataLoaded(key = KEY, oldKey = null, data)
- executor.runAllReady()
+ onMediaDataLoaded(key = KEY, oldKey = null, data)
// Ensure we disconnect the browser
verify(resumeBrowser).disconnect()
@@ -579,8 +575,7 @@
callbackCaptor.value.addTrack(description, component, resumeBrowser)
}
- resumeListener.onMediaDataLoaded(key = KEY, oldKey = null, data)
- executor.runAllReady()
+ onMediaDataLoaded(key = KEY, oldKey = null, data)
// Ensure we disconnect the browser
verify(resumeBrowser).disconnect()
@@ -598,8 +593,7 @@
// Load media data that will require us to get the resume action
val dataCopy = data.copy(resumeAction = null, hasCheckedForResume = false)
- resumeListener.onMediaDataLoaded(KEY, null, dataCopy)
- executor.runAllReady()
+ onMediaDataLoaded(KEY, null, dataCopy)
verify(mediaDataManager, times(2)).setResumeAction(eq(KEY), capture(actionCaptor))
// Set up our factory to return a new browser so we can verify we disconnected the old one
@@ -634,6 +628,7 @@
// When the first user unlocks and we query their recent media
userCallbackCaptor.value.onUserChanged(firstUserId, context)
resumeListener.userUnlockReceiver.onReceive(context, unlockIntent)
+ executor.runAllReady()
whenever(resumeBrowser.userId).thenReturn(userIdCaptor.value)
verify(resumeBrowser, times(3)).findRecentMedia()
@@ -688,4 +683,16 @@
whenever(pm.resolveServiceAsUser(any(), anyInt(), anyInt())).thenReturn(resolveInfo)
whenever(pm.getApplicationLabel(any())).thenReturn(PACKAGE_NAME)
}
+
+ private fun onMediaDataLoaded(
+ key: String,
+ oldKey: String?,
+ data: MediaData,
+ resume: Boolean = true
+ ) {
+ resumeListener.onMediaDataLoaded(key, oldKey, data)
+ if (resume) {
+ assertThat(executor.runAllReady()).isEqualTo(1)
+ }
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaControlPanelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaControlPanelTest.kt
index 1260a65..68a5d93 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaControlPanelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaControlPanelTest.kt
@@ -79,6 +79,7 @@
import com.android.systemui.media.controls.shared.model.MediaButton
import com.android.systemui.media.controls.shared.model.MediaData
import com.android.systemui.media.controls.shared.model.MediaDeviceData
+import com.android.systemui.media.controls.shared.model.MediaNotificationAction
import com.android.systemui.media.controls.shared.model.SmartspaceMediaData
import com.android.systemui.media.controls.ui.binder.SeekBarObserver
import com.android.systemui.media.controls.ui.view.GutsViewHolder
@@ -236,6 +237,19 @@
@Mock private lateinit var recProgressBar3: SeekBar
@Mock private lateinit var globalSettings: GlobalSettings
+ private val intent =
+ Intent().apply {
+ putExtras(Bundle().also { it.putString(KEY_SMARTSPACE_APP_NAME, REC_APP_NAME) })
+ setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ }
+ private val pendingIntent =
+ PendingIntent.getActivity(
+ mContext,
+ 0,
+ intent.setPackage(mContext.packageName),
+ PendingIntent.FLAG_MUTABLE
+ )
+
@JvmField @Rule val mockito = MockitoJUnit.rule()
@Before
@@ -989,14 +1003,13 @@
@Test
fun bindNotificationActions() {
val icon = context.getDrawable(android.R.drawable.ic_media_play)
- val bg = context.getDrawable(R.drawable.qs_media_round_button_background)
val actions =
listOf(
- MediaAction(icon, Runnable {}, "previous", bg),
- MediaAction(icon, Runnable {}, "play", bg),
- MediaAction(icon, null, "next", bg),
- MediaAction(icon, null, "custom 0", bg),
- MediaAction(icon, Runnable {}, "custom 1", bg)
+ MediaNotificationAction(true, actionIntent = pendingIntent, icon, "previous"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, icon, "play"),
+ MediaNotificationAction(true, actionIntent = null, icon, "next"),
+ MediaNotificationAction(true, actionIntent = null, icon, "custom 0"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, icon, "custom 1")
)
val state =
mediaData.copy(
@@ -1684,11 +1697,11 @@
fun actionCustom2Click_isLogged() {
val actions =
listOf(
- MediaAction(null, Runnable {}, "action 0", null),
- MediaAction(null, Runnable {}, "action 1", null),
- MediaAction(null, Runnable {}, "action 2", null),
- MediaAction(null, Runnable {}, "action 3", null),
- MediaAction(null, Runnable {}, "action 4", null)
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 0"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 1"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 2"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 3"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 4")
)
val data = mediaData.copy(actions = actions)
@@ -1703,11 +1716,11 @@
fun actionCustom3Click_isLogged() {
val actions =
listOf(
- MediaAction(null, Runnable {}, "action 0", null),
- MediaAction(null, Runnable {}, "action 1", null),
- MediaAction(null, Runnable {}, "action 2", null),
- MediaAction(null, Runnable {}, "action 3", null),
- MediaAction(null, Runnable {}, "action 4", null)
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 0"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 1"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 2"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 3"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 4")
)
val data = mediaData.copy(actions = actions)
@@ -1722,11 +1735,11 @@
fun actionCustom4Click_isLogged() {
val actions =
listOf(
- MediaAction(null, Runnable {}, "action 0", null),
- MediaAction(null, Runnable {}, "action 1", null),
- MediaAction(null, Runnable {}, "action 2", null),
- MediaAction(null, Runnable {}, "action 3", null),
- MediaAction(null, Runnable {}, "action 4", null)
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 0"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 1"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 2"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 3"),
+ MediaNotificationAction(true, actionIntent = pendingIntent, null, "action 4")
)
val data = mediaData.copy(actions = actions)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java
index c1cf91d..bc0ec2d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileLifecycleManagerTest.java
@@ -22,6 +22,7 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
import static com.android.systemui.Flags.FLAG_QS_CUSTOM_TILE_CLICK_GUARANTEED_BUG_FIX;
+import static com.android.systemui.Flags.FLAG_QS_QUICK_REBIND_ACTIVE_TILES;
import static com.google.common.truth.Truth.assertThat;
@@ -75,6 +76,8 @@
import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.time.FakeSystemClock;
+import com.google.common.truth.Truth;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -95,7 +98,8 @@
@Parameters(name = "{0}")
public static List<FlagsParameterization> getParams() {
- return allCombinationsOf(FLAG_QS_CUSTOM_TILE_CLICK_GUARANTEED_BUG_FIX);
+ return allCombinationsOf(FLAG_QS_CUSTOM_TILE_CLICK_GUARANTEED_BUG_FIX,
+ FLAG_QS_QUICK_REBIND_ACTIVE_TILES);
}
private final PackageManagerAdapter mMockPackageManagerAdapter =
@@ -154,7 +158,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
}
@After
@@ -169,12 +174,12 @@
mStateManager.handleDestroy();
}
- private void setPackageEnabled(boolean enabled) throws Exception {
+ private void setPackageEnabledAndActive(boolean enabled, boolean active) throws Exception {
ServiceInfo defaultServiceInfo = null;
if (enabled) {
defaultServiceInfo = new ServiceInfo();
defaultServiceInfo.metaData = new Bundle();
- defaultServiceInfo.metaData.putBoolean(TileService.META_DATA_ACTIVE_TILE, true);
+ defaultServiceInfo.metaData.putBoolean(TileService.META_DATA_ACTIVE_TILE, active);
defaultServiceInfo.metaData.putBoolean(TileService.META_DATA_TOGGLEABLE_TILE, true);
}
when(mMockPackageManagerAdapter.getServiceInfo(any(), anyInt(), anyInt()))
@@ -186,6 +191,10 @@
.thenReturn(defaultPackageInfo);
}
+ private void setPackageEnabled(boolean enabled) throws Exception {
+ setPackageEnabledAndActive(enabled, true);
+ }
+
private void setPackageInstalledForUser(
boolean installed,
boolean active,
@@ -396,13 +405,40 @@
}
@Test
- public void testKillProcess() throws Exception {
+ public void testKillProcessWhenTileServiceIsNotActive() throws Exception {
+ setPackageEnabledAndActive(true, false);
mStateManager.onStartListening();
mStateManager.executeSetBindService(true);
mExecutor.runAllReady();
+ verifyBind(1);
+ verify(mMockTileService, times(1)).onStartListening();
+
mStateManager.onBindingDied(mTileServiceComponentName);
mExecutor.runAllReady();
- mClock.advanceTime(5000);
+ mClock.advanceTime(1000);
+ mExecutor.runAllReady();
+
+ // still 4 seconds left because non active tile service rebind time is 5 seconds
+ Truth.assertThat(mContext.isBound(mTileServiceComponentName)).isFalse();
+
+ mClock.advanceTime(4000); // 5 seconds delay for nonActive service rebinding
+ mExecutor.runAllReady();
+ verifyBind(2);
+ verify(mMockTileService, times(2)).onStartListening();
+ }
+
+ @EnableFlags(FLAG_QS_QUICK_REBIND_ACTIVE_TILES)
+ @Test
+ public void testKillProcessWhenTileServiceIsActive_withRebindFlagOn() throws Exception {
+ mStateManager.onStartListening();
+ mStateManager.executeSetBindService(true);
+ mExecutor.runAllReady();
+ verifyBind(1);
+ verify(mMockTileService, times(1)).onStartListening();
+
+ mStateManager.onBindingDied(mTileServiceComponentName);
+ mExecutor.runAllReady();
+ mClock.advanceTime(1000);
mExecutor.runAllReady();
// Two calls: one for the first bind, one for the restart.
@@ -410,6 +446,86 @@
verify(mMockTileService, times(2)).onStartListening();
}
+ @DisableFlags(FLAG_QS_QUICK_REBIND_ACTIVE_TILES)
+ @Test
+ public void testKillProcessWhenTileServiceIsActive_withRebindFlagOff() throws Exception {
+ mStateManager.onStartListening();
+ mStateManager.executeSetBindService(true);
+ mExecutor.runAllReady();
+ verifyBind(1);
+ verify(mMockTileService, times(1)).onStartListening();
+
+ mStateManager.onBindingDied(mTileServiceComponentName);
+ mExecutor.runAllReady();
+ mClock.advanceTime(1000);
+ mExecutor.runAllReady();
+ verifyBind(0); // the rebind happens after 4 more seconds
+
+ mClock.advanceTime(4000);
+ mExecutor.runAllReady();
+ verifyBind(1);
+ }
+
+ @EnableFlags(FLAG_QS_QUICK_REBIND_ACTIVE_TILES)
+ @Test
+ public void testKillProcessWhenTileServiceIsActiveTwice_withRebindFlagOn_delaysSecondRebind()
+ throws Exception {
+ mStateManager.onStartListening();
+ mStateManager.executeSetBindService(true);
+ mExecutor.runAllReady();
+ verifyBind(1);
+ verify(mMockTileService, times(1)).onStartListening();
+
+ mStateManager.onBindingDied(mTileServiceComponentName);
+ mExecutor.runAllReady();
+ mClock.advanceTime(1000);
+ mExecutor.runAllReady();
+
+ // Two calls: one for the first bind, one for the restart.
+ verifyBind(2);
+ verify(mMockTileService, times(2)).onStartListening();
+
+ mStateManager.onBindingDied(mTileServiceComponentName);
+ mExecutor.runAllReady();
+ mClock.advanceTime(1000);
+ mExecutor.runAllReady();
+ // because active tile will take 5 seconds to bind the second time, not 1
+ verifyBind(0);
+
+ mClock.advanceTime(4000);
+ mExecutor.runAllReady();
+ verifyBind(1);
+ }
+
+ @DisableFlags(FLAG_QS_QUICK_REBIND_ACTIVE_TILES)
+ @Test
+ public void testKillProcessWhenTileServiceIsActiveTwice_withRebindFlagOff_rebindsFromFirstKill()
+ throws Exception {
+ mStateManager.onStartListening();
+ mStateManager.executeSetBindService(true);
+ mExecutor.runAllReady();
+ verifyBind(1);
+ verify(mMockTileService, times(1)).onStartListening();
+
+ mStateManager.onBindingDied(mTileServiceComponentName); // rebind scheduled for 5 seconds
+ mExecutor.runAllReady();
+ mClock.advanceTime(1000);
+ mExecutor.runAllReady();
+
+ verifyBind(0); // it would bind in 4 more seconds
+
+ mStateManager.onBindingDied(mTileServiceComponentName); // this does not affect the rebind
+ mExecutor.runAllReady();
+ mClock.advanceTime(1000);
+ mExecutor.runAllReady();
+
+ verifyBind(0); // only 2 seconds passed from first kill
+
+ mClock.advanceTime(3000);
+ mExecutor.runAllReady();
+ verifyBind(1); // the rebind scheduled 5 seconds from the first kill should now happen
+ }
+
@Test
public void testKillProcessLowMemory() throws Exception {
doAnswer(invocation -> {
@@ -510,7 +626,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
manager.executeSetBindService(true);
mExecutor.runAllReady();
@@ -533,7 +650,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
manager.executeSetBindService(true);
mExecutor.runAllReady();
@@ -556,7 +674,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
manager.executeSetBindService(true);
mExecutor.runAllReady();
@@ -581,7 +700,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
manager.executeSetBindService(true);
mExecutor.runAllReady();
@@ -607,7 +727,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
assertThat(manager.isActiveTile()).isTrue();
}
@@ -626,7 +747,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
assertThat(manager.isActiveTile()).isTrue();
}
@@ -644,7 +766,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
assertThat(manager.isToggleableTile()).isTrue();
}
@@ -663,7 +786,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
assertThat(manager.isToggleableTile()).isTrue();
}
@@ -682,7 +806,8 @@
mUser,
mActivityManager,
mDeviceIdleController,
- mExecutor);
+ mExecutor,
+ mClock);
assertThat(manager.isToggleableTile()).isFalse();
assertThat(manager.isActiveTile()).isFalse();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/panels/ui/compose/DragAndDropTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/panels/ui/compose/DragAndDropTest.kt
index d9faa30..70af5e7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/panels/ui/compose/DragAndDropTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/panels/ui/compose/DragAndDropTest.kt
@@ -31,17 +31,18 @@
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
+import androidx.compose.ui.text.AnnotatedString
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.FlakyTest
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.shared.model.ContentDescription
import com.android.systemui.common.shared.model.Icon
-import com.android.systemui.common.shared.model.Text
import com.android.systemui.qs.panels.shared.model.SizedTile
import com.android.systemui.qs.panels.shared.model.SizedTileImpl
import com.android.systemui.qs.panels.ui.viewmodel.EditTileViewModel
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -199,10 +200,11 @@
android.R.drawable.star_on,
ContentDescription.Loaded(tileSpec)
),
- label = Text.Loaded(tileSpec),
+ label = AnnotatedString(tileSpec),
appName = null,
isCurrent = true,
availableEditActions = emptySet(),
+ category = TileCategory.UNKNOWN,
),
getWidth(tileSpec),
)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/HearingDevicesTileTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/HearingDevicesTileTest.java
index 76c8cf0..7d41a20 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/HearingDevicesTileTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/HearingDevicesTileTest.java
@@ -16,6 +16,8 @@
package com.android.systemui.qs.tiles;
+import static com.android.systemui.accessibility.hearingaid.HearingDevicesUiEventLogger.LAUNCH_SOURCE_QS_TILE;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
@@ -151,7 +153,7 @@
mTile.handleClick(expandable);
mTestableLooper.processAllMessages();
- verify(mHearingDevicesDialogManager).showDialog(expandable);
+ verify(mHearingDevicesDialogManager).showDialog(expandable, LAUNCH_SOURCE_QS_TILE);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/InternetTileNewImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/InternetTileNewImplTest.kt
index e6ec07e..9f84e34 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/InternetTileNewImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/InternetTileNewImplTest.kt
@@ -258,7 +258,7 @@
companion object {
const val WIFI_SSID = "test ssid"
val ACTIVE_WIFI =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
isValidated = true,
level = 4,
ssid = WIFI_SSID,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/RecordIssueTileTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/RecordIssueTileTest.kt
index 73548ba..ca518f9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/RecordIssueTileTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/RecordIssueTileTest.kt
@@ -35,6 +35,7 @@
import com.android.systemui.recordissue.RecordIssueDialogDelegate
import com.android.systemui.recordissue.TraceurMessageSender
import com.android.systemui.res.R
+import com.android.systemui.screenrecord.RecordingController
import com.android.systemui.settings.UserContextProvider
import com.android.systemui.statusbar.phone.KeyguardDismissUtil
import com.android.systemui.statusbar.phone.SystemUIDialog
@@ -65,6 +66,7 @@
@Mock private lateinit var qsEventLogger: QsEventLogger
@Mock private lateinit var metricsLogger: MetricsLogger
@Mock private lateinit var statusBarStateController: StatusBarStateController
+ @Mock private lateinit var recordingController: RecordingController
@Mock private lateinit var activityStarter: ActivityStarter
@Mock private lateinit var qsLogger: QSLogger
@Mock private lateinit var keyguardDismissUtil: KeyguardDismissUtil
@@ -109,6 +111,7 @@
Executors.newSingleThreadExecutor(),
issueRecordingState,
delegateFactory,
+ recordingController,
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ReduceBrightColorsTileTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ReduceBrightColorsTileTest.java
index d6bde27..1aff45b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ReduceBrightColorsTileTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ReduceBrightColorsTileTest.java
@@ -18,6 +18,8 @@
import static junit.framework.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -25,6 +27,7 @@
import android.os.Handler;
import android.platform.test.annotations.RequiresFlagsDisabled;
+import android.platform.test.annotations.RequiresFlagsEnabled;
import android.service.quicksettings.Tile;
import android.testing.TestableLooper;
@@ -35,6 +38,7 @@
import com.android.internal.logging.MetricsLogger;
import com.android.server.display.feature.flags.Flags;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.accessibility.extradim.ExtraDimDialogManager;
import com.android.systemui.classifier.FalsingManagerFake;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.qs.QSTile;
@@ -74,6 +78,8 @@
private ReduceBrightColorsController mReduceBrightColorsController;
@Mock
private QsEventLogger mUiEventLogger;
+ @Mock
+ private ExtraDimDialogManager mExtraDimDialogManager;
private TestableLooper mTestableLooper;
private ReduceBrightColorsTile mTile;
@@ -97,7 +103,8 @@
mMetricsLogger,
mStatusBarStateController,
mActivityStarter,
- mQSLogger
+ mQSLogger,
+ mExtraDimDialogManager
);
mTile.initialize();
@@ -148,6 +155,78 @@
}
@Test
+ @RequiresFlagsEnabled(Flags.FLAG_EVEN_DIMMER)
+ public void testDialogueShownOnClick() {
+ when(mReduceBrightColorsController.isReduceBrightColorsActivated()).thenReturn(true);
+ when(mReduceBrightColorsController.isInUpgradeMode(mContext.getResources()))
+ .thenReturn(true);
+ mTile = new ReduceBrightColorsTile(
+ true,
+ mReduceBrightColorsController,
+ mHost,
+ mUiEventLogger,
+ mTestableLooper.getLooper(),
+ new Handler(mTestableLooper.getLooper()),
+ new FalsingManagerFake(),
+ mMetricsLogger,
+ mStatusBarStateController,
+ mActivityStarter,
+ mQSLogger,
+ mExtraDimDialogManager
+ );
+
+ mTile.initialize();
+ mTestableLooper.processAllMessages();
+
+ // Validity check
+ assertEquals(Tile.STATE_ACTIVE, mTile.getState().state);
+ mTile.handleClick(null /* view */);
+
+ verify(mExtraDimDialogManager, times(1))
+ .dismissKeyguardIfNeededAndShowDialog(any());
+ verify(mReduceBrightColorsController, times(0))
+ .setReduceBrightColorsActivated(anyBoolean());
+ mTile.destroy();
+ mTestableLooper.processAllMessages();
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_EVEN_DIMMER)
+ public void testDialogueShownOnLongClick() {
+ when(mReduceBrightColorsController.isReduceBrightColorsActivated()).thenReturn(true);
+ when(mReduceBrightColorsController.isInUpgradeMode(mContext.getResources()))
+ .thenReturn(true);
+ mTile = new ReduceBrightColorsTile(
+ true,
+ mReduceBrightColorsController,
+ mHost,
+ mUiEventLogger,
+ mTestableLooper.getLooper(),
+ new Handler(mTestableLooper.getLooper()),
+ new FalsingManagerFake(),
+ mMetricsLogger,
+ mStatusBarStateController,
+ mActivityStarter,
+ mQSLogger,
+ mExtraDimDialogManager
+ );
+
+ mTile.initialize();
+ mTestableLooper.processAllMessages();
+
+ // Validity check
+ assertEquals(Tile.STATE_ACTIVE, mTile.getState().state);
+ mTile.handleLongClick(null /* view */);
+
+ verify(mExtraDimDialogManager, times(1))
+ .dismissKeyguardIfNeededAndShowDialog(any());
+ verify(mReduceBrightColorsController, times(0))
+ .setReduceBrightColorsActivated(anyBoolean());
+ mTile.destroy();
+ mTestableLooper.processAllMessages();
+ }
+
+ @Test
public void testIcon_whenTileEnabled_isOnState() {
when(mReduceBrightColorsController.isReduceBrightColorsActivated()).thenReturn(true);
mTile.refreshState();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/recordissue/IssueRecordingServiceCommandHandlerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/recordissue/IssueRecordingServiceCommandHandlerTest.kt
new file mode 100644
index 0000000..57cfe1b
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/recordissue/IssueRecordingServiceCommandHandlerTest.kt
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.recordissue
+
+import android.app.IActivityManager
+import android.app.NotificationManager
+import android.net.Uri
+import android.os.UserHandle
+import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.animation.DialogTransitionAnimator
+import com.android.systemui.animation.dialogTransitionAnimator
+import com.android.systemui.concurrency.fakeExecutor
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.testCase
+import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor
+import com.android.systemui.settings.UserContextProvider
+import com.android.systemui.settings.userFileManager
+import com.android.systemui.settings.userTracker
+import com.android.traceur.TraceConfig
+import com.google.common.truth.Truth
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.anyInt
+import org.mockito.kotlin.any
+import org.mockito.kotlin.isNull
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+@TestableLooper.RunWithLooper(setAsMainLooper = true)
+class IssueRecordingServiceCommandHandlerTest : SysuiTestCase() {
+
+ private val kosmos = Kosmos().also { it.testCase = this }
+ private val bgExecutor = kosmos.fakeExecutor
+ private val userContextProvider: UserContextProvider = kosmos.userTracker
+ private val dialogTransitionAnimator: DialogTransitionAnimator = kosmos.dialogTransitionAnimator
+ private lateinit var traceurMessageSender: TraceurMessageSender
+ private val issueRecordingState =
+ IssueRecordingState(kosmos.userTracker, kosmos.userFileManager)
+
+ private val iActivityManager = mock<IActivityManager>()
+ private val notificationManager = mock<NotificationManager>()
+ private val panelInteractor = mock<PanelInteractor>()
+
+ private lateinit var underTest: IssueRecordingServiceCommandHandler
+
+ @Before
+ fun setup() {
+ traceurMessageSender = mock<TraceurMessageSender>()
+ underTest =
+ IssueRecordingServiceCommandHandler(
+ bgExecutor,
+ dialogTransitionAnimator,
+ panelInteractor,
+ traceurMessageSender,
+ issueRecordingState,
+ iActivityManager,
+ notificationManager,
+ userContextProvider
+ )
+ }
+
+ @Test
+ fun startsTracing_afterReceivingActionStartCommand() {
+ underTest.handleStartCommand()
+ bgExecutor.runAllReady()
+
+ Truth.assertThat(issueRecordingState.isRecording).isTrue()
+ verify(traceurMessageSender).startTracing(any<TraceConfig>())
+ }
+
+ @Test
+ fun stopsTracing_afterReceivingStopTracingCommand() {
+ underTest.handleStopCommand(mContext.contentResolver)
+ bgExecutor.runAllReady()
+
+ Truth.assertThat(issueRecordingState.isRecording).isFalse()
+ verify(traceurMessageSender).stopTracing()
+ }
+
+ @Test
+ fun cancelsNotification_afterReceivingShareCommand() {
+ underTest.handleShareCommand(0, null, mContext)
+ bgExecutor.runAllReady()
+
+ verify(notificationManager).cancelAsUser(isNull(), anyInt(), any<UserHandle>())
+ }
+
+ @Test
+ fun requestBugreport_afterReceivingShareCommand_withTakeBugreportTrue() {
+ issueRecordingState.takeBugreport = true
+ val uri = mock<Uri>()
+
+ underTest.handleShareCommand(0, uri, mContext)
+ bgExecutor.runAllReady()
+
+ verify(iActivityManager).requestBugReportWithExtraAttachment(uri)
+ }
+
+ @Test
+ fun sharesTracesDirectly_afterReceivingShareCommand_withTakeBugreportFalse() {
+ issueRecordingState.takeBugreport = false
+ val uri = mock<Uri>()
+
+ underTest.handleShareCommand(0, uri, mContext)
+ bgExecutor.runAllReady()
+
+ verify(traceurMessageSender).shareTraces(mContext, uri)
+ }
+
+ @Test
+ fun closesShade_afterReceivingShareCommand() {
+ val uri = mock<Uri>()
+
+ underTest.handleShareCommand(0, uri, mContext)
+ bgExecutor.runAllReady()
+
+ verify(panelInteractor).collapsePanels()
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/SaveImageInBackgroundTaskTest.kt b/packages/SystemUI/tests/src/com/android/systemui/screenshot/SaveImageInBackgroundTaskTest.kt
deleted file mode 100644
index 5e07aef..0000000
--- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/SaveImageInBackgroundTaskTest.kt
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.screenshot
-
-import android.app.Notification
-import android.app.PendingIntent
-import android.content.ComponentName
-import android.content.Intent
-import android.graphics.Bitmap
-import android.graphics.drawable.Icon
-import android.net.Uri
-import android.os.UserHandle
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.flags.FakeFeatureFlags
-import com.android.systemui.screenshot.ScreenshotNotificationSmartActionsProvider.ScreenshotSmartActionType
-import com.android.systemui.util.mockito.any
-import com.android.systemui.util.mockito.eq
-import com.android.systemui.util.mockito.mock
-import com.android.systemui.util.mockito.whenever
-import java.util.concurrent.CompletableFuture
-import org.junit.Assert.assertEquals
-import org.junit.Assert.assertNull
-import org.junit.Before
-import org.junit.Test
-
-@SmallTest
-class SaveImageInBackgroundTaskTest : SysuiTestCase() {
- private val imageExporter = mock<ImageExporter>()
- private val smartActions = mock<ScreenshotSmartActions>()
- private val smartActionsProvider = mock<ScreenshotNotificationSmartActionsProvider>()
- private val saveImageData = SaveImageInBackgroundTask.SaveImageInBackgroundData()
- private val testScreenshotId: String = "testScreenshotId"
- private val testBitmap = mock<Bitmap>()
- private val testUser = UserHandle.getUserHandleForUid(0)
- private val testIcon = mock<Icon>()
- private val testImageTime = 1234.toLong()
- private val flags = FakeFeatureFlags()
-
- private val smartActionsUriFuture = mock<CompletableFuture<List<Notification.Action>>>()
- private val smartActionsFuture = mock<CompletableFuture<List<Notification.Action>>>()
-
- private val testUri: Uri = Uri.parse("testUri")
- private val intent =
- Intent(Intent.ACTION_SEND)
- .setComponent(
- ComponentName.unflattenFromString(
- "com.google.android.test/com.google.android.test.TestActivity"
- )
- )
- private val immutablePendingIntent =
- PendingIntent.getBroadcast(
- mContext,
- 0,
- intent,
- PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE
- )
- private val mutablePendingIntent =
- PendingIntent.getBroadcast(
- mContext,
- 0,
- intent,
- PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_MUTABLE
- )
-
- private val saveImageTask =
- SaveImageInBackgroundTask(
- mContext,
- flags,
- imageExporter,
- smartActions,
- saveImageData,
- smartActionsProvider,
- )
-
- @Before
- fun setup() {
- whenever(
- smartActions.getSmartActionsFuture(
- eq(testScreenshotId),
- any(Uri::class.java),
- eq(testBitmap),
- eq(smartActionsProvider),
- any(ScreenshotSmartActionType::class.java),
- any(Boolean::class.java),
- eq(testUser)
- )
- )
- .thenReturn(smartActionsUriFuture)
- whenever(
- smartActions.getSmartActionsFuture(
- eq(testScreenshotId),
- eq(null),
- eq(testBitmap),
- eq(smartActionsProvider),
- any(ScreenshotSmartActionType::class.java),
- any(Boolean::class.java),
- eq(testUser)
- )
- )
- .thenReturn(smartActionsFuture)
- }
-
- @Test
- fun testQueryQuickShare_noAction() {
- whenever(
- smartActions.getSmartActions(
- eq(testScreenshotId),
- eq(smartActionsFuture),
- any(Int::class.java),
- eq(smartActionsProvider),
- eq(ScreenshotSmartActionType.QUICK_SHARE_ACTION)
- )
- )
- .thenReturn(ArrayList<Notification.Action>())
-
- val quickShareAction =
- saveImageTask.queryQuickShareAction(testScreenshotId, testBitmap, testUser, testUri)
-
- assertNull(quickShareAction)
- }
-
- @Test
- fun testQueryQuickShare_withActions() {
- val actions = ArrayList<Notification.Action>()
- actions.add(constructAction("Action One", mutablePendingIntent))
- actions.add(constructAction("Action Two", mutablePendingIntent))
- whenever(
- smartActions.getSmartActions(
- eq(testScreenshotId),
- eq(smartActionsUriFuture),
- any(Int::class.java),
- eq(smartActionsProvider),
- eq(ScreenshotSmartActionType.QUICK_SHARE_ACTION)
- )
- )
- .thenReturn(actions)
-
- val quickShareAction =
- saveImageTask.queryQuickShareAction(testScreenshotId, testBitmap, testUser, testUri)!!
-
- assertEquals("Action One", quickShareAction.title)
- assertEquals(mutablePendingIntent, quickShareAction.actionIntent)
- }
-
- @Test
- fun testCreateQuickShareAction_originalWasNull_returnsNull() {
- val quickShareAction =
- saveImageTask.createQuickShareAction(
- null,
- testScreenshotId,
- testUri,
- testImageTime,
- testBitmap,
- testUser
- )
-
- assertNull(quickShareAction)
- }
-
- @Test
- fun testCreateQuickShareAction_immutableIntentDifferentAction_returnsNull() {
- val actions = ArrayList<Notification.Action>()
- actions.add(constructAction("New Test Action", immutablePendingIntent))
- whenever(
- smartActions.getSmartActions(
- eq(testScreenshotId),
- eq(smartActionsUriFuture),
- any(Int::class.java),
- eq(smartActionsProvider),
- eq(ScreenshotSmartActionType.QUICK_SHARE_ACTION)
- )
- )
- .thenReturn(actions)
- val origAction = constructAction("Old Test Action", immutablePendingIntent)
-
- val quickShareAction =
- saveImageTask.createQuickShareAction(
- origAction,
- testScreenshotId,
- testUri,
- testImageTime,
- testBitmap,
- testUser,
- )
-
- assertNull(quickShareAction)
- }
-
- @Test
- fun testCreateQuickShareAction_mutableIntent_returnsSafeIntent() {
- val actions = ArrayList<Notification.Action>()
- val action = constructAction("Action One", mutablePendingIntent)
- actions.add(action)
- whenever(
- smartActions.getSmartActions(
- eq(testScreenshotId),
- eq(smartActionsUriFuture),
- any(Int::class.java),
- eq(smartActionsProvider),
- eq(ScreenshotSmartActionType.QUICK_SHARE_ACTION)
- )
- )
- .thenReturn(actions)
-
- val quickShareAction =
- saveImageTask.createQuickShareAction(
- constructAction("Test Action", mutablePendingIntent),
- testScreenshotId,
- testUri,
- testImageTime,
- testBitmap,
- testUser
- )
- val quickSharePendingIntent =
- quickShareAction.actionIntent.intent.extras!!.getParcelable(
- SmartActionsReceiver.EXTRA_ACTION_INTENT,
- PendingIntent::class.java
- )
-
- assertEquals("Test Action", quickShareAction.title)
- assertEquals(mutablePendingIntent, quickSharePendingIntent)
- }
-
- @Test
- fun testCreateQuickShareAction_immutableIntent_returnsSafeIntent() {
- val actions = ArrayList<Notification.Action>()
- val action = constructAction("Test Action", immutablePendingIntent)
- actions.add(action)
- whenever(
- smartActions.getSmartActions(
- eq(testScreenshotId),
- eq(smartActionsUriFuture),
- any(Int::class.java),
- eq(smartActionsProvider),
- eq(ScreenshotSmartActionType.QUICK_SHARE_ACTION)
- )
- )
- .thenReturn(actions)
-
- val quickShareAction =
- saveImageTask.createQuickShareAction(
- constructAction("Test Action", immutablePendingIntent),
- testScreenshotId,
- testUri,
- testImageTime,
- testBitmap,
- testUser,
- )!!
-
- assertEquals("Test Action", quickShareAction.title)
- assertEquals(
- immutablePendingIntent,
- quickShareAction.actionIntent.intent.extras!!.getParcelable(
- SmartActionsReceiver.EXTRA_ACTION_INTENT,
- PendingIntent::class.java
- )
- )
- }
-
- private fun constructAction(title: String, intent: PendingIntent): Notification.Action {
- return Notification.Action.Builder(testIcon, title, intent).build()
- }
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/appclips/AppClipsViewModelTest.java b/packages/SystemUI/tests/src/com/android/systemui/screenshot/appclips/AppClipsViewModelTest.java
index 5d71c05..886b32b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/appclips/AppClipsViewModelTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/appclips/AppClipsViewModelTest.java
@@ -24,6 +24,7 @@
import static android.content.Intent.ACTION_VIEW;
import static android.content.Intent.CAPTURE_CONTENT_FOR_NOTE_FAILED;
import static android.content.Intent.CATEGORY_LAUNCHER;
+import static android.content.pm.PackageManager.MATCH_DEFAULT_ONLY;
import static android.view.Display.DEFAULT_DISPLAY;
import static com.google.common.truth.Truth.assertThat;
@@ -32,6 +33,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.reset;
@@ -73,6 +75,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -108,19 +111,24 @@
Context mMockedContext;
@Mock
private PackageManager mPackageManager;
- private ArgumentCaptor<Intent> mPackageManagerIntentCaptor;
+ private ArgumentCaptor<Intent> mPackageManagerLauncherIntentCaptor;
+ private ArgumentCaptor<Intent> mPackageManagerBacklinkIntentCaptor;
private AppClipsViewModel mViewModel;
@Before
public void setUp() throws RemoteException {
MockitoAnnotations.initMocks(this);
- mPackageManagerIntentCaptor = ArgumentCaptor.forClass(Intent.class);
+ mPackageManagerLauncherIntentCaptor = ArgumentCaptor.forClass(Intent.class);
+ mPackageManagerBacklinkIntentCaptor = ArgumentCaptor.forClass(Intent.class);
// Set up mocking for backlinks.
when(mAtmService.getTasks(Integer.MAX_VALUE, false, false, DEFAULT_DISPLAY))
.thenReturn(List.of(createTaskInfoForBacklinksTask()));
- when(mPackageManager.resolveActivity(mPackageManagerIntentCaptor.capture(), anyInt()))
- .thenReturn(createBacklinksTaskResolveInfo());
+ ResolveInfo expectedResolveInfo = createBacklinksTaskResolveInfo();
+ when(mPackageManager.resolveActivity(mPackageManagerLauncherIntentCaptor.capture(),
+ anyInt())).thenReturn(expectedResolveInfo);
+ when(mPackageManager.queryIntentActivities(mPackageManagerBacklinkIntentCaptor.capture(),
+ eq(MATCH_DEFAULT_ONLY))).thenReturn(List.of(expectedResolveInfo));
when(mPackageManager.loadItemIcon(any(), any())).thenReturn(FAKE_DRAWABLE);
when(mMockedContext.getPackageManager()).thenReturn(mPackageManager);
@@ -209,7 +217,7 @@
mViewModel.triggerBacklinks(Collections.emptySet(), DEFAULT_DISPLAY);
waitForIdleSync();
- Intent queriedIntent = mPackageManagerIntentCaptor.getValue();
+ Intent queriedIntent = mPackageManagerBacklinkIntentCaptor.getValue();
assertThat(queriedIntent.getData()).isEqualTo(expectedUri);
assertThat(queriedIntent.getAction()).isEqualTo(ACTION_VIEW);
@@ -226,6 +234,63 @@
}
@Test
+ public void triggerBacklinks_shouldUpdateBacklinks_withUriForDifferentApp() {
+ Uri expectedUri = Uri.parse("https://android.com");
+ AssistContent contentWithUri = new AssistContent();
+ contentWithUri.setWebUri(expectedUri);
+ mockForAssistContent(contentWithUri, BACKLINKS_TASK_ID);
+
+ // Reset PackageManager mocking done in setup.
+ reset(mPackageManager);
+ String package2 = BACKLINKS_TASK_PACKAGE_NAME + 2;
+ String appName2 = BACKLINKS_TASK_APP_NAME + 2;
+ ResolveInfo resolveInfo2 = createBacklinksTaskResolveInfo();
+ ActivityInfo activityInfo2 = resolveInfo2.activityInfo;
+ activityInfo2.name = appName2;
+ activityInfo2.packageName = package2;
+ activityInfo2.applicationInfo.packageName = package2;
+
+ Intent app2LauncherIntent = new Intent(ACTION_MAIN).addCategory(
+ CATEGORY_LAUNCHER).setPackage(package2);
+ when(mPackageManager.resolveActivity(intentEquals(app2LauncherIntent), eq(/* flags= */ 0)))
+ .thenReturn(resolveInfo2);
+ Intent uriIntent = new Intent(ACTION_VIEW).setData(expectedUri);
+ when(mPackageManager.queryIntentActivities(intentEquals(uriIntent), eq(MATCH_DEFAULT_ONLY)))
+ .thenReturn(List.of(resolveInfo2));
+ when(mPackageManager.loadItemIcon(any(), any())).thenReturn(FAKE_DRAWABLE);
+
+ mViewModel.triggerBacklinks(Collections.emptySet(), DEFAULT_DISPLAY);
+ waitForIdleSync();
+
+ BacklinksData result = (BacklinksData) mViewModel.mSelectedBacklinksLiveData.getValue();
+ ClipData clipData = result.getClipData();
+ ClipDescription resultDescription = clipData.getDescription();
+ assertThat(resultDescription.getLabel().toString()).isEqualTo(appName2);
+ assertThat(resultDescription.getMimeType(0)).isEqualTo(MIMETYPE_TEXT_URILIST);
+ assertThat(clipData.getItemCount()).isEqualTo(1);
+ assertThat(clipData.getItemAt(0).getUri()).isEqualTo(expectedUri);
+
+ assertThat(mViewModel.getBacklinksLiveData().getValue().size()).isEqualTo(1);
+ }
+
+ private static class IntentMatcher implements ArgumentMatcher<Intent> {
+ private final Intent mExpectedIntent;
+
+ IntentMatcher(Intent expectedIntent) {
+ mExpectedIntent = expectedIntent;
+ }
+
+ @Override
+ public boolean matches(Intent actualIntent) {
+ return actualIntent != null && mExpectedIntent.filterEquals(actualIntent);
+ }
+ }
+
+ private static Intent intentEquals(Intent intent) {
+ return argThat(new IntentMatcher(intent));
+ }
+
+ @Test
public void triggerBacklinks_withNonResolvableUri_usesMainLauncherIntent() {
Uri expectedUri = Uri.parse("https://developers.android.com");
AssistContent contentWithUri = new AssistContent();
@@ -249,7 +314,7 @@
mViewModel.triggerBacklinks(Collections.emptySet(), DEFAULT_DISPLAY);
waitForIdleSync();
- Intent queriedIntent = mPackageManagerIntentCaptor.getValue();
+ Intent queriedIntent = mPackageManagerBacklinkIntentCaptor.getValue();
assertThat(queriedIntent.getPackage()).isEqualTo(expectedIntent.getPackage());
BacklinksData result = (BacklinksData) mViewModel.mSelectedBacklinksLiveData.getValue();
@@ -283,7 +348,7 @@
mViewModel.triggerBacklinks(Collections.emptySet(), DEFAULT_DISPLAY);
waitForIdleSync();
- Intent queriedIntent = mPackageManagerIntentCaptor.getValue();
+ Intent queriedIntent = mPackageManagerLauncherIntentCaptor.getValue();
assertThat(queriedIntent.getPackage()).isEqualTo(BACKLINKS_TASK_PACKAGE_NAME);
assertThat(queriedIntent.getAction()).isEqualTo(ACTION_MAIN);
assertThat(queriedIntent.getCategories()).containsExactly(CATEGORY_LAUNCHER);
@@ -356,7 +421,9 @@
// For each task, the logic queries PM 3 times, twice for verifying if an app can be
// launched via launcher and once with the data provided in backlink intent.
when(mPackageManager.resolveActivity(any(), anyInt())).thenReturn(resolveInfo1,
- resolveInfo1, resolveInfo1, resolveInfo2, resolveInfo2, resolveInfo2);
+ resolveInfo1, resolveInfo2, resolveInfo2);
+ when(mPackageManager.queryIntentActivities(any(Intent.class), eq(MATCH_DEFAULT_ONLY)))
+ .thenReturn(List.of(resolveInfo1)).thenReturn(List.of(resolveInfo2));
when(mPackageManager.loadItemIcon(any(), any())).thenReturn(FAKE_DRAWABLE);
when(mAtmService.getTasks(Integer.MAX_VALUE, false, false, DEFAULT_DISPLAY))
.thenReturn(List.of(runningTaskInfo1, runningTaskInfo2));
diff --git a/packages/SystemUI/tests/src/com/android/systemui/settings/UserTrackerImplReceiveTest.kt b/packages/SystemUI/tests/src/com/android/systemui/settings/UserTrackerImplReceiveTest.kt
index 263b001..78764c2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/settings/UserTrackerImplReceiveTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/settings/UserTrackerImplReceiveTest.kt
@@ -79,21 +79,6 @@
@Test
fun callsCallbackAndUpdatesProfilesWhenAnIntentReceived() = runTest {
- tracker =
- UserTrackerImpl(
- context,
- { fakeFeatures },
- userManager,
- iActivityManager,
- dumpManager,
- this,
- testDispatcher,
- handler
- )
- tracker.initialize(0)
- tracker.addCallback(callback, executor)
- val profileID = tracker.userId + 10
-
`when`(userManager.getProfiles(anyInt())).thenAnswer { invocation ->
val id = invocation.getArgument<Int>(0)
val info = UserInfo(id, "", UserInfo.FLAG_FULL)
@@ -109,6 +94,21 @@
listOf(info, infoProfile)
}
+ tracker =
+ UserTrackerImpl(
+ context,
+ { fakeFeatures },
+ userManager,
+ iActivityManager,
+ dumpManager,
+ this,
+ testDispatcher,
+ handler
+ )
+ tracker.initialize(0)
+ tracker.addCallback(callback, executor)
+ val profileID = tracker.userId + 10
+
tracker.onReceive(context, Intent(intentAction))
verify(callback, times(0)).onUserChanged(anyInt(), any())
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
index 9481e5a..e0c4ab7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
@@ -431,7 +431,6 @@
mFakeKeyguardRepository,
mKeyguardTransitionInteractor,
mPowerInteractor,
- mShadeRepository,
new FakeUserSetupRepository(),
mock(UserSwitcherInteractor.class),
new ShadeInteractorLegacyImpl(
@@ -447,8 +446,8 @@
() -> mLargeScreenHeaderHelper
),
mShadeRepository
- )
- );
+ ),
+ mKosmos.getShadeModeInteractor());
SystemClock systemClock = new FakeSystemClock();
mStatusBarStateController = new StatusBarStateControllerImpl(
mUiEventLogger,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerImplBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerImplBaseTest.java
index 3f6617b..a52f173 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerImplBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerImplBaseTest.java
@@ -217,7 +217,6 @@
mKeyguardRepository,
keyguardTransitionInteractor,
powerInteractor,
- mShadeRepository,
new FakeUserSetupRepository(),
mUserSwitcherInteractor,
new ShadeInteractorLegacyImpl(
@@ -232,8 +231,8 @@
deviceEntryUdfpsInteractor,
() -> mLargeScreenHeaderHelper),
mShadeRepository
- )
- );
+ ),
+ mKosmos.getShadeModeInteractor());
mActiveNotificationsInteractor = new ActiveNotificationsInteractor(
new ActiveNotificationListRepository(),
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelTest.kt
index f528ebb..26ce7b9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelTest.kt
@@ -19,8 +19,9 @@
import android.content.DialogInterface
import android.content.packageManager
import android.content.pm.PackageManager
+import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
-import android.platform.test.annotations.EnableFlags
+import android.platform.test.annotations.DisableFlags
import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
@@ -39,11 +40,9 @@
import com.android.systemui.screenrecord.data.repository.screenRecordRepository
import com.android.systemui.statusbar.chips.mediaprojection.domain.interactor.MediaProjectionChipInteractorTest.Companion.NORMAL_PACKAGE
import com.android.systemui.statusbar.chips.mediaprojection.domain.interactor.MediaProjectionChipInteractorTest.Companion.setUpPackageManagerForMediaProjection
-import com.android.systemui.statusbar.chips.ron.demo.ui.viewmodel.DemoRonChipViewModelTest.Companion.addDemoRonChip
import com.android.systemui.statusbar.chips.ron.demo.ui.viewmodel.demoRonChipViewModel
import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
import com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer
-import com.android.systemui.statusbar.commandline.commandRegistry
import com.android.systemui.statusbar.phone.SystemUIDialog
import com.android.systemui.statusbar.phone.mockSystemUIDialogFactory
import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingCallRepository
@@ -51,8 +50,6 @@
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.inCallModel
import com.android.systemui.util.time.fakeSystemClock
import com.google.common.truth.Truth.assertThat
-import java.io.PrintWriter
-import java.io.StringWriter
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
@@ -69,21 +66,22 @@
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
+/**
+ * Tests for [OngoingActivityChipsViewModel] when the [FLAG_STATUS_BAR_RON_CHIPS] flag is disabled.
+ */
@SmallTest
@RunWith(AndroidJUnit4::class)
@OptIn(ExperimentalCoroutinesApi::class)
+@DisableFlags(FLAG_STATUS_BAR_RON_CHIPS)
class OngoingActivityChipsViewModelTest : SysuiTestCase() {
private val kosmos = Kosmos().also { it.testCase = this }
private val testScope = kosmos.testScope
private val systemClock = kosmos.fakeSystemClock
- private val commandRegistry = kosmos.commandRegistry
private val screenRecordState = kosmos.screenRecordRepository.screenRecordState
private val mediaProjectionState = kosmos.fakeMediaProjectionRepository.mediaProjectionState
private val callRepo = kosmos.ongoingCallRepository
- private val pw = PrintWriter(StringWriter())
-
private val mockSystemUIDialog = mock<SystemUIDialog>()
private val chipBackgroundView = mock<ChipBackgroundContainer>()
private val chipView =
@@ -102,8 +100,12 @@
fun setUp() {
setUpPackageManagerForMediaProjection(kosmos)
kosmos.demoRonChipViewModel.start()
- whenever(kosmos.packageManager.getApplicationIcon(any<String>()))
- .thenReturn(BitmapDrawable())
+ val icon =
+ BitmapDrawable(
+ context.resources,
+ Bitmap.createBitmap(/* width= */ 100, /* height= */ 100, Bitmap.Config.ARGB_8888)
+ )
+ whenever(kosmos.packageManager.getApplicationIcon(any<String>())).thenReturn(icon)
}
@Test
@@ -183,24 +185,16 @@
}
@Test
- @EnableFlags(FLAG_STATUS_BAR_RON_CHIPS)
fun primaryChip_higherPriorityChipAdded_lowerPriorityChipReplaced() =
testScope.runTest {
// Start with just the lowest priority chip shown
- addDemoRonChip(commandRegistry, pw)
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
// And everything else hidden
- callRepo.setOngoingCallState(OngoingCallModel.NoCall)
mediaProjectionState.value = MediaProjectionState.NotProjecting
screenRecordState.value = ScreenRecordModel.DoingNothing
val latest by collectLastValue(underTest.primaryChip)
- assertIsDemoRonChip(latest)
-
- // WHEN the higher priority call chip is added
- callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
-
- // THEN the higher priority call chip is used
assertIsCallChip(latest)
// WHEN the higher priority media projection chip is added
@@ -222,7 +216,6 @@
}
@Test
- @EnableFlags(FLAG_STATUS_BAR_RON_CHIPS)
fun primaryChip_highestPriorityChipRemoved_showsNextPriorityChip() =
testScope.runTest {
// WHEN all chips are active
@@ -230,7 +223,6 @@
mediaProjectionState.value =
MediaProjectionState.Projecting.EntireScreen(NORMAL_PACKAGE)
callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
- addDemoRonChip(commandRegistry, pw)
val latest by collectLastValue(underTest.primaryChip)
@@ -248,12 +240,6 @@
// THEN the lower priority call is used
assertIsCallChip(latest)
-
- // WHEN the higher priority call is removed
- callRepo.setOngoingCallState(OngoingCallModel.NoCall)
-
- // THEN the lower priority demo RON is used
- assertIsDemoRonChip(latest)
}
/** Regression test for b/347726238. */
@@ -390,11 +376,5 @@
.impl as Icon.Resource
assertThat(icon.res).isEqualTo(com.android.internal.R.drawable.ic_phone)
}
-
- fun assertIsDemoRonChip(latest: OngoingActivityChipModel?) {
- assertThat(latest).isInstanceOf(OngoingActivityChipModel.Shown::class.java)
- assertThat((latest as OngoingActivityChipModel.Shown).icon)
- .isInstanceOf(OngoingActivityChipModel.ChipIcon.FullColorAppIcon::class.java)
- }
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithRonsViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithRonsViewModelTest.kt
new file mode 100644
index 0000000..631120b
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsWithRonsViewModelTest.kt
@@ -0,0 +1,534 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.chips.ui.viewmodel
+
+import android.content.DialogInterface
+import android.content.packageManager
+import android.graphics.Bitmap
+import android.graphics.drawable.BitmapDrawable
+import android.platform.test.annotations.EnableFlags
+import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.Flags.FLAG_STATUS_BAR_RON_CHIPS
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.mediaprojection.data.model.MediaProjectionState
+import com.android.systemui.mediaprojection.data.repository.fakeMediaProjectionRepository
+import com.android.systemui.mediaprojection.taskswitcher.FakeActivityTaskManager.Companion.createTask
+import com.android.systemui.res.R
+import com.android.systemui.screenrecord.data.model.ScreenRecordModel
+import com.android.systemui.screenrecord.data.repository.screenRecordRepository
+import com.android.systemui.statusbar.chips.mediaprojection.domain.interactor.MediaProjectionChipInteractorTest.Companion.NORMAL_PACKAGE
+import com.android.systemui.statusbar.chips.mediaprojection.domain.interactor.MediaProjectionChipInteractorTest.Companion.setUpPackageManagerForMediaProjection
+import com.android.systemui.statusbar.chips.ron.demo.ui.viewmodel.DemoRonChipViewModelTest.Companion.addDemoRonChip
+import com.android.systemui.statusbar.chips.ron.demo.ui.viewmodel.demoRonChipViewModel
+import com.android.systemui.statusbar.chips.ui.model.MultipleOngoingActivityChipsModel
+import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
+import com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer
+import com.android.systemui.statusbar.chips.ui.viewmodel.OngoingActivityChipsViewModelTest.Companion.assertIsCallChip
+import com.android.systemui.statusbar.chips.ui.viewmodel.OngoingActivityChipsViewModelTest.Companion.assertIsScreenRecordChip
+import com.android.systemui.statusbar.chips.ui.viewmodel.OngoingActivityChipsViewModelTest.Companion.assertIsShareToAppChip
+import com.android.systemui.statusbar.chips.ui.viewmodel.OngoingActivityChipsViewModelTest.Companion.getStopActionFromDialog
+import com.android.systemui.statusbar.commandline.commandRegistry
+import com.android.systemui.statusbar.phone.SystemUIDialog
+import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingCallRepository
+import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel
+import com.android.systemui.statusbar.phone.ongoingcall.shared.model.inCallModel
+import com.android.systemui.testKosmos
+import com.android.systemui.util.time.fakeSystemClock
+import com.google.common.truth.Truth.assertThat
+import java.io.PrintWriter
+import java.io.StringWriter
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.test.runCurrent
+import kotlinx.coroutines.test.runTest
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+/**
+ * Tests for [OngoingActivityChipsViewModel] when the [FLAG_STATUS_BAR_RON_CHIPS] flag is enabled.
+ */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+@OptIn(ExperimentalCoroutinesApi::class)
+@EnableFlags(FLAG_STATUS_BAR_RON_CHIPS)
+class OngoingActivityChipsWithRonsViewModelTest : SysuiTestCase() {
+ private val kosmos = testKosmos()
+ private val testScope = kosmos.testScope
+ private val systemClock = kosmos.fakeSystemClock
+ private val commandRegistry = kosmos.commandRegistry
+
+ private val screenRecordState = kosmos.screenRecordRepository.screenRecordState
+ private val mediaProjectionState = kosmos.fakeMediaProjectionRepository.mediaProjectionState
+ private val callRepo = kosmos.ongoingCallRepository
+
+ private val pw = PrintWriter(StringWriter())
+
+ private val mockSystemUIDialog = mock<SystemUIDialog>()
+ private val chipBackgroundView = mock<ChipBackgroundContainer>()
+ private val chipView =
+ mock<View>().apply {
+ whenever(
+ this.requireViewById<ChipBackgroundContainer>(
+ R.id.ongoing_activity_chip_background
+ )
+ )
+ .thenReturn(chipBackgroundView)
+ }
+
+ private val underTest = kosmos.ongoingActivityChipsViewModel
+
+ @Before
+ fun setUp() {
+ setUpPackageManagerForMediaProjection(kosmos)
+ kosmos.demoRonChipViewModel.start()
+ val icon =
+ BitmapDrawable(
+ context.resources,
+ Bitmap.createBitmap(/* width= */ 100, /* height= */ 100, Bitmap.Config.ARGB_8888)
+ )
+ whenever(kosmos.packageManager.getApplicationIcon(any<String>())).thenReturn(icon)
+ }
+
+ // Even though the `primaryChip` flow isn't used when the RONs flag is on, still test that the
+ // flow has the right behavior to verify that we don't break any existing functionality.
+
+ @Test
+ fun primaryChip_allHidden_hidden() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertThat(latest).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+ }
+
+ @Test
+ fun chips_allHidden_bothPrimaryAndSecondaryHidden() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertThat(latest!!.primary).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+ assertThat(latest!!.secondary).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+ }
+
+ @Test
+ fun primaryChip_screenRecordShow_restHidden_screenRecordShown() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsScreenRecordChip(latest)
+ }
+
+ @Test
+ fun chips_screenRecordShow_restHidden_primaryIsScreenRecordSecondaryIsHidden() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertIsScreenRecordChip(latest!!.primary)
+ assertThat(latest!!.secondary).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+ }
+
+ @Test
+ fun primaryChip_screenRecordShowAndCallShow_screenRecordShown() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsScreenRecordChip(latest)
+ }
+
+ @Test
+ fun chips_screenRecordShowAndCallShow_primaryIsScreenRecordSecondaryIsCall() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertIsScreenRecordChip(latest!!.primary)
+ assertIsCallChip(latest!!.secondary)
+ }
+
+ @Test
+ fun primaryChip_screenRecordShowAndShareToAppShow_screenRecordShown() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.EntireScreen(NORMAL_PACKAGE)
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsScreenRecordChip(latest)
+ }
+
+ @Test
+ fun chips_screenRecordShowAndShareToAppShow_primaryIsScreenRecordSecondaryIsHidden() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.EntireScreen(NORMAL_PACKAGE)
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertIsScreenRecordChip(latest!!.primary)
+ // Even though share-to-app is active, we suppress it because this share-to-app is
+ // represented by screen record being active. See b/296461748.
+ assertThat(latest!!.secondary).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+ }
+
+ @Test
+ fun primaryChip_shareToAppShowAndCallShow_shareToAppShown() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.EntireScreen(NORMAL_PACKAGE)
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsShareToAppChip(latest)
+ }
+
+ @Test
+ fun chips_shareToAppShowAndCallShow_primaryIsShareToAppSecondaryIsCall() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.EntireScreen(NORMAL_PACKAGE)
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertIsShareToAppChip(latest!!.primary)
+ assertIsCallChip(latest!!.secondary)
+ }
+
+ @Test
+ fun chips_threeActiveChips_topTwoShown() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+ addDemoRonChip(commandRegistry, pw)
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertIsScreenRecordChip(latest!!.primary)
+ assertIsCallChip(latest!!.secondary)
+ // Demo RON chip is dropped
+ }
+
+ @Test
+ fun primaryChip_onlyCallShown_callShown() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ // MediaProjection covers both share-to-app and cast-to-other-device
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsCallChip(latest)
+ }
+
+ @Test
+ fun chips_onlyCallShown_primaryIsCallSecondaryIsHidden() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ // MediaProjection covers both share-to-app and cast-to-other-device
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertIsCallChip(latest!!.primary)
+ assertThat(latest!!.secondary).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+ }
+
+ @Test
+ fun primaryChip_higherPriorityChipAdded_lowerPriorityChipReplaced() =
+ testScope.runTest {
+ // Start with just the lowest priority chip shown
+ addDemoRonChip(commandRegistry, pw)
+ // And everything else hidden
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsDemoRonChip(latest)
+
+ // WHEN the higher priority call chip is added
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ // THEN the higher priority call chip is used
+ assertIsCallChip(latest)
+
+ // WHEN the higher priority media projection chip is added
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.SingleTask(
+ NORMAL_PACKAGE,
+ hostDeviceName = null,
+ createTask(taskId = 1),
+ )
+
+ // THEN the higher priority media projection chip is used
+ assertIsShareToAppChip(latest)
+
+ // WHEN the higher priority screen record chip is added
+ screenRecordState.value = ScreenRecordModel.Recording
+
+ // THEN the higher priority screen record chip is used
+ assertIsScreenRecordChip(latest)
+ }
+
+ @Test
+ fun primaryChip_highestPriorityChipRemoved_showsNextPriorityChip() =
+ testScope.runTest {
+ // WHEN all chips are active
+ screenRecordState.value = ScreenRecordModel.Recording
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.EntireScreen(NORMAL_PACKAGE)
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+ addDemoRonChip(commandRegistry, pw)
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ // THEN the highest priority screen record is used
+ assertIsScreenRecordChip(latest)
+
+ // WHEN the higher priority screen record is removed
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+
+ // THEN the lower priority media projection is used
+ assertIsShareToAppChip(latest)
+
+ // WHEN the higher priority media projection is removed
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+
+ // THEN the lower priority call is used
+ assertIsCallChip(latest)
+
+ // WHEN the higher priority call is removed
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ // THEN the lower priority demo RON is used
+ assertIsDemoRonChip(latest)
+ }
+
+ @Test
+ fun chips_movesChipsAroundAccordingToPriority() =
+ testScope.runTest {
+ // Start with just the lowest priority chip shown
+ addDemoRonChip(commandRegistry, pw)
+ // And everything else hidden
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+
+ val latest by collectLastValue(underTest.chips)
+
+ assertIsDemoRonChip(latest!!.primary)
+ assertThat(latest!!.secondary).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+
+ // WHEN the higher priority call chip is added
+ callRepo.setOngoingCallState(inCallModel(startTimeMs = 34))
+
+ // THEN the higher priority call chip is used as primary and demo ron is demoted to
+ // secondary
+ assertIsCallChip(latest!!.primary)
+ assertIsDemoRonChip(latest!!.secondary)
+
+ // WHEN the higher priority media projection chip is added
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.SingleTask(
+ NORMAL_PACKAGE,
+ hostDeviceName = null,
+ createTask(taskId = 1),
+ )
+
+ // THEN the higher priority media projection chip is used as primary and call is demoted
+ // to secondary (and demo RON is dropped altogether)
+ assertIsShareToAppChip(latest!!.primary)
+ assertIsCallChip(latest!!.secondary)
+
+ // WHEN the higher priority screen record chip is added
+ screenRecordState.value = ScreenRecordModel.Recording
+
+ // THEN the higher priority screen record chip is used
+ assertIsScreenRecordChip(latest!!.primary)
+
+ // WHEN screen record and call is dropped
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ // THEN media projection and demo RON remain
+ assertIsShareToAppChip(latest!!.primary)
+ assertIsDemoRonChip(latest!!.secondary)
+
+ // WHEN media projection is dropped
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+
+ // THEN demo RON is promoted to primary
+ assertIsDemoRonChip(latest!!.primary)
+ assertThat(latest!!.secondary).isInstanceOf(OngoingActivityChipModel.Hidden::class.java)
+ }
+
+ /** Regression test for b/347726238. */
+ @Test
+ fun primaryChip_timerDoesNotResetAfterSubscribersRestart() =
+ testScope.runTest {
+ var latest: OngoingActivityChipModel? = null
+
+ val job1 = underTest.primaryChip.onEach { latest = it }.launchIn(this)
+
+ // Start a chip with a timer
+ systemClock.setElapsedRealtime(1234)
+ screenRecordState.value = ScreenRecordModel.Recording
+
+ runCurrent()
+
+ assertThat((latest as OngoingActivityChipModel.Shown.Timer).startTimeMs).isEqualTo(1234)
+
+ // Stop subscribing to the chip flow
+ job1.cancel()
+
+ // Let time pass
+ systemClock.setElapsedRealtime(5678)
+
+ // WHEN we re-subscribe to the chip flow
+ val job2 = underTest.primaryChip.onEach { latest = it }.launchIn(this)
+
+ runCurrent()
+
+ // THEN the old start time is still used
+ assertThat((latest as OngoingActivityChipModel.Shown.Timer).startTimeMs).isEqualTo(1234)
+
+ job2.cancel()
+ }
+
+ /** Regression test for b/347726238. */
+ @Test
+ fun chips_timerDoesNotResetAfterSubscribersRestart() =
+ testScope.runTest {
+ var latest: MultipleOngoingActivityChipsModel? = null
+
+ val job1 = underTest.chips.onEach { latest = it }.launchIn(this)
+
+ // Start a chip with a timer
+ systemClock.setElapsedRealtime(1234)
+ screenRecordState.value = ScreenRecordModel.Recording
+
+ runCurrent()
+
+ val primaryChip = latest!!.primary as OngoingActivityChipModel.Shown.Timer
+ assertThat(primaryChip.startTimeMs).isEqualTo(1234)
+
+ // Stop subscribing to the chip flow
+ job1.cancel()
+
+ // Let time pass
+ systemClock.setElapsedRealtime(5678)
+
+ // WHEN we re-subscribe to the chip flow
+ val job2 = underTest.chips.onEach { latest = it }.launchIn(this)
+
+ runCurrent()
+
+ // THEN the old start time is still used
+ val newPrimaryChip = latest!!.primary as OngoingActivityChipModel.Shown.Timer
+ assertThat(newPrimaryChip.startTimeMs).isEqualTo(1234)
+
+ job2.cancel()
+ }
+
+ @Test
+ fun primaryChip_screenRecordStoppedViaDialog_chipHiddenWithoutAnimation() =
+ testScope.runTest {
+ screenRecordState.value = ScreenRecordModel.Recording
+ mediaProjectionState.value = MediaProjectionState.NotProjecting
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsScreenRecordChip(latest)
+
+ // WHEN screen record gets stopped via dialog
+ val dialogStopAction =
+ getStopActionFromDialog(latest, chipView, mockSystemUIDialog, kosmos)
+ dialogStopAction.onClick(mock<DialogInterface>(), 0)
+
+ // THEN the chip is immediately hidden with no animation
+ assertThat(latest).isEqualTo(OngoingActivityChipModel.Hidden(shouldAnimate = false))
+ }
+
+ @Test
+ fun primaryChip_projectionStoppedViaDialog_chipHiddenWithoutAnimation() =
+ testScope.runTest {
+ mediaProjectionState.value =
+ MediaProjectionState.Projecting.EntireScreen(NORMAL_PACKAGE)
+ screenRecordState.value = ScreenRecordModel.DoingNothing
+ callRepo.setOngoingCallState(OngoingCallModel.NoCall)
+
+ val latest by collectLastValue(underTest.primaryChip)
+
+ assertIsShareToAppChip(latest)
+
+ // WHEN media projection gets stopped via dialog
+ val dialogStopAction =
+ getStopActionFromDialog(latest, chipView, mockSystemUIDialog, kosmos)
+ dialogStopAction.onClick(mock<DialogInterface>(), 0)
+
+ // THEN the chip is immediately hidden with no animation
+ assertThat(latest).isEqualTo(OngoingActivityChipModel.Hidden(shouldAnimate = false))
+ }
+
+ private fun assertIsDemoRonChip(latest: OngoingActivityChipModel?) {
+ assertThat(latest).isInstanceOf(OngoingActivityChipModel.Shown::class.java)
+ assertThat((latest as OngoingActivityChipModel.Shown).icon)
+ .isInstanceOf(OngoingActivityChipModel.ChipIcon.FullColorAppIcon::class.java)
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt
index ed99705..b177e4a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt
@@ -101,7 +101,7 @@
private fun getAvalancheSuppressor() : AvalancheSuppressor {
return AvalancheSuppressor(
avalancheProvider, systemClock, settingsInteractor, packageManager,
- uiEventLogger, context, notificationManager, logger
+ uiEventLogger, context, notificationManager, logger, systemSettings
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
index 01a3d36..1d74331 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
@@ -1112,9 +1112,11 @@
public void testShowBouncerOrKeyguard_showsKeyguardIfShowBouncerReturnsFalse() {
when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
KeyguardSecurityModel.SecurityMode.SimPin);
+ // Returning false means unable to show the bouncer
when(mPrimaryBouncerInteractor.show(true)).thenReturn(false);
when(mKeyguardTransitionInteractor.getTransitionState().getValue().getTo())
.thenReturn(KeyguardState.LOCKSCREEN);
+ mStatusBarKeyguardViewManager.onStartedWakingUp();
reset(mCentralSurfaces);
// Advance past reattempts
@@ -1127,6 +1129,23 @@
@Test
@DisableSceneContainer
+ @EnableFlags(Flags.FLAG_SIM_PIN_RACE_CONDITION_ON_RESTART)
+ public void testShowBouncerOrKeyguard_showsKeyguardIfSleeping() {
+ when(mKeyguardTransitionInteractor.getTransitionState().getValue().getTo())
+ .thenReturn(KeyguardState.LOCKSCREEN);
+ mStatusBarKeyguardViewManager.onStartedGoingToSleep();
+
+ reset(mCentralSurfaces);
+ reset(mPrimaryBouncerInteractor);
+ mStatusBarKeyguardViewManager.showBouncerOrKeyguard(
+ /* hideBouncerWhenShowing= */true, false);
+ verify(mCentralSurfaces).showKeyguard();
+ verify(mPrimaryBouncerInteractor).hide();
+ }
+
+
+ @Test
+ @DisableSceneContainer
public void testShowBouncerOrKeyguard_needsFullScreen_bouncerAlreadyShowing() {
boolean isFalsingReset = false;
when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLoggerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLoggerTest.kt
index 219b16f..d7fb129 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLoggerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentLoggerTest.kt
@@ -34,12 +34,13 @@
@RunWith(AndroidJUnit4::class)
class CollapsedStatusBarFragmentLoggerTest : SysuiTestCase() {
- private val buffer = LogBufferFactory(DumpManager(), mock(LogcatEchoTracker::class.java))
- .create("buffer", 10)
- private val disableFlagsLogger = DisableFlagsLogger(
+ private val buffer =
+ LogBufferFactory(DumpManager(), mock(LogcatEchoTracker::class.java)).create("buffer", 10)
+ private val disableFlagsLogger =
+ DisableFlagsLogger(
listOf(DisableFlagsLogger.DisableFlag(0b001, 'A', 'a')),
listOf(DisableFlagsLogger.DisableFlag(0b001, 'B', 'b'))
- )
+ )
private val logger = CollapsedStatusBarFragmentLogger(buffer, disableFlagsLogger)
@Test
@@ -66,7 +67,8 @@
StatusBarVisibilityModel(
showClock = false,
showNotificationIcons = true,
- showOngoingActivityChip = false,
+ showPrimaryOngoingActivityChip = false,
+ showSecondaryOngoingActivityChip = false,
showSystemInfo = true,
)
)
@@ -77,7 +79,8 @@
assertThat(actualString).contains("showClock=false")
assertThat(actualString).contains("showNotificationIcons=true")
- assertThat(actualString).contains("showOngoingActivityChip=false")
+ assertThat(actualString).contains("showPrimaryOngoingActivityChip=false")
+ assertThat(actualString).contains("showSecondaryOngoingActivityChip=false")
assertThat(actualString).contains("showSystemInfo=true")
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
index 6e337ef..135fab8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
@@ -16,6 +16,7 @@
import static android.view.Display.DEFAULT_DISPLAY;
+import static com.android.systemui.Flags.FLAG_STATUS_BAR_RON_CHIPS;
import static com.android.systemui.Flags.FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS;
import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_CLOSED;
import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_OPEN;
@@ -526,7 +527,9 @@
// WHEN there's *no* ongoing activity via new callback
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ false, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ false,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
// THEN the old callback value is used, so the view is shown
assertEquals(View.VISIBLE, getPrimaryOngoingActivityChipView().getVisibility());
@@ -535,12 +538,15 @@
when(mOngoingCallController.hasOngoingCall()).thenReturn(false);
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
- // WHEN there *is* an ongoing activity via new callback
+ // WHEN there *are* ongoing activities via new callback
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ true, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ true,
+ /* shouldAnimate= */ false);
- // THEN the old callback value is used, so the view is hidden
+ // THEN the old callback value is used, so the views are hidden
assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
+ assertEquals(View.GONE, getSecondaryOngoingActivityChipView().getVisibility());
}
@Test
@@ -553,18 +559,22 @@
// listener, but I'm unable to get the fragment to get attached so that the binder starts
// listening to flows.
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ false, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ false,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
}
@Test
@EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
- public void hasOngoingActivity_chipDisplayedAndNotificationIconsHidden() {
+ public void hasPrimaryOngoingActivity_primaryChipDisplayedAndNotificationIconsHidden() {
resumeAndGetFragment();
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ true, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
assertEquals(View.VISIBLE, getPrimaryOngoingActivityChipView().getVisibility());
assertEquals(View.INVISIBLE, getNotificationAreaView().getVisibility());
@@ -572,11 +582,42 @@
@Test
@EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
- public void hasOngoingActivityButNotificationIconsDisabled_chipHidden() {
+ @DisableFlags(FLAG_STATUS_BAR_RON_CHIPS)
+ public void hasSecondaryOngoingActivity_butRonsFlagOff_secondaryChipHidden() {
+ resumeAndGetFragment();
+
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ true,
+ /* shouldAnimate= */ false);
+
+ assertEquals(View.GONE, getSecondaryOngoingActivityChipView().getVisibility());
+ }
+
+ @Test
+ @EnableFlags({FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS, FLAG_STATUS_BAR_RON_CHIPS})
+ public void hasSecondaryOngoingActivity_flagOn_secondaryChipShownAndNotificationIconsHidden() {
+ resumeAndGetFragment();
+
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ true,
+ /* shouldAnimate= */ false);
+
+ assertEquals(View.VISIBLE, getSecondaryOngoingActivityChipView().getVisibility());
+ assertEquals(View.INVISIBLE, getNotificationAreaView().getVisibility());
+ }
+
+ @Test
+ @EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
+ @DisableFlags(FLAG_STATUS_BAR_RON_CHIPS)
+ public void hasOngoingActivityButNotificationIconsDisabled_chipHidden_ronsFlagOff() {
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ true, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
fragment.disable(DEFAULT_DISPLAY,
StatusBarManager.DISABLE_NOTIFICATION_ICONS, 0, false);
@@ -585,12 +626,32 @@
}
@Test
- @EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
- public void hasOngoingActivityButAlsoHun_chipHidden() {
+ @EnableFlags({FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS, FLAG_STATUS_BAR_RON_CHIPS})
+ public void hasOngoingActivitiesButNotificationIconsDisabled_chipsHidden_ronsFlagOn() {
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ true, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ true,
+ /* shouldAnimate= */ false);
+
+ fragment.disable(DEFAULT_DISPLAY,
+ StatusBarManager.DISABLE_NOTIFICATION_ICONS, 0, false);
+
+ assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
+ assertEquals(View.GONE, getSecondaryOngoingActivityChipView().getVisibility());
+ }
+
+ @Test
+ @EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
+ @DisableFlags(FLAG_STATUS_BAR_RON_CHIPS)
+ public void hasOngoingActivityButAlsoHun_chipHidden_ronsFlagOff() {
+ CollapsedStatusBarFragment fragment = resumeAndGetFragment();
+
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
when(mHeadsUpAppearanceController.shouldBeVisible()).thenReturn(true);
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
@@ -599,33 +660,120 @@
}
@Test
+ @EnableFlags({FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS, FLAG_STATUS_BAR_RON_CHIPS})
+ public void hasOngoingActivitiesButAlsoHun_chipsHidden_ronsFlagOn() {
+ CollapsedStatusBarFragment fragment = resumeAndGetFragment();
+
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ true,
+ /* shouldAnimate= */ false);
+ when(mHeadsUpAppearanceController.shouldBeVisible()).thenReturn(true);
+
+ fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
+
+ assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
+ assertEquals(View.GONE, getSecondaryOngoingActivityChipView().getVisibility());
+ }
+
+ @Test
@EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
- public void ongoingActivityEnded_chipHidden() {
+ @DisableFlags(FLAG_STATUS_BAR_RON_CHIPS)
+ public void primaryOngoingActivityEnded_chipHidden_ronsFlagOff() {
resumeAndGetFragment();
// Ongoing activity started
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ true, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
assertEquals(View.VISIBLE, getPrimaryOngoingActivityChipView().getVisibility());
// Ongoing activity ended
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ false, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ false,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
}
@Test
+ @EnableFlags({FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS, FLAG_STATUS_BAR_RON_CHIPS})
+ public void primaryOngoingActivityEnded_chipHidden_ronsFlagOn() {
+ resumeAndGetFragment();
+
+ // Ongoing activity started
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
+
+ assertEquals(View.VISIBLE, getPrimaryOngoingActivityChipView().getVisibility());
+
+ // Ongoing activity ended
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ false,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
+
+ assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
+ }
+
+ @Test
+ @EnableFlags({FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS, FLAG_STATUS_BAR_RON_CHIPS})
+ public void secondaryOngoingActivityEnded_chipHidden() {
+ resumeAndGetFragment();
+
+ // Secondary ongoing activity started
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ true,
+ /* shouldAnimate= */ false);
+
+ assertEquals(View.VISIBLE, getSecondaryOngoingActivityChipView().getVisibility());
+
+ // Ongoing activity ended
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
+
+ assertEquals(View.GONE, getSecondaryOngoingActivityChipView().getVisibility());
+ }
+
+ @Test
@EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
- public void hasOngoingActivity_hidesNotifsWithoutAnimation() {
+ @DisableFlags(FLAG_STATUS_BAR_RON_CHIPS)
+ public void hasOngoingActivity_hidesNotifsWithoutAnimation_ronsFlagOff() {
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
// Enable animations for testing so that we can verify we still aren't animating
fragment.enableAnimationsForTesting();
- // Ongoing call started
+ // Ongoing activity started
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ true, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
+
+ // Notification area is hidden without delay
+ assertEquals(0f, getNotificationAreaView().getAlpha(), 0.01);
+ assertEquals(View.INVISIBLE, getNotificationAreaView().getVisibility());
+ }
+
+ @Test
+ @EnableFlags({FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS, FLAG_STATUS_BAR_RON_CHIPS})
+ public void hasOngoingActivity_hidesNotifsWithoutAnimation_ronsFlagOn() {
+ CollapsedStatusBarFragment fragment = resumeAndGetFragment();
+ // Enable animations for testing so that we can verify we still aren't animating
+ fragment.enableAnimationsForTesting();
+
+ // Ongoing activity started
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
// Notification area is hidden without delay
assertEquals(0f, getNotificationAreaView().getAlpha(), 0.01);
@@ -634,7 +782,8 @@
@Test
@EnableFlags(FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS)
- public void screenSharingChipsEnabled_ignoresOngoingCallController() {
+ @DisableFlags(FLAG_STATUS_BAR_RON_CHIPS)
+ public void screenSharingChipsEnabled_ignoresOngoingCallController_ronsFlagOff() {
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
// WHEN there *is* an ongoing call via old callback
@@ -643,7 +792,9 @@
// WHEN there's *no* ongoing activity via new callback
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ false, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ false,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
// THEN the new callback value is used, so the view is hidden
assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
@@ -652,15 +803,50 @@
when(mOngoingCallController.hasOngoingCall()).thenReturn(false);
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
- // WHEN there *is* an ongoing activity via new callback
+ // WHEN there *are* ongoing activities via new callback
mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
- /* hasOngoingActivity= */ true, /* shouldAnimate= */ false);
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
- // THEN the new callback value is used, so the view is shown
+ // THEN the new callback value is used, so the views are shown
assertEquals(View.VISIBLE, getPrimaryOngoingActivityChipView().getVisibility());
}
@Test
+ @EnableFlags({FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS, FLAG_STATUS_BAR_RON_CHIPS})
+ public void screenSharingChipsEnabled_ignoresOngoingCallController_ronsFlagOn() {
+ CollapsedStatusBarFragment fragment = resumeAndGetFragment();
+
+ // WHEN there *is* an ongoing call via old callback
+ when(mOngoingCallController.hasOngoingCall()).thenReturn(true);
+ fragment.disable(DEFAULT_DISPLAY, 0, 0, true);
+
+ // WHEN there's *no* ongoing activity via new callback
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ false,
+ /* hasSecondaryOngoingActivity= */ false,
+ /* shouldAnimate= */ false);
+
+ // THEN the new callback value is used, so the view is hidden
+ assertEquals(View.GONE, getPrimaryOngoingActivityChipView().getVisibility());
+
+ // WHEN there's *no* ongoing call via old callback
+ when(mOngoingCallController.hasOngoingCall()).thenReturn(false);
+ fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
+
+ // WHEN there *are* ongoing activities via new callback
+ mCollapsedStatusBarViewBinder.getListener().onOngoingActivityStatusChanged(
+ /* hasPrimaryOngoingActivity= */ true,
+ /* hasSecondaryOngoingActivity= */ true,
+ /* shouldAnimate= */ false);
+
+ // THEN the new callback value is used, so the views are shown
+ assertEquals(View.VISIBLE, getPrimaryOngoingActivityChipView().getVisibility());
+ assertEquals(View.VISIBLE, getSecondaryOngoingActivityChipView().getVisibility());
+ }
+
+ @Test
@EnableSceneContainer
public void isHomeStatusBarAllowedByScene_false_everythingHidden() {
resumeAndGetFragment();
@@ -1010,4 +1196,8 @@
private View getPrimaryOngoingActivityChipView() {
return mFragment.getView().findViewById(R.id.ongoing_activity_chip_primary);
}
+
+ private View getSecondaryOngoingActivityChipView() {
+ return mFragment.getView().findViewById(R.id.ongoing_activity_chip_secondary);
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModelTest.kt
index 9f6f51a..d47a903 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/StatusBarVisibilityModelTest.kt
@@ -39,7 +39,8 @@
StatusBarVisibilityModel(
showClock = true,
showNotificationIcons = true,
- showOngoingActivityChip = true,
+ showPrimaryOngoingActivityChip = true,
+ showSecondaryOngoingActivityChip = true,
showSystemInfo = true,
)
@@ -75,17 +76,19 @@
}
@Test
- fun createModelFromFlags_ongoingCallChipNotDisabled_showOngoingActivityChipTrue() {
+ fun createModelFromFlags_ongoingCallChipNotDisabled_showOngoingActivityChipsTrue() {
val result = createModelFromFlags(disabled1 = 0, disabled2 = 0)
- assertThat(result.showOngoingActivityChip).isTrue()
+ assertThat(result.showPrimaryOngoingActivityChip).isTrue()
+ assertThat(result.showSecondaryOngoingActivityChip).isTrue()
}
@Test
- fun createModelFromFlags_ongoingCallChipDisabled_showOngoingActivityChipFalse() {
+ fun createModelFromFlags_ongoingCallChipDisabled_showOngoingActivityChipsFalse() {
val result = createModelFromFlags(disabled1 = DISABLE_ONGOING_CALL_CHIP, disabled2 = 0)
- assertThat(result.showOngoingActivityChip).isFalse()
+ assertThat(result.showPrimaryOngoingActivityChip).isFalse()
+ assertThat(result.showSecondaryOngoingActivityChip).isFalse()
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt
index b6e23c1..715e3b4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt
@@ -85,7 +85,7 @@
underTest.dataConnectionState.onEach { latestConnState = it }.launchIn(this)
val netJob = underTest.resolvedNetworkType.onEach { latestNetType = it }.launchIn(this)
- wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive)
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Inactive())
assertThat(latestConnState).isEqualTo(DataConnectionState.Disconnected)
assertThat(latestNetType).isNotEqualTo(ResolvedNetworkType.CarrierMergedNetworkType)
@@ -104,7 +104,7 @@
underTest.dataConnectionState.onEach { latestConnState = it }.launchIn(this)
val netJob = underTest.resolvedNetworkType.onEach { latestNetType = it }.launchIn(this)
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(level = 1))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(level = 1))
assertThat(latestConnState).isEqualTo(DataConnectionState.Disconnected)
assertThat(latestNetType).isNotEqualTo(ResolvedNetworkType.CarrierMergedNetworkType)
@@ -123,7 +123,7 @@
wifiRepository.setIsWifiDefault(true)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = SUB_ID,
level = 3,
)
@@ -143,7 +143,7 @@
wifiRepository.setIsWifiEnabled(true)
wifiRepository.setIsWifiDefault(true)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = SUB_ID,
level = 3,
)
@@ -180,7 +180,7 @@
val typeJob = underTest.resolvedNetworkType.onEach { latestType = it }.launchIn(this)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = SUB_ID + 10,
level = 3,
)
@@ -201,7 +201,7 @@
val job = underTest.primaryLevel.onEach { latest = it }.launchIn(this)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = SUB_ID,
level = 3,
)
@@ -221,7 +221,7 @@
val job = underTest.primaryLevel.onEach { latest = it }.launchIn(this)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = SUB_ID,
level = 3,
)
@@ -240,7 +240,7 @@
val job = underTest.numberOfLevels.onEach { latest = it }.launchIn(this)
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = SUB_ID,
level = 1,
numberOfLevels = 6,
@@ -303,7 +303,7 @@
whenever(telephonyManager.simOperatorName).thenReturn("New SIM name")
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = SUB_ID,
level = 3,
)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt
index a03980a..fd23655 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt
@@ -488,7 +488,7 @@
// WHEN we set up carrier merged info
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
SUB_ID,
level = 3,
)
@@ -499,7 +499,7 @@
// WHEN we update the info
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
SUB_ID,
level = 1,
)
@@ -538,7 +538,7 @@
// WHEN isCarrierMerged is set to true
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
SUB_ID,
level = 3,
)
@@ -550,7 +550,7 @@
// WHEN the carrier merge network is updated
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
SUB_ID,
level = 4,
)
@@ -602,7 +602,7 @@
// THEN updates to the carrier merged level aren't logged
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
SUB_ID,
level = 4,
)
@@ -610,7 +610,7 @@
assertThat(dumpBuffer()).doesNotContain("$COL_PRIMARY_LEVEL${BUFFER_SEPARATOR}4")
wifiRepository.setWifiNetwork(
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
SUB_ID,
level = 3,
)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt
index fe408e3..7634490 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt
@@ -817,7 +817,7 @@
captor.lastValue.onReceive(context, intent)
// spnIntent() sets all values to true and test strings
- assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$SPN"))
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$DATA_SPN"))
job.cancel()
}
@@ -852,7 +852,7 @@
verify(context).registerReceiver(captor.capture(), any())
captor.lastValue.onReceive(context, intent)
- assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$SPN"))
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$DATA_SPN"))
// WHEN an intent with a different subId is sent
val wrongSubIntent = spnIntent(subId = 101)
@@ -860,7 +860,7 @@
captor.lastValue.onReceive(context, wrongSubIntent)
// THEN the previous intent's name is still used
- assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$SPN"))
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$DATA_SPN"))
job.cancel()
}
@@ -902,7 +902,7 @@
verify(context).registerReceiver(captor.capture(), any())
captor.lastValue.onReceive(context, intent)
- assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$SPN"))
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$DATA_SPN"))
val intentWithoutInfo =
spnIntent(
@@ -961,7 +961,7 @@
// The value is still there despite no active subscribers
assertThat(underTest.networkName.value)
- .isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$SPN"))
+ .isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$DATA_SPN"))
}
@Test
@@ -986,7 +986,7 @@
@Test
@EnableFlags(Flags.FLAG_STATUS_BAR_SWITCH_TO_SPN_FROM_DATA_SPN)
- fun networkName_allFieldsSet_doesNotUseDataSpn() =
+ fun networkName_allFieldsSet_prioritizesDataSpnOverSpn() =
testScope.runTest {
val latest by collectLastValue(underTest.networkName)
val captor = argumentCaptor<BroadcastReceiver>()
@@ -1002,6 +1002,27 @@
plmn = PLMN,
)
captor.lastValue.onReceive(context, intent)
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$DATA_SPN"))
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_STATUS_BAR_SWITCH_TO_SPN_FROM_DATA_SPN)
+ fun networkName_spnAndPlmn_fallbackToSpnWhenNullDataSpn() =
+ testScope.runTest {
+ val latest by collectLastValue(underTest.networkName)
+ val captor = argumentCaptor<BroadcastReceiver>()
+ verify(context).registerReceiver(captor.capture(), any())
+
+ val intent =
+ spnIntent(
+ subId = SUB_1_ID,
+ showSpn = true,
+ spn = SPN,
+ dataSpn = null,
+ showPlmn = true,
+ plmn = PLMN,
+ )
+ captor.lastValue.onReceive(context, intent)
assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$SPN"))
}
@@ -1043,7 +1064,27 @@
plmn = PLMN,
)
captor.lastValue.onReceive(context, intent)
- assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN"))
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$DATA_SPN"))
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_STATUS_BAR_SWITCH_TO_SPN_FROM_DATA_SPN)
+ fun networkName_showPlmn_plmnNotNull_showSpn_spnNotNull_dataSpnNull() =
+ testScope.runTest {
+ val latest by collectLastValue(underTest.networkName)
+ val captor = argumentCaptor<BroadcastReceiver>()
+ verify(context).registerReceiver(captor.capture(), any())
+ val intent =
+ spnIntent(
+ subId = SUB_1_ID,
+ showSpn = true,
+ spn = SPN,
+ dataSpn = null,
+ showPlmn = true,
+ plmn = PLMN,
+ )
+ captor.lastValue.onReceive(context, intent)
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$PLMN$SEP$SPN"))
}
@Test
@@ -1102,10 +1143,50 @@
plmn = null,
)
captor.lastValue.onReceive(context, intent)
+ assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$DATA_SPN"))
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_STATUS_BAR_SWITCH_TO_SPN_FROM_DATA_SPN)
+ fun networkName_showPlmn_plmnNull_showSpn_dataSpnNull() =
+ testScope.runTest {
+ val latest by collectLastValue(underTest.networkName)
+ val captor = argumentCaptor<BroadcastReceiver>()
+ verify(context).registerReceiver(captor.capture(), any())
+ val intent =
+ spnIntent(
+ subId = SUB_1_ID,
+ showSpn = true,
+ spn = SPN,
+ dataSpn = null,
+ showPlmn = true,
+ plmn = null,
+ )
+ captor.lastValue.onReceive(context, intent)
assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived("$SPN"))
}
@Test
+ @EnableFlags(Flags.FLAG_STATUS_BAR_SWITCH_TO_SPN_FROM_DATA_SPN)
+ fun networkName_showPlmn_plmnNull_showSpn_bothSpnNull() =
+ testScope.runTest {
+ val latest by collectLastValue(underTest.networkName)
+ val captor = argumentCaptor<BroadcastReceiver>()
+ verify(context).registerReceiver(captor.capture(), any())
+ val intent =
+ spnIntent(
+ subId = SUB_1_ID,
+ showSpn = true,
+ spn = null,
+ dataSpn = null,
+ showPlmn = true,
+ plmn = null,
+ )
+ captor.lastValue.onReceive(context, intent)
+ assertThat(latest).isEqualTo(DEFAULT_NAME_MODEL)
+ }
+
+ @Test
@DisableFlags(Flags.FLAG_STATUS_BAR_SWITCH_TO_SPN_FROM_DATA_SPN)
fun networkName_showPlmn_plmnNull_showSpn_flagOff() =
testScope.runTest {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractorTest.kt
index a1cb29b..c0a206a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractorTest.kt
@@ -574,7 +574,7 @@
val latest by collectLastValue(underTest.isWifiActive)
// WHEN wifi is active
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(level = 1))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(level = 1))
// THEN the interactor returns true due to the wifi network being active
assertThat(latest).isTrue()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModelTest.kt
index c1abf98..e7e4969 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModelTest.kt
@@ -375,7 +375,7 @@
repo.isSatelliteProvisioned.value = true
// GIVEN wifi network is active
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(level = 1))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(level = 1))
// THEN icon is null because the device is connected to wifi
assertThat(latest).isNull()
@@ -573,7 +573,7 @@
repo.isSatelliteProvisioned.value = true
// GIVEN wifi network is active
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(level = 1))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(level = 1))
// THEN carrier text is null because the device is connected to wifi
assertThat(latest).isNull()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewModel.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewModel.kt
index e71f521..4834d36 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewModel.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewModel.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.pipeline.shared.ui.viewmodel
+import com.android.systemui.statusbar.chips.ui.model.MultipleOngoingActivityChipsModel
import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
@@ -31,6 +32,8 @@
override val primaryOngoingActivityChip: MutableStateFlow<OngoingActivityChipModel> =
MutableStateFlow(OngoingActivityChipModel.Hidden())
+ override val ongoingActivityChips = MutableStateFlow(MultipleOngoingActivityChipsModel())
+
override val isHomeStatusBarAllowedByScene = MutableStateFlow(false)
override fun areNotificationsLightsOut(displayId: Int): Flow<Boolean> = areNotificationLightsOut
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/InternetTileViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/InternetTileViewModelTest.kt
index fed3317..975e2ca 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/InternetTileViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/InternetTileViewModelTest.kt
@@ -154,7 +154,7 @@
val latest by collectLastValue(underTest.tileModel)
val networkModel =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 4,
ssid = "test ssid",
)
@@ -183,7 +183,7 @@
val latest by collectLastValue(underTest.tileModel)
val networkModel =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 4,
ssid = "test ssid",
hotspotDeviceType = WifiNetworkModel.HotspotDeviceType.NONE,
@@ -295,7 +295,7 @@
testScope.runTest {
val latest by collectLastValue(underTest.tileModel)
- val networkModel = WifiNetworkModel.Inactive
+ val networkModel = WifiNetworkModel.Inactive()
connectivityRepository.setWifiConnected(validated = false)
wifiRepository.setIsWifiDefault(true)
@@ -310,7 +310,7 @@
testScope.runTest {
val latest by collectLastValue(underTest.tileModel)
- val networkModel = WifiNetworkModel.Inactive
+ val networkModel = WifiNetworkModel.Inactive()
connectivityRepository.setWifiConnected(validated = false)
wifiRepository.setIsWifiDefault(true)
@@ -390,7 +390,7 @@
private fun setWifiNetworkWithHotspot(hotspot: WifiNetworkModel.HotspotDeviceType) {
val networkModel =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = 4,
ssid = "test ssid",
hotspotDeviceType = hotspot,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImplTest.kt
index 46f34e8..fd4b77d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImplTest.kt
@@ -295,7 +295,10 @@
whenever(wifiPickerTracker.connectedWifiEntry).thenReturn(wifiEntry)
getCallback().onWifiEntriesChanged()
- assertThat(latest).isEqualTo(WifiNetworkModel.Inactive)
+ assertThat(latest).isInstanceOf(WifiNetworkModel.Inactive::class.java)
+ val inactiveReason = (latest as WifiNetworkModel.Inactive).inactiveReason
+ assertThat(inactiveReason).contains("level")
+ assertThat(inactiveReason).contains("$WIFI_LEVEL_UNREACHABLE")
}
@Test
@@ -311,7 +314,10 @@
whenever(wifiPickerTracker.connectedWifiEntry).thenReturn(wifiEntry)
getCallback().onWifiEntriesChanged()
- assertThat(latest).isEqualTo(WifiNetworkModel.Inactive)
+ assertThat(latest).isInstanceOf(WifiNetworkModel.Inactive::class.java)
+ val inactiveReason = (latest as WifiNetworkModel.Inactive).inactiveReason
+ assertThat(inactiveReason).contains("level")
+ assertThat(inactiveReason).contains("${WIFI_LEVEL_MAX + 1}")
}
@Test
@@ -327,7 +333,10 @@
whenever(wifiPickerTracker.connectedWifiEntry).thenReturn(wifiEntry)
getCallback().onWifiEntriesChanged()
- assertThat(latest).isEqualTo(WifiNetworkModel.Inactive)
+ assertThat(latest).isInstanceOf(WifiNetworkModel.Inactive::class.java)
+ val inactiveReason = (latest as WifiNetworkModel.Inactive).inactiveReason
+ assertThat(inactiveReason).contains("level")
+ assertThat(inactiveReason).contains("${WIFI_LEVEL_MIN - 1}")
}
@Test
@@ -530,6 +539,25 @@
}
@Test
+ fun wifiNetwork_carrierMergedButInvalidLevel_flowHasInvalid() =
+ testScope.runTest {
+ val latest by collectLastValue(underTest.wifiNetwork)
+
+ val mergedEntry =
+ mock<MergedCarrierEntry>().apply {
+ whenever(this.isPrimaryNetwork).thenReturn(true)
+ whenever(this.subscriptionId).thenReturn(3)
+ whenever(this.isDefaultNetwork).thenReturn(true)
+ whenever(this.level).thenReturn(WIFI_LEVEL_UNREACHABLE)
+ }
+ whenever(wifiPickerTracker.mergedCarrierEntry).thenReturn(mergedEntry)
+
+ getCallback().onWifiEntriesChanged()
+
+ assertThat(latest).isInstanceOf(WifiNetworkModel.Invalid::class.java)
+ }
+
+ @Test
fun wifiNetwork_notValidated_networkNotValidated() =
testScope.runTest {
val latest by collectLastValue(underTest.wifiNetwork)
@@ -571,7 +599,7 @@
whenever(wifiPickerTracker.connectedWifiEntry).thenReturn(wifiEntry)
getCallback().onWifiEntriesChanged()
- assertThat(latest).isEqualTo(WifiNetworkModel.Inactive)
+ assertThat(latest).isEqualTo(WifiNetworkModel.Inactive())
}
@Test
@@ -587,7 +615,7 @@
whenever(wifiPickerTracker.connectedWifiEntry).thenReturn(null)
getCallback().onWifiEntriesChanged()
- assertThat(latest).isEqualTo(WifiNetworkModel.Inactive)
+ assertThat(latest).isEqualTo(WifiNetworkModel.Inactive())
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModelTest.kt
index 92860ef..1495519 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/shared/model/WifiNetworkModelTest.kt
@@ -24,6 +24,7 @@
import com.android.systemui.log.table.TableRowLogger
import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel.Active.Companion.MAX_VALID_LEVEL
import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel.Companion.MIN_VALID_LEVEL
+import com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_UNREACHABLE
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
@@ -32,59 +33,109 @@
@RunWith(AndroidJUnit4::class)
class WifiNetworkModelTest : SysuiTestCase() {
@Test
- fun active_levelsInValidRange_noException() {
+ fun active_levelsInValidRange_createsActive() {
(MIN_VALID_LEVEL..MAX_VALID_LEVEL).forEach { level ->
- WifiNetworkModel.Active(level = level)
- // No assert, just need no crash
+ val result = WifiNetworkModel.Active.of(level = level)
+ assertThat(result).isInstanceOf(WifiNetworkModel.Active::class.java)
}
}
- @Test(expected = IllegalArgumentException::class)
- fun active_levelNegative_exceptionThrown() {
- WifiNetworkModel.Active(level = MIN_VALID_LEVEL - 1)
+ fun active_levelTooLow_returnsInactive() {
+ val result = WifiNetworkModel.Active.of(level = MIN_VALID_LEVEL - 1)
+ assertThat(result).isInstanceOf(WifiNetworkModel.Inactive::class.java)
}
@Test(expected = IllegalArgumentException::class)
- fun active_levelTooHigh_exceptionThrown() {
- WifiNetworkModel.Active(level = MAX_VALID_LEVEL + 1)
+ fun active_levelTooLow_createdByCopy_exceptionThrown() {
+ val starting = WifiNetworkModel.Active.of(level = MIN_VALID_LEVEL)
+
+ (starting as WifiNetworkModel.Active).copy(level = MIN_VALID_LEVEL - 1)
+ }
+
+ fun active_levelTooHigh_returnsInactive() {
+ val result = WifiNetworkModel.Active.of(level = MAX_VALID_LEVEL + 1)
+
+ assertThat(result).isInstanceOf(WifiNetworkModel.Inactive::class.java)
}
@Test(expected = IllegalArgumentException::class)
- fun carrierMerged_invalidSubId_exceptionThrown() {
- WifiNetworkModel.CarrierMerged(INVALID_SUBSCRIPTION_ID, 1)
+ fun active_levelTooHigh_createdByCopy_exceptionThrown() {
+ val starting = WifiNetworkModel.Active.of(level = MAX_VALID_LEVEL)
+
+ (starting as WifiNetworkModel.Active).copy(level = MAX_VALID_LEVEL + 1)
+ }
+
+ fun active_levelUnreachable_returnsInactive() {
+ val result = WifiNetworkModel.Active.of(level = WIFI_LEVEL_UNREACHABLE)
+
+ assertThat(result).isInstanceOf(WifiNetworkModel.Inactive::class.java)
+ }
+
+ @Test(expected = IllegalArgumentException::class)
+ fun active_levelUnreachable_createdByCopy_exceptionThrown() {
+ val starting = WifiNetworkModel.Active.of(level = MAX_VALID_LEVEL)
+
+ (starting as WifiNetworkModel.Active).copy(level = WIFI_LEVEL_UNREACHABLE)
+ }
+
+ fun carrierMerged_invalidSubId_returnsInvalid() {
+ val result = WifiNetworkModel.CarrierMerged.of(INVALID_SUBSCRIPTION_ID, level = 1)
+
+ assertThat(result).isInstanceOf(WifiNetworkModel.Invalid::class.java)
+ }
+
+ @Test(expected = IllegalArgumentException::class)
+ fun carrierMerged_invalidSubId_createdByCopy_exceptionThrown() {
+ val starting = WifiNetworkModel.CarrierMerged.of(subscriptionId = 1, level = 1)
+
+ (starting as WifiNetworkModel.CarrierMerged).copy(subscriptionId = INVALID_SUBSCRIPTION_ID)
+ }
+
+ fun carrierMerged_levelUnreachable_returnsInvalid() {
+ val result =
+ WifiNetworkModel.CarrierMerged.of(subscriptionId = 1, level = WIFI_LEVEL_UNREACHABLE)
+
+ assertThat(result).isInstanceOf(WifiNetworkModel.Invalid::class.java)
+ }
+
+ @Test(expected = IllegalArgumentException::class)
+ fun carrierMerged_levelUnreachable_createdByCopy_exceptionThrown() {
+ val starting = WifiNetworkModel.CarrierMerged.of(subscriptionId = 1, level = 1)
+
+ (starting as WifiNetworkModel.CarrierMerged).copy(level = WIFI_LEVEL_UNREACHABLE)
}
@Test
fun active_hasValidSsid_nullSsid_false() {
val network =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = MAX_VALID_LEVEL,
ssid = null,
)
- assertThat(network.hasValidSsid()).isFalse()
+ assertThat((network as WifiNetworkModel.Active).hasValidSsid()).isFalse()
}
@Test
fun active_hasValidSsid_unknownSsid_false() {
val network =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = MAX_VALID_LEVEL,
ssid = UNKNOWN_SSID,
)
- assertThat(network.hasValidSsid()).isFalse()
+ assertThat((network as WifiNetworkModel.Active).hasValidSsid()).isFalse()
}
@Test
fun active_hasValidSsid_validSsid_true() {
val network =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
level = MAX_VALID_LEVEL,
ssid = "FakeSsid",
)
- assertThat(network.hasValidSsid()).isTrue()
+ assertThat((network as WifiNetworkModel.Active).hasValidSsid()).isTrue()
}
// Non-exhaustive logDiffs test -- just want to make sure the logging logic isn't totally broken
@@ -93,14 +144,15 @@
fun logDiffs_carrierMergedToInactive_resetsAllFields() {
val logger = TestLogger()
val prevVal =
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = 3,
level = 1,
)
- WifiNetworkModel.Inactive.logDiffs(prevVal, logger)
+ WifiNetworkModel.Inactive(inactiveReason = "TestReason").logDiffs(prevVal, logger)
- assertThat(logger.changes).contains(Pair(COL_NETWORK_TYPE, TYPE_INACTIVE))
+ assertThat(logger.changes)
+ .contains(Pair(COL_NETWORK_TYPE, "$TYPE_INACTIVE[reason=TestReason]"))
assertThat(logger.changes).contains(Pair(COL_VALIDATED, "false"))
assertThat(logger.changes).contains(Pair(COL_LEVEL, LEVEL_DEFAULT.toString()))
assertThat(logger.changes).contains(Pair(COL_SSID, "null"))
@@ -110,12 +162,12 @@
fun logDiffs_inactiveToCarrierMerged_logsAllFields() {
val logger = TestLogger()
val carrierMerged =
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = 3,
level = 2,
)
- carrierMerged.logDiffs(prevVal = WifiNetworkModel.Inactive, logger)
+ carrierMerged.logDiffs(prevVal = WifiNetworkModel.Inactive(), logger)
assertThat(logger.changes).contains(Pair(COL_NETWORK_TYPE, TYPE_CARRIER_MERGED))
assertThat(logger.changes).contains(Pair(COL_SUB_ID, "3"))
@@ -128,14 +180,14 @@
fun logDiffs_inactiveToActive_logsAllActiveFields() {
val logger = TestLogger()
val activeNetwork =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
isValidated = true,
level = 3,
ssid = "Test SSID",
hotspotDeviceType = WifiNetworkModel.HotspotDeviceType.LAPTOP,
)
- activeNetwork.logDiffs(prevVal = WifiNetworkModel.Inactive, logger)
+ activeNetwork.logDiffs(prevVal = WifiNetworkModel.Inactive(), logger)
assertThat(logger.changes).contains(Pair(COL_NETWORK_TYPE, TYPE_ACTIVE))
assertThat(logger.changes).contains(Pair(COL_VALIDATED, "true"))
@@ -148,11 +200,13 @@
fun logDiffs_activeToInactive_resetsAllActiveFields() {
val logger = TestLogger()
val activeNetwork =
- WifiNetworkModel.Active(isValidated = true, level = 3, ssid = "Test SSID")
+ WifiNetworkModel.Active.of(isValidated = true, level = 3, ssid = "Test SSID")
- WifiNetworkModel.Inactive.logDiffs(prevVal = activeNetwork, logger)
+ WifiNetworkModel.Inactive(inactiveReason = "TestReason")
+ .logDiffs(prevVal = activeNetwork, logger)
- assertThat(logger.changes).contains(Pair(COL_NETWORK_TYPE, TYPE_INACTIVE))
+ assertThat(logger.changes)
+ .contains(Pair(COL_NETWORK_TYPE, "$TYPE_INACTIVE[reason=TestReason]"))
assertThat(logger.changes).contains(Pair(COL_VALIDATED, "false"))
assertThat(logger.changes).contains(Pair(COL_LEVEL, LEVEL_DEFAULT.toString()))
assertThat(logger.changes).contains(Pair(COL_SSID, "null"))
@@ -163,14 +217,14 @@
fun logDiffs_carrierMergedToActive_logsAllActiveFields() {
val logger = TestLogger()
val activeNetwork =
- WifiNetworkModel.Active(
+ WifiNetworkModel.Active.of(
isValidated = true,
level = 3,
ssid = "Test SSID",
hotspotDeviceType = WifiNetworkModel.HotspotDeviceType.AUTO,
)
val prevVal =
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = 3,
level = 1,
)
@@ -188,9 +242,9 @@
fun logDiffs_activeToCarrierMerged_logsAllFields() {
val logger = TestLogger()
val activeNetwork =
- WifiNetworkModel.Active(isValidated = true, level = 3, ssid = "Test SSID")
+ WifiNetworkModel.Active.of(isValidated = true, level = 3, ssid = "Test SSID")
val carrierMerged =
- WifiNetworkModel.CarrierMerged(
+ WifiNetworkModel.CarrierMerged.of(
subscriptionId = 3,
level = 2,
)
@@ -208,9 +262,9 @@
fun logDiffs_activeChangesLevel_onlyLevelLogged() {
val logger = TestLogger()
val prevActiveNetwork =
- WifiNetworkModel.Active(isValidated = true, level = 3, ssid = "Test SSID")
+ WifiNetworkModel.Active.of(isValidated = true, level = 3, ssid = "Test SSID")
val newActiveNetwork =
- WifiNetworkModel.Active(isValidated = true, level = 2, ssid = "Test SSID")
+ WifiNetworkModel.Active.of(isValidated = true, level = 2, ssid = "Test SSID")
newActiveNetwork.logDiffs(prevActiveNetwork, logger)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/view/ModernStatusBarWifiViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/view/ModernStatusBarWifiViewTest.kt
index ff398f9..37c7a48 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/view/ModernStatusBarWifiViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/view/ModernStatusBarWifiViewTest.kt
@@ -195,7 +195,7 @@
@Test
fun isIconVisible_notEnabled_outputsFalse() {
wifiRepository.setIsWifiEnabled(false)
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(isValidated = true, level = 2))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(isValidated = true, level = 2))
val view = ModernStatusBarWifiView.constructAndBind(context, SLOT_NAME, viewModel)
@@ -210,7 +210,7 @@
@Test
fun isIconVisible_enabled_outputsTrue() {
wifiRepository.setIsWifiEnabled(true)
- wifiRepository.setWifiNetwork(WifiNetworkModel.Active(isValidated = true, level = 2))
+ wifiRepository.setWifiNetwork(WifiNetworkModel.Active.of(isValidated = true, level = 2))
val view = ModernStatusBarWifiView.constructAndBind(context, SLOT_NAME, viewModel)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelIconParameterizedTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelIconParameterizedTest.kt
index 82acb40..96a0194 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelIconParameterizedTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelIconParameterizedTest.kt
@@ -206,51 +206,51 @@
// Enabled = false => no networks shown
TestCase(
enabled = false,
- network = WifiNetworkModel.CarrierMerged(subscriptionId = 1, level = 1),
+ network = WifiNetworkModel.CarrierMerged.of(subscriptionId = 1, level = 1),
expected = null,
),
TestCase(
enabled = false,
- network = WifiNetworkModel.Inactive,
+ network = WifiNetworkModel.Inactive(),
expected = null,
),
TestCase(
enabled = false,
- network = WifiNetworkModel.Active(isValidated = false, level = 1),
+ network = WifiNetworkModel.Active.of(isValidated = false, level = 1),
expected = null,
),
TestCase(
enabled = false,
- network = WifiNetworkModel.Active(isValidated = true, level = 3),
+ network = WifiNetworkModel.Active.of(isValidated = true, level = 3),
expected = null,
),
// forceHidden = true => no networks shown
TestCase(
forceHidden = true,
- network = WifiNetworkModel.CarrierMerged(subscriptionId = 1, level = 1),
+ network = WifiNetworkModel.CarrierMerged.of(subscriptionId = 1, level = 1),
expected = null,
),
TestCase(
forceHidden = true,
- network = WifiNetworkModel.Inactive,
+ network = WifiNetworkModel.Inactive(),
expected = null,
),
TestCase(
enabled = false,
- network = WifiNetworkModel.Active(isValidated = false, level = 2),
+ network = WifiNetworkModel.Active.of(isValidated = false, level = 2),
expected = null,
),
TestCase(
forceHidden = true,
- network = WifiNetworkModel.Active(isValidated = true, level = 1),
+ network = WifiNetworkModel.Active.of(isValidated = true, level = 1),
expected = null,
),
// alwaysShowIconWhenEnabled = true => all Inactive and Active networks shown
TestCase(
alwaysShowIconWhenEnabled = true,
- network = WifiNetworkModel.Inactive,
+ network = WifiNetworkModel.Inactive(),
expected =
Expected(
iconResource = WIFI_NO_NETWORK,
@@ -263,7 +263,7 @@
),
TestCase(
alwaysShowIconWhenEnabled = true,
- network = WifiNetworkModel.Active(isValidated = false, level = 4),
+ network = WifiNetworkModel.Active.of(isValidated = false, level = 4),
expected =
Expected(
iconResource = WIFI_NO_INTERNET_ICONS[4],
@@ -276,7 +276,7 @@
),
TestCase(
alwaysShowIconWhenEnabled = true,
- network = WifiNetworkModel.Active(isValidated = true, level = 2),
+ network = WifiNetworkModel.Active.of(isValidated = true, level = 2),
expected =
Expected(
iconResource = WIFI_FULL_ICONS[2],
@@ -290,7 +290,7 @@
// hasDataCapabilities = false => all Inactive and Active networks shown
TestCase(
hasDataCapabilities = false,
- network = WifiNetworkModel.Inactive,
+ network = WifiNetworkModel.Inactive(),
expected =
Expected(
iconResource = WIFI_NO_NETWORK,
@@ -303,7 +303,7 @@
),
TestCase(
hasDataCapabilities = false,
- network = WifiNetworkModel.Active(isValidated = false, level = 2),
+ network = WifiNetworkModel.Active.of(isValidated = false, level = 2),
expected =
Expected(
iconResource = WIFI_NO_INTERNET_ICONS[2],
@@ -316,7 +316,7 @@
),
TestCase(
hasDataCapabilities = false,
- network = WifiNetworkModel.Active(isValidated = true, level = 0),
+ network = WifiNetworkModel.Active.of(isValidated = true, level = 0),
expected =
Expected(
iconResource = WIFI_FULL_ICONS[0],
@@ -330,7 +330,7 @@
// isDefault = true => all Inactive and Active networks shown
TestCase(
isDefault = true,
- network = WifiNetworkModel.Inactive,
+ network = WifiNetworkModel.Inactive(),
expected =
Expected(
iconResource = WIFI_NO_NETWORK,
@@ -343,7 +343,7 @@
),
TestCase(
isDefault = true,
- network = WifiNetworkModel.Active(isValidated = false, level = 3),
+ network = WifiNetworkModel.Active.of(isValidated = false, level = 3),
expected =
Expected(
iconResource = WIFI_NO_INTERNET_ICONS[3],
@@ -356,7 +356,7 @@
),
TestCase(
isDefault = true,
- network = WifiNetworkModel.Active(isValidated = true, level = 1),
+ network = WifiNetworkModel.Active.of(isValidated = true, level = 1),
expected =
Expected(
iconResource = WIFI_FULL_ICONS[1],
@@ -372,14 +372,14 @@
enabled = true,
isDefault = true,
forceHidden = false,
- network = WifiNetworkModel.CarrierMerged(subscriptionId = 1, level = 1),
+ network = WifiNetworkModel.CarrierMerged.of(subscriptionId = 1, level = 1),
expected = null,
),
// isDefault = false => no networks shown
TestCase(
isDefault = false,
- network = WifiNetworkModel.Inactive,
+ network = WifiNetworkModel.Inactive(),
expected = null,
),
TestCase(
@@ -389,7 +389,7 @@
),
TestCase(
isDefault = false,
- network = WifiNetworkModel.Active(isValidated = false, level = 3),
+ network = WifiNetworkModel.Active.of(isValidated = false, level = 3),
expected = null,
),
@@ -397,7 +397,7 @@
// because wifi isn't the default connection (b/272509965).
TestCase(
isDefault = false,
- network = WifiNetworkModel.Active(isValidated = true, level = 4),
+ network = WifiNetworkModel.Active.of(isValidated = true, level = 4),
expected = null,
),
)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/touchpad/tutorial/ui/gesture/RecentAppsGestureMonitorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/touchpad/tutorial/ui/gesture/RecentAppsGestureMonitorTest.kt
new file mode 100644
index 0000000..cafebb9
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/touchpad/tutorial/ui/gesture/RecentAppsGestureMonitorTest.kt
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.touchpad.tutorial.ui.gesture
+
+import android.view.MotionEvent
+import androidx.compose.ui.input.pointer.util.VelocityTracker1D
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.touchpad.tutorial.ui.gesture.GestureState.FINISHED
+import com.android.systemui.touchpad.tutorial.ui.gesture.GestureState.IN_PROGRESS
+import com.android.systemui.touchpad.tutorial.ui.gesture.GestureState.NOT_STARTED
+import com.android.systemui.touchpad.tutorial.ui.gesture.MultiFingerGesture.Companion.SWIPE_DISTANCE
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class RecentAppsGestureMonitorTest : SysuiTestCase() {
+
+ companion object {
+ const val THRESHOLD_VELOCITY_PX_PER_MS = 0.1f
+ // multiply by 1000 to get px per ms instead of px per s which is unit used by velocity
+ // tracker
+ const val SLOW = THRESHOLD_VELOCITY_PX_PER_MS * 1000 - 1
+ const val FAST = THRESHOLD_VELOCITY_PX_PER_MS * 1000 + 1
+ }
+
+ private var gestureState = NOT_STARTED
+ private val velocityTracker =
+ mock<VelocityTracker1D> {
+ // by default return correct speed for the gesture - as if pointer is slowing down
+ on { calculateVelocity() } doReturn SLOW
+ }
+ private val gestureMonitor =
+ RecentAppsGestureMonitor(
+ gestureDistanceThresholdPx = SWIPE_DISTANCE.toInt(),
+ gestureStateChangedCallback = { gestureState = it },
+ velocityThresholdPxPerMs = THRESHOLD_VELOCITY_PX_PER_MS,
+ velocityTracker = velocityTracker
+ )
+
+ @Test
+ fun triggersGestureFinishedForThreeFingerGestureUp() {
+ assertStateAfterEvents(events = ThreeFingerGesture.swipeUp(), expectedState = FINISHED)
+ }
+
+ @Test
+ fun doesntTriggerGestureFinished_onGestureSpeedTooHigh() {
+ whenever(velocityTracker.calculateVelocity()).thenReturn(FAST)
+ assertStateAfterEvents(events = ThreeFingerGesture.swipeUp(), expectedState = NOT_STARTED)
+ }
+
+ @Test
+ fun triggersGestureProgressForThreeFingerGestureStarted() {
+ assertStateAfterEvents(
+ events = ThreeFingerGesture.startEvents(x = 0f, y = 0f),
+ expectedState = IN_PROGRESS
+ )
+ }
+
+ @Test
+ fun doesntTriggerGestureFinished_onGestureDistanceTooShort() {
+ assertStateAfterEvents(
+ events = ThreeFingerGesture.swipeUp(distancePx = SWIPE_DISTANCE / 2),
+ expectedState = NOT_STARTED
+ )
+ }
+
+ @Test
+ fun doesntTriggerGestureFinished_onThreeFingersSwipeInOtherDirections() {
+ assertStateAfterEvents(events = ThreeFingerGesture.swipeDown(), expectedState = NOT_STARTED)
+ assertStateAfterEvents(events = ThreeFingerGesture.swipeLeft(), expectedState = NOT_STARTED)
+ assertStateAfterEvents(
+ events = ThreeFingerGesture.swipeRight(),
+ expectedState = NOT_STARTED
+ )
+ }
+
+ @Test
+ fun doesntTriggerGestureFinished_onTwoFingersSwipe() {
+ assertStateAfterEvents(events = TwoFingerGesture.swipeUp(), expectedState = NOT_STARTED)
+ }
+
+ @Test
+ fun doesntTriggerGestureFinished_onFourFingersSwipe() {
+ assertStateAfterEvents(events = FourFingerGesture.swipeUp(), expectedState = NOT_STARTED)
+ }
+
+ private fun assertStateAfterEvents(events: List<MotionEvent>, expectedState: GestureState) {
+ events.forEach { gestureMonitor.processTouchpadEvent(it) }
+ assertThat(gestureState).isEqualTo(expectedState)
+ }
+}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestableContext.java b/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestableContext.java
index 0358474..3041240 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestableContext.java
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestableContext.java
@@ -19,6 +19,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.pm.PackageManager;
import android.hardware.display.DisplayManager;
import android.os.Handler;
import android.os.UserHandle;
@@ -40,6 +41,7 @@
@GuardedBy("mRegisteredReceivers")
private final Set<BroadcastReceiver> mRegisteredReceivers = new ArraySet<>();
private final Map<UserHandle, Context> mContextForUser = new HashMap<>();
+ private final Map<String, Context> mContextForPackage = new HashMap<>();
public SysuiTestableContext(Context base) {
super(base);
@@ -175,4 +177,22 @@
}
return super.createContextAsUser(user, flags);
}
+
+ /**
+ * Sets a Context object that will be returned as the result of {@link #createPackageContext}
+ * for a specific {@code packageName}.
+ */
+ public void prepareCreatePackageContext(String packageName, Context context) {
+ mContextForPackage.put(packageName, context);
+ }
+
+ @Override
+ public Context createPackageContext(String packageName, int flags)
+ throws PackageManager.NameNotFoundException {
+ Context packageContext = mContextForPackage.get(packageName);
+ if (packageContext != null) {
+ return packageContext;
+ }
+ return super.createPackageContext(packageName, flags);
+ }
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/FakeReduceBrightColorsController.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/FakeReduceBrightColorsController.kt
index e02042d..ab745ef 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/FakeReduceBrightColorsController.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/FakeReduceBrightColorsController.kt
@@ -47,14 +47,6 @@
}
}
- override fun setReduceBrightColorsFeatureAvailable(enabled: Boolean) {
- // do nothing
- }
-
- override fun isReduceBrightColorsFeatureAvailable(): Boolean {
- return true
- }
-
override fun isInUpgradeMode(resources: Resources?): Boolean {
if (resources != null) {
return Flags.evenDimmer() &&
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/data/repository/FakeCaptioningRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/data/repository/FakeCaptioningRepository.kt
index 2a0e764..a639463 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/data/repository/FakeCaptioningRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/accessibility/data/repository/FakeCaptioningRepository.kt
@@ -16,25 +16,31 @@
package com.android.systemui.accessibility.data.repository
+import com.android.systemui.accessibility.data.model.CaptioningModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
class FakeCaptioningRepository : CaptioningRepository {
- private val mutableIsSystemAudioCaptioningEnabled = MutableStateFlow(false)
- override val isSystemAudioCaptioningEnabled: StateFlow<Boolean>
- get() = mutableIsSystemAudioCaptioningEnabled.asStateFlow()
-
- private val mutableIsSystemAudioCaptioningUiEnabled = MutableStateFlow(false)
- override val isSystemAudioCaptioningUiEnabled: StateFlow<Boolean>
- get() = mutableIsSystemAudioCaptioningUiEnabled.asStateFlow()
+ private val mutableCaptioningModel = MutableStateFlow<CaptioningModel?>(null)
+ override val captioningModel: StateFlow<CaptioningModel?> = mutableCaptioningModel.asStateFlow()
override suspend fun setIsSystemAudioCaptioningEnabled(isEnabled: Boolean) {
- mutableIsSystemAudioCaptioningEnabled.value = isEnabled
+ mutableCaptioningModel.value =
+ CaptioningModel(
+ isSystemAudioCaptioningEnabled = isEnabled,
+ isSystemAudioCaptioningUiEnabled =
+ mutableCaptioningModel.value?.isSystemAudioCaptioningUiEnabled == true,
+ )
}
- fun setIsSystemAudioCaptioningUiEnabled(isSystemAudioCaptioningUiEnabled: Boolean) {
- mutableIsSystemAudioCaptioningUiEnabled.value = isSystemAudioCaptioningUiEnabled
+ fun setIsSystemAudioCaptioningUiEnabled(isEnabled: Boolean) {
+ mutableCaptioningModel.value =
+ CaptioningModel(
+ isSystemAudioCaptioningEnabled =
+ mutableCaptioningModel.value?.isSystemAudioCaptioningEnabled == true,
+ isSystemAudioCaptioningUiEnabled = isEnabled,
+ )
}
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractorKosmos.kt
new file mode 100644
index 0000000..15c7e25
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/domain/interactor/SideFpsOverlayInteractorKosmos.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.biometrics.domain.interactor
+
+import com.android.systemui.keyguard.domain.interactor.deviceEntrySideFpsOverlayInteractor
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.Kosmos.Fixture
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+
+@OptIn(ExperimentalCoroutinesApi::class)
+val Kosmos.sideFpsOverlayInteractor by Fixture {
+ SideFpsOverlayInteractorImpl(
+ biometricStatusInteractor,
+ displayStateInteractor,
+ deviceEntrySideFpsOverlayInteractor,
+ sideFpsSensorInteractor,
+ )
+}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderKosmos.kt
index 79d58a1..59809e3 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderKosmos.kt
@@ -19,27 +19,19 @@
import android.content.applicationContext
import android.view.layoutInflater
import android.view.windowManager
-import com.android.systemui.biometrics.domain.interactor.biometricStatusInteractor
-import com.android.systemui.biometrics.domain.interactor.displayStateInteractor
-import com.android.systemui.biometrics.domain.interactor.sideFpsSensorInteractor
-import com.android.systemui.keyguard.domain.interactor.deviceEntrySideFpsOverlayInteractor
-import com.android.systemui.keyguard.ui.viewmodel.sideFpsProgressBarViewModel
+import com.android.systemui.biometrics.domain.interactor.sideFpsOverlayInteractor
+import com.android.systemui.biometrics.ui.viewmodel.sideFpsOverlayViewModel
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.applicationCoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-@OptIn(ExperimentalCoroutinesApi::class)
val Kosmos.sideFpsOverlayViewBinder by Fixture {
SideFpsOverlayViewBinder(
- applicationScope = applicationCoroutineScope,
- applicationContext = applicationContext,
- { biometricStatusInteractor },
- { displayStateInteractor },
- { deviceEntrySideFpsOverlayInteractor },
+ applicationCoroutineScope,
+ applicationContext,
{ layoutInflater },
- { sideFpsProgressBarViewModel },
- { sideFpsSensorInteractor },
+ { sideFpsOverlayInteractor },
+ { sideFpsOverlayViewModel },
{ windowManager }
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelKosmos.kt
index de03855..e10b2dd 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModelKosmos.kt
@@ -27,9 +27,9 @@
@OptIn(ExperimentalCoroutinesApi::class)
val Kosmos.sideFpsOverlayViewModel by Fixture {
SideFpsOverlayViewModel(
- applicationContext = applicationContext,
- deviceEntrySideFpsOverlayInteractor = deviceEntrySideFpsOverlayInteractor,
- displayStateInteractor = displayStateInteractor,
- sfpsSensorInteractor = sideFpsSensorInteractor,
+ applicationContext,
+ deviceEntrySideFpsOverlayInteractor,
+ displayStateInteractor,
+ sideFpsSensorInteractor,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorKosmos.kt
index 5ced578..3087d01 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractorKosmos.kt
@@ -26,6 +26,7 @@
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.testDispatcher
+import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.statusbar.pipeline.mobile.data.repository.mobileConnectionsRepository
import com.android.systemui.telephony.domain.interactor.telephonyInteractor
import com.android.systemui.user.domain.interactor.selectedUserInteractor
@@ -50,5 +51,6 @@
},
metricsLogger = metricsLogger,
dozeLogger = mock(),
+ sceneInteractor = { sceneInteractor },
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/classifier/FalsingCollectorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/classifier/FalsingCollectorKosmos.kt
index d31491d..25c4bbb 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/classifier/FalsingCollectorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/classifier/FalsingCollectorKosmos.kt
@@ -18,4 +18,6 @@
import com.android.systemui.kosmos.Kosmos
-var Kosmos.falsingCollector by Kosmos.Fixture<FalsingCollector> { FalsingCollectorFake() }
+var Kosmos.fakeFalsingCollector by Kosmos.Fixture { FalsingCollectorFake() }
+
+var Kosmos.falsingCollector by Kosmos.Fixture<FalsingCollector> { fakeFalsingCollector }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt
index 2ab8221..209d163 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt
@@ -20,6 +20,7 @@
import com.android.systemui.communal.shared.log.communalSceneLogger
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
+import com.android.systemui.scene.domain.interactor.sceneInteractor
val Kosmos.communalSceneInteractor: CommunalSceneInteractor by
Kosmos.Fixture {
@@ -27,5 +28,6 @@
applicationScope = applicationCoroutineScope,
repository = communalSceneRepository,
logger = communalSceneLogger,
+ sceneInteractor = sceneInteractor,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorKosmos.kt
index 13116e7..096022c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryInteractorKosmos.kt
@@ -22,6 +22,7 @@
import com.android.systemui.keyguard.dismissCallbackRegistry
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
+import com.android.systemui.scene.domain.interactor.sceneBackInteractor
import com.android.systemui.scene.domain.interactor.sceneInteractor
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -36,5 +37,6 @@
deviceUnlockedInteractor = deviceUnlockedInteractor,
alternateBouncerInteractor = alternateBouncerInteractor,
dismissCallbackRegistry = dismissCallbackRegistry,
+ sceneBackInteractor = sceneBackInteractor,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt
index 811c653..80f6fc2 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt
@@ -19,6 +19,7 @@
import android.hardware.input.InputManager
import com.android.systemui.education.data.repository.fakeEduClock
import com.android.systemui.inputdevice.data.repository.UserInputDeviceRepository
+import com.android.systemui.inputdevice.tutorial.tutorialSchedulerRepository
import com.android.systemui.keyboard.data.repository.keyboardRepository
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testDispatcher
@@ -50,6 +51,15 @@
Kosmos.Fixture {
KeyboardTouchpadEduStatsInteractorImpl(
backgroundScope = testScope.backgroundScope,
- contextualEducationInteractor = contextualEducationInteractor
+ contextualEducationInteractor = contextualEducationInteractor,
+ inputDeviceRepository =
+ UserInputDeviceRepository(
+ testDispatcher,
+ keyboardRepository,
+ touchpadRepository,
+ userRepository
+ ),
+ tutorialSchedulerRepository,
+ fakeEduClock
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/haptics/msdl/BouncerHapticHelperKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/haptics/msdl/BouncerHapticHelperKosmos.kt
new file mode 100644
index 0000000..94982ed
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/haptics/msdl/BouncerHapticHelperKosmos.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.haptics.msdl
+
+import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer
+import com.android.systemui.kosmos.Kosmos
+import com.google.android.msdl.domain.MSDLPlayer
+import dagger.Lazy
+
+val Kosmos.bouncerHapticPlayer: BouncerHapticPlayer by
+ Kosmos.Fixture {
+ val lazyPlayer = Lazy<MSDLPlayer> { fakeMSDLPlayer }
+ BouncerHapticPlayer(lazyPlayer)
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/haptics/msdl/MSDLPlayerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/haptics/msdl/MSDLPlayerKosmos.kt
index f5a05b4..4f5c32a 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/haptics/msdl/MSDLPlayerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/haptics/msdl/MSDLPlayerKosmos.kt
@@ -17,5 +17,7 @@
package com.android.systemui.haptics.msdl
import com.android.systemui.kosmos.Kosmos
+import com.google.android.msdl.domain.MSDLPlayer
-val Kosmos.msdlPlayer by Kosmos.Fixture { FakeMSDLPlayer() }
+var Kosmos.msdlPlayer: MSDLPlayer by Kosmos.Fixture { fakeMSDLPlayer }
+val Kosmos.fakeMSDLPlayer by Kosmos.Fixture { FakeMSDLPlayer() }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/inputdevice/tutorial/InputDeviceTutorialKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/inputdevice/tutorial/InputDeviceTutorialKosmos.kt
index 827f0d2..a83baff 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/inputdevice/tutorial/InputDeviceTutorialKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/inputdevice/tutorial/InputDeviceTutorialKosmos.kt
@@ -16,8 +16,20 @@
package com.android.systemui.inputdevice.tutorial
+import android.content.applicationContext
+import com.android.systemui.inputdevice.tutorial.data.repository.TutorialSchedulerRepository
import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.testScope
import org.mockito.kotlin.mock
var Kosmos.inputDeviceTutorialLogger: InputDeviceTutorialLogger by
Kosmos.Fixture { mock<InputDeviceTutorialLogger>() }
+
+var Kosmos.tutorialSchedulerRepository by
+ Kosmos.Fixture {
+ TutorialSchedulerRepository(
+ applicationContext = applicationContext,
+ testScope.backgroundScope,
+ "KosmosTutorialSchedulerRepository"
+ )
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorKosmos.kt
index 27eadb1..d920c4f 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissActionInteractorKosmos.kt
@@ -25,6 +25,7 @@
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.domain.resolver.notifShadeSceneFamilyResolver
import com.android.systemui.scene.domain.resolver.quickSettingsSceneFamilyResolver
+import com.android.systemui.shade.domain.interactor.shadeInteractor
import kotlinx.coroutines.ExperimentalCoroutinesApi
@ExperimentalCoroutinesApi
@@ -35,11 +36,13 @@
transitionInteractor = keyguardTransitionInteractor,
dismissInteractor = keyguardDismissInteractor,
applicationScope = testScope.backgroundScope,
- sceneInteractor = sceneInteractor,
- deviceEntryInteractor = deviceEntryInteractor,
- quickSettingsSceneFamilyResolver = quickSettingsSceneFamilyResolver,
- notifShadeSceneFamilyResolver = notifShadeSceneFamilyResolver,
+ sceneInteractor = { sceneInteractor },
+ deviceEntryInteractor = { deviceEntryInteractor },
+ quickSettingsSceneFamilyResolver = { quickSettingsSceneFamilyResolver },
+ notifShadeSceneFamilyResolver = { notifShadeSceneFamilyResolver },
powerInteractor = powerInteractor,
alternateBouncerInteractor = alternateBouncerInteractor,
+ keyguardInteractor = { keyguardInteractor },
+ shadeInteractor = { shadeInteractor },
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorFactory.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorFactory.kt
index f5232ce..9593dfb 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorFactory.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorFactory.kt
@@ -36,6 +36,7 @@
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.test.TestScope
+import org.mockito.kotlin.any
/**
* Simply put, I got tired of adding a constructor argument and then having to tweak dozens of
@@ -66,6 +67,7 @@
mock<KeyguardTransitionInteractor>().also {
whenever(it.currentKeyguardState).thenReturn(currentKeyguardStateFlow)
whenever(it.transitionState).thenReturn(transitionStateFlow)
+ whenever(it.isFinishedIn(any(), any())).thenReturn(MutableStateFlow(false))
}
val configurationDimensionFlow = MutableSharedFlow<ConfigurationBasedDimensions>()
configurationDimensionFlow.tryEmit(
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinderKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinderKosmos.kt
index 1e95fc1..740d891 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinderKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinderKosmos.kt
@@ -34,6 +34,7 @@
import com.android.systemui.keyguard.ui.viewmodel.alternateBouncerWindowViewModel
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
+import com.android.systemui.log.logcatLogBuffer
import com.android.systemui.power.domain.interactor.powerInteractor
import com.android.systemui.statusbar.gesture.TapGestureDetector
import com.android.systemui.util.mockito.mock
@@ -64,6 +65,7 @@
},
messageAreaViewModel = mock<AlternateBouncerMessageAreaViewModel>(),
powerInteractor = powerInteractor,
+ touchLogBuffer = logcatLogBuffer(),
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt
index 851a378..f97f303 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt
@@ -36,7 +36,8 @@
import com.android.systemui.deviceentry.domain.interactor.deviceEntryUdfpsInteractor
import com.android.systemui.deviceentry.domain.interactor.deviceUnlockedInteractor
import com.android.systemui.globalactions.domain.interactor.globalActionsInteractor
-import com.android.systemui.haptics.msdl.msdlPlayer
+import com.android.systemui.haptics.msdl.bouncerHapticPlayer
+import com.android.systemui.haptics.msdl.fakeMSDLPlayer
import com.android.systemui.haptics.qs.qsLongPressEffect
import com.android.systemui.jank.interactionJankMonitor
import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
@@ -61,6 +62,7 @@
import com.android.systemui.settings.brightness.domain.interactor.brightnessMirrorShowingInteractor
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.shade.domain.interactor.shadeInteractor
+import com.android.systemui.shade.domain.interactor.shadeModeInteractor
import com.android.systemui.shade.shadeController
import com.android.systemui.shade.ui.viewmodel.notificationShadeWindowModel
import com.android.systemui.statusbar.chips.ui.viewmodel.ongoingActivityChipsViewModel
@@ -155,5 +157,7 @@
val scrimController by lazy { kosmos.scrimController }
val scrimStartable by lazy { kosmos.scrimStartable }
val sceneContainerOcclusionInteractor by lazy { kosmos.sceneContainerOcclusionInteractor }
- val msdlPlayer by lazy { kosmos.msdlPlayer }
+ val msdlPlayer by lazy { kosmos.fakeMSDLPlayer }
+ val shadeModeInteractor by lazy { kosmos.shadeModeInteractor }
+ val bouncerHapticHelper by lazy { kosmos.bouncerHapticPlayer }
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderKosmos.kt
index a5690a0..cb7750f5 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataLoaderKosmos.kt
@@ -24,7 +24,6 @@
import com.android.systemui.kosmos.testScope
import com.android.systemui.media.controls.util.fakeMediaControllerFactory
import com.android.systemui.media.controls.util.mediaFlags
-import com.android.systemui.plugins.activityStarter
val Kosmos.mediaDataLoader by
Kosmos.Fixture {
@@ -32,7 +31,6 @@
testableContext,
testDispatcher,
testScope,
- activityStarter,
fakeMediaControllerFactory,
mediaFlags,
imageLoader,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorKosmos.kt
index 632436a..174e653 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDataProcessorKosmos.kt
@@ -26,6 +26,7 @@
import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.media.controls.data.repository.mediaDataRepository
+import com.android.systemui.media.controls.shared.mediaLogger
import com.android.systemui.media.controls.shared.model.SmartspaceMediaDataProvider
import com.android.systemui.media.controls.util.fakeMediaControllerFactory
import com.android.systemui.media.controls.util.mediaFlags
@@ -60,5 +61,6 @@
keyguardUpdateMonitor = keyguardUpdateMonitor,
mediaDataRepository = mediaDataRepository,
mediaDataLoader = { mediaDataLoader },
+ mediaLogger = mediaLogger,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceLoggerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceLoggerKosmos.kt
new file mode 100644
index 0000000..76d71dd
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceLoggerKosmos.kt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media.controls.domain.pipeline
+
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.log.logcatLogBuffer
+
+var Kosmos.mediaDeviceLogger by
+ Kosmos.Fixture { MediaDeviceLogger(logcatLogBuffer("MediaDeviceLoggerKosmos")) }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerKosmos.kt
index c479ce6..11408d8 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManagerKosmos.kt
@@ -41,5 +41,6 @@
},
fgExecutor = fakeExecutor,
bgExecutor = fakeExecutor,
+ logger = mediaDeviceLogger,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerKosmos.kt
index b7660e0..b33edf9 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/media/controls/domain/pipeline/MediaTimeoutListenerKosmos.kt
@@ -28,6 +28,8 @@
Kosmos.Fixture {
MediaTimeoutListener(
mediaControllerFactory = fakeMediaControllerFactory,
+ bgExecutor = fakeExecutor,
+ uiExecutor = fakeExecutor,
mainExecutor = fakeExecutor,
logger = MediaTimeoutLogger(logcatLogBuffer("MediaTimeoutLogBuffer")),
statusBarStateController = statusBarStateController,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/external/TileLifecycleManagerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/external/TileLifecycleManagerKosmos.kt
index a0fc76b..4978558 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/external/TileLifecycleManagerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/external/TileLifecycleManagerKosmos.kt
@@ -24,6 +24,7 @@
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.qs.tiles.impl.custom.packageManagerAdapterFacade
import com.android.systemui.util.mockito.mock
+import com.android.systemui.util.time.fakeSystemClock
val Kosmos.tileLifecycleManagerFactory: TileLifecycleManager.Factory by
Kosmos.Fixture {
@@ -39,6 +40,7 @@
activityManager,
mock(),
fakeExecutor,
+ fakeSystemClock,
)
}
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt
index b03542c..33227a4 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt
@@ -16,6 +16,8 @@
package com.android.systemui.qs.panels.ui.viewmodel
+import android.content.applicationContext
+import com.android.systemui.common.ui.domain.interactor.configurationInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.qs.panels.domain.interactor.editTilesListInteractor
@@ -33,6 +35,8 @@
currentTilesInteractor,
tilesAvailabilityInteractor,
minimumTilesInteractor,
+ configurationInteractor,
+ applicationContext,
infiniteGridLayout,
applicationCoroutineScope,
gridLayoutTypeInteractor,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/di/NewQSTileFactoryKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/di/NewQSTileFactoryKosmos.kt
index dceb8bf..f66125a 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/di/NewQSTileFactoryKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/di/NewQSTileFactoryKosmos.kt
@@ -20,6 +20,7 @@
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.qs.instanceIdSequenceFake
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
import com.android.systemui.qs.tiles.base.viewmodel.QSTileViewModelFactory
import com.android.systemui.qs.tiles.viewmodel.QSTileConfig
import com.android.systemui.qs.tiles.viewmodel.QSTileState
@@ -47,6 +48,7 @@
tileSpec,
QSTileUIConfig.Empty,
instanceIdSequenceFake.newInstanceId(),
+ category = TileCategory.PROVIDED_BY_APP,
)
object : QSTileViewModel {
override val state: StateFlow<QSTileState?> =
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigTestBuilder.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigTestBuilder.kt
index 2a0ee88..73d9b32 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigTestBuilder.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/viewmodel/QSTileConfigTestBuilder.kt
@@ -18,6 +18,7 @@
import com.android.internal.logging.InstanceId
import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.qs.shared.model.TileCategory
object QSTileConfigTestBuilder {
@@ -30,12 +31,14 @@
var instanceId: InstanceId = InstanceId.fakeInstanceId(0)
var metricsSpec: String = tileSpec.spec
var policy: QSTilePolicy = QSTilePolicy.NoRestrictions
+ var category: TileCategory = TileCategory.UNKNOWN
fun build() =
QSTileConfig(
tileSpec,
uiConfig,
instanceId,
+ category,
metricsSpec,
policy,
)
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneKosmos.kt
index 55f3ed7..8744638 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneKosmos.kt
@@ -12,6 +12,8 @@
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.ui.FakeOverlay
import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel
+import com.android.systemui.scene.ui.viewmodel.splitEdgeDetector
+import com.android.systemui.shade.domain.interactor.shadeInteractor
import kotlinx.coroutines.flow.MutableStateFlow
var Kosmos.sceneKeys by Fixture {
@@ -70,6 +72,8 @@
sceneInteractor = sceneInteractor,
falsingInteractor = falsingInteractor,
powerInteractor = powerInteractor,
+ shadeInteractor = shadeInteractor,
+ splitEdgeDetector = splitEdgeDetector,
motionEventHandlerReceiver = {},
logger = sceneLogger
)
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/resolver/SceneResolverKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/resolver/SceneResolverKosmos.kt
index ae33aea..d17b575 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/resolver/SceneResolverKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/resolver/SceneResolverKosmos.kt
@@ -24,7 +24,7 @@
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.scene.shared.model.SceneFamilies
-import com.android.systemui.shade.domain.interactor.shadeInteractor
+import com.android.systemui.shade.domain.interactor.shadeModeInteractor
import kotlinx.coroutines.ExperimentalCoroutinesApi
val Kosmos.sceneFamilyResolvers: Map<SceneKey, SceneResolver>
@@ -48,7 +48,7 @@
Kosmos.Fixture {
NotifShadeSceneFamilyResolver(
applicationScope = applicationCoroutineScope,
- shadeInteractor = shadeInteractor,
+ shadeModeInteractor = shadeModeInteractor,
)
}
@@ -56,6 +56,6 @@
Kosmos.Fixture {
QuickSettingsSceneFamilyResolver(
applicationScope = applicationCoroutineScope,
- shadeInteractor = shadeInteractor,
+ shadeModeInteractor = shadeModeInteractor,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/startable/SceneContainerStartableKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/startable/SceneContainerStartableKosmos.kt
index b612a8b..4228c3c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/startable/SceneContainerStartableKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/domain/startable/SceneContainerStartableKosmos.kt
@@ -27,17 +27,16 @@
import com.android.systemui.deviceentry.domain.interactor.deviceEntryHapticsInteractor
import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
import com.android.systemui.deviceentry.domain.interactor.deviceUnlockedInteractor
+import com.android.systemui.haptics.msdl.msdlPlayer
import com.android.systemui.haptics.vibratorHelper
import com.android.systemui.keyguard.dismissCallbackRegistry
import com.android.systemui.keyguard.domain.interactor.keyguardEnabledInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
-import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
import com.android.systemui.keyguard.domain.interactor.windowManagerLockscreenVisibilityInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.testScope
import com.android.systemui.model.sysUiState
-import com.android.systemui.plugins.statusbar.statusBarStateController
import com.android.systemui.power.domain.interactor.powerInteractor
import com.android.systemui.scene.domain.interactor.sceneBackInteractor
import com.android.systemui.scene.domain.interactor.sceneContainerOcclusionInteractor
@@ -61,7 +60,6 @@
deviceUnlockedInteractor = deviceUnlockedInteractor,
bouncerInteractor = bouncerInteractor,
keyguardInteractor = keyguardInteractor,
- keyguardTransitionInteractor = keyguardTransitionInteractor,
sysUiState = sysUiState,
displayId = displayTracker.defaultDisplayId,
sceneLogger = sceneLogger,
@@ -86,5 +84,6 @@
statusBarStateController = sysuiStatusBarStateController,
alternateBouncerInteractor = alternateBouncerInteractor,
vibratorHelper = vibratorHelper,
+ msdlPlayer = msdlPlayer,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetectorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetectorKosmos.kt
new file mode 100644
index 0000000..e0b5292
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/ui/viewmodel/SplitEdgeDetectorKosmos.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.scene.ui.viewmodel
+
+import androidx.compose.ui.unit.dp
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.shade.domain.interactor.shadeInteractor
+
+var Kosmos.splitEdgeDetector: SplitEdgeDetector by
+ Kosmos.Fixture {
+ SplitEdgeDetector(
+ topEdgeSplitFraction = shadeInteractor::getTopEdgeSplitFraction,
+ edgeSize = 40.dp,
+ )
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/shade/domain/interactor/ShadeInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/shade/domain/interactor/ShadeInteractorKosmos.kt
index 54208b9..04d930c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/shade/domain/interactor/ShadeInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/shade/domain/interactor/ShadeInteractorKosmos.kt
@@ -53,7 +53,7 @@
scope = applicationCoroutineScope,
keyguardRepository = keyguardRepository,
sharedNotificationContainerInteractor = sharedNotificationContainerInteractor,
- repository = shadeRepository
+ repository = shadeRepository,
)
}
var Kosmos.shadeInteractor: ShadeInteractor by Kosmos.Fixture { shadeInteractorImpl }
@@ -70,6 +70,6 @@
userSetupRepository = userSetupRepository,
userSwitcherInteractor = userSwitcherInteractor,
baseShadeInteractor = baseShadeInteractor,
- shadeRepository = shadeRepository,
+ shadeModeInteractor = shadeModeInteractor,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorKosmos.kt
new file mode 100644
index 0000000..7892e96
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorKosmos.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shade.domain.interactor
+
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.Kosmos.Fixture
+import com.android.systemui.kosmos.applicationCoroutineScope
+import com.android.systemui.shade.data.repository.shadeRepository
+
+val Kosmos.shadeModeInteractor by Fixture {
+ ShadeModeInteractorImpl(
+ applicationScope = applicationCoroutineScope,
+ repository = shadeRepository,
+ )
+}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/FakeWifiRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/FakeWifiRepository.kt
index 709be5e..7ca90ea 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/FakeWifiRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/FakeWifiRepository.kt
@@ -32,7 +32,7 @@
override val isWifiDefault: StateFlow<Boolean> = _isWifiDefault
private val _wifiNetwork: MutableStateFlow<WifiNetworkModel> =
- MutableStateFlow(WifiNetworkModel.Inactive)
+ MutableStateFlow(WifiNetworkModel.Inactive())
override val wifiNetwork: StateFlow<WifiNetworkModel> = _wifiNetwork
override val secondaryNetworks = MutableStateFlow<List<WifiNetworkModel>>(emptyList())
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/user/utils/FakeUserScopedService.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/user/utils/FakeUserScopedService.kt
new file mode 100644
index 0000000..78763f9
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/user/utils/FakeUserScopedService.kt
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.user.utils
+
+import android.os.UserHandle
+
+class FakeUserScopedService<T>(private val defaultImplementation: T) : UserScopedService<T> {
+
+ private val implementations = mutableMapOf<UserHandle, T>()
+
+ fun addImplementation(user: UserHandle, implementation: T) {
+ implementations[user] = implementation
+ }
+
+ fun removeImplementation(user: UserHandle): T? = implementations.remove(user)
+
+ override fun forUser(user: UserHandle): T =
+ implementations.getOrDefault(user, defaultImplementation)
+}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt
index 888351f..ba6ffd7 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt
@@ -33,11 +33,7 @@
class FakeAudioRepository : AudioRepository {
- private val unMutableStreams =
- setOf(
- AudioManager.STREAM_VOICE_CALL,
- AudioManager.STREAM_ALARM,
- )
+ private val unMutableStreams = setOf(AudioManager.STREAM_VOICE_CALL, AudioManager.STREAM_ALARM)
private val mutableMode = MutableStateFlow(AudioManager.MODE_NORMAL)
override val mode: StateFlow<Int> = mutableMode.asStateFlow()
@@ -126,7 +122,7 @@
lastAudibleVolumes[audioStream] = volume
}
- override suspend fun setRingerMode(audioStream: AudioStream, mode: RingerMode) {
+ override suspend fun setRingerModeInternal(audioStream: AudioStream, mode: RingerMode) {
mutableRingerMode.value = mode
}
diff --git a/packages/VpnDialogs/tests/Android.bp b/packages/VpnDialogs/tests/Android.bp
index 68639bd..409282e 100644
--- a/packages/VpnDialogs/tests/Android.bp
+++ b/packages/VpnDialogs/tests/Android.bp
@@ -22,8 +22,8 @@
// (e.g. VpnManager#prepareVpn()).
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/WAPPushManager/tests/Android.bp b/packages/WAPPushManager/tests/Android.bp
index 0a17938..9731002 100644
--- a/packages/WAPPushManager/tests/Android.bp
+++ b/packages/WAPPushManager/tests/Android.bp
@@ -26,9 +26,9 @@
android_test {
name: "WAPPushManagerTests",
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
"telephony-common",
- "android.test.base",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
// Include all test java files.
diff --git a/packages/WallpaperBackup/Android.bp b/packages/WallpaperBackup/Android.bp
index 18f78314..b8e0d42 100644
--- a/packages/WallpaperBackup/Android.bp
+++ b/packages/WallpaperBackup/Android.bp
@@ -42,8 +42,8 @@
"test/src/**/*.java",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/packages/overlays/tests/Android.bp b/packages/overlays/tests/Android.bp
index 0244c0f..8bbe600 100644
--- a/packages/overlays/tests/Android.bp
+++ b/packages/overlays/tests/Android.bp
@@ -26,8 +26,8 @@
certificate: "platform",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
static_libs: [
diff --git a/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java b/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java
index 26b0f61..136738f 100644
--- a/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java
+++ b/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java
@@ -22,6 +22,7 @@
import android.graphics.GraphicBuffer;
import android.graphics.Rect;
import android.hardware.HardwareBuffer;
+import android.hardware.SyncFence;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraExtensionCharacteristics;
@@ -2525,6 +2526,19 @@
}
@Override
+ public SyncFence getFence() {
+ if (mParcelImage.fence != null) {
+ try {
+ return SyncFence.create(mParcelImage.fence.dup());
+ } catch (IOException e) {
+ Log.e(TAG, "Failed to parcel buffer fence!");
+ }
+ }
+
+ return SyncFence.createEmpty();
+ }
+
+ @Override
protected final void finalize() throws Throwable {
try {
close();
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index 9b0c8e5..3c65f37 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -94,6 +94,9 @@
libs: [
"ravenwood-runtime-common-ravenwood",
],
+ static_libs: [
+ "framework-annotations-lib", // should it be "libs" instead?
+ ],
visibility: ["//visibility:private"],
}
@@ -126,8 +129,9 @@
],
libs: [
"framework-minus-apex.ravenwood",
- "ravenwood-junit",
+ "ravenwood-helper-libcore-runtime",
],
+ sdk_version: "core_current",
visibility: ["//visibility:private"],
}
@@ -155,14 +159,15 @@
"ravenwood-runtime-common",
],
libs: [
- "android.test.mock",
+ "android.test.mock.impl",
"framework-minus-apex.ravenwood",
"ravenwood-framework",
"services.core.ravenwood",
"junit",
"framework-annotations-lib",
+ "ravenwood-helper-framework-runtime",
+ "ravenwood-helper-libcore-runtime",
],
- sdk_version: "core_current",
visibility: ["//frameworks/base"],
jarjar_rules: ":ravenwood-services-jarjar-rules",
}
diff --git a/ravenwood/TEST_MAPPING b/ravenwood/TEST_MAPPING
index 469759b..7f9d9c2 100644
--- a/ravenwood/TEST_MAPPING
+++ b/ravenwood/TEST_MAPPING
@@ -142,6 +142,10 @@
"host": true
},
{
+ "name": "RavenwoodCoreTest",
+ "host": true
+ },
+ {
"name": "RavenwoodMinimumTest",
"host": true
},
diff --git a/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java b/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodRedirect.java
similarity index 82%
copy from ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java
copy to ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodRedirect.java
index 4b9cf85..b582ccf 100644
--- a/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java
+++ b/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodRedirect.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package android.ravenwood.annotation;
-import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -29,8 +29,7 @@
*
* @hide
*/
-@Target({TYPE})
+@Target({METHOD})
@Retention(RetentionPolicy.CLASS)
-public @interface RavenwoodNativeSubstitutionClass {
- String value();
+public @interface RavenwoodRedirect {
}
diff --git a/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java b/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodRedirectionClass.java
similarity index 94%
rename from ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java
rename to ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodRedirectionClass.java
index 4b9cf85..bee9222 100644
--- a/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java
+++ b/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodRedirectionClass.java
@@ -31,6 +31,6 @@
*/
@Target({TYPE})
@Retention(RetentionPolicy.CLASS)
-public @interface RavenwoodNativeSubstitutionClass {
+public @interface RavenwoodRedirectionClass {
String value();
}
diff --git a/ravenwood/bivalenttest/test/com/android/ravenwoodtest/bivalenttest/RavenwoodConfigTest.java b/ravenwood/bivalenttest/test/com/android/ravenwoodtest/bivalenttest/RavenwoodConfigTest.java
new file mode 100644
index 0000000..a5a16c1
--- /dev/null
+++ b/ravenwood/bivalenttest/test/com/android/ravenwoodtest/bivalenttest/RavenwoodConfigTest.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ravenwoodtest.bivalenttest;
+
+import static android.platform.test.ravenwood.RavenwoodConfig.isOnRavenwood;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeTrue;
+
+import android.platform.test.ravenwood.RavenwoodConfig;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Test to make sure the config field is used.
+ */
+@RunWith(AndroidJUnit4.class)
+public class RavenwoodConfigTest {
+ private static final String PACKAGE_NAME = "com.test";
+
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig =
+ new RavenwoodConfig.Builder()
+ .setPackageName(PACKAGE_NAME)
+ .build();
+
+ @Test
+ public void testConfig() {
+ assumeTrue(isOnRavenwood());
+ assertEquals(PACKAGE_NAME,
+ InstrumentationRegistry.getInstrumentation().getContext().getPackageName());
+ }
+}
diff --git a/ravenwood/bivalenttest/test/com/android/ravenwoodtest/bivalenttest/RavenwoodMultipleRuleTest.java b/ravenwood/bivalenttest/test/com/android/ravenwoodtest/bivalenttest/RavenwoodMultipleRuleTest.java
new file mode 100644
index 0000000..c25d2b4
--- /dev/null
+++ b/ravenwood/bivalenttest/test/com/android/ravenwoodtest/bivalenttest/RavenwoodMultipleRuleTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ravenwoodtest.bivalenttest;
+
+import android.platform.test.ravenwood.RavenwoodConfig;
+import android.platform.test.ravenwood.RavenwoodRule;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Assume;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+
+/**
+ * Make sure having multiple RavenwoodRule's is detected.
+ * (But only when running on ravenwod. Otherwise it'll be ignored.)
+ */
+@RunWith(AndroidJUnit4.class)
+public class RavenwoodMultipleRuleTest {
+
+ @Rule(order = Integer.MIN_VALUE)
+ public final ExpectedException mExpectedException = ExpectedException.none();
+
+ @Rule
+ public final RavenwoodRule mRavenwood1 = new RavenwoodRule();
+
+ @Rule
+ public final RavenwoodRule mRavenwood2 = new RavenwoodRule();
+
+ public RavenwoodMultipleRuleTest() {
+ // We can't call it within the test method because the exception happens before
+ // calling the method, so set it up here.
+ if (RavenwoodConfig.isOnRavenwood()) {
+ mExpectedException.expectMessage("Multiple nesting RavenwoodRule");
+ }
+ }
+
+ @Test
+ public void testMultipleRulesNotAllowed() {
+ Assume.assumeTrue(RavenwoodConfig.isOnRavenwood());
+ }
+}
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
index f237ba9..68472c1 100644
--- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
@@ -27,49 +27,69 @@
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.internal.os.RuntimeInit;
+import com.android.platform.test.ravenwood.runtimehelper.ClassLoadHook;
+import com.android.ravenwood.common.RavenwoodCommonUtils;
+
import org.junit.runner.Description;
-import org.junit.runner.Runner;
import org.junit.runners.model.TestClass;
/**
* Provide hook points created by {@link RavenwoodAwareTestRunner}.
+ *
+ * States are associated with each {@link RavenwoodAwareTestRunner} are stored in
+ * {@link RavenwoodRunnerState}, rather than as members of {@link RavenwoodAwareTestRunner}.
+ * See its javadoc for the reasons.
+ *
+ * All methods in this class must be called from the test main thread.
*/
public class RavenwoodAwareTestRunnerHook {
- private static final String TAG = "RavenwoodAwareTestRunnerHook";
+ private static final String TAG = RavenwoodAwareTestRunner.TAG;
private RavenwoodAwareTestRunnerHook() {
}
- private static RavenwoodTestStats sStats; // lazy initialization.
- private static Description sCurrentClassDescription;
-
- private static RavenwoodTestStats getStats() {
- if (sStats == null) {
- // We don't want to throw in the static initializer, because tradefed may not report
- // it properly, so we initialize it here.
- sStats = new RavenwoodTestStats();
- }
- return sStats;
- }
-
/**
* Called when a runner starts, before the inner runner gets a chance to run.
*/
- public static void onRunnerInitializing(Runner runner, TestClass testClass) {
+ public static void onRunnerInitializing(RavenwoodAwareTestRunner runner, TestClass testClass) {
+ // TODO: Move the initialization code to a better place.
+
+ initOnce();
+
// This log call also ensures the framework JNI is loaded.
Log.i(TAG, "onRunnerInitializing: testClass=" + testClass.getJavaClass()
+ " runner=" + runner);
- // TODO: Move the initialization code to a better place.
+ // This is needed to make AndroidJUnit4ClassRunner happy.
+ InstrumentationRegistry.registerInstance(null, Bundle.EMPTY);
+ }
+
+ private static boolean sInitialized = false;
+
+ private static void initOnce() {
+ if (sInitialized) {
+ return;
+ }
+ sInitialized = true;
+
+ // We haven't initialized liblog yet, so directly write to System.out here.
+ RavenwoodCommonUtils.log(TAG, "initOnce()");
+
+ // Make sure libandroid_runtime is loaded.
+ ClassLoadHook.onClassLoaded(Log.class);
+
+ // Redirect stdout/stdin to liblog.
+ RuntimeInit.redirectLogStreams();
// This will let AndroidJUnit4 use the original runner.
System.setProperty("android.junit.runner",
"androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner");
System.setProperty(RAVENWOOD_VERSION_JAVA_SYSPROP, "1");
-
- // This is needed to make AndroidJUnit4ClassRunner happy.
- InstrumentationRegistry.registerInstance(null, Bundle.EMPTY);
+ // Do the basic set up for the android sysprops.
+ RavenwoodRuntimeEnvironmentController.setSystemProperties(
+ RavenwoodSystemProperties.DEFAULT_VALUES);
}
/**
@@ -77,7 +97,29 @@
*/
public static void onClassSkipped(Description description) {
Log.i(TAG, "onClassSkipped: description=" + description);
- getStats().onClassSkipped(description);
+ RavenwoodTestStats.getInstance().onClassSkipped(description);
+ }
+
+ /**
+ * Called before the inner runner starts.
+ */
+ public static void onBeforeInnerRunnerStart(
+ RavenwoodAwareTestRunner runner, Description description) throws Throwable {
+ Log.v(TAG, "onBeforeInnerRunnerStart: description=" + description);
+
+ // Prepare the environment before the inner runner starts.
+ RavenwoodRunnerState.forRunner(runner).enterTestClass(description);
+ }
+
+ /**
+ * Called after the inner runner finished.
+ */
+ public static void onAfterInnerRunnerFinished(
+ RavenwoodAwareTestRunner runner, Description description) throws Throwable {
+ Log.v(TAG, "onAfterInnerRunnerFinished: description=" + description);
+
+ RavenwoodTestStats.getInstance().onClassFinished(description);
+ RavenwoodRunnerState.forRunner(runner).exitTestClass();
}
/**
@@ -86,20 +128,23 @@
* Return false if it should be skipped.
*/
public static boolean onBefore(RavenwoodAwareTestRunner runner, Description description,
- Scope scope, Order order) {
- Log.i(TAG, "onBefore: description=" + description + ", " + scope + ", " + order);
+ Scope scope, Order order) throws Throwable {
+ Log.v(TAG, "onBefore: description=" + description + ", " + scope + ", " + order);
- if (scope == Scope.Class && order == Order.First) {
- // Keep track of the current class.
- sCurrentClassDescription = description;
+ if (scope == Scope.Instance && order == Order.Outer) {
+ // Start of a test method.
+ RavenwoodRunnerState.forRunner(runner).enterTestMethod(description);
}
+ final var classDescription = RavenwoodRunnerState.forRunner(runner).getClassDescription();
+
// Class-level annotations are checked by the runner already, so we only check
// method-level annotations here.
- if (scope == Scope.Instance && order == Order.First) {
+ if (scope == Scope.Instance && order == Order.Outer) {
if (!RavenwoodEnablementChecker.shouldEnableOnRavenwood(
description, true)) {
- getStats().onTestFinished(sCurrentClassDescription, description, Result.Skipped);
+ RavenwoodTestStats.getInstance().onTestFinished(
+ classDescription, description, Result.Skipped);
return false;
}
}
@@ -113,19 +158,20 @@
*/
public static boolean onAfter(RavenwoodAwareTestRunner runner, Description description,
Scope scope, Order order, Throwable th) {
- Log.i(TAG, "onAfter: description=" + description + ", " + scope + ", " + order + ", " + th);
+ Log.v(TAG, "onAfter: description=" + description + ", " + scope + ", " + order + ", " + th);
- if (scope == Scope.Instance && order == Order.First) {
- getStats().onTestFinished(sCurrentClassDescription, description,
+ final var classDescription = RavenwoodRunnerState.forRunner(runner).getClassDescription();
+
+ if (scope == Scope.Instance && order == Order.Outer) {
+ // End of a test method.
+ RavenwoodRunnerState.forRunner(runner).exitTestMethod();
+ RavenwoodTestStats.getInstance().onTestFinished(classDescription, description,
th == null ? Result.Passed : Result.Failed);
-
- } else if (scope == Scope.Class && order == Order.Last) {
- getStats().onClassFinished(sCurrentClassDescription);
}
// If RUN_DISABLED_TESTS is set, and the method did _not_ throw, make it an error.
if (RavenwoodRule.private$ravenwood().isRunningDisabledTests()
- && scope == Scope.Instance && order == Order.First) {
+ && scope == Scope.Instance && order == Order.Outer) {
boolean isTestEnabled = RavenwoodEnablementChecker.shouldEnableOnRavenwood(
description, false);
@@ -160,4 +206,25 @@
public static boolean shouldRunClassOnRavenwood(Class<?> clazz) {
return RavenwoodEnablementChecker.shouldRunClassOnRavenwood(clazz, true);
}
-}
+
+ /**
+ * Called by RavenwoodRule.
+ */
+ public static void onRavenwoodRuleEnter(RavenwoodAwareTestRunner runner,
+ Description description, RavenwoodRule rule) throws Throwable {
+ Log.v(TAG, "onRavenwoodRuleEnter: description=" + description);
+
+ RavenwoodRunnerState.forRunner(runner).enterRavenwoodRule(rule);
+ }
+
+
+ /**
+ * Called by RavenwoodRule.
+ */
+ public static void onRavenwoodRuleExit(RavenwoodAwareTestRunner runner,
+ Description description, RavenwoodRule rule) throws Throwable {
+ Log.v(TAG, "onRavenwoodRuleExit: description=" + description);
+
+ RavenwoodRunnerState.forRunner(runner).exitRavenwoodRule(rule);
+ }
+}
\ No newline at end of file
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRunnerState.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRunnerState.java
new file mode 100644
index 0000000..d73afd4
--- /dev/null
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRunnerState.java
@@ -0,0 +1,252 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.platform.test.ravenwood;
+
+import static com.android.ravenwood.common.RavenwoodCommonUtils.ensureIsPublicMember;
+
+import static org.junit.Assert.fail;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.ravenwood.common.RavenwoodRuntimeException;
+
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.WeakHashMap;
+
+/**
+ * Used to store various states associated with the current test runner.
+ *
+ * This class could be added to {@link RavenwoodAwareTestRunner} as a field, but we don't
+ * want to put it in junit-src/ (for one, that'll cause all the downstream dependencies to be
+ * rebuilt when this file is updated), so we manage it separately using a Map from each
+ * {@link RavenwoodAwareTestRunner} instance to a {@link RavenwoodRunnerState}.
+ *
+ * All members must be called from the runner's main thread.
+ */
+public final class RavenwoodRunnerState {
+ private static final String TAG = "RavenwoodRunnerState";
+
+ @GuardedBy("sStates")
+ private static final WeakHashMap<RavenwoodAwareTestRunner, RavenwoodRunnerState> sStates =
+ new WeakHashMap<>();
+
+ /**
+ * Get the instance for a given runner.
+ */
+ public static RavenwoodRunnerState forRunner(@NonNull RavenwoodAwareTestRunner runner) {
+ synchronized (sStates) {
+ var ret = sStates.get(runner);
+ if (ret == null) {
+ ret = new RavenwoodRunnerState(runner);
+ sStates.put(runner, ret);
+ }
+ return ret;
+ }
+ }
+
+ private final RavenwoodAwareTestRunner mRunner;
+
+ private RavenwoodRunnerState(RavenwoodAwareTestRunner runner) {
+ mRunner = runner;
+ }
+
+ private Description mClassDescription;
+ private Description mMethodDescription;
+
+ private RavenwoodConfig mCurrentConfig;
+ private RavenwoodRule mCurrentRule;
+
+ public Description getClassDescription() {
+ return mClassDescription;
+ }
+
+ public void enterTestClass(Description classDescription) throws IOException {
+ mClassDescription = classDescription;
+
+ mCurrentConfig = extractConfiguration(mRunner.getTestClass().getJavaClass());
+
+ if (mCurrentConfig != null) {
+ RavenwoodRuntimeEnvironmentController.init(mCurrentConfig);
+ }
+ }
+
+ public void exitTestClass() {
+ if (mCurrentConfig != null) {
+ try {
+ RavenwoodRuntimeEnvironmentController.reset();
+ } finally {
+ mClassDescription = null;
+ }
+ }
+ }
+
+ public void enterTestMethod(Description description) {
+ mMethodDescription = description;
+ }
+
+ public void exitTestMethod() {
+ mMethodDescription = null;
+ }
+
+ public void enterRavenwoodRule(RavenwoodRule rule) throws IOException {
+ if (mCurrentConfig != null) {
+ fail("RavenwoodConfiguration and RavenwoodRule cannot be used in the same class."
+ + " Suggest migrating to RavenwoodConfiguration.");
+ }
+ if (mCurrentRule != null) {
+ fail("Multiple nesting RavenwoodRule's are detected in the same class,"
+ + " which is not supported.");
+ }
+ mCurrentRule = rule;
+ RavenwoodRuntimeEnvironmentController.init(rule.getConfiguration());
+ }
+
+ public void exitRavenwoodRule(RavenwoodRule rule) {
+ if (mCurrentRule != rule) {
+ return; // This happens if the rule did _not_ take effect somehow.
+ }
+
+ try {
+ RavenwoodRuntimeEnvironmentController.reset();
+ } finally {
+ mCurrentRule = null;
+ }
+ }
+
+ /**
+ * @return a configuration from a test class, if any.
+ */
+ @Nullable
+ private static RavenwoodConfig extractConfiguration(Class<?> testClass) {
+ final boolean hasRavenwoodRule = hasRavenwoodRule(testClass);
+
+ var field = findConfigurationField(testClass);
+ if (field == null) {
+ return null;
+ }
+ if (hasRavenwoodRule) {
+ fail("RavenwoodConfiguration and RavenwoodRule cannot be used in the same class."
+ + " Suggest migrating to RavenwoodConfiguration.");
+ }
+
+ try {
+ return (RavenwoodConfig) field.get(null);
+ } catch (IllegalAccessException e) {
+ throw new RavenwoodRuntimeException("Failed to fetch from the configuration field", e);
+ }
+ }
+
+ /**
+ * @return true if the current target class (or its super classes) has any @Rule / @ClassRule
+ * fields of type RavenwoodRule.
+ *
+ * Note, this check won't detect cases where a Rule is of type
+ * {@link TestRule} and still be a {@link RavenwoodRule}. But that'll be detected at runtime
+ * as a failure, in {@link #enterRavenwoodRule}.
+ */
+ private static boolean hasRavenwoodRule(Class<?> testClass) {
+ for (var field : testClass.getDeclaredFields()) {
+ if (!field.isAnnotationPresent(Rule.class)
+ && field.isAnnotationPresent(ClassRule.class)) {
+ continue;
+ }
+ if (field.getType().equals(RavenwoodRule.class)) {
+ return true;
+ }
+ }
+ // JUnit supports rules as methods, so we need to check them too.
+ for (var method : testClass.getDeclaredMethods()) {
+ if (!method.isAnnotationPresent(Rule.class)
+ && method.isAnnotationPresent(ClassRule.class)) {
+ continue;
+ }
+ if (method.getReturnType().equals(RavenwoodRule.class)) {
+ return true;
+ }
+ }
+ // Look into the super class.
+ if (!testClass.getSuperclass().equals(Object.class)) {
+ return hasRavenwoodRule(testClass.getSuperclass());
+ }
+ return false;
+ }
+
+ /**
+ * Find and return a field with @RavenwoodConfiguration.Config, which must be of type
+ * RavenwoodConfiguration.
+ */
+ @Nullable
+ private static Field findConfigurationField(Class<?> testClass) {
+ Field foundField = null;
+
+ for (var field : testClass.getDeclaredFields()) {
+ final var hasAnot = field.isAnnotationPresent(RavenwoodConfig.Config.class);
+ final var isType = field.getType().equals(RavenwoodConfig.class);
+
+ if (hasAnot) {
+ if (isType) {
+ // Good, use this field.
+ if (foundField != null) {
+ fail(String.format(
+ "Class %s has multiple fields with %s",
+ testClass.getCanonicalName(),
+ "@RavenwoodConfiguration.Config"));
+ }
+ // Make sure it's static public
+ ensureIsPublicMember(field, true);
+
+ foundField = field;
+ } else {
+ fail(String.format(
+ "Field %s.%s has %s but type is not %s",
+ testClass.getCanonicalName(),
+ field.getName(),
+ "@RavenwoodConfiguration.Config",
+ "RavenwoodConfiguration"));
+ return null; // unreachable
+ }
+ } else {
+ if (isType) {
+ fail(String.format(
+ "Field %s.%s does not have %s but type is %s",
+ testClass.getCanonicalName(),
+ field.getName(),
+ "@RavenwoodConfiguration.Config",
+ "RavenwoodConfiguration"));
+ return null; // unreachable
+ } else {
+ // Unrelated field, ignore.
+ continue;
+ }
+ }
+ }
+ if (foundField != null) {
+ return foundField;
+ }
+ if (!testClass.getSuperclass().equals(Object.class)) {
+ return findConfigurationField(testClass.getSuperclass());
+ }
+ return null;
+ }
+}
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
similarity index 66%
rename from ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java
rename to ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
index a2088fd..03c9001 100644
--- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
@@ -18,6 +18,7 @@
import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_EMPTY_RESOURCES_APK;
import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_RESOURCE_APK;
+import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -26,6 +27,7 @@
import android.app.Instrumentation;
import android.app.ResourcesManager;
import android.content.res.Resources;
+import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.HandlerThread;
@@ -36,7 +38,8 @@
import androidx.test.platform.app.InstrumentationRegistry;
-import com.android.internal.os.RuntimeInit;
+import com.android.ravenwood.common.RavenwoodRuntimeException;
+import com.android.ravenwood.common.SneakyThrow;
import com.android.server.LocalServices;
import org.junit.runner.Description;
@@ -53,14 +56,25 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
-public class RavenwoodRuleImpl {
+/**
+ * Responsible for initializing and de-initializing the environment, according to a
+ * {@link RavenwoodConfig}.
+ */
+public class RavenwoodRuntimeEnvironmentController {
+ private static final String TAG = "RavenwoodRuntimeEnvironmentController";
+
+ private RavenwoodRuntimeEnvironmentController() {
+ }
+
private static final String MAIN_THREAD_NAME = "RavenwoodMain";
/**
* When enabled, attempt to dump all thread stacks just before we hit the
* overall Tradefed timeout, to aid in debugging deadlocks.
*/
- private static final boolean ENABLE_TIMEOUT_STACKS = false;
+ private static final boolean ENABLE_TIMEOUT_STACKS =
+ "1".equals(System.getenv("RAVENWOOD_ENABLE_TIMEOUT_STACKS"));
+
private static final int TIMEOUT_MILLIS = 9_000;
private static final ScheduledExecutorService sTimeoutExecutor =
@@ -68,10 +82,13 @@
private static ScheduledFuture<?> sPendingTimeout;
+ private static long sOriginalIdentityToken = -1;
+
/**
* When enabled, attempt to detect uncaught exceptions from background threads.
*/
- private static final boolean ENABLE_UNCAUGHT_EXCEPTION_DETECTION = false;
+ private static final boolean ENABLE_UNCAUGHT_EXCEPTION_DETECTION =
+ "1".equals(System.getenv("RAVENWOOD_ENABLE_UNCAUGHT_EXCEPTION_DETECTION"));
/**
* When set, an unhandled exception was discovered (typically on a background thread), and we
@@ -86,25 +103,59 @@
sPendingUncaughtException.compareAndSet(null, throwable);
};
- public static void init(RavenwoodRule rule) throws IOException {
+ // TODO: expose packCallingIdentity function in libbinder and use it directly
+ // See: packCallingIdentity in frameworks/native/libs/binder/IPCThreadState.cpp
+ private static long packBinderIdentityToken(
+ boolean hasExplicitIdentity, int callingUid, int callingPid) {
+ long res = ((long) callingUid << 32) | callingPid;
+ if (hasExplicitIdentity) {
+ res |= (0x1 << 30);
+ } else {
+ res &= ~(0x1 << 30);
+ }
+ return res;
+ }
+
+ private static RavenwoodConfig sConfig;
+
+ /**
+ * Initialize the environment.
+ */
+ public static void init(RavenwoodConfig config) throws IOException {
+ if (RAVENWOOD_VERBOSE_LOGGING) {
+ Log.i(TAG, "init() called here", new RuntimeException("STACKTRACE"));
+ }
+ try {
+ initInner(config);
+ } catch (Exception th) {
+ Log.e(TAG, "init() failed", th);
+ reset();
+ SneakyThrow.sneakyThrow(th);
+ }
+ }
+
+ private static void initInner(RavenwoodConfig config) throws IOException {
+ if (sConfig != null) {
+ throw new RavenwoodRuntimeException("Internal error: init() called without reset()");
+ }
+ sConfig = config;
if (ENABLE_UNCAUGHT_EXCEPTION_DETECTION) {
maybeThrowPendingUncaughtException(false);
Thread.setDefaultUncaughtExceptionHandler(sUncaughtExceptionHandler);
}
- RuntimeInit.redirectLogStreams();
-
- android.os.Process.init$ravenwood(rule.mUid, rule.mPid);
- android.os.Binder.init$ravenwood();
- setSystemProperties(rule.mSystemProperties);
+ android.os.Process.init$ravenwood(config.mUid, config.mPid);
+ sOriginalIdentityToken = Binder.clearCallingIdentity();
+ Binder.restoreCallingIdentity(packBinderIdentityToken(false, config.mUid, config.mPid));
+ setSystemProperties(config.mSystemProperties);
ServiceManager.init$ravenwood();
LocalServices.removeAllServicesForTest();
- ActivityManager.init$ravenwood(rule.mCurrentUser);
+ ActivityManager.init$ravenwood(config.mCurrentUser);
final HandlerThread main;
- if (rule.mProvideMainThread) {
+ if (config.mProvideMainThread) {
main = new HandlerThread(MAIN_THREAD_NAME);
main.start();
Looper.setMainLooperForTest(main.getLooper());
@@ -128,21 +179,22 @@
emptyPaths, emptyPaths, emptyPaths,
emptyPaths, null, null,
new DisplayAdjustments().getCompatibilityInfo(),
- RavenwoodRuleImpl.class.getClassLoader(), null);
+ RavenwoodRuntimeEnvironmentController.class.getClassLoader(), null);
assertNotNull(ret);
return ret;
};
- rule.mContext = new RavenwoodContext(rule.mPackageName, main, resourcesSupplier);
- rule.mInstrumentation = new Instrumentation();
- rule.mInstrumentation.basicInit(rule.mContext);
- InstrumentationRegistry.registerInstance(rule.mInstrumentation, Bundle.EMPTY);
+ config.mContext = new RavenwoodContext(config.mPackageName, main, resourcesSupplier);
+ config.mInstrumentation = new Instrumentation();
+ config.mInstrumentation.basicInit(config.mContext);
+ InstrumentationRegistry.registerInstance(config.mInstrumentation, Bundle.EMPTY);
- RavenwoodSystemServer.init(rule);
+ RavenwoodSystemServer.init(config);
if (ENABLE_TIMEOUT_STACKS) {
- sPendingTimeout = sTimeoutExecutor.schedule(RavenwoodRuleImpl::dumpStacks,
+ sPendingTimeout = sTimeoutExecutor.schedule(
+ RavenwoodRuntimeEnvironmentController::dumpStacks,
TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
}
@@ -151,21 +203,33 @@
Objects.requireNonNull(Build.VERSION.SDK);
}
- public static void reset(RavenwoodRule rule) {
+ /**
+ * De-initialize.
+ */
+ public static void reset() {
+ if (RAVENWOOD_VERBOSE_LOGGING) {
+ Log.i(TAG, "reset() called here", new RuntimeException("STACKTRACE"));
+ }
+ if (sConfig == null) {
+ throw new RavenwoodRuntimeException("Internal error: reset() already called");
+ }
+ var config = sConfig;
+ sConfig = null;
+
if (ENABLE_TIMEOUT_STACKS) {
sPendingTimeout.cancel(false);
}
- RavenwoodSystemServer.reset(rule);
+ RavenwoodSystemServer.reset(config);
InstrumentationRegistry.registerInstance(null, Bundle.EMPTY);
- rule.mInstrumentation = null;
- if (rule.mContext != null) {
- ((RavenwoodContext) rule.mContext).cleanUp();
+ config.mInstrumentation = null;
+ if (config.mContext != null) {
+ ((RavenwoodContext) config.mContext).cleanUp();
}
- rule.mContext = null;
+ config.mContext = null;
- if (rule.mProvideMainThread) {
+ if (config.mProvideMainThread) {
Looper.getMainLooper().quit();
Looper.clearMainLooperForTest();
}
@@ -176,7 +240,7 @@
ServiceManager.reset$ravenwood();
setSystemProperties(RavenwoodSystemProperties.DEFAULT_VALUES);
- android.os.Binder.reset$ravenwood();
+ Binder.restoreCallingIdentity(sOriginalIdentityToken);
android.os.Process.reset$ravenwood();
ResourcesManager.setInstance(null); // Better structure needed.
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodSystemServer.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodSystemServer.java
index cd6b61d..f3a93c1 100644
--- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodSystemServer.java
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodSystemServer.java
@@ -61,19 +61,19 @@
private static TimingsTraceAndSlog sTimings;
private static SystemServiceManager sServiceManager;
- public static void init(RavenwoodRule rule) {
+ public static void init(RavenwoodConfig config) {
// Avoid overhead if no services required
- if (rule.mServicesRequired.isEmpty()) return;
+ if (config.mServicesRequired.isEmpty()) return;
sStartedServices = new ArraySet<>();
sTimings = new TimingsTraceAndSlog();
- sServiceManager = new SystemServiceManager(rule.mContext);
+ sServiceManager = new SystemServiceManager(config.mContext);
sServiceManager.setStartInfo(false,
SystemClock.elapsedRealtime(),
SystemClock.uptimeMillis());
LocalServices.addService(SystemServiceManager.class, sServiceManager);
- startServices(rule.mServicesRequired);
+ startServices(config.mServicesRequired);
sServiceManager.sealStartedServices();
// TODO: expand to include additional boot phases when relevant
@@ -81,7 +81,7 @@
sServiceManager.startBootPhase(sTimings, SystemService.PHASE_BOOT_COMPLETED);
}
- public static void reset(RavenwoodRule rule) {
+ public static void reset(RavenwoodConfig config) {
// TODO: consider introducing shutdown boot phases
LocalServices.removeServiceForTest(SystemServiceManager.class);
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodTestStats.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodTestStats.java
index 631f68f..428eb57 100644
--- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodTestStats.java
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodTestStats.java
@@ -31,7 +31,7 @@
import java.util.Map;
/**
- * Creats a "stats" CSV file containing the test results.
+ * Collect test result stats and write them into a CSV file containing the test results.
*
* The output file is created as `/tmp/Ravenwood-stats_[TEST-MODULE=NAME]_[TIMESTAMP].csv`.
* A symlink to the latest result will be created as
@@ -41,6 +41,21 @@
private static final String TAG = "RavenwoodTestStats";
private static final String HEADER = "Module,Class,ClassDesc,Passed,Failed,Skipped";
+ private static RavenwoodTestStats sInstance;
+
+ /**
+ * @return a singleton instance.
+ */
+ public static RavenwoodTestStats getInstance() {
+ if (sInstance == null) {
+ sInstance = new RavenwoodTestStats();
+ }
+ return sInstance;
+ }
+
+ /**
+ * Represents a test result.
+ */
public enum Result {
Passed,
Failed,
@@ -113,21 +128,34 @@
});
}
+ /**
+ * Call it when a test class is skipped.
+ */
public void onClassSkipped(Description classDescription) {
addResult(classDescription, Description.EMPTY, Result.Skipped);
onClassFinished(classDescription);
}
+ /**
+ * Call it when a test method is finished.
+ */
public void onTestFinished(Description classDescription, Description testDescription,
Result result) {
addResult(classDescription, testDescription, result);
}
+ /**
+ * Call it when a test class is finished.
+ */
public void onClassFinished(Description classDescription) {
int passed = 0;
int skipped = 0;
int failed = 0;
- for (var e : mStats.get(classDescription).values()) {
+ var stats = mStats.get(classDescription);
+ if (stats == null) {
+ return;
+ }
+ for (var e : stats.values()) {
switch (e) {
case Passed: passed++; break;
case Skipped: skipped++; break;
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodAwareTestRunner.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodAwareTestRunner.java
index 7d99166..bc944d7 100644
--- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodAwareTestRunner.java
+++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodAwareTestRunner.java
@@ -15,21 +15,23 @@
*/
package android.platform.test.ravenwood;
+import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING;
import static com.android.ravenwood.common.RavenwoodCommonUtils.ensureIsPublicVoidMethod;
import static com.android.ravenwood.common.RavenwoodCommonUtils.isOnRavenwood;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.util.Log;
-import com.android.ravenwood.common.RavenwoodCommonUtils;
-import com.android.ravenwood.common.SneakyThrow;
-
import org.junit.Assume;
+import org.junit.AssumptionViolatedException;
import org.junit.internal.builders.AllDefaultPossibilitiesBuilder;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
+import org.junit.runner.Result;
import org.junit.runner.Runner;
import org.junit.runner.manipulation.Filter;
import org.junit.runner.manipulation.Filterable;
@@ -40,8 +42,11 @@
import org.junit.runner.manipulation.Sortable;
import org.junit.runner.manipulation.Sorter;
import org.junit.runner.notification.Failure;
+import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
+import org.junit.runner.notification.StoppedByUserException;
import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.MultipleFailureException;
import org.junit.runners.model.RunnerBuilder;
import org.junit.runners.model.Statement;
import org.junit.runners.model.TestClass;
@@ -52,6 +57,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Stack;
+import java.util.function.BiConsumer;
/**
* A test runner used for Ravenwood.
@@ -62,7 +70,7 @@
* the inner runner gets a chance to run. This can be used to initialize stuff used by the
* inner runner.
* - Add hook points, which are handed by RavenwoodAwareTestRunnerHook, with help from
- * the four test rules such as {@link #sImplicitClassMinRule}, which are also injected by
+ * the four test rules such as {@link #sImplicitClassOuterRule}, which are also injected by
* the ravenizer tool.
*
* We use this runner to:
@@ -74,8 +82,8 @@
* it will basically just delegate to the inner wrapper, and won't do anything special.
* (no hooks, etc.)
*/
-public class RavenwoodAwareTestRunner extends Runner implements Filterable, Orderable {
- private static final String TAG = "RavenwoodAwareTestRunner";
+public final class RavenwoodAwareTestRunner extends Runner implements Filterable, Orderable {
+ public static final String TAG = "Ravenwood";
@Inherited
@Target({TYPE})
@@ -96,40 +104,61 @@
/** Scope of a hook. */
public enum Scope {
- Runner,
Class,
Instance,
}
/** Order of a hook. */
public enum Order {
- First,
- Last,
+ Outer,
+ Inner,
}
// The following four rule instances will be injected to tests by the Ravenizer tool.
+ private static class RavenwoodClassOuterRule implements TestRule {
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return getCurrentRunner().wrapWithHooks(base, description, Scope.Class, Order.Outer);
+ }
+ }
- public static final TestRule sImplicitClassMinRule = (base, description) ->
- getCurrentRunner().updateStatement(base, description, Scope.Class, Order.First);
+ private static class RavenwoodClassInnerRule implements TestRule {
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return getCurrentRunner().wrapWithHooks(base, description, Scope.Class, Order.Inner);
+ }
+ }
- public static final TestRule sImplicitClassMaxRule = (base, description) ->
- getCurrentRunner().updateStatement(base, description, Scope.Class, Order.Last);
+ private static class RavenwoodInstanceOuterRule implements TestRule {
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return getCurrentRunner().wrapWithHooks(
+ base, description, Scope.Instance, Order.Outer);
+ }
+ }
- public static final TestRule sImplicitInstMinRule = (base, description) ->
- getCurrentRunner().updateStatement(base, description, Scope.Instance, Order.First);
+ private static class RavenwoodInstanceInnerRule implements TestRule {
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return getCurrentRunner().wrapWithHooks(
+ base, description, Scope.Instance, Order.Inner);
+ }
+ }
- public static final TestRule sImplicitInstMaxRule = (base, description) ->
- getCurrentRunner().updateStatement(base, description, Scope.Instance, Order.Last);
+ public static final TestRule sImplicitClassOuterRule = new RavenwoodClassOuterRule();
+ public static final TestRule sImplicitClassInnerRule = new RavenwoodClassInnerRule();
+ public static final TestRule sImplicitInstOuterRule = new RavenwoodInstanceOuterRule();
+ public static final TestRule sImplicitInstInnerRule = new RavenwoodInstanceOuterRule();
- public static final String IMPLICIT_CLASS_MIN_RULE_NAME = "sImplicitClassMinRule";
- public static final String IMPLICIT_CLASS_MAX_RULE_NAME = "sImplicitClassMaxRule";
- public static final String IMPLICIT_INST_MIN_RULE_NAME = "sImplicitInstMinRule";
- public static final String IMPLICIT_INST_MAX_RULE_NAME = "sImplicitInstMaxRule";
+ public static final String IMPLICIT_CLASS_OUTER_RULE_NAME = "sImplicitClassOuterRule";
+ public static final String IMPLICIT_CLASS_INNER_RULE_NAME = "sImplicitClassInnerRule";
+ public static final String IMPLICIT_INST_OUTER_RULE_NAME = "sImplicitInstOuterRule";
+ public static final String IMPLICIT_INST_INNER_RULE_NAME = "sImplicitInstInnerRule";
/** Keeps track of the runner on the current thread. */
private static final ThreadLocal<RavenwoodAwareTestRunner> sCurrentRunner = new ThreadLocal<>();
- private static RavenwoodAwareTestRunner getCurrentRunner() {
+ static RavenwoodAwareTestRunner getCurrentRunner() {
var runner = sCurrentRunner.get();
if (runner == null) {
throw new RuntimeException("Current test runner not set!");
@@ -142,16 +171,9 @@
private Description mDescription = null;
private Throwable mExceptionInConstructor = null;
- /** Simple logging method. */
- private void log(String message) {
- RavenwoodCommonUtils.log(TAG, "[" + getTestClass().getJavaClass() + " @" + this + "] "
- + message);
- }
-
- private Error logAndFail(String message, Throwable innerException) {
- log(message);
- log(" Exception=" + innerException);
- throw new AssertionError(message, innerException);
+ private Error logAndFail(String message, Throwable exception) {
+ Log.e(TAG, message, exception);
+ throw new AssertionError(message, exception);
}
public TestClass getTestClass() {
@@ -165,6 +187,10 @@
try {
mTestClass = new TestClass(testClass);
+ Log.v(TAG, "RavenwoodAwareTestRunner starting for " + testClass.getCanonicalName());
+
+ onRunnerInitializing();
+
/*
* If the class has @DisabledOnRavenwood, then we'll delegate to
* ClassSkippingTestRunner, which simply skips it.
@@ -186,10 +212,8 @@
realRunnerClass = BlockJUnit4ClassRunner.class;
}
- onRunnerInitializing();
-
try {
- log("Initializing the inner runner: " + realRunnerClass);
+ Log.i(TAG, "Initializing the inner runner: " + realRunnerClass);
mRealRunner = instantiateRealRunner(realRunnerClass, testClass);
mDescription = mRealRunner.getDescription();
@@ -201,8 +225,7 @@
} catch (Throwable th) {
// If we throw in the constructor, Tradefed may not report it and just ignore the class,
// so record it and throw it when the test actually started.
- log("Fatal: Exception detected in constructor: " + th.getMessage() + "\n"
- + Log.getStackTraceString(th));
+ Log.e(TAG, "Fatal: Exception detected in constructor", th);
mExceptionInConstructor = new RuntimeException("Exception detected in constructor",
th);
mDescription = Description.createTestDescription(testClass, "Constructor");
@@ -236,8 +259,7 @@
if (!isOnRavenwood()) {
return;
}
-
- log("onRunnerInitializing");
+ // DO NOT USE android.util.Log before calling onRunnerInitializing().
RavenwoodAwareTestRunnerHook.onRunnerInitializing(this, mTestClass);
@@ -250,7 +272,7 @@
if (!isOnRavenwood()) {
return;
}
- log("runAnnotatedMethodsOnRavenwood() " + annotationClass.getName());
+ Log.v(TAG, "runAnnotatedMethodsOnRavenwood() " + annotationClass.getName());
for (var method : getTestClass().getAnnotatedMethods(annotationClass)) {
ensureIsPublicVoidMethod(method.getMethod(), /* isStatic=*/ instance == null);
@@ -271,23 +293,46 @@
}
@Override
- public void run(RunNotifier notifier) {
+ public void run(RunNotifier realNotifier) {
+ final RavenwoodRunNotifier notifier = new RavenwoodRunNotifier(realNotifier);
+
if (mRealRunner instanceof ClassSkippingTestRunner) {
mRealRunner.run(notifier);
RavenwoodAwareTestRunnerHook.onClassSkipped(getDescription());
return;
}
+ Log.v(TAG, "Starting " + mTestClass.getJavaClass().getCanonicalName());
+ if (RAVENWOOD_VERBOSE_LOGGING) {
+ dumpDescription(getDescription());
+ }
+
if (maybeReportExceptionFromConstructor(notifier)) {
return;
}
sCurrentRunner.set(this);
try {
- runWithHooks(getDescription(), Scope.Runner, Order.First,
- () -> mRealRunner.run(notifier));
+ try {
+ RavenwoodAwareTestRunnerHook.onBeforeInnerRunnerStart(
+ this, getDescription());
+ } catch (Throwable th) {
+ notifier.reportBeforeTestFailure(getDescription(), th);
+ return;
+ }
+
+ // Delegate to the inner runner.
+ mRealRunner.run(notifier);
} finally {
sCurrentRunner.remove();
+
+ try {
+ RavenwoodAwareTestRunnerHook.onAfterInnerRunnerFinished(
+ this, getDescription());
+ } catch (Throwable th) {
+ notifier.reportAfterTestFailure(th);
+ return;
+ }
}
}
@@ -324,7 +369,7 @@
}
}
- private Statement updateStatement(Statement base, Description description, Scope scope,
+ private Statement wrapWithHooks(Statement base, Description description, Scope scope,
Order order) {
if (!isOnRavenwood()) {
return base;
@@ -337,7 +382,8 @@
};
}
- private void runWithHooks(Description description, Scope scope, Order order, Runnable r) {
+ private void runWithHooks(Description description, Scope scope, Order order, Runnable r)
+ throws Throwable {
runWithHooks(description, scope, order, new Statement() {
@Override
public void evaluate() throws Throwable {
@@ -346,7 +392,8 @@
});
}
- private void runWithHooks(Description description, Scope scope, Order order, Statement s) {
+ private void runWithHooks(Description description, Scope scope, Order order, Statement s)
+ throws Throwable {
if (isOnRavenwood()) {
Assume.assumeTrue(
RavenwoodAwareTestRunnerHook.onBefore(this, description, scope, order));
@@ -363,7 +410,7 @@
this, description, scope, order, t);
}
if (shouldThrow) {
- SneakyThrow.sneakyThrow(t);
+ throw t;
}
}
}
@@ -409,4 +456,254 @@
}
}
}
+
+ private void dumpDescription(Description desc) {
+ dumpDescription(desc, "[TestDescription]=", " ");
+ }
+
+ private void dumpDescription(Description desc, String header, String indent) {
+ Log.v(TAG, indent + header + desc);
+
+ var children = desc.getChildren();
+ var childrenIndent = " " + indent;
+ for (int i = 0; i < children.size(); i++) {
+ dumpDescription(children.get(i), "#" + i + ": ", childrenIndent);
+ }
+ }
+
+ /**
+ * A run notifier that wraps another notifier and provides the following features:
+ * - Handle a failure that happened before testStarted and testEnded (typically that means
+ * it's from @BeforeClass or @AfterClass, or a @ClassRule) and deliver it as if
+ * individual tests in the class reported it. This is for b/364395552.
+ *
+ * - Logging.
+ */
+ private class RavenwoodRunNotifier extends RunNotifier {
+ private final RunNotifier mRealNotifier;
+
+ private final Stack<Description> mSuiteStack = new Stack<>();
+ private Description mCurrentSuite = null;
+ private final ArrayList<Throwable> mOutOfTestFailures = new ArrayList<>();
+
+ private boolean mBeforeTest = true;
+ private boolean mAfterTest = false;
+
+ private RavenwoodRunNotifier(RunNotifier realNotifier) {
+ mRealNotifier = realNotifier;
+ }
+
+ private boolean isInTest() {
+ return !mBeforeTest && !mAfterTest;
+ }
+
+ @Override
+ public void addListener(RunListener listener) {
+ mRealNotifier.addListener(listener);
+ }
+
+ @Override
+ public void removeListener(RunListener listener) {
+ mRealNotifier.removeListener(listener);
+ }
+
+ @Override
+ public void addFirstListener(RunListener listener) {
+ mRealNotifier.addFirstListener(listener);
+ }
+
+ @Override
+ public void fireTestRunStarted(Description description) {
+ Log.i(TAG, "testRunStarted: " + description);
+ mRealNotifier.fireTestRunStarted(description);
+ }
+
+ @Override
+ public void fireTestRunFinished(Result result) {
+ Log.i(TAG, "testRunFinished: "
+ + result.getRunCount() + ","
+ + result.getFailureCount() + ","
+ + result.getAssumptionFailureCount() + ","
+ + result.getIgnoreCount());
+ mRealNotifier.fireTestRunFinished(result);
+ }
+
+ @Override
+ public void fireTestSuiteStarted(Description description) {
+ Log.i(TAG, "testSuiteStarted: " + description);
+ mRealNotifier.fireTestSuiteStarted(description);
+
+ mBeforeTest = true;
+ mAfterTest = false;
+
+ // Keep track of the current suite, needed if the outer test is a Suite,
+ // in which case its children are test classes. (not test methods)
+ mCurrentSuite = description;
+ mSuiteStack.push(description);
+
+ mOutOfTestFailures.clear();
+ }
+
+ @Override
+ public void fireTestSuiteFinished(Description description) {
+ Log.i(TAG, "testSuiteFinished: " + description);
+ mRealNotifier.fireTestSuiteFinished(description);
+
+ maybeHandleOutOfTestFailures();
+
+ mBeforeTest = true;
+ mAfterTest = false;
+
+ // Restore the upper suite.
+ mSuiteStack.pop();
+ mCurrentSuite = mSuiteStack.size() == 0 ? null : mSuiteStack.peek();
+ }
+
+ @Override
+ public void fireTestStarted(Description description) throws StoppedByUserException {
+ Log.i(TAG, "testStarted: " + description);
+ mRealNotifier.fireTestStarted(description);
+
+ mAfterTest = false;
+ mBeforeTest = false;
+ }
+
+ @Override
+ public void fireTestFailure(Failure failure) {
+ Log.i(TAG, "testFailure: " + failure);
+
+ if (isInTest()) {
+ mRealNotifier.fireTestFailure(failure);
+ } else {
+ mOutOfTestFailures.add(failure.getException());
+ }
+ }
+
+ @Override
+ public void fireTestAssumptionFailed(Failure failure) {
+ Log.i(TAG, "testAssumptionFailed: " + failure);
+
+ if (isInTest()) {
+ mRealNotifier.fireTestAssumptionFailed(failure);
+ } else {
+ mOutOfTestFailures.add(failure.getException());
+ }
+ }
+
+ @Override
+ public void fireTestIgnored(Description description) {
+ Log.i(TAG, "testIgnored: " + description);
+ mRealNotifier.fireTestIgnored(description);
+ }
+
+ @Override
+ public void fireTestFinished(Description description) {
+ Log.i(TAG, "testFinished: " + description);
+ mRealNotifier.fireTestFinished(description);
+
+ mAfterTest = true;
+ }
+
+ @Override
+ public void pleaseStop() {
+ Log.w(TAG, "pleaseStop:");
+ mRealNotifier.pleaseStop();
+ }
+
+ /**
+ * At the end of each Suite, we handle failures happened out of test methods.
+ * (typically in @BeforeClass or @AfterClasses)
+ *
+ * This is to work around b/364395552.
+ */
+ private boolean maybeHandleOutOfTestFailures() {
+ if (mOutOfTestFailures.size() == 0) {
+ return false;
+ }
+ Throwable th;
+ if (mOutOfTestFailures.size() == 1) {
+ th = mOutOfTestFailures.get(0);
+ } else {
+ th = new MultipleFailureException(mOutOfTestFailures);
+ }
+ if (mBeforeTest) {
+ reportBeforeTestFailure(mCurrentSuite, th);
+ return true;
+ }
+ if (mAfterTest) {
+ reportAfterTestFailure(th);
+ return true;
+ }
+ return false;
+ }
+
+ public void reportBeforeTestFailure(Description suiteDesc, Throwable th) {
+ // If a failure happens befere running any tests, we'll need to pretend
+ // as if each test in the suite reported the failure, to work around b/364395552.
+ for (var child : suiteDesc.getChildren()) {
+ if (child.isSuite()) {
+ // If the chiil is still a "parent" -- a test class or a test suite
+ // -- propagate to its children.
+ mRealNotifier.fireTestSuiteStarted(child);
+ reportBeforeTestFailure(child, th);
+ mRealNotifier.fireTestSuiteFinished(child);
+ } else {
+ mRealNotifier.fireTestStarted(child);
+ Failure f = new Failure(child, th);
+ if (th instanceof AssumptionViolatedException) {
+ mRealNotifier.fireTestAssumptionFailed(f);
+ } else {
+ mRealNotifier.fireTestFailure(f);
+ }
+ mRealNotifier.fireTestFinished(child);
+ }
+ }
+ }
+
+ public void reportAfterTestFailure(Throwable th) {
+ // Unfortunately, there's no good way to report it, so kill the own process.
+ onCriticalError(
+ "Failures detected in @AfterClass, which would be swallowed by tradefed",
+ th);
+ }
+ }
+
+ private static volatile BiConsumer<String, Throwable> sCriticalErrorHanler;
+
+ private void onCriticalError(@NonNull String message, @Nullable Throwable th) {
+ Log.e(TAG, "Critical error! " + message, th);
+ var handler = sCriticalErrorHanler;
+ if (handler == null) {
+ handler = sDefaultCriticalErrorHandler;
+ }
+ handler.accept(message, th);
+ }
+
+ private static BiConsumer<String, Throwable> sDefaultCriticalErrorHandler = (message, th) -> {
+ Log.e(TAG, "Ravenwood cannot continue. Killing self process.", th);
+ System.exit(1);
+ };
+
+ /**
+ * Contains Ravenwood private APIs.
+ */
+ public static class RavenwoodPrivate {
+ private RavenwoodPrivate() {
+ }
+
+ /**
+ * Set a listener for onCriticalError(), for testing. If a listener is set, we won't call
+ * System.exit().
+ */
+ public void setCriticalErrorHandler(
+ @Nullable BiConsumer<String, Throwable> handler) {
+ sCriticalErrorHanler = handler;
+ }
+ }
+
+ private static final RavenwoodPrivate sRavenwoodPrivate = new RavenwoodPrivate();
+
+ public static RavenwoodPrivate private$ravenwood() {
+ return sRavenwoodPrivate;
+ }
}
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java
new file mode 100644
index 0000000..04e0bed
--- /dev/null
+++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodConfig.java
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.platform.test.ravenwood;
+
+import static android.os.Process.FIRST_APPLICATION_UID;
+import static android.os.Process.SYSTEM_UID;
+import static android.os.UserHandle.SYSTEM;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.app.Instrumentation;
+import android.content.Context;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Represents how to configure the ravenwood environment for a test class.
+ *
+ * If a ravenwood test class has a public static field with the {@link Config} annotation,
+ * Ravenwood will extract the config from it and initializes the environment. The type of the
+ * field must be of {@link RavenwoodConfig}.
+ */
+public final class RavenwoodConfig {
+ /**
+ * Use this to mark a field as the configuration.
+ * @hide
+ */
+ @Target({ElementType.FIELD})
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Config {
+ }
+
+ private static final int NOBODY_UID = 9999;
+
+ private static final AtomicInteger sNextPid = new AtomicInteger(100);
+
+ int mCurrentUser = SYSTEM.getIdentifier();
+
+ /**
+ * Unless the test author requests differently, run as "nobody", and give each collection of
+ * tests its own unique PID.
+ */
+ int mUid = NOBODY_UID;
+ int mPid = sNextPid.getAndIncrement();
+
+ String mPackageName;
+
+ boolean mProvideMainThread = false;
+
+ final RavenwoodSystemProperties mSystemProperties = new RavenwoodSystemProperties();
+
+ final List<Class<?>> mServicesRequired = new ArrayList<>();
+
+ volatile Context mContext;
+ volatile Instrumentation mInstrumentation;
+
+ private RavenwoodConfig() {
+ }
+
+ /**
+ * Return if the current process is running on a Ravenwood test environment.
+ */
+ public static boolean isOnRavenwood() {
+ return RavenwoodRule.isOnRavenwood();
+ }
+
+ public static class Builder {
+ private final RavenwoodConfig mConfig = new RavenwoodConfig();
+
+ public Builder() {
+ }
+
+ /**
+ * Configure the identity of this process to be the system UID for the duration of the
+ * test. Has no effect on non-Ravenwood environments.
+ */
+ public Builder setProcessSystem() {
+ mConfig.mUid = SYSTEM_UID;
+ return this;
+ }
+
+ /**
+ * Configure the identity of this process to be an app UID for the duration of the
+ * test. Has no effect on non-Ravenwood environments.
+ */
+ public Builder setProcessApp() {
+ mConfig.mUid = FIRST_APPLICATION_UID;
+ return this;
+ }
+
+ /**
+ * Configure the identity of this process to be the given package name for the duration
+ * of the test. Has no effect on non-Ravenwood environments.
+ */
+ public Builder setPackageName(@NonNull String packageName) {
+ mConfig.mPackageName = Objects.requireNonNull(packageName);
+ return this;
+ }
+
+ /**
+ * Configure a "main" thread to be available for the duration of the test, as defined
+ * by {@code Looper.getMainLooper()}. Has no effect on non-Ravenwood environments.
+ */
+ public Builder setProvideMainThread(boolean provideMainThread) {
+ mConfig.mProvideMainThread = provideMainThread;
+ return this;
+ }
+
+ /**
+ * Configure the given system property as immutable for the duration of the test.
+ * Read access to the key is allowed, and write access will fail. When {@code value} is
+ * {@code null}, the value is left as undefined.
+ *
+ * All properties in the {@code debug.*} namespace are automatically mutable, with no
+ * developer action required.
+ *
+ * Has no effect on non-Ravenwood environments.
+ */
+ public Builder setSystemPropertyImmutable(@NonNull String key,
+ @Nullable Object value) {
+ mConfig.mSystemProperties.setValue(key, value);
+ mConfig.mSystemProperties.setAccessReadOnly(key);
+ return this;
+ }
+
+ /**
+ * Configure the given system property as mutable for the duration of the test.
+ * Both read and write access to the key is allowed, and its value will be reset between
+ * each test. When {@code value} is {@code null}, the value is left as undefined.
+ *
+ * All properties in the {@code debug.*} namespace are automatically mutable, with no
+ * developer action required.
+ *
+ * Has no effect on non-Ravenwood environments.
+ */
+ public Builder setSystemPropertyMutable(@NonNull String key,
+ @Nullable Object value) {
+ mConfig.mSystemProperties.setValue(key, value);
+ mConfig.mSystemProperties.setAccessReadWrite(key);
+ return this;
+ }
+
+ /**
+ * Configure the set of system services that are required for this test to operate.
+ *
+ * For example, passing {@code android.hardware.SerialManager.class} as an argument will
+ * ensure that the underlying service is created, initialized, and ready to use for the
+ * duration of the test. The {@code SerialManager} instance can be obtained via
+ * {@code RavenwoodRule.getContext()} and {@code Context.getSystemService()}, and
+ * {@code SerialManagerInternal} can be obtained via {@code LocalServices.getService()}.
+ */
+ public Builder setServicesRequired(@NonNull Class<?>... services) {
+ mConfig.mServicesRequired.clear();
+ for (Class<?> service : services) {
+ mConfig.mServicesRequired.add(service);
+ }
+ return this;
+ }
+
+ public RavenwoodConfig build() {
+ return mConfig;
+ }
+ }
+}
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java
index d569896..7847e7c 100644
--- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java
+++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java
@@ -16,17 +16,13 @@
package android.platform.test.ravenwood;
-import static android.os.Process.FIRST_APPLICATION_UID;
-import static android.os.Process.SYSTEM_UID;
-import static android.os.UserHandle.SYSTEM;
-
import static com.android.ravenwood.common.RavenwoodCommonUtils.log;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Instrumentation;
import android.content.Context;
import android.platform.test.annotations.DisabledOnRavenwood;
-import android.platform.test.annotations.EnabledOnRavenwood;
import com.android.ravenwood.common.RavenwoodCommonUtils;
@@ -34,26 +30,17 @@
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Objects;
-import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
/**
- * {@code @Rule} that configures the Ravenwood test environment. This rule has no effect when
- * tests are run on non-Ravenwood test environments.
- *
- * This rule initializes and resets the Ravenwood environment between each test method to offer a
- * hermetic testing environment.
- *
- * By default, all tests are executed on Ravenwood, but annotations such as
- * {@link DisabledOnRavenwood} and {@link EnabledOnRavenwood} can be used at both the method
- * and class level to "ignore" tests that may not be ready. When needed, a
- * {@link RavenwoodClassRule} can be used in addition to a {@link RavenwoodRule} to ignore tests
- * before a test class is fully initialized.
+ * @deprecated Use {@link RavenwoodConfig} to configure the ravenwood environment instead.
+ * A {@link RavenwoodRule} is no longer needed for {@link DisabledOnRavenwood}. To get the
+ * {@link Context} and {@link Instrumentation}, use
+ * {@link androidx.test.platform.app.InstrumentationRegistry} instead.
*/
-public class RavenwoodRule implements TestRule {
+@Deprecated
+public final class RavenwoodRule implements TestRule {
private static final String TAG = "RavenwoodRule";
static final boolean IS_ON_RAVENWOOD = RavenwoodCommonUtils.isOnRavenwood();
@@ -105,35 +92,19 @@
}
}
- private static final int NOBODY_UID = 9999;
-
- private static final AtomicInteger sNextPid = new AtomicInteger(100);
-
- int mCurrentUser = SYSTEM.getIdentifier();
-
- /**
- * Unless the test author requests differently, run as "nobody", and give each collection of
- * tests its own unique PID.
- */
- int mUid = NOBODY_UID;
- int mPid = sNextPid.getAndIncrement();
-
- String mPackageName;
-
- boolean mProvideMainThread = false;
-
- final RavenwoodSystemProperties mSystemProperties = new RavenwoodSystemProperties();
-
- final List<Class<?>> mServicesRequired = new ArrayList<>();
-
- volatile Context mContext;
- volatile Instrumentation mInstrumentation;
+ private final RavenwoodConfig mConfiguration;
public RavenwoodRule() {
+ mConfiguration = new RavenwoodConfig.Builder().build();
+ }
+
+ private RavenwoodRule(RavenwoodConfig config) {
+ mConfiguration = config;
}
public static class Builder {
- private RavenwoodRule mRule = new RavenwoodRule();
+ private final RavenwoodConfig.Builder mBuilder =
+ new RavenwoodConfig.Builder();
public Builder() {
}
@@ -143,7 +114,7 @@
* test. Has no effect on non-Ravenwood environments.
*/
public Builder setProcessSystem() {
- mRule.mUid = SYSTEM_UID;
+ mBuilder.setProcessSystem();
return this;
}
@@ -152,7 +123,7 @@
* test. Has no effect on non-Ravenwood environments.
*/
public Builder setProcessApp() {
- mRule.mUid = FIRST_APPLICATION_UID;
+ mBuilder.setProcessApp();
return this;
}
@@ -160,8 +131,8 @@
* Configure the identity of this process to be the given package name for the duration
* of the test. Has no effect on non-Ravenwood environments.
*/
- public Builder setPackageName(/* @NonNull */ String packageName) {
- mRule.mPackageName = Objects.requireNonNull(packageName);
+ public Builder setPackageName(@NonNull String packageName) {
+ mBuilder.setPackageName(packageName);
return this;
}
@@ -170,7 +141,7 @@
* by {@code Looper.getMainLooper()}. Has no effect on non-Ravenwood environments.
*/
public Builder setProvideMainThread(boolean provideMainThread) {
- mRule.mProvideMainThread = provideMainThread;
+ mBuilder.setProvideMainThread(provideMainThread);
return this;
}
@@ -184,10 +155,8 @@
*
* Has no effect on non-Ravenwood environments.
*/
- public Builder setSystemPropertyImmutable(/* @NonNull */ String key,
- /* @Nullable */ Object value) {
- mRule.mSystemProperties.setValue(key, value);
- mRule.mSystemProperties.setAccessReadOnly(key);
+ public Builder setSystemPropertyImmutable(@NonNull String key, @Nullable Object value) {
+ mBuilder.setSystemPropertyImmutable(key, value);
return this;
}
@@ -201,10 +170,8 @@
*
* Has no effect on non-Ravenwood environments.
*/
- public Builder setSystemPropertyMutable(/* @NonNull */ String key,
- /* @Nullable */ Object value) {
- mRule.mSystemProperties.setValue(key, value);
- mRule.mSystemProperties.setAccessReadWrite(key);
+ public Builder setSystemPropertyMutable(@NonNull String key, @Nullable Object value) {
+ mBuilder.setSystemPropertyMutable(key, value);
return this;
}
@@ -217,16 +184,13 @@
* {@code RavenwoodRule.getContext()} and {@code Context.getSystemService()}, and
* {@code SerialManagerInternal} can be obtained via {@code LocalServices.getService()}.
*/
- public Builder setServicesRequired(Class<?>... services) {
- mRule.mServicesRequired.clear();
- for (Class<?> service : services) {
- mRule.mServicesRequired.add(service);
- }
+ public Builder setServicesRequired(@NonNull Class<?>... services) {
+ mBuilder.setServicesRequired(services);
return this;
}
public RavenwoodRule build() {
- return mRule;
+ return new RavenwoodRule(mBuilder.build());
}
}
@@ -246,41 +210,44 @@
}
/**
- * Return a {@code Context} available for usage during the currently running test case.
- *
- * Each test should obtain needed information or references via this method;
- * references must not be stored beyond the scope of a test case.
+ * @deprecated Use
+ * {@code androidx.test.platform.app.InstrumentationRegistry.getInstrumentation().getContext()}
+ * instead.
*/
+ @Deprecated
public Context getContext() {
- return Objects.requireNonNull(mContext,
+ return Objects.requireNonNull(mConfiguration.mContext,
"Context is only available during @Test execution");
}
/**
- * Return a {@code Instrumentation} available for usage during the currently running test case.
- *
- * Each test should obtain needed information or references via this method;
- * references must not be stored beyond the scope of a test case.
+ * @deprecated Use
+ * {@code androidx.test.platform.app.InstrumentationRegistry.getInstrumentation()}
+ * instead.
*/
+ @Deprecated
public Instrumentation getInstrumentation() {
- return Objects.requireNonNull(mInstrumentation,
+ return Objects.requireNonNull(mConfiguration.mInstrumentation,
"Instrumentation is only available during @Test execution");
}
-
@Override
public Statement apply(Statement base, Description description) {
- // TODO: Here, we're calling init() / reset() once for each rule.
- // That means if a test class has multiple rules -- even if they refer to the same
- // rule instance -- we're calling them multiple times. We need to fix it.
+ if (!RavenwoodConfig.isOnRavenwood()) {
+ return base;
+ }
return new Statement() {
@Override
public void evaluate() throws Throwable {
- RavenwoodRuleImpl.init(RavenwoodRule.this);
+ RavenwoodAwareTestRunnerHook.onRavenwoodRuleEnter(
+ RavenwoodAwareTestRunner.getCurrentRunner(), description,
+ RavenwoodRule.this);
try {
base.evaluate();
} finally {
- RavenwoodRuleImpl.reset(RavenwoodRule.this);
+ RavenwoodAwareTestRunnerHook.onRavenwoodRuleExit(
+ RavenwoodAwareTestRunner.getCurrentRunner(), description,
+ RavenwoodRule.this);
}
}
};
@@ -339,4 +306,8 @@
public static RavenwoodPrivate private$ravenwood() {
return sRavenwoodPrivate;
}
+
+ RavenwoodConfig getConfiguration() {
+ return mConfiguration;
+ }
}
diff --git a/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java b/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
index 1e4889c..0178b93 100644
--- a/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
+++ b/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
@@ -19,7 +19,6 @@
import android.platform.test.ravenwood.RavenwoodAwareTestRunner.Scope;
import org.junit.runner.Description;
-import org.junit.runner.Runner;
import org.junit.runners.model.TestClass;
/**
@@ -38,7 +37,7 @@
/**
* Called when a runner starts, before the inner runner gets a chance to run.
*/
- public static void onRunnerInitializing(Runner runner, TestClass testClass) {
+ public static void onRunnerInitializing(RavenwoodAwareTestRunner runner, TestClass testClass) {
}
/**
@@ -48,15 +47,38 @@
}
/**
+ * Called before the inner runner starts.
+ */
+ public static void onBeforeInnerRunnerStart(
+ RavenwoodAwareTestRunner runner, Description description) throws Throwable {
+ }
+
+ /**
+ * Called after the inner runner finished.
+ */
+ public static void onAfterInnerRunnerFinished(
+ RavenwoodAwareTestRunner runner, Description description) throws Throwable {
+ }
+
+ /**
* Called before a test / class.
*
* Return false if it should be skipped.
*/
public static boolean onBefore(RavenwoodAwareTestRunner runner, Description description,
- Scope scope, Order order) {
+ Scope scope, Order order) throws Throwable {
return true;
}
+ public static void onRavenwoodRuleEnter(RavenwoodAwareTestRunner runner,
+ Description description, RavenwoodRule rule) throws Throwable {
+ }
+
+ public static void onRavenwoodRuleExit(RavenwoodAwareTestRunner runner,
+ Description description, RavenwoodRule rule) throws Throwable {
+ }
+
+
/**
* Called after a test / class.
*
diff --git a/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java b/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java
deleted file mode 100644
index a470626..0000000
--- a/ravenwood/junit-stub-src/android/platform/test/ravenwood/RavenwoodRuleImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.platform.test.ravenwood;
-
-import org.junit.runner.Description;
-
-public class RavenwoodRuleImpl {
- public static void init(RavenwoodRule rule) {
- // No-op when running on a real device
- }
-
- public static void reset(RavenwoodRule rule) {
- // No-op when running on a real device
- }
-
- public static void logTestRunner(String label, Description description) {
- // No-op when running on a real device
- }
-
- public static long realCurrentTimeMillis() {
- return System.currentTimeMillis();
- }
-}
diff --git a/ravenwood/mockito/Android.bp b/ravenwood/mockito/Android.bp
index 95c7394..d91537b 100644
--- a/ravenwood/mockito/Android.bp
+++ b/ravenwood/mockito/Android.bp
@@ -21,9 +21,9 @@
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
auto_gen_config: true,
}
@@ -48,9 +48,9 @@
"mockito-target-extended-minus-junit4",
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
// Required by mockito
diff --git a/ravenwood/runtime-common-src/com/android/ravenwood/common/RavenwoodCommonUtils.java b/ravenwood/runtime-common-src/com/android/ravenwood/common/RavenwoodCommonUtils.java
index 7b5bc5a..96746c6 100644
--- a/ravenwood/runtime-common-src/com/android/ravenwood/common/RavenwoodCommonUtils.java
+++ b/ravenwood/runtime-common-src/com/android/ravenwood/common/RavenwoodCommonUtils.java
@@ -15,12 +15,18 @@
*/
package com.android.ravenwood.common;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
import com.android.ravenwood.common.divergence.RavenwoodDivergence;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
@@ -33,6 +39,14 @@
private static final Object sLock = new Object();
+ /**
+ * If set to "1", we enable the verbose logging.
+ *
+ * (See also InitLogging() in http://ac/system/libbase/logging.cpp)
+ */
+ public static final boolean RAVENWOOD_VERBOSE_LOGGING = "1".equals(System.getenv(
+ "RAVENWOOD_VERBOSE"));
+
/** Name of `libravenwood_runtime` */
private static final String RAVENWOOD_NATIVE_RUNTIME_NAME = "ravenwood_runtime";
@@ -265,4 +279,24 @@
method.getDeclaringClass().getName(), method.getName(),
(isStatic ? "static " : "")));
}
+
+ public static void ensureIsPublicMember(Member member, boolean isStatic) {
+ var ok = Modifier.isPublic(member.getModifiers())
+ && (Modifier.isStatic(member.getModifiers()) == isStatic);
+ if (ok) {
+ return; // okay
+ }
+ throw new AssertionError(String.format(
+ "%s.%s expected to be public %s",
+ member.getDeclaringClass().getName(), member.getName(),
+ (isStatic ? "static" : "")));
+ }
+
+ @NonNull
+ public static String getStackTraceString(@Nullable Throwable th) {
+ StringWriter stringWriter = new StringWriter();
+ PrintWriter writer = new PrintWriter(stringWriter);
+ th.printStackTrace(writer);
+ return stringWriter.toString();
+ }
}
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/CursorWindow_host.java b/ravenwood/runtime-helper-src/framework/android/database/CursorWindow_host.java
similarity index 89%
rename from ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/CursorWindow_host.java
rename to ravenwood/runtime-helper-src/framework/android/database/CursorWindow_host.java
index f38d565..e21a9cd 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/CursorWindow_host.java
+++ b/ravenwood/runtime-helper-src/framework/android/database/CursorWindow_host.java
@@ -13,9 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.platform.test.ravenwood.nativesubstitution;
+package android.database;
-import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.os.Parcel;
import android.util.Base64;
@@ -35,8 +34,8 @@
private String mName;
private int mColumnNum;
private static class Row {
- String[] fields;
- int[] types;
+ String[] mFields;
+ int[] mTypes;
}
private final List<Row> mRows = new ArrayList<>();
@@ -69,9 +68,9 @@
public static boolean nativeAllocRow(long windowPtr) {
CursorWindow_host instance = sInstances.get(windowPtr);
Row row = new Row();
- row.fields = new String[instance.mColumnNum];
- row.types = new int[instance.mColumnNum];
- Arrays.fill(row.types, Cursor.FIELD_TYPE_NULL);
+ row.mFields = new String[instance.mColumnNum];
+ row.mTypes = new int[instance.mColumnNum];
+ Arrays.fill(row.mTypes, Cursor.FIELD_TYPE_NULL);
instance.mRows.add(row);
return true;
}
@@ -82,8 +81,8 @@
return false;
}
Row r = instance.mRows.get(row);
- r.fields[column] = value;
- r.types[column] = type;
+ r.mFields[column] = value;
+ r.mTypes[column] = type;
return true;
}
@@ -93,7 +92,7 @@
return Cursor.FIELD_TYPE_NULL;
}
- return instance.mRows.get(row).types[column];
+ return instance.mRows.get(row).mTypes[column];
}
public static boolean nativePutString(long windowPtr, String value,
@@ -107,7 +106,7 @@
return null;
}
- return instance.mRows.get(row).fields[column];
+ return instance.mRows.get(row).mFields[column];
}
public static boolean nativePutLong(long windowPtr, long value, int row, int column) {
@@ -170,8 +169,8 @@
parcel.writeInt(window.mColumnNum);
parcel.writeInt(window.mRows.size());
for (int row = 0; row < window.mRows.size(); row++) {
- parcel.writeStringArray(window.mRows.get(row).fields);
- parcel.writeIntArray(window.mRows.get(row).types);
+ parcel.writeStringArray(window.mRows.get(row).mFields);
+ parcel.writeIntArray(window.mRows.get(row).mTypes);
}
}
@@ -183,8 +182,8 @@
int rowCount = parcel.readInt();
for (int row = 0; row < rowCount; row++) {
Row r = new Row();
- r.fields = parcel.createStringArray();
- r.types = parcel.createIntArray();
+ r.mFields = parcel.createStringArray();
+ r.mTypes = parcel.createIntArray();
window.mRows.add(r);
}
return windowPtr;
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/MessageQueue_host.java b/ravenwood/runtime-helper-src/framework/android/os/MessageQueue_host.java
similarity index 97%
rename from ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/MessageQueue_host.java
rename to ravenwood/runtime-helper-src/framework/android/os/MessageQueue_host.java
index 5e81124..1b63adc 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/MessageQueue_host.java
+++ b/ravenwood/runtime-helper-src/framework/android/os/MessageQueue_host.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.platform.test.ravenwood.nativesubstitution;
+package android.os;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/SystemProperties_host.java b/ravenwood/runtime-helper-src/framework/android/os/SystemProperties_host.java
similarity index 89%
rename from ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/SystemProperties_host.java
rename to ravenwood/runtime-helper-src/framework/android/os/SystemProperties_host.java
index e7479d3..b09bf31 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/SystemProperties_host.java
+++ b/ravenwood/runtime-helper-src/framework/android/os/SystemProperties_host.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.platform.test.ravenwood.nativesubstitution;
+package android.os;
import android.util.SparseArray;
@@ -36,9 +36,6 @@
/** Predicate tested to determine if a given key can be written. */
@GuardedBy("sLock")
private static Predicate<String> sKeyWritablePredicate;
- /** Callback to trigger when values are changed */
- @GuardedBy("sLock")
- private static Runnable sChangeCallback;
/**
* Reverse mapping that provides a way back to an original key from the
@@ -48,7 +45,7 @@
private static SparseArray<String> sKeyHandles = new SparseArray<>();
/**
- * Basically the same as {@link #native_init$ravenwood}, but it'll only run if no values are
+ * Basically the same as {@link #init$ravenwood}, but it'll only run if no values are
* set yet.
*/
public static void initializeIfNeeded(Map<String, String> values,
@@ -57,30 +54,32 @@
if (sValues != null) {
return; // Already initialized.
}
- native_init$ravenwood(values, keyReadablePredicate, keyWritablePredicate,
- () -> {});
+ init$ravenwood(values, keyReadablePredicate, keyWritablePredicate);
}
}
- public static void native_init$ravenwood(Map<String, String> values,
- Predicate<String> keyReadablePredicate, Predicate<String> keyWritablePredicate,
- Runnable changeCallback) {
+ public static void init$ravenwood(Map<String, String> values,
+ Predicate<String> keyReadablePredicate, Predicate<String> keyWritablePredicate) {
synchronized (sLock) {
sValues = Objects.requireNonNull(values);
sKeyReadablePredicate = Objects.requireNonNull(keyReadablePredicate);
sKeyWritablePredicate = Objects.requireNonNull(keyWritablePredicate);
- sChangeCallback = Objects.requireNonNull(changeCallback);
sKeyHandles.clear();
+ synchronized (SystemProperties.sChangeCallbacks) {
+ SystemProperties.sChangeCallbacks.clear();
+ }
}
}
- public static void native_reset$ravenwood() {
+ public static void reset$ravenwood() {
synchronized (sLock) {
sValues = null;
sKeyReadablePredicate = null;
sKeyWritablePredicate = null;
- sChangeCallback = null;
sKeyHandles.clear();
+ synchronized (SystemProperties.sChangeCallbacks) {
+ SystemProperties.sChangeCallbacks.clear();
+ }
}
}
@@ -101,7 +100,7 @@
} else {
sValues.put(key, val);
}
- sChangeCallback.run();
+ SystemProperties.callChangeCallbacks();
}
}
@@ -183,7 +182,7 @@
// Report through callback always registered via init above
synchronized (sLock) {
Preconditions.requireNonNullViaRavenwoodRule(sValues);
- sChangeCallback.run();
+ SystemProperties.callChangeCallbacks();
}
}
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/EventLog_host.java b/ravenwood/runtime-helper-src/framework/android/util/EventLog_host.java
similarity index 83%
rename from ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/EventLog_host.java
rename to ravenwood/runtime-helper-src/framework/android/util/EventLog_host.java
index 55d4ffb..878a0ff 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/EventLog_host.java
+++ b/ravenwood/runtime-helper-src/framework/android/util/EventLog_host.java
@@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.platform.test.ravenwood.nativesubstitution;
+package android.util;
import com.android.internal.os.RuntimeInit;
import java.io.PrintStream;
-import java.util.Collection;
public class EventLog_host {
public static int writeEvent(int tag, int value) {
@@ -58,15 +57,6 @@
return sb.length();
}
- public static void readEvents(int[] tags, Collection<android.util.EventLog.Event> output) {
- throw new UnsupportedOperationException();
- }
-
- public static void readEventsOnWrapping(int[] tags, long timestamp,
- Collection<android.util.EventLog.Event> output) {
- throw new UnsupportedOperationException();
- }
-
/**
* Return the "real" {@code System.out} if it's been swapped by {@code RavenwoodRuleImpl}, so
* that we don't end up in a recursive loop.
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/Log_host.java b/ravenwood/runtime-helper-src/framework/android/util/Log_host.java
similarity index 95%
rename from ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/Log_host.java
rename to ravenwood/runtime-helper-src/framework/android/util/Log_host.java
index f301b9c..d232ef2 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/Log_host.java
+++ b/ravenwood/runtime-helper-src/framework/android/util/Log_host.java
@@ -13,9 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.platform.test.ravenwood.nativesubstitution;
+package android.util;
-import android.util.Log;
import android.util.Log.Level;
import com.android.internal.os.RuntimeInit;
@@ -44,7 +43,7 @@
case Log.LOG_ID_SYSTEM: buffer = "system"; break;
case Log.LOG_ID_CRASH: buffer = "crash"; break;
default: buffer = "buf:" + bufID; break;
- };
+ }
final String prio;
switch (priority) {
@@ -55,7 +54,7 @@
case Log.ERROR: prio = "E"; break;
case Log.ASSERT: prio = "A"; break;
default: prio = "prio:" + priority; break;
- };
+ }
for (String s : msg.split("\\n")) {
getRealOut().println(String.format("logd: [%s] %s %s: %s", buffer, prio, tag, s));
diff --git a/ravenwood/runtime-helper-src/framework/com/android/internal/os/LongArrayContainer_host.java b/ravenwood/runtime-helper-src/framework/com/android/internal/os/LongArrayContainer_host.java
new file mode 100644
index 0000000..c18c307
--- /dev/null
+++ b/ravenwood/runtime-helper-src/framework/com/android/internal/os/LongArrayContainer_host.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.internal.os;
+
+import java.util.Arrays;
+import java.util.HashMap;
+
+public class LongArrayContainer_host {
+ private static final HashMap<Long, long[]> sInstances = new HashMap<>();
+ private static long sNextId = 1;
+
+ public static long native_init(int arrayLength) {
+ long[] array = new long[arrayLength];
+ long instanceId = sNextId++;
+ sInstances.put(instanceId, array);
+ return instanceId;
+ }
+
+ static long[] getInstance(long instanceId) {
+ return sInstances.get(instanceId);
+ }
+
+ public static void native_setValues(long instanceId, long[] values) {
+ System.arraycopy(values, 0, getInstance(instanceId), 0, values.length);
+ }
+
+ public static void native_getValues(long instanceId, long[] values) {
+ System.arraycopy(getInstance(instanceId), 0, values, 0, values.length);
+ }
+
+ public static boolean native_combineValues(long instanceId, long[] array, int[] indexMap) {
+ long[] values = getInstance(instanceId);
+
+ boolean nonZero = false;
+ Arrays.fill(array, 0);
+
+ for (int i = 0; i < values.length; i++) {
+ int index = indexMap[i];
+ if (index < 0 || index >= array.length) {
+ throw new IndexOutOfBoundsException("Index " + index + " is out of bounds: [0, "
+ + (array.length - 1) + "]");
+ }
+ if (values[i] != 0) {
+ array[index] += values[i];
+ nonZero = true;
+ }
+ }
+ return nonZero;
+ }
+}
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/LongArrayMultiStateCounter_host.java b/ravenwood/runtime-helper-src/framework/com/android/internal/os/LongArrayMultiStateCounter_host.java
similarity index 87%
rename from ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/LongArrayMultiStateCounter_host.java
rename to ravenwood/runtime-helper-src/framework/com/android/internal/os/LongArrayMultiStateCounter_host.java
index 0f65544..9ce8ea8 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/LongArrayMultiStateCounter_host.java
+++ b/ravenwood/runtime-helper-src/framework/com/android/internal/os/LongArrayMultiStateCounter_host.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.platform.test.ravenwood.nativesubstitution;
+package com.android.internal.os;
import android.os.BadParcelableException;
import android.os.Parcel;
@@ -28,7 +28,7 @@
public class LongArrayMultiStateCounter_host {
/**
- * A reimplementation of {@link com.android.internal.os.LongArrayMultiStateCounter}, only in
+ * A reimplementation of {@link LongArrayMultiStateCounter}, only in
* Java instead of native. The majority of the code (in C++) can be found in
* /frameworks/native/libs/battery/MultiStateCounter.h
*/
@@ -257,50 +257,6 @@
}
}
- public static class LongArrayContainer_host {
- private static final HashMap<Long, long[]> sInstances = new HashMap<>();
- private static long sNextId = 1;
-
- public static long native_init(int arrayLength) {
- long[] array = new long[arrayLength];
- long instanceId = sNextId++;
- sInstances.put(instanceId, array);
- return instanceId;
- }
-
- static long[] getInstance(long instanceId) {
- return sInstances.get(instanceId);
- }
-
- public static void native_setValues(long instanceId, long[] values) {
- System.arraycopy(values, 0, getInstance(instanceId), 0, values.length);
- }
-
- public static void native_getValues(long instanceId, long[] values) {
- System.arraycopy(getInstance(instanceId), 0, values, 0, values.length);
- }
-
- public static boolean native_combineValues(long instanceId, long[] array, int[] indexMap) {
- long[] values = getInstance(instanceId);
-
- boolean nonZero = false;
- Arrays.fill(array, 0);
-
- for (int i = 0; i < values.length; i++) {
- int index = indexMap[i];
- if (index < 0 || index >= array.length) {
- throw new IndexOutOfBoundsException("Index " + index + " is out of bounds: [0, "
- + (array.length - 1) + "]");
- }
- if (values[i] != 0) {
- array[index] += values[i];
- nonZero = true;
- }
- }
- return nonZero;
- }
- }
-
private static final HashMap<Long, LongArrayMultiStateCounterRavenwood> sInstances =
new HashMap<>();
private static long sNextId = 1;
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/LongMultiStateCounter_host.java b/ravenwood/runtime-helper-src/framework/com/android/internal/os/LongMultiStateCounter_host.java
similarity index 98%
rename from ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/LongMultiStateCounter_host.java
rename to ravenwood/runtime-helper-src/framework/com/android/internal/os/LongMultiStateCounter_host.java
index 9486651..1d95aa1 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/LongMultiStateCounter_host.java
+++ b/ravenwood/runtime-helper-src/framework/com/android/internal/os/LongMultiStateCounter_host.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.platform.test.ravenwood.nativesubstitution;
+package com.android.internal.os;
import android.os.BadParcelableException;
import android.os.Parcel;
diff --git a/ravenwood/runtime-helper-src/framework/com/android/internal/ravenwood/RavenwoodEnvironment_host.java b/ravenwood/runtime-helper-src/framework/com/android/internal/ravenwood/RavenwoodEnvironment_host.java
new file mode 100644
index 0000000..e12ff24
--- /dev/null
+++ b/ravenwood/runtime-helper-src/framework/com/android/internal/ravenwood/RavenwoodEnvironment_host.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.internal.ravenwood;
+
+import com.android.ravenwood.common.JvmWorkaround;
+import com.android.ravenwood.common.RavenwoodCommonUtils;
+
+public class RavenwoodEnvironment_host {
+ private RavenwoodEnvironment_host() {
+ }
+
+ /**
+ * Called from {@link RavenwoodEnvironment#ensureRavenwoodInitialized()}.
+ */
+ public static void ensureRavenwoodInitialized() {
+ // Initialization is now done by RavenwoodAwareTestRunner.
+ // Should we remove it?
+ }
+
+ /**
+ * Called from {@link RavenwoodEnvironment#getRavenwoodRuntimePath()}.
+ */
+ public static String getRavenwoodRuntimePath(RavenwoodEnvironment env) {
+ return RavenwoodCommonUtils.getRavenwoodRuntimePath();
+ }
+
+ /**
+ * Called from {@link RavenwoodEnvironment#fromAddress(long)}.
+ */
+ public static <T> T fromAddress(RavenwoodEnvironment env, long address) {
+ return JvmWorkaround.getInstance().fromAddress(address);
+ }
+}
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/Parcel_host.java b/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/Parcel_host.java
deleted file mode 100644
index cb00b3e..0000000
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/Parcel_host.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.platform.test.ravenwood.nativesubstitution;
-
-import android.system.ErrnoException;
-import android.system.Os;
-import android.util.Log;
-
-import java.io.FileDescriptor;
-import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * Tentative, partial implementation of the Parcel native methods, using Java's
- * {@code byte[]}.
- * (We don't use a {@link ByteBuffer} because there's enough semantics differences between Parcel
- * and {@link ByteBuffer}, and it didn't work out.
- * e.g. Parcel seems to allow moving the data position to be beyond its size? Which
- * {@link ByteBuffer} wouldn't allow...)
- */
-public class Parcel_host {
- private static final String TAG = "Parcel";
-
- private Parcel_host() {
- }
-
- private static final AtomicLong sNextId = new AtomicLong(1);
-
- private static final Map<Long, Parcel_host> sInstances = new ConcurrentHashMap<>();
-
- private boolean mDeleted = false;
-
- private byte[] mBuffer;
- private int mSize;
- private int mPos;
-
- private boolean mSensitive;
- private boolean mAllowFds;
-
- // TODO Use the actual value from Parcel.java.
- private static final int OK = 0;
-
- private final Map<Integer, FileDescriptor> mFdMap = new ConcurrentHashMap<>();
-
- private static final int FD_PLACEHOLDER = 0xDEADBEEF;
- private static final int FD_PAYLOAD_SIZE = 8;
-
- private void validate() {
- if (mDeleted) {
- // TODO: Put more info
- throw new RuntimeException("Parcel already destroyed");
- }
- }
-
- private static Parcel_host getInstance(long id) {
- Parcel_host p = sInstances.get(id);
- if (p == null) {
- // TODO: Put more info
- throw new RuntimeException("Parcel doesn't exist with id=" + id);
- }
- p.validate();
- return p;
- }
-
- /** Native method substitution */
- public static long nativeCreate() {
- final long id = sNextId.getAndIncrement();
- final Parcel_host p = new Parcel_host();
- sInstances.put(id, p);
- p.init();
- return id;
- }
-
- private void init() {
- mBuffer = new byte[0];
- mSize = 0;
- mPos = 0;
- mSensitive = false;
- mAllowFds = true;
- mFdMap.clear();
- }
-
- private void updateSize() {
- if (mSize < mPos) {
- mSize = mPos;
- }
- }
-
- /** Native method substitution */
- public static void nativeDestroy(long nativePtr) {
- getInstance(nativePtr).mDeleted = true;
- sInstances.remove(nativePtr);
- }
-
- /** Native method substitution */
- public static void nativeFreeBuffer(long nativePtr) {
- getInstance(nativePtr).freeBuffer();
- }
-
- /** Native method substitution */
- private void freeBuffer() {
- init();
- }
-
- private int getCapacity() {
- return mBuffer.length;
- }
-
- private void ensureMoreCapacity(int size) {
- ensureCapacity(mPos + size);
- }
-
- private void ensureCapacity(int targetSize) {
- if (targetSize <= getCapacity()) {
- return;
- }
- var newSize = getCapacity() * 2;
- if (newSize < targetSize) {
- newSize = targetSize;
- }
- forceSetCapacity(newSize);
- }
-
- private void forceSetCapacity(int newSize) {
- var newBuf = new byte[newSize];
-
- // Copy
- System.arraycopy(mBuffer, 0, newBuf, 0, Math.min(newSize, getCapacity()));
-
- this.mBuffer = newBuf;
- }
-
- private void ensureDataAvailable(int requestSize) {
- if (mSize - mPos < requestSize) {
- throw new RuntimeException(String.format(
- "Pacel data underflow. size=%d, pos=%d, request=%d", mSize, mPos, requestSize));
- }
- }
-
- /** Native method substitution */
- public static void nativeMarkSensitive(long nativePtr) {
- getInstance(nativePtr).mSensitive = true;
- }
-
- /** Native method substitution */
- public static int nativeDataSize(long nativePtr) {
- return getInstance(nativePtr).mSize;
- }
-
- /** Native method substitution */
- public static int nativeDataAvail(long nativePtr) {
- var p = getInstance(nativePtr);
- return p.mSize - p.mPos;
- }
-
- /** Native method substitution */
- public static int nativeDataPosition(long nativePtr) {
- return getInstance(nativePtr).mPos;
- }
-
- /** Native method substitution */
- public static int nativeDataCapacity(long nativePtr) {
- return getInstance(nativePtr).mBuffer.length;
- }
-
- /** Native method substitution */
- public static void nativeSetDataSize(long nativePtr, int size) {
- var p = getInstance(nativePtr);
- p.ensureCapacity(size);
- getInstance(nativePtr).mSize = size;
- }
-
- /** Native method substitution */
- public static void nativeSetDataPosition(long nativePtr, int pos) {
- var p = getInstance(nativePtr);
- // TODO: Should this change the size or the capacity??
- p.mPos = pos;
- }
-
- /** Native method substitution */
- public static void nativeSetDataCapacity(long nativePtr, int size) {
- if (size < 0) {
- throw new IllegalArgumentException("size < 0: size=" + size);
- }
- var p = getInstance(nativePtr);
- if (p.getCapacity() < size) {
- p.forceSetCapacity(size);
- }
- }
-
- /** Native method substitution */
- public static boolean nativePushAllowFds(long nativePtr, boolean allowFds) {
- var p = getInstance(nativePtr);
- var prev = p.mAllowFds;
- p.mAllowFds = allowFds;
- return prev;
- }
-
- /** Native method substitution */
- public static void nativeRestoreAllowFds(long nativePtr, boolean lastValue) {
- getInstance(nativePtr).mAllowFds = lastValue;
- }
-
- /** Native method substitution */
- public static void nativeWriteByteArray(long nativePtr, byte[] b, int offset, int len) {
- nativeWriteBlob(nativePtr, b, offset, len);
- }
-
- /** Native method substitution */
- public static void nativeWriteBlob(long nativePtr, byte[] b, int offset, int len) {
- var p = getInstance(nativePtr);
-
- if (b == null) {
- nativeWriteInt(nativePtr, -1);
- } else {
- final var alignedSize = align4(len);
-
- nativeWriteInt(nativePtr, len);
-
- p.ensureMoreCapacity(alignedSize);
-
- System.arraycopy(b, offset, p.mBuffer, p.mPos, len);
- p.mPos += alignedSize;
- p.updateSize();
- }
- }
-
- /** Native method substitution */
- public static int nativeWriteInt(long nativePtr, int value) {
- var p = getInstance(nativePtr);
- p.ensureMoreCapacity(Integer.BYTES);
-
- p.mBuffer[p.mPos++] = (byte) ((value >> 24) & 0xff);
- p.mBuffer[p.mPos++] = (byte) ((value >> 16) & 0xff);
- p.mBuffer[p.mPos++] = (byte) ((value >> 8) & 0xff);
- p.mBuffer[p.mPos++] = (byte) ((value >> 0) & 0xff);
-
- p.updateSize();
-
- return OK;
- }
-
- /** Native method substitution */
- public static int nativeWriteLong(long nativePtr, long value) {
- nativeWriteInt(nativePtr, (int) (value >>> 32));
- nativeWriteInt(nativePtr, (int) (value));
- return OK;
- }
-
- /** Native method substitution */
- public static int nativeWriteFloat(long nativePtr, float val) {
- return nativeWriteInt(nativePtr, Float.floatToIntBits(val));
- }
-
- /** Native method substitution */
- public static int nativeWriteDouble(long nativePtr, double val) {
- return nativeWriteLong(nativePtr, Double.doubleToLongBits(val));
- }
-
- private static int align4(int val) {
- return ((val + 3) / 4) * 4;
- }
-
- /** Native method substitution */
- public static void nativeWriteString8(long nativePtr, String val) {
- if (val == null) {
- nativeWriteBlob(nativePtr, null, 0, 0);
- } else {
- var bytes = val.getBytes(StandardCharsets.UTF_8);
- nativeWriteBlob(nativePtr, bytes, 0, bytes.length);
- }
- }
-
- /** Native method substitution */
- public static void nativeWriteString16(long nativePtr, String val) {
- // Just reuse String8
- nativeWriteString8(nativePtr, val);
- }
-
- /** Native method substitution */
- public static byte[] nativeCreateByteArray(long nativePtr) {
- return nativeReadBlob(nativePtr);
- }
-
- /** Native method substitution */
- public static boolean nativeReadByteArray(long nativePtr, byte[] dest, int destLen) {
- if (dest == null) {
- return false;
- }
- var data = nativeReadBlob(nativePtr);
- if (data == null) {
- System.err.println("Percel has NULL, which is unexpected."); // TODO: Is this correct?
- return false;
- }
- // TODO: Make sure the check logic is correct.
- if (data.length != destLen) {
- System.err.println("Byte array size mismatch: expected="
- + data.length + " given=" + destLen);
- return false;
- }
- System.arraycopy(data, 0, dest, 0, data.length);
- return true;
- }
-
- /** Native method substitution */
- public static byte[] nativeReadBlob(long nativePtr) {
- var p = getInstance(nativePtr);
- if (p.mSize - p.mPos < 4) {
- // Match native impl that returns "null" when not enough data
- return null;
- }
- final var size = nativeReadInt(nativePtr);
- if (size == -1) {
- return null;
- }
- try {
- p.ensureDataAvailable(align4(size));
- } catch (Exception e) {
- System.err.println(e.toString());
- return null;
- }
-
- var bytes = new byte[size];
- System.arraycopy(p.mBuffer, p.mPos, bytes, 0, size);
-
- p.mPos += align4(size);
-
- return bytes;
- }
-
- /** Native method substitution */
- public static int nativeReadInt(long nativePtr) {
- var p = getInstance(nativePtr);
-
- if (p.mSize - p.mPos < 4) {
- // Match native impl that returns "0" when not enough data
- return 0;
- }
-
- var ret = (((p.mBuffer[p.mPos++] & 0xff) << 24)
- | ((p.mBuffer[p.mPos++] & 0xff) << 16)
- | ((p.mBuffer[p.mPos++] & 0xff) << 8)
- | ((p.mBuffer[p.mPos++] & 0xff) << 0));
-
- return ret;
- }
-
- /** Native method substitution */
- public static long nativeReadLong(long nativePtr) {
- return (((long) nativeReadInt(nativePtr)) << 32)
- | (((long) nativeReadInt(nativePtr)) & 0xffff_ffffL);
- }
-
- /** Native method substitution */
- public static float nativeReadFloat(long nativePtr) {
- return Float.intBitsToFloat(nativeReadInt(nativePtr));
- }
-
- /** Native method substitution */
- public static double nativeReadDouble(long nativePtr) {
- return Double.longBitsToDouble(nativeReadLong(nativePtr));
- }
-
- /** Native method substitution */
- public static String nativeReadString8(long nativePtr) {
- final var bytes = nativeReadBlob(nativePtr);
- if (bytes == null) {
- return null;
- }
- return new String(bytes, StandardCharsets.UTF_8);
- }
- public static String nativeReadString16(long nativePtr) {
- return nativeReadString8(nativePtr);
- }
-
- /** Native method substitution */
- public static byte[] nativeMarshall(long nativePtr) {
- var p = getInstance(nativePtr);
- return Arrays.copyOf(p.mBuffer, p.mSize);
- }
-
- /** Native method substitution */
- public static void nativeUnmarshall(
- long nativePtr, byte[] data, int offset, int length) {
- var p = getInstance(nativePtr);
- p.ensureMoreCapacity(length);
- System.arraycopy(data, offset, p.mBuffer, p.mPos, length);
- p.mPos += length;
- p.updateSize();
- }
-
- /** Native method substitution */
- public static int nativeCompareData(long thisNativePtr, long otherNativePtr) {
- var a = getInstance(thisNativePtr);
- var b = getInstance(otherNativePtr);
- if ((a.mSize == b.mSize) && Arrays.equals(a.mBuffer, b.mBuffer)) {
- return 0;
- } else {
- return -1;
- }
- }
-
- /** Native method substitution */
- public static boolean nativeCompareDataInRange(
- long ptrA, int offsetA, long ptrB, int offsetB, int length) {
- var a = getInstance(ptrA);
- var b = getInstance(ptrB);
- if (offsetA < 0 || offsetA + length > a.mSize) {
- throw new IllegalArgumentException();
- }
- if (offsetB < 0 || offsetB + length > b.mSize) {
- throw new IllegalArgumentException();
- }
- return Arrays.equals(Arrays.copyOfRange(a.mBuffer, offsetA, offsetA + length),
- Arrays.copyOfRange(b.mBuffer, offsetB, offsetB + length));
- }
-
- /** Native method substitution */
- public static void nativeAppendFrom(
- long thisNativePtr, long otherNativePtr, int srcOffset, int length) {
- var dst = getInstance(thisNativePtr);
- var src = getInstance(otherNativePtr);
-
- dst.ensureMoreCapacity(length);
-
- System.arraycopy(src.mBuffer, srcOffset, dst.mBuffer, dst.mPos, length);
- dst.mPos += length; // TODO: 4 byte align?
- dst.updateSize();
-
- // TODO: Update the other's position?
- }
-
- /** Native method substitution */
- public static boolean nativeHasBinders(long nativePtr) {
- // Assume false for now, because we don't support adding binders.
- return false;
- }
-
- /** Native method substitution */
- public static boolean nativeHasBindersInRange(
- long nativePtr, int offset, int length) {
- // Assume false for now, because we don't support writing FDs yet.
- return false;
- }
-
- /** Native method substitution */
- public static void nativeWriteFileDescriptor(long nativePtr, java.io.FileDescriptor val) {
- var p = getInstance(nativePtr);
-
- if (!p.mAllowFds) {
- // Simulate the FDS_NOT_ALLOWED case in frameworks/base/core/jni/android_util_Binder.cpp
- throw new RuntimeException("Not allowed to write file descriptors here");
- }
-
- FileDescriptor dup = null;
- try {
- dup = Os.dup(val);
- } catch (ErrnoException e) {
- throw new RuntimeException(e);
- }
- p.mFdMap.put(p.mPos, dup);
-
- // Parcel.cpp writes two int32s for a FD.
- // Make sure FD_PAYLOAD_SIZE is in sync with this code.
- nativeWriteInt(nativePtr, FD_PLACEHOLDER);
- nativeWriteInt(nativePtr, FD_PLACEHOLDER);
- }
-
- /** Native method substitution */
- public static java.io.FileDescriptor nativeReadFileDescriptor(long nativePtr) {
- var p = getInstance(nativePtr);
-
- var pos = p.mPos;
- var fd = p.mFdMap.get(pos);
-
- if (fd == null) {
- Log.w(TAG, "nativeReadFileDescriptor: Not a FD at pos #" + pos);
- return null;
- }
- nativeReadInt(nativePtr);
- nativeReadInt(nativePtr);
- return fd;
- }
-
- /** Native method substitution */
- public static boolean nativeHasFileDescriptors(long nativePtr) {
- var p = getInstance(nativePtr);
- return p.mFdMap.size() > 0;
- }
-
- /** Native method substitution */
- public static boolean nativeHasFileDescriptorsInRange(long nativePtr, int offset, int length) {
- var p = getInstance(nativePtr);
-
- // Original code: hasFileDescriptorsInRange() in frameworks/native/libs/binder/Parcel.cpp
- if (offset < 0 || length < 0) {
- throw new IllegalArgumentException("Negative value not allowed: offset=" + offset
- + " length=" + length);
- }
- long limit = (long) offset + (long) length;
- if (limit > p.mSize) {
- throw new IllegalArgumentException("Out of range: offset=" + offset
- + " length=" + length + " dataSize=" + p.mSize);
- }
-
- for (var pos : p.mFdMap.keySet()) {
- if (offset <= pos && (pos + FD_PAYLOAD_SIZE - 1) < (offset + length)) {
- return true;
- }
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/RavenwoodEnvironment_host.java b/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/RavenwoodEnvironment_host.java
deleted file mode 100644
index 58f6bbb..0000000
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/nativesubstitution/RavenwoodEnvironment_host.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.platform.test.ravenwood.nativesubstitution;
-
-import android.platform.test.ravenwood.RavenwoodSystemProperties;
-import android.util.Log;
-
-import com.android.internal.ravenwood.RavenwoodEnvironment;
-import com.android.ravenwood.common.JvmWorkaround;
-import com.android.ravenwood.common.RavenwoodCommonUtils;
-
-public class RavenwoodEnvironment_host {
- private static final String TAG = RavenwoodEnvironment.TAG;
-
- private static final Object sInitializeLock = new Object();
-
- // @GuardedBy("sInitializeLock")
- private static boolean sInitialized;
-
- private RavenwoodEnvironment_host() {
- }
-
- /**
- * Called from {@link RavenwoodEnvironment#ensureRavenwoodInitialized()}.
- */
- public static void nativeEnsureRavenwoodInitialized() {
-
- // TODO Unify it with the initialization code in RavenwoodAwareTestRunnerHook.
-
- synchronized (sInitializeLock) {
- if (sInitialized) {
- return;
- }
- Log.i(TAG, "Initializing Ravenwood environment");
-
- // Set the default values.
- var sysProps = RavenwoodSystemProperties.DEFAULT_VALUES;
-
- // We have a method that does it in RavenwoodRuleImpl, but we can't use that class
- // here, So just inline it.
- SystemProperties_host.initializeIfNeeded(
- sysProps.getValues(),
- sysProps.getKeyReadablePredicate(),
- sysProps.getKeyWritablePredicate());
-
- sInitialized = true;
- }
- }
-
- /**
- * Called from {@link RavenwoodEnvironment#getRavenwoodRuntimePath()}.
- */
- public static String nativeGetRavenwoodRuntimePath(RavenwoodEnvironment env) {
- return RavenwoodCommonUtils.getRavenwoodRuntimePath();
- }
-
- /**
- * Called from {@link RavenwoodEnvironment#fromAddress(long)}.
- */
- public static <T> T nativeFromAddress(RavenwoodEnvironment env, long address) {
- return JvmWorkaround.getInstance().fromAddress(address);
- }
-}
diff --git a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/runtimehelper/ClassLoadHook.java b/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/runtimehelper/ClassLoadHook.java
index 0f955e7..790bb1c 100644
--- a/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/runtimehelper/ClassLoadHook.java
+++ b/ravenwood/runtime-helper-src/framework/com/android/platform/test/ravenwood/runtimehelper/ClassLoadHook.java
@@ -15,6 +15,11 @@
*/
package com.android.platform.test.ravenwood.runtimehelper;
+import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING;
+
+import android.system.ErrnoException;
+import android.system.Os;
+
import com.android.ravenwood.common.RavenwoodCommonUtils;
import java.io.File;
@@ -123,6 +128,15 @@
return;
}
+ if (RAVENWOOD_VERBOSE_LOGGING) {
+ log("Force enabling verbose logging");
+ try {
+ Os.setenv("ANDROID_LOG_TAGS", "*:v", true);
+ } catch (ErrnoException e) {
+ // Shouldn't happen.
+ }
+ }
+
// Make sure these properties are not set.
ensurePropertyNotSet(CORE_NATIVE_CLASSES);
ensurePropertyNotSet(ICU_DATA_PATH);
@@ -152,6 +166,7 @@
private static final Class<?>[] sLibandroidClasses = {
android.util.Log.class,
android.os.Parcel.class,
+ android.os.Binder.class,
android.content.res.ApkAssets.class,
android.content.res.AssetManager.class,
android.content.res.StringBlock.class,
diff --git a/ravenwood/runtime-helper-src/libcore-fake/android/system/Os.java b/ravenwood/runtime-helper-src/libcore-fake/android/system/Os.java
index a5c0b54..c94ef31 100644
--- a/ravenwood/runtime-helper-src/libcore-fake/android/system/Os.java
+++ b/ravenwood/runtime-helper-src/libcore-fake/android/system/Os.java
@@ -93,4 +93,8 @@
throw new ErrnoException("pread", OsConstants.EIO, e);
}
}
+
+ public static void setenv(String name, String value, boolean overwrite) throws ErrnoException {
+ RavenwoodRuntimeNative.setenv(name, value, overwrite);
+ }
}
diff --git a/ravenwood/runtime-helper-src/libcore-fake/com/android/ravenwood/RavenwoodRuntimeNative.java b/ravenwood/runtime-helper-src/libcore-fake/com/android/ravenwood/RavenwoodRuntimeNative.java
index 0d8408c..ad80d92 100644
--- a/ravenwood/runtime-helper-src/libcore-fake/com/android/ravenwood/RavenwoodRuntimeNative.java
+++ b/ravenwood/runtime-helper-src/libcore-fake/com/android/ravenwood/RavenwoodRuntimeNative.java
@@ -53,6 +53,9 @@
private static native int nOpen(String path, int flags, int mode) throws ErrnoException;
+ public static native void setenv(String name, String value, boolean overwrite)
+ throws ErrnoException;
+
public static long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException {
return nLseek(JvmWorkaround.getInstance().getFdInt(fd), offset, whence);
}
diff --git a/ravenwood/runtime-jni/ravenwood_runtime.cpp b/ravenwood/runtime-jni/ravenwood_runtime.cpp
index f5cb019f..c255be5 100644
--- a/ravenwood/runtime-jni/ravenwood_runtime.cpp
+++ b/ravenwood/runtime-jni/ravenwood_runtime.cpp
@@ -214,6 +214,19 @@
return throwIfMinusOne(env, "open", TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)));
}
+static void Linux_setenv(JNIEnv* env, jobject, jstring javaName, jstring javaValue,
+ jboolean overwrite) {
+ ScopedRealUtf8Chars name(env, javaName);
+ if (name.c_str() == NULL) {
+ jniThrowNullPointerException(env);
+ }
+ ScopedRealUtf8Chars value(env, javaValue);
+ if (value.c_str() == NULL) {
+ jniThrowNullPointerException(env);
+ }
+ throwIfMinusOne(env, "setenv", setenv(name.c_str(), value.c_str(), overwrite ? 1 : 0));
+}
+
// ---- Registration ----
static const JNINativeMethod sMethods[] =
@@ -227,6 +240,7 @@
{ "lstat", "(Ljava/lang/String;)Landroid/system/StructStat;", (void*)Linux_lstat },
{ "stat", "(Ljava/lang/String;)Landroid/system/StructStat;", (void*)Linux_stat },
{ "nOpen", "(Ljava/lang/String;II)I", (void*)Linux_open },
+ { "setenv", "(Ljava/lang/String;Ljava/lang/String;Z)V", (void*)Linux_setenv },
};
extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
diff --git a/ravenwood/tests/coretest/Android.bp b/ravenwood/tests/coretest/Android.bp
new file mode 100644
index 0000000..d94475c
--- /dev/null
+++ b/ravenwood/tests/coretest/Android.bp
@@ -0,0 +1,25 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "frameworks_base_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+android_ravenwood_test {
+ name: "RavenwoodCoreTest",
+
+ static_libs: [
+ "androidx.annotation_annotation",
+ "androidx.test.ext.junit",
+ "androidx.test.rules",
+ "junit-params",
+ "platform-parametric-runner-lib",
+ "truth",
+ ],
+ srcs: [
+ "test/**/*.java",
+ ],
+ auto_gen_config: true,
+}
diff --git a/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerCallbackTest.java b/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerCallbackTest.java
new file mode 100644
index 0000000..6d8fb98
--- /dev/null
+++ b/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerCallbackTest.java
@@ -0,0 +1,356 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ravenwoodtest.runnercallbacktests;
+
+import static org.junit.Assume.assumeTrue;
+
+import android.platform.test.annotations.NoRavenizer;
+import android.platform.test.ravenwood.RavenwoodAwareTestRunner;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.AfterClass;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runner.RunWith;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.Statement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import platform.test.runner.parameterized.ParameterizedAndroidJunit4;
+import platform.test.runner.parameterized.Parameters;
+
+
+/**
+ * Tests to make sure {@link RavenwoodAwareTestRunner} produces expected callbacks in various
+ * error situations in places such as @BeforeClass / @AfterClass / Constructors, which are
+ * out of test method bodies.
+ */
+@NoRavenizer // This class shouldn't be executed with RavenwoodAwareTestRunner.
+public class RavenwoodRunnerCallbackTest extends RavenwoodRunnerTestBase {
+
+ /**
+ * Throws an exception in @AfterClass. This should produce a critical error.
+ */
+ @RunWith(BlockJUnit4ClassRunner.class)
+ // CHECKSTYLE:OFF Generated code
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$AfterClassFailureTest
+ testStarted: test1(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$AfterClassFailureTest)
+ testFinished: test1(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$AfterClassFailureTest)
+ testStarted: test2(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$AfterClassFailureTest)
+ testFinished: test2(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$AfterClassFailureTest)
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$AfterClassFailureTest
+ criticalError: Failures detected in @AfterClass, which would be swallowed by tradefed: FAILURE
+ testSuiteFinished: classes
+ testRunFinished: 2,0,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class AfterClassFailureTest {
+ public AfterClassFailureTest() {
+ }
+
+ @AfterClass
+ public static void afterClass() {
+ throw new RuntimeException("FAILURE");
+ }
+
+ @Test
+ public void test1() {
+ }
+
+ @Test
+ public void test2() {
+ }
+
+ }
+
+ /**
+ * Assumption failure in @BeforeClass.
+ */
+ @RunWith(ParameterizedAndroidJunit4.class)
+ // Because the test uses ParameterizedAndroidJunit4 with two parameters,
+ // the whole class is executed twice.
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest
+ testSuiteStarted: [0]
+ testStarted: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testStarted: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testSuiteFinished: [0]
+ testSuiteStarted: [1]
+ testStarted: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testStarted: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassAssumptionFailureTest)
+ testSuiteFinished: [1]
+ testSuiteFinished: classes
+ testRunFinished: 4,0,4,0
+ """)
+ // CHECKSTYLE:ON
+ public static class BeforeClassAssumptionFailureTest {
+ public BeforeClassAssumptionFailureTest(String param) {
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ Assume.assumeTrue(false);
+ }
+
+ @Parameters
+ public static List<String> getParams() {
+ var params = new ArrayList<String>();
+ params.add("foo");
+ params.add("bar");
+ return params;
+ }
+
+ @Test
+ public void test1() {
+ }
+
+ @Test
+ public void test2() {
+ }
+ }
+
+ /**
+ * General exception in @BeforeClass.
+ */
+ @RunWith(ParameterizedAndroidJunit4.class)
+ // Because the test uses ParameterizedAndroidJunit4 with two parameters,
+ // the whole class is executed twice.
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest
+ testSuiteStarted: [0]
+ testStarted: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testFailure: FAILURE
+ testFinished: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testStarted: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testFailure: FAILURE
+ testFinished: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testSuiteFinished: [0]
+ testSuiteStarted: [1]
+ testStarted: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testFailure: FAILURE
+ testFinished: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testStarted: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testFailure: FAILURE
+ testFinished: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$BeforeClassExceptionTest)
+ testSuiteFinished: [1]
+ testSuiteFinished: classes
+ testRunFinished: 4,4,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class BeforeClassExceptionTest {
+ public BeforeClassExceptionTest(String param) {
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ throw new RuntimeException("FAILURE");
+ }
+
+ @Parameters
+ public static List<String> getParams() {
+ var params = new ArrayList<String>();
+ params.add("foo");
+ params.add("bar");
+ return params;
+ }
+
+ @Test
+ public void test1() {
+ }
+
+ @Test
+ public void test2() {
+ }
+ }
+
+ /**
+ * Assumption failure from a @ClassRule.
+ */
+ @RunWith(ParameterizedAndroidJunit4.class)
+ // Because the test uses ParameterizedAndroidJunit4 with two parameters,
+ // the whole class is executed twice.
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest
+ testSuiteStarted: [0]
+ testStarted: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testStarted: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testSuiteFinished: [0]
+ testSuiteStarted: [1]
+ testStarted: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testStarted: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleAssumptionFailureTest)
+ testSuiteFinished: [1]
+ testSuiteFinished: classes
+ testRunFinished: 4,0,4,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ClassRuleAssumptionFailureTest {
+ @ClassRule
+ public static final TestRule sClassRule = new TestRule() {
+ @Override
+ public Statement apply(Statement base, Description description) {
+ assumeTrue(false);
+ return null; // unreachable
+ }
+ };
+
+ public ClassRuleAssumptionFailureTest(String param) {
+ }
+
+ @Parameters
+ public static List<String> getParams() {
+ var params = new ArrayList<String>();
+ params.add("foo");
+ params.add("bar");
+ return params;
+ }
+
+ @Test
+ public void test1() {
+ }
+
+ @Test
+ public void test2() {
+ }
+ }
+
+ /**
+ * General exception from a @ClassRule.
+ */
+ @RunWith(ParameterizedAndroidJunit4.class)
+ // Because the test uses ParameterizedAndroidJunit4 with two parameters,
+ // the whole class is executed twice.
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest
+ testSuiteStarted: [0]
+ testStarted: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test1[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testStarted: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test2[0](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testSuiteFinished: [0]
+ testSuiteStarted: [1]
+ testStarted: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test1[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testStarted: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testAssumptionFailure: got: <false>, expected: is <true>
+ testFinished: test2[1](com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ClassRuleExceptionTest)
+ testSuiteFinished: [1]
+ testSuiteFinished: classes
+ testRunFinished: 4,0,4,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ClassRuleExceptionTest {
+ @ClassRule
+ public static final TestRule sClassRule = new TestRule() {
+ @Override
+ public Statement apply(Statement base, Description description) {
+ assumeTrue(false);
+ return null; // unreachable
+ }
+ };
+
+ public ClassRuleExceptionTest(String param) {
+ }
+
+ @Parameters
+ public static List<String> getParams() {
+ var params = new ArrayList<String>();
+ params.add("foo");
+ params.add("bar");
+ return params;
+ }
+
+ @Test
+ public void test1() {
+ }
+
+ @Test
+ public void test2() {
+ }
+ }
+
+ /**
+ * General exception from a @ClassRule.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: Constructor(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ExceptionFromInnerRunnerConstructorTest)
+ testFailure: Exception detected in constructor
+ testFinished: Constructor(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerCallbackTest$ExceptionFromInnerRunnerConstructorTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ExceptionFromInnerRunnerConstructorTest {
+ public ExceptionFromInnerRunnerConstructorTest(String arg1, String arg2) {
+ }
+
+ @Test
+ public void test1() {
+ }
+
+ @Test
+ public void test2() {
+ }
+ }
+}
diff --git a/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerConfigValidationTest.java b/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerConfigValidationTest.java
new file mode 100644
index 0000000..6ee443f
--- /dev/null
+++ b/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerConfigValidationTest.java
@@ -0,0 +1,452 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ravenwoodtest.runnercallbacktests;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.platform.test.annotations.NoRavenizer;
+import android.platform.test.ravenwood.RavenwoodConfig;
+import android.platform.test.ravenwood.RavenwoodRule;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestRule;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Test for @Config field extraction and validation.
+ */
+@NoRavenizer // This class shouldn't be executed with RavenwoodAwareTestRunner.
+public class RavenwoodRunnerConfigValidationTest extends RavenwoodRunnerTestBase {
+ public abstract static class ConfigInBaseClass {
+ static String PACKAGE_NAME = "com.ConfigInBaseClass";
+
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig = new RavenwoodConfig.Builder()
+ .setPackageName(PACKAGE_NAME).build();
+ }
+
+ /**
+ * Make sure a config in the base class is detected.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigInBaseClassTest
+ testStarted: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigInBaseClassTest)
+ testFinished: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigInBaseClassTest)
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigInBaseClassTest
+ testSuiteFinished: classes
+ testRunFinished: 1,0,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ConfigInBaseClassTest extends ConfigInBaseClass {
+ @Test
+ public void test() {
+ assertThat(InstrumentationRegistry.getInstrumentation().getContext().getPackageName())
+ .isEqualTo(PACKAGE_NAME);
+ }
+ }
+
+ /**
+ * Make sure a config in the base class is detected.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigOverridingTest
+ testStarted: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigOverridingTest)
+ testFinished: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigOverridingTest)
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigOverridingTest
+ testSuiteFinished: classes
+ testRunFinished: 1,0,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ConfigOverridingTest extends ConfigInBaseClass {
+ static String PACKAGE_NAME_OVERRIDE = "com.ConfigOverridingTest";
+
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig = new RavenwoodConfig.Builder()
+ .setPackageName(PACKAGE_NAME_OVERRIDE).build();
+
+ @Test
+ public void test() {
+ assertThat(InstrumentationRegistry.getInstrumentation().getContext().getPackageName())
+ .isEqualTo(PACKAGE_NAME_OVERRIDE);
+ }
+ }
+
+ /**
+ * Test to make sure that if a test has a config error, the failure would be reported from
+ * each test method.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: testMethod1(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest)
+ testFailure: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest.sConfig expected to be public static
+ testFinished: testMethod1(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest)
+ testStarted: testMethod2(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest)
+ testFailure: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest.sConfig expected to be public static
+ testFinished: testMethod2(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest)
+ testStarted: testMethod3(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest)
+ testFailure: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest.sConfig expected to be public static
+ testFinished: testMethod3(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ErrorMustBeReportedFromEachTest)
+ testSuiteFinished: classes
+ testRunFinished: 3,3,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ErrorMustBeReportedFromEachTest {
+ @RavenwoodConfig.Config
+ private static RavenwoodConfig sConfig = // Invalid because it's private.
+ new RavenwoodConfig.Builder().build();
+
+ @Test
+ public void testMethod1() {
+ }
+
+ @Test
+ public void testMethod2() {
+ }
+
+ @Test
+ public void testMethod3() {
+ }
+ }
+
+ /**
+ * Invalid because there are two @Config's.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$DuplicateConfigTest)
+ testFailure: Class com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest.DuplicateConfigTest has multiple fields with @RavenwoodConfiguration.Config
+ testFinished: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$DuplicateConfigTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class DuplicateConfigTest {
+
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig1 =
+ new RavenwoodConfig.Builder().build();
+
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig2 =
+ new RavenwoodConfig.Builder().build();
+
+ @Test
+ public void testConfig() {
+ }
+ }
+
+ /**
+ * @Config's must be static.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$NonStaticConfigTest)
+ testFailure: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$NonStaticConfigTest.sConfig expected to be public static
+ testFinished: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$NonStaticConfigTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class NonStaticConfigTest {
+
+ @RavenwoodConfig.Config
+ public RavenwoodConfig sConfig =
+ new RavenwoodConfig.Builder().build();
+
+ @Test
+ public void testConfig() {
+ }
+ }
+
+ /**
+ * @Config's must be public.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$NonPublicConfigTest)
+ testFailure: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$NonPublicConfigTest.sConfig expected to be public static
+ testFinished: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$NonPublicConfigTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class NonPublicConfigTest {
+
+ @RavenwoodConfig.Config
+ RavenwoodConfig sConfig =
+ new RavenwoodConfig.Builder().build();
+
+ @Test
+ public void testConfig() {
+ }
+ }
+
+ /**
+ * @Config's must be of type RavenwoodConfiguration.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$WrongTypeConfigTest)
+ testFailure: Field com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest.WrongTypeConfigTest.sConfig has @RavenwoodConfiguration.Config but type is not RavenwoodConfiguration
+ testFinished: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$WrongTypeConfigTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class WrongTypeConfigTest {
+
+ @RavenwoodConfig.Config
+ public Object sConfig =
+ new RavenwoodConfig.Builder().build();
+
+ @Test
+ public void testConfig() {
+ }
+
+ }
+
+ /**
+ * Config can't be used with a (instance) Rule.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$WithInstanceRuleTest)
+ testFailure: RavenwoodConfiguration and RavenwoodRule cannot be used in the same class. Suggest migrating to RavenwoodConfiguration.
+ testFinished: testConfig(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$WithInstanceRuleTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class WithInstanceRuleTest {
+
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig =
+ new RavenwoodConfig.Builder().build();
+
+ @Rule
+ public RavenwoodRule mRule = new RavenwoodRule.Builder().build();
+
+ @Test
+ public void testConfig() {
+ }
+ }
+
+ /**
+ * Config can't be used with a (static) Rule.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: Constructor(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$WithStaticRuleTest)
+ testFailure: Exception detected in constructor
+ testFinished: Constructor(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$WithStaticRuleTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class WithStaticRuleTest {
+
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig =
+ new RavenwoodConfig.Builder().build();
+
+ @Rule
+ public static RavenwoodRule sRule = new RavenwoodRule.Builder().build();
+
+ @Test
+ public void testConfig() {
+ }
+ }
+
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$DuplicateRulesTest
+ testStarted: testMultipleRulesNotAllowed(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$DuplicateRulesTest)
+ testFailure: Multiple nesting RavenwoodRule's are detected in the same class, which is not supported.
+ testFinished: testMultipleRulesNotAllowed(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$DuplicateRulesTest)
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$DuplicateRulesTest
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class DuplicateRulesTest {
+
+ @Rule
+ public final RavenwoodRule mRavenwood1 = new RavenwoodRule();
+
+ @Rule
+ public final RavenwoodRule mRavenwood2 = new RavenwoodRule();
+
+ @Test
+ public void testMultipleRulesNotAllowed() {
+ }
+ }
+
+ public static class RuleInBaseClass {
+ static String PACKAGE_NAME = "com.RuleInBaseClass";
+ @Rule
+ public final RavenwoodRule mRavenwood1 = new RavenwoodRule.Builder()
+ .setPackageName(PACKAGE_NAME).build();
+ }
+
+ /**
+ * Make sure that RavenwoodRule in a base class takes effect.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleInBaseClassSuccessTest
+ testStarted: testRuleInBaseClass(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleInBaseClassSuccessTest)
+ testFinished: testRuleInBaseClass(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleInBaseClassSuccessTest)
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleInBaseClassSuccessTest
+ testSuiteFinished: classes
+ testRunFinished: 1,0,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class RuleInBaseClassSuccessTest extends RuleInBaseClass {
+
+ @Test
+ public void testRuleInBaseClass() {
+ assertThat(InstrumentationRegistry.getInstrumentation().getContext().getPackageName())
+ .isEqualTo(PACKAGE_NAME);
+ }
+ }
+
+ /**
+ * Make sure that having a config and a rule in a base class should fail.
+ * RavenwoodRule.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testStarted: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigWithRuleInBaseClassTest)
+ testFailure: RavenwoodConfiguration and RavenwoodRule cannot be used in the same class. Suggest migrating to RavenwoodConfiguration.
+ testFinished: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigWithRuleInBaseClassTest)
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ConfigWithRuleInBaseClassTest extends RuleInBaseClass {
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig = new RavenwoodConfig.Builder().build();
+
+ @Test
+ public void test() {
+ }
+ }
+
+ /**
+ * Same as {@link RuleInBaseClass}, but the type of the rule field is not {@link RavenwoodRule}.
+ */
+ public abstract static class RuleWithDifferentTypeInBaseClass {
+ static String PACKAGE_NAME = "com.RuleWithDifferentTypeInBaseClass";
+ @Rule
+ public final TestRule mRavenwood1 = new RavenwoodRule.Builder()
+ .setPackageName(PACKAGE_NAME).build();
+ }
+
+ /**
+ * Make sure that RavenwoodRule in a base class takes effect, even if the field type is not
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleWithDifferentTypeInBaseClassSuccessTest
+ testStarted: testRuleInBaseClass(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleWithDifferentTypeInBaseClassSuccessTest)
+ testFinished: testRuleInBaseClass(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleWithDifferentTypeInBaseClassSuccessTest)
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$RuleWithDifferentTypeInBaseClassSuccessTest
+ testSuiteFinished: classes
+ testRunFinished: 1,0,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class RuleWithDifferentTypeInBaseClassSuccessTest extends RuleWithDifferentTypeInBaseClass {
+
+ @Test
+ public void testRuleInBaseClass() {
+ assertThat(InstrumentationRegistry.getInstrumentation().getContext().getPackageName())
+ .isEqualTo(PACKAGE_NAME);
+ }
+ }
+
+ /**
+ * Make sure that having a config and a rule in a base class should fail, even if the field type is not
+ * RavenwoodRule.
+ */
+ @RunWith(AndroidJUnit4.class)
+ // CHECKSTYLE:OFF
+ @Expected("""
+ testRunStarted: classes
+ testSuiteStarted: classes
+ testSuiteStarted: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigWithRuleWithDifferentTypeInBaseClassTest
+ testStarted: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigWithRuleWithDifferentTypeInBaseClassTest)
+ testFailure: RavenwoodConfiguration and RavenwoodRule cannot be used in the same class. Suggest migrating to RavenwoodConfiguration.
+ testFinished: test(com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigWithRuleWithDifferentTypeInBaseClassTest)
+ testSuiteFinished: com.android.ravenwoodtest.runnercallbacktests.RavenwoodRunnerConfigValidationTest$ConfigWithRuleWithDifferentTypeInBaseClassTest
+ testSuiteFinished: classes
+ testRunFinished: 1,1,0,0
+ """)
+ // CHECKSTYLE:ON
+ public static class ConfigWithRuleWithDifferentTypeInBaseClassTest extends RuleWithDifferentTypeInBaseClass {
+ @RavenwoodConfig.Config
+ public static RavenwoodConfig sConfig = new RavenwoodConfig.Builder().build();
+
+ @Test
+ public void test() {
+ }
+ }
+}
diff --git a/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerTestBase.java b/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerTestBase.java
new file mode 100644
index 0000000..9a6934b
--- /dev/null
+++ b/ravenwood/tests/coretest/test/com/android/ravenwoodtest/runnercallbacktests/RavenwoodRunnerTestBase.java
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ravenwoodtest.runnercallbacktests;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import android.platform.test.annotations.NoRavenizer;
+import android.platform.test.ravenwood.RavenwoodAwareTestRunner;
+import android.util.Log;
+
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+import org.junit.Test;
+import org.junit.runner.Description;
+import org.junit.runner.JUnitCore;
+import org.junit.runner.Result;
+import org.junit.runner.RunWith;
+import org.junit.runner.notification.Failure;
+import org.junit.runner.notification.RunListener;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.function.BiConsumer;
+
+
+/**
+ * Base class for tests to make sure {@link RavenwoodAwareTestRunner} produces expected callbacks
+ * in various situations. (most of them are error situations.)
+ *
+ * Subclasses must contain test classes as static inner classes with an {@link Expected} annotation.
+ * This class finds them using reflections and run them one by one directly using {@link JUnitCore},
+ * and check the callbacks.
+ *
+ * Subclasses do no need to have any test methods.
+ *
+ * The {@link Expected} annotation must contain the expected result as a string.
+ *
+ * This test abuses the fact that atest + tradefed + junit won't run nested classes automatically.
+ * (So atest won't show any results directly from the nested classes.)
+ *
+ * The actual test method is {@link #doTest}, which is executed for each target test class, using
+ * junit-params.
+ */
+@RunWith(JUnitParamsRunner.class)
+@NoRavenizer // This class shouldn't be executed with RavenwoodAwareTestRunner.
+public abstract class RavenwoodRunnerTestBase {
+ private static final String TAG = "RavenwoodRunnerTestBase";
+
+ /**
+ * Annotation to specify the expected result for a class.
+ */
+ @Target({ElementType.TYPE})
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Expected {
+ String value();
+ }
+
+ /**
+ * Take a multiline string, strip all of them, remove empty lines, and return it.
+ */
+ private static String stripMultiLines(String resultString) {
+ var list = new ArrayList<String>();
+ for (var line : resultString.split("\n")) {
+ var s = line.strip();
+ if (s.length() > 0) {
+ list.add(s);
+ }
+ }
+ return String.join("\n", list);
+ }
+
+ /**
+ * Extract the expected result from @Expected.
+ */
+ private String getExpectedResult(Class<?> testClazz) {
+ var expect = testClazz.getAnnotation(Expected.class);
+ return stripMultiLines(expect.value());
+ }
+
+ /**
+ * List all the nested classrs with an {@link Expected} annotation in a given class.
+ */
+ public Class<?>[] getTestClasses() {
+ var thisClass = this.getClass();
+ var ret = Arrays.stream(thisClass.getNestMembers())
+ .filter((c) -> c.getAnnotation(Expected.class) != null)
+ .toArray(Class[]::new);
+
+ assertThat(ret.length).isGreaterThan(0);
+
+ return ret;
+ }
+
+ /**
+ * This is the actual test method. We use junit-params to run this method for each target
+ * test class, which are returned by {@link #getTestClasses}.
+ *
+ * It runs each test class, and compare the result collected with
+ * {@link ResultCollectingListener} to expected results (as strings).
+ */
+ @Test
+ @Parameters(method = "getTestClasses")
+ public void doTest(Class<?> testClazz) {
+ doTest(testClazz, getExpectedResult(testClazz));
+ }
+
+ /**
+ * Run a given test class, and compare the result collected with
+ * {@link ResultCollectingListener} to expected results (as a string).
+ */
+ private void doTest(Class<?> testClazz, String expectedResult) {
+ Log.i(TAG, "Running test for " + testClazz);
+ var junitCore = new JUnitCore();
+
+ // Create a listener.
+ var listener = new ResultCollectingListener();
+ junitCore.addListener(listener);
+
+ // Set a listener to critical errors. This will also prevent
+ // {@link RavenwoodAwareTestRunner} from calling System.exit() when there's
+ // a critical error.
+ RavenwoodAwareTestRunner.private$ravenwood().setCriticalErrorHandler(
+ listener.sCriticalErrorListener);
+
+ try {
+ // Run the test class.
+ junitCore.run(testClazz);
+ } finally {
+ // Clear the critical error listener.
+ RavenwoodAwareTestRunner.private$ravenwood().setCriticalErrorHandler(null);
+ }
+
+ // Check the result.
+ assertWithMessage("Failure in test class: " + testClazz.getCanonicalName() + "]")
+ .that(listener.getResult())
+ .isEqualTo(expectedResult);
+ }
+
+ /**
+ * A JUnit RunListener that collects all the callbacks as a single string.
+ */
+ private static class ResultCollectingListener extends RunListener {
+ private final ArrayList<String> mResult = new ArrayList<>();
+
+ public final BiConsumer<String, Throwable> sCriticalErrorListener = (message, th) -> {
+ mResult.add("criticalError: " + message + ": " + th.getMessage());
+ };
+
+ @Override
+ public void testRunStarted(Description description) throws Exception {
+ mResult.add("testRunStarted: " + description);
+ }
+
+ @Override
+ public void testRunFinished(Result result) throws Exception {
+ mResult.add("testRunFinished: "
+ + result.getRunCount() + ","
+ + result.getFailureCount() + ","
+ + result.getAssumptionFailureCount() + ","
+ + result.getIgnoreCount());
+ }
+
+ @Override
+ public void testSuiteStarted(Description description) throws Exception {
+ mResult.add("testSuiteStarted: " + description);
+ }
+
+ @Override
+ public void testSuiteFinished(Description description) throws Exception {
+ mResult.add("testSuiteFinished: " + description);
+ }
+
+ @Override
+ public void testStarted(Description description) throws Exception {
+ mResult.add("testStarted: " + description);
+ }
+
+ @Override
+ public void testFinished(Description description) throws Exception {
+ mResult.add("testFinished: " + description);
+ }
+
+ @Override
+ public void testFailure(Failure failure) throws Exception {
+ mResult.add("testFailure: " + failure.getException().getMessage());
+ }
+
+ @Override
+ public void testAssumptionFailure(Failure failure) {
+ mResult.add("testAssumptionFailure: " + failure.getException().getMessage());
+ }
+
+ @Override
+ public void testIgnored(Description description) throws Exception {
+ mResult.add("testIgnored: " + description);
+ }
+
+ public String getResult() {
+ return String.join("\n", mResult);
+ }
+ }
+}
diff --git a/ravenwood/texts/ravenwood-standard-options.txt b/ravenwood/texts/ravenwood-standard-options.txt
index 952ab82..3ec3e3c 100644
--- a/ravenwood/texts/ravenwood-standard-options.txt
+++ b/ravenwood/texts/ravenwood-standard-options.txt
@@ -32,8 +32,11 @@
--substitute-annotation
android.ravenwood.annotation.RavenwoodReplace
---native-substitute-annotation
- android.ravenwood.annotation.RavenwoodNativeSubstitutionClass
+--redirect-annotation
+ android.ravenwood.annotation.RavenwoodRedirect
+
+--redirection-class-annotation
+ android.ravenwood.annotation.RavenwoodRedirectionClass
--class-load-hook-annotation
android.ravenwood.annotation.RavenwoodClassLoadHook
diff --git a/ravenwood/tools/ravenizer/src/com/android/platform/test/ravenwood/ravenizer/adapter/RunnerRewritingAdapter.kt b/ravenwood/tools/ravenizer/src/com/android/platform/test/ravenwood/ravenizer/adapter/RunnerRewritingAdapter.kt
index eaef2cf..bd9d96d 100644
--- a/ravenwood/tools/ravenizer/src/com/android/platform/test/ravenwood/ravenizer/adapter/RunnerRewritingAdapter.kt
+++ b/ravenwood/tools/ravenizer/src/com/android/platform/test/ravenwood/ravenizer/adapter/RunnerRewritingAdapter.kt
@@ -302,7 +302,7 @@
override fun visitCode() {
visitFieldInsn(Opcodes.GETSTATIC,
ravenwoodTestRunnerType.internlName,
- RavenwoodAwareTestRunner.IMPLICIT_CLASS_MIN_RULE_NAME,
+ RavenwoodAwareTestRunner.IMPLICIT_CLASS_OUTER_RULE_NAME,
testRuleType.desc
)
visitFieldInsn(Opcodes.PUTSTATIC,
@@ -313,7 +313,7 @@
visitFieldInsn(Opcodes.GETSTATIC,
ravenwoodTestRunnerType.internlName,
- RavenwoodAwareTestRunner.IMPLICIT_CLASS_MAX_RULE_NAME,
+ RavenwoodAwareTestRunner.IMPLICIT_CLASS_INNER_RULE_NAME,
testRuleType.desc
)
visitFieldInsn(Opcodes.PUTSTATIC,
@@ -361,7 +361,7 @@
visitVarInsn(ALOAD, 0)
visitFieldInsn(Opcodes.GETSTATIC,
ravenwoodTestRunnerType.internlName,
- RavenwoodAwareTestRunner.IMPLICIT_INST_MIN_RULE_NAME,
+ RavenwoodAwareTestRunner.IMPLICIT_INST_OUTER_RULE_NAME,
testRuleType.desc
)
visitFieldInsn(Opcodes.PUTFIELD,
@@ -373,7 +373,7 @@
visitVarInsn(ALOAD, 0)
visitFieldInsn(Opcodes.GETSTATIC,
ravenwoodTestRunnerType.internlName,
- RavenwoodAwareTestRunner.IMPLICIT_INST_MAX_RULE_NAME,
+ RavenwoodAwareTestRunner.IMPLICIT_INST_INNER_RULE_NAME,
testRuleType.desc
)
visitFieldInsn(Opcodes.PUTFIELD,
diff --git a/sax/tests/saxtests/Android.bp b/sax/tests/saxtests/Android.bp
index 446ee93..29c742f 100644
--- a/sax/tests/saxtests/Android.bp
+++ b/sax/tests/saxtests/Android.bp
@@ -12,8 +12,8 @@
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"junit",
diff --git a/services/accessibility/Android.bp b/services/accessibility/Android.bp
index 3d7ad0b..b97ff62 100644
--- a/services/accessibility/Android.bp
+++ b/services/accessibility/Android.bp
@@ -10,6 +10,7 @@
filegroup {
name: "services.accessibility-sources",
srcs: ["java/**/*.java"],
+ exclude_srcs: ["java/**/a11ychecker/*.java"],
path: "java",
visibility: ["//frameworks/base/services"],
}
@@ -26,16 +27,13 @@
},
srcs: [
":services.accessibility-sources",
- ":statslog-accessibility-java-gen",
"//frameworks/base/packages/SettingsLib/RestrictedLockUtils:SettingsLibRestrictedLockUtilsSrc",
],
libs: [
- "aatf",
"services.core",
"androidx.annotation_annotation",
],
static_libs: [
- "accessibility_protos_lite",
"com_android_server_accessibility_flags_lib",
"//frameworks/base/packages/SystemUI/aconfig:com_android_systemui_flags_lib",
],
@@ -70,12 +68,3 @@
name: "com_android_server_accessibility_flags_lib",
aconfig_declarations: "com_android_server_accessibility_flags",
}
-
-genrule {
- name: "statslog-accessibility-java-gen",
- tools: ["stats-log-api-gen"],
- cmd: "$(location stats-log-api-gen) --java $(out) --module accessibility" +
- " --javaPackage com.android.server.accessibility.a11ychecker" +
- " --javaClass AccessibilityCheckerStatsLog --minApiLevel 34",
- out: ["java/com/android/server/accessibility/a11ychecker/AccessibilityCheckerStatsLog.java"],
-}
diff --git a/services/accessibility/TEST_MAPPING b/services/accessibility/TEST_MAPPING
index 3f85a90..0bc25e2 100644
--- a/services/accessibility/TEST_MAPPING
+++ b/services/accessibility/TEST_MAPPING
@@ -1,34 +1,19 @@
{
"presubmit": [
{
- "name": "CtsAccessibilityServiceTestCases",
- "options": [
- {
- "exclude-annotation": "androidx.test.filters.FlakyTest"
- }
- ]
+ "name": "CtsAccessibilityServiceTestCases"
},
{
- "name": "CtsAccessibilityTestCases",
- "options": [
- {
- "exclude-annotation": "androidx.test.filters.FlakyTest"
- }
- ]
+ "name": "CtsAccessibilityTestCases"
},
{
- "name": "CtsUiAutomationTestCases",
- "options": [
- {
- "exclude-annotation": "androidx.test.filters.FlakyTest"
- }
- ]
+ "name": "CtsUiAutomationTestCases"
},
{
- "name": "FrameworksServicesTests_accessibility_Presubmit"
+ "name": "FrameworksServicesTests_accessibility"
},
{
- "name": "FrameworksCoreTests_accessibility_NO_FLAKES"
+ "name": "FrameworksCoreTests_accessibility"
}
],
"postsubmit": [
@@ -45,12 +30,7 @@
"name": "CtsUiAutomationTestCases"
},
{
- "name": "FrameworksServicesTests",
- "options": [
- {
- "include-filter": "com.android.server.accessibility"
- }
- ]
+ "name": "FrameworksServicesTests_accessibility"
},
{
"name": "FrameworksCoreTests_accessibility"
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index b541345..7580b69 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -58,6 +58,7 @@
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.SOFTWARE;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.TRIPLETAP;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.TWOFINGER_DOUBLETAP;
+import static com.android.internal.accessibility.dialog.AccessibilityButtonChooserActivity.EXTRA_TYPE_TO_CHOOSE;
import static com.android.internal.accessibility.util.AccessibilityStatsLogUtils.logAccessibilityShortcutActivated;
import static com.android.internal.accessibility.util.AccessibilityUtils.isUserSetupCompleted;
import static com.android.internal.util.FunctionalUtils.ignoreRemoteException;
@@ -1616,7 +1617,7 @@
/**
* Invoked remotely over AIDL by SysUi when the accessibility button within the system's
- * navigation area has been clicked.
+ * navigation area has been clicked, or a gesture shortcut input has been performed.
*
* @param displayId The logical display id.
* @param targetName The flattened {@link ComponentName} string or the class name of a system
@@ -1646,7 +1647,26 @@
}
mMainHandler.sendMessage(obtainMessage(
AccessibilityManagerService::performAccessibilityShortcutInternal, this,
- displayId, SOFTWARE, targetName));
+ displayId, getShortcutTypeForGenericShortcutCalls(currentUserId), targetName));
+ }
+
+ /**
+ * AIDL-exposed method to show the dialog
+ * for choosing the target for the gesture or button shortcuts.
+ * The shortcut is determined by the current navigation mode.
+ *
+ * @param displayId The id for the display to show the dialog on.
+ */
+ @Override
+ @EnforcePermission(STATUS_BAR_SERVICE)
+ public void notifyAccessibilityButtonLongClicked(int displayId) {
+ notifyAccessibilityButtonLongClicked_enforcePermission();
+ int userId;
+ synchronized (mLock) {
+ userId = mCurrentUserId;
+ }
+ showAccessibilityTargetsSelection(displayId,
+ getShortcutTypeForGenericShortcutCalls(userId), userId);
}
/**
@@ -2344,16 +2364,18 @@
}
}
- private void showAccessibilityTargetsSelection(int displayId,
- @UserShortcutType int shortcutType) {
+ private void showAccessibilityTargetsSelection(int displayId, int shortcutType,
+ int userId) {
final Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
final String chooserClassName = (shortcutType == HARDWARE)
? AccessibilityShortcutChooserActivity.class.getName()
: AccessibilityButtonChooserActivity.class.getName();
intent.setClassName(CHOOSER_PACKAGE_NAME, chooserClassName);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ intent.putExtra(EXTRA_TYPE_TO_CHOOSE, shortcutType);
final Bundle bundle = ActivityOptions.makeBasic().setLaunchDisplayId(displayId).toBundle();
- mContext.startActivityAsUser(intent, bundle, UserHandle.of(mCurrentUserId));
+ mMainHandler.post(() ->
+ mContext.startActivityAsUser(intent, bundle, UserHandle.of(userId)));
}
private void launchShortcutTargetActivity(int displayId, ComponentName name) {
@@ -4011,7 +4033,7 @@
* Perform the accessibility shortcut action.
*
* @param shortcutType The shortcut type.
- * @param displayId The display id of the accessibility button.
+ * @param displayId The display id the shortcut is being performed from.
* @param targetName The flattened {@link ComponentName} string or the class name of a system
* class implementing a supported accessibility feature, or {@code null} if there's no
* specified target.
@@ -4031,7 +4053,8 @@
if (targetName == null) {
// In case there are many targets assigned to the given shortcut.
if (shortcutTargets.size() > 1) {
- showAccessibilityTargetsSelection(displayId, shortcutType);
+ showAccessibilityTargetsSelection(
+ displayId, shortcutType, getCurrentUserState().mUserId);
return;
}
targetName = shortcutTargets.get(0);
@@ -6563,6 +6586,18 @@
callback));
}
+ @VisibleForTesting
+ int getShortcutTypeForGenericShortcutCalls(int userId) {
+ int navigationMode = Settings.Secure.getIntForUser(
+ mContext.getContentResolver(),
+ Settings.Secure.NAVIGATION_MODE, -1, userId);
+ if (android.provider.Flags.a11yStandaloneGestureEnabled()) {
+ return (navigationMode == NAV_BAR_MODE_GESTURAL) ? GESTURE : SOFTWARE;
+ } else {
+ return SOFTWARE;
+ }
+ }
+
void attachAccessibilityOverlayToDisplayInternal(
int interactionId,
int displayId,
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
index b18e6ba..0bf7ec00 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java
@@ -57,6 +57,7 @@
import com.android.internal.R;
import com.android.internal.accessibility.AccessibilityShortcutController;
+import com.android.internal.accessibility.common.ShortcutConstants;
import com.android.internal.accessibility.util.ShortcutUtils;
import java.io.FileDescriptor;
@@ -707,11 +708,16 @@
}
/**
- * Returns true if navibar magnification or shortcut key magnification is enabled.
+ * Returns true if a magnification shortcut of any type is enabled.
*/
public boolean isShortcutMagnificationEnabledLocked() {
- return mAccessibilityShortcutKeyTargets.contains(MAGNIFICATION_CONTROLLER_NAME)
- || mAccessibilityButtonTargets.contains(MAGNIFICATION_CONTROLLER_NAME);
+ for (int shortcutType : ShortcutConstants.USER_SHORTCUT_TYPES) {
+ if (getShortcutTargetsInternalLocked(shortcutType)
+ .contains(MAGNIFICATION_CONTROLLER_NAME)) {
+ return true;
+ }
+ }
+ return false;
}
/**
diff --git a/services/accessibility/java/com/android/server/accessibility/a11ychecker/Android.bp b/services/accessibility/java/com/android/server/accessibility/a11ychecker/Android.bp
new file mode 100644
index 0000000..e9ed202
--- /dev/null
+++ b/services/accessibility/java/com/android/server/accessibility/a11ychecker/Android.bp
@@ -0,0 +1,31 @@
+package {
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+// TODO(http://b/364326163): a11ychecker depends on aatf which currently can't be used in the system
+// server as it pulls in test deps. We moved a11ychecker sources from services.accessibility to an
+// isolated library while this is resolved.
+java_library_static {
+ name: "a11ychecker",
+ srcs: [
+ "*.java",
+ ":statslog-accessibility-java-gen",
+ ],
+ libs: [
+ "aatf",
+ "androidx.annotation_annotation",
+ ],
+ static_libs: [
+ "accessibility_protos_lite",
+ "com_android_server_accessibility_flags_lib",
+ ],
+}
+
+genrule {
+ name: "statslog-accessibility-java-gen",
+ tools: ["stats-log-api-gen"],
+ cmd: "$(location stats-log-api-gen) --java $(out) --module accessibility" +
+ " --javaPackage com.android.server.accessibility.a11ychecker" +
+ " --javaClass AccessibilityCheckerStatsLog --minApiLevel 34",
+ out: ["java/com/android/server/accessibility/a11ychecker/AccessibilityCheckerStatsLog.java"],
+}
diff --git a/services/appfunctions/TEST_MAPPING b/services/appfunctions/TEST_MAPPING
new file mode 100644
index 0000000..91e82ec
--- /dev/null
+++ b/services/appfunctions/TEST_MAPPING
@@ -0,0 +1,10 @@
+{
+ "postsubmit": [
+ {
+ "name": "FrameworksAppFunctionsTests"
+ },
+ {
+ "name": "CtsAppFunctionTestCases"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java
new file mode 100644
index 0000000..c3b7087
--- /dev/null
+++ b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.appfunctions;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/** Executors for App function operations. */
+public final class AppFunctionExecutors {
+
+ /** Executor for operations that do not need to block. */
+ public static final Executor THREAD_POOL_EXECUTOR =
+ new ThreadPoolExecutor(
+ /* corePoolSize= */ Runtime.getRuntime().availableProcessors(),
+ /* maxConcurrency= */ Runtime.getRuntime().availableProcessors(),
+ /* keepAliveTime= */ 0L,
+ /* unit= */ TimeUnit.SECONDS,
+ /* workQueue= */ new LinkedBlockingQueue<>());
+
+ private AppFunctionExecutors() {}
+}
diff --git a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java
index f04bd9f..f83269f 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java
@@ -16,6 +16,8 @@
package com.android.server.appfunctions;
+import static com.android.server.appfunctions.AppFunctionExecutors.THREAD_POOL_EXECUTOR;
+
import android.annotation.NonNull;
import android.app.appfunctions.ExecuteAppFunctionAidlRequest;
import android.app.appfunctions.ExecuteAppFunctionResponse;
@@ -51,14 +53,7 @@
public AppFunctionManagerServiceImpl(@NonNull Context context) {
this(
new RemoteServiceCallerImpl<>(
- context,
- IAppFunctionService.Stub::asInterface,
- new ThreadPoolExecutor(
- /* corePoolSize= */ Runtime.getRuntime().availableProcessors(),
- /* maxConcurrency= */ Runtime.getRuntime().availableProcessors(),
- /* keepAliveTime= */ 0L,
- /* unit= */ TimeUnit.SECONDS,
- /* workQueue= */ new LinkedBlockingQueue<>())),
+ context, IAppFunctionService.Stub::asInterface, THREAD_POOL_EXECUTOR),
new CallerValidatorImpl(context),
new ServiceHelperImpl(context),
new ServiceConfigImpl());
@@ -124,39 +119,47 @@
return;
}
- if (!mCallerValidator.verifyCallerCanExecuteAppFunction(
- validatedCallingPackage, targetPackageName)) {
- safeExecuteAppFunctionCallback.onResult(
- ExecuteAppFunctionResponse.newFailure(
- ExecuteAppFunctionResponse.RESULT_DENIED,
- "Caller does not have permission to execute the appfunction",
- /* extras= */ null));
- return;
- }
-
- Intent serviceIntent =
- mInternalServiceHelper.resolveAppFunctionService(targetPackageName, targetUser);
- if (serviceIntent == null) {
- safeExecuteAppFunctionCallback.onResult(
- ExecuteAppFunctionResponse.newFailure(
- ExecuteAppFunctionResponse.RESULT_INTERNAL_ERROR,
- "Cannot find the target service.",
- /* extras= */ null));
- return;
- }
-
- final long token = Binder.clearCallingIdentity();
- try {
- bindAppFunctionServiceUnchecked(
- requestInternal,
- serviceIntent,
- targetUser,
- safeExecuteAppFunctionCallback,
- /* bindFlags= */ Context.BIND_AUTO_CREATE,
- /* timeoutInMillis= */ mServiceConfig.getExecuteAppFunctionTimeoutMillis());
- } finally {
- Binder.restoreCallingIdentity(token);
- }
+ mCallerValidator
+ .verifyCallerCanExecuteAppFunction(
+ validatedCallingPackage,
+ targetPackageName,
+ requestInternal.getClientRequest().getFunctionIdentifier())
+ .thenAccept(
+ canExecute -> {
+ if (!canExecute) {
+ safeExecuteAppFunctionCallback.onResult(
+ ExecuteAppFunctionResponse.newFailure(
+ ExecuteAppFunctionResponse.RESULT_DENIED,
+ "Caller does not have permission to execute the"
+ + " appfunction",
+ /* extras= */ null));
+ return;
+ }
+ Intent serviceIntent =
+ mInternalServiceHelper.resolveAppFunctionService(
+ targetPackageName, targetUser);
+ if (serviceIntent == null) {
+ safeExecuteAppFunctionCallback.onResult(
+ ExecuteAppFunctionResponse.newFailure(
+ ExecuteAppFunctionResponse.RESULT_INTERNAL_ERROR,
+ "Cannot find the target service.",
+ /* extras= */ null));
+ return;
+ }
+ final long token = Binder.clearCallingIdentity();
+ try {
+ bindAppFunctionServiceUnchecked(
+ requestInternal,
+ serviceIntent,
+ targetUser,
+ safeExecuteAppFunctionCallback,
+ /* bindFlags= */ Context.BIND_AUTO_CREATE,
+ /* timeoutInMillis= */ mServiceConfig
+ .getExecuteAppFunctionTimeoutMillis());
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ });
}
private void bindAppFunctionServiceUnchecked(
diff --git a/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java b/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java
index ca43dfa..e7a861e 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java
@@ -21,6 +21,7 @@
import android.os.UserHandle;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.infra.AndroidFuture;
/**
* Interface for validating that the caller has the correct privilege to call an AppFunctionManager
@@ -65,10 +66,13 @@
*
* @param callerPackageName The calling package (as previously validated).
* @param targetPackageName The package that owns the app function to execute.
+ * @param functionId The id of the app function to execute.
* @return Whether the caller can execute the specified app function.
*/
- boolean verifyCallerCanExecuteAppFunction(
- @NonNull String callerPackageName, @NonNull String targetPackageName);
+ AndroidFuture<Boolean> verifyCallerCanExecuteAppFunction(
+ @NonNull String callerPackageName,
+ @NonNull String targetPackageName,
+ @NonNull String functionId);
/**
* Checks if the user is organization managed.
diff --git a/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java b/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java
index 35905ed..9998438 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java
@@ -16,19 +16,30 @@
package com.android.server.appfunctions;
+import static android.app.appfunctions.AppFunctionStaticMetadataHelper.APP_FUNCTION_STATIC_METADATA_DB;
+import static android.app.appfunctions.AppFunctionStaticMetadataHelper.APP_FUNCTION_STATIC_NAMESPACE;
+import static android.app.appfunctions.AppFunctionStaticMetadataHelper.STATIC_PROPERTY_RESTRICT_CALLERS_WITH_EXECUTE_APP_FUNCTIONS;
+import static android.app.appfunctions.AppFunctionStaticMetadataHelper.getDocumentIdForAppFunction;
+import static com.android.server.appfunctions.AppFunctionExecutors.THREAD_POOL_EXECUTOR;
+
import android.Manifest;
import android.annotation.BinderThread;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.app.admin.DevicePolicyManager;
+import android.app.appsearch.AppSearchBatchResult;
+import android.app.appsearch.AppSearchManager;
+import android.app.appsearch.AppSearchManager.SearchContext;
+import android.app.appsearch.GenericDocument;
+import android.app.appsearch.GetByDocumentIdRequest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
-
import java.util.Objects;
+import com.android.internal.infra.AndroidFuture;
/* Validates that caller has the correct privilege to call an AppFunctionManager Api. */
class CallerValidatorImpl implements CallerValidator {
@@ -76,20 +87,70 @@
Manifest.permission.EXECUTE_APP_FUNCTIONS
},
conditional = true)
- // TODO(b/360864791): Add and honor apps that opt-out from EXECUTE_APP_FUNCTIONS caller.
- public boolean verifyCallerCanExecuteAppFunction(
- @NonNull String callerPackageName, @NonNull String targetPackageName) {
+ public AndroidFuture<Boolean> verifyCallerCanExecuteAppFunction(
+ @NonNull String callerPackageName,
+ @NonNull String targetPackageName,
+ @NonNull String functionId) {
+ if (callerPackageName.equals(targetPackageName)) {
+ return AndroidFuture.completedFuture(true);
+ }
+
int pid = Binder.getCallingPid();
int uid = Binder.getCallingUid();
- boolean hasExecutionPermission =
+ boolean hasTrustedExecutionPermission =
mContext.checkPermission(
Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, pid, uid)
== PackageManager.PERMISSION_GRANTED;
- boolean hasTrustedExecutionPermission =
+
+ if (hasTrustedExecutionPermission) {
+ return AndroidFuture.completedFuture(true);
+ }
+
+ boolean hasExecutionPermission =
mContext.checkPermission(Manifest.permission.EXECUTE_APP_FUNCTIONS, pid, uid)
== PackageManager.PERMISSION_GRANTED;
- boolean isSamePackage = callerPackageName.equals(targetPackageName);
- return hasExecutionPermission || hasTrustedExecutionPermission || isSamePackage;
+
+ final long token = Binder.clearCallingIdentity();
+ try {
+ FutureAppSearchSession futureAppSearchSession =
+ new FutureAppSearchSessionImpl(
+ mContext.getSystemService(AppSearchManager.class),
+ THREAD_POOL_EXECUTOR,
+ new SearchContext.Builder(APP_FUNCTION_STATIC_METADATA_DB).build());
+
+ String documentId = getDocumentIdForAppFunction(targetPackageName, functionId);
+
+ return futureAppSearchSession
+ .getByDocumentId(
+ new GetByDocumentIdRequest.Builder(APP_FUNCTION_STATIC_NAMESPACE)
+ .addIds(documentId)
+ .build())
+ .thenApply(
+ batchResult ->
+ getGenericDocumentFromBatchResult(batchResult, documentId))
+ .thenApply(
+ CallerValidatorImpl::getRestrictCallersWithExecuteAppFunctionsProperty)
+ .thenApply(
+ restrictCallersWithExecuteAppFunctions ->
+ !restrictCallersWithExecuteAppFunctions
+ && hasExecutionPermission);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
+ private static GenericDocument getGenericDocumentFromBatchResult(
+ AppSearchBatchResult<String, GenericDocument> result, String documentId) {
+ if (result.isSuccess()) {
+ return result.getSuccesses().get(documentId);
+ }
+ throw new IllegalArgumentException("No document in the result for id: " + documentId);
+ }
+
+ private static boolean getRestrictCallersWithExecuteAppFunctionsProperty(
+ GenericDocument genericDocument) {
+ return genericDocument.getPropertyBoolean(
+ STATIC_PROPERTY_RESTRICT_CALLERS_WITH_EXECUTE_APP_FUNCTIONS);
}
@Override
diff --git a/services/appfunctions/java/com/android/server/appfunctions/FutureAppSearchSession.java b/services/appfunctions/java/com/android/server/appfunctions/FutureAppSearchSession.java
new file mode 100644
index 0000000..b1c25c4
--- /dev/null
+++ b/services/appfunctions/java/com/android/server/appfunctions/FutureAppSearchSession.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.appfunctions;
+
+import android.annotation.NonNull;
+import android.app.appsearch.AppSearchBatchResult;
+import android.app.appsearch.AppSearchResult;
+import android.app.appsearch.AppSearchSession;
+import android.app.appsearch.GenericDocument;
+import android.app.appsearch.GetByDocumentIdRequest;
+import android.app.appsearch.GetSchemaResponse;
+import android.app.appsearch.PutDocumentsRequest;
+import android.app.appsearch.RemoveByDocumentIdRequest;
+import android.app.appsearch.SearchResult;
+import android.app.appsearch.SearchResults;
+import android.app.appsearch.SearchSpec;
+import android.app.appsearch.SetSchemaRequest;
+import android.app.appsearch.SetSchemaResponse;
+
+import com.android.internal.infra.AndroidFuture;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.Executor;
+
+/** A future API wrapper of {@link AppSearchSession} APIs. */
+public interface FutureAppSearchSession extends Closeable {
+
+ /** Converts a failed app search result codes into an exception. */
+ @NonNull
+ static Exception failedResultToException(@NonNull AppSearchResult<?> appSearchResult) {
+ return switch (appSearchResult.getResultCode()) {
+ case AppSearchResult.RESULT_INVALID_ARGUMENT ->
+ new IllegalArgumentException(appSearchResult.getErrorMessage());
+ case AppSearchResult.RESULT_IO_ERROR ->
+ new IOException(appSearchResult.getErrorMessage());
+ case AppSearchResult.RESULT_SECURITY_ERROR ->
+ new SecurityException(appSearchResult.getErrorMessage());
+ default -> new IllegalStateException(appSearchResult.getErrorMessage());
+ };
+ }
+
+ /**
+ * Sets the schema that represents the organizational structure of data within the AppSearch
+ * database.
+ */
+ AndroidFuture<SetSchemaResponse> setSchema(@NonNull SetSchemaRequest setSchemaRequest);
+
+ /** Retrieves the schema most recently successfully provided to {@code setSchema}. */
+ AndroidFuture<GetSchemaResponse> getSchema();
+
+ /** Indexes documents into the {@link AppSearchSession} database. */
+ AndroidFuture<AppSearchBatchResult<String, Void>> put(
+ @NonNull PutDocumentsRequest putDocumentsRequest);
+
+ /** Removes {@link GenericDocument} from the index by Query. */
+ AndroidFuture<AppSearchBatchResult<String, Void>> remove(
+ @NonNull RemoveByDocumentIdRequest removeRequest);
+
+ /**
+ * Gets {@link GenericDocument} objects by document IDs in a namespace from the {@link
+ * AppSearchSession} database.
+ */
+ AndroidFuture<AppSearchBatchResult<String, GenericDocument>> getByDocumentId(
+ GetByDocumentIdRequest getRequest);
+
+ /**
+ * Retrieves documents from the open {@link AppSearchSession} that match a given query string
+ * and type of search provided.
+ */
+ AndroidFuture<FutureSearchResults> search(
+ @NonNull String queryExpression, @NonNull SearchSpec searchSpec);
+
+ /** A future API wrapper of {@link android.app.appsearch.SearchResults}. */
+ class FutureSearchResults {
+ private final SearchResults mSearchResults;
+ private final Executor mExecutor;
+
+ public FutureSearchResults(
+ @NonNull SearchResults searchResults, @NonNull Executor executor) {
+ mSearchResults = Objects.requireNonNull(searchResults);
+ mExecutor = Objects.requireNonNull(executor);
+ }
+
+ public AndroidFuture<List<SearchResult>> getNextPage() {
+ AndroidFuture<AppSearchResult<List<SearchResult>>> nextPageFuture =
+ new AndroidFuture<>();
+
+ mSearchResults.getNextPage(mExecutor, nextPageFuture::complete);
+ return nextPageFuture.thenApply(
+ result -> {
+ if (result.isSuccess()) {
+ return result.getResultValue();
+ } else {
+ throw new RuntimeException(failedResultToException(result));
+ }
+ });
+ }
+ }
+}
diff --git a/services/appfunctions/java/com/android/server/appfunctions/FutureAppSearchSessionImpl.java b/services/appfunctions/java/com/android/server/appfunctions/FutureAppSearchSessionImpl.java
new file mode 100644
index 0000000..e78f390
--- /dev/null
+++ b/services/appfunctions/java/com/android/server/appfunctions/FutureAppSearchSessionImpl.java
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.appfunctions;
+
+import static com.android.server.appfunctions.FutureAppSearchSession.failedResultToException;
+
+import android.annotation.NonNull;
+import android.app.appsearch.AppSearchBatchResult;
+import android.app.appsearch.AppSearchManager;
+import android.app.appsearch.AppSearchManager.SearchContext;
+import android.app.appsearch.AppSearchResult;
+import android.app.appsearch.AppSearchSession;
+import android.app.appsearch.BatchResultCallback;
+import android.app.appsearch.GenericDocument;
+import android.app.appsearch.GetByDocumentIdRequest;
+import android.app.appsearch.GetSchemaResponse;
+import android.app.appsearch.PutDocumentsRequest;
+import android.app.appsearch.RemoveByDocumentIdRequest;
+import android.app.appsearch.SearchSpec;
+import android.app.appsearch.SetSchemaRequest;
+import android.app.appsearch.SetSchemaResponse;
+
+import com.android.internal.infra.AndroidFuture;
+
+import java.io.IOException;
+import java.util.Objects;
+import java.util.concurrent.Executor;
+
+/** Implementation of {@link FutureAppSearchSession} */
+public class FutureAppSearchSessionImpl implements FutureAppSearchSession {
+
+ private static final String TAG = FutureAppSearchSession.class.getSimpleName();
+ private final Executor mExecutor;
+ private final AndroidFuture<AppSearchResult<AppSearchSession>> mSettableSessionFuture;
+
+ public FutureAppSearchSessionImpl(
+ @NonNull AppSearchManager appSearchManager,
+ @NonNull Executor executor,
+ @NonNull SearchContext appSearchContext) {
+ Objects.requireNonNull(appSearchManager);
+ Objects.requireNonNull(executor);
+ Objects.requireNonNull(appSearchContext);
+
+ mExecutor = executor;
+ mSettableSessionFuture = new AndroidFuture<>();
+ appSearchManager.createSearchSession(
+ appSearchContext, mExecutor, mSettableSessionFuture::complete);
+ }
+
+ private AndroidFuture<AppSearchSession> getSessionAsync() {
+ return mSettableSessionFuture.thenApply(
+ result -> {
+ if (result.isSuccess()) {
+ return result.getResultValue();
+ } else {
+ throw new RuntimeException(failedResultToException(result));
+ }
+ });
+ }
+
+ @Override
+ public AndroidFuture<SetSchemaResponse> setSchema(@NonNull SetSchemaRequest setSchemaRequest) {
+ Objects.requireNonNull(setSchemaRequest);
+
+ return getSessionAsync()
+ .thenCompose(
+ session -> {
+ AndroidFuture<AppSearchResult<SetSchemaResponse>>
+ settableSchemaResponse = new AndroidFuture<>();
+ session.setSchema(
+ setSchemaRequest,
+ mExecutor,
+ mExecutor,
+ settableSchemaResponse::complete);
+ return settableSchemaResponse.thenApply(
+ result -> {
+ if (result.isSuccess()) {
+ return result.getResultValue();
+ } else {
+ throw new RuntimeException(
+ failedResultToException(result));
+ }
+ });
+ });
+ }
+
+ @Override
+ public AndroidFuture<GetSchemaResponse> getSchema() {
+ return getSessionAsync()
+ .thenCompose(
+ session -> {
+ AndroidFuture<AppSearchResult<GetSchemaResponse>>
+ settableSchemaResponse = new AndroidFuture<>();
+ session.getSchema(mExecutor, settableSchemaResponse::complete);
+ return settableSchemaResponse.thenApply(
+ result -> {
+ if (result.isSuccess()) {
+ return result.getResultValue();
+ } else {
+ throw new RuntimeException(
+ failedResultToException(result));
+ }
+ });
+ });
+ }
+
+ @Override
+ public AndroidFuture<AppSearchBatchResult<String, Void>> put(
+ @NonNull PutDocumentsRequest putDocumentsRequest) {
+ Objects.requireNonNull(putDocumentsRequest);
+
+ return getSessionAsync()
+ .thenCompose(
+ session -> {
+ AndroidFuture<AppSearchBatchResult<String, Void>> batchResultFuture =
+ new AndroidFuture<>();
+
+ session.put(
+ putDocumentsRequest, mExecutor, batchResultFuture::complete);
+ return batchResultFuture;
+ });
+ }
+
+ @Override
+ public AndroidFuture<AppSearchBatchResult<String, Void>> remove(
+ @NonNull RemoveByDocumentIdRequest removeRequest) {
+ Objects.requireNonNull(removeRequest);
+
+ return getSessionAsync()
+ .thenCompose(
+ session -> {
+ AndroidFuture<AppSearchBatchResult<String, Void>>
+ settableBatchResultFuture = new AndroidFuture<>();
+ session.remove(
+ removeRequest,
+ mExecutor,
+ new BatchResultCallbackAdapter<>(settableBatchResultFuture));
+ return settableBatchResultFuture;
+ });
+ }
+
+ @Override
+ public AndroidFuture<AppSearchBatchResult<String, GenericDocument>> getByDocumentId(
+ @NonNull GetByDocumentIdRequest getRequest) {
+ Objects.requireNonNull(getRequest);
+
+ return getSessionAsync()
+ .thenCompose(
+ session -> {
+ AndroidFuture<AppSearchBatchResult<String, GenericDocument>>
+ batchResultFuture = new AndroidFuture<>();
+ session.getByDocumentId(
+ getRequest,
+ mExecutor,
+ new BatchResultCallbackAdapter<>(batchResultFuture));
+ return batchResultFuture;
+ });
+ }
+
+ @Override
+ public AndroidFuture<FutureSearchResults> search(
+ @NonNull String queryExpression, @NonNull SearchSpec searchSpec) {
+ return getSessionAsync()
+ .thenApply(session -> session.search(queryExpression, searchSpec))
+ .thenApply(result -> new FutureSearchResults(result, mExecutor));
+ }
+
+ @Override
+ public void close() throws IOException {}
+
+ private static final class BatchResultCallbackAdapter<K, V>
+ implements BatchResultCallback<K, V> {
+ private final AndroidFuture<AppSearchBatchResult<K, V>> mFuture;
+
+ BatchResultCallbackAdapter(AndroidFuture<AppSearchBatchResult<K, V>> future) {
+ mFuture = future;
+ }
+
+ @Override
+ public void onResult(@NonNull AppSearchBatchResult<K, V> result) {
+ mFuture.complete(result);
+ }
+
+ @Override
+ public void onSystemError(Throwable t) {
+ mFuture.completeExceptionally(t);
+ }
+ }
+}
diff --git a/services/appfunctions/java/com/android/server/appfunctions/FutureGlobalSearchSession.java b/services/appfunctions/java/com/android/server/appfunctions/FutureGlobalSearchSession.java
new file mode 100644
index 0000000..0c22624
--- /dev/null
+++ b/services/appfunctions/java/com/android/server/appfunctions/FutureGlobalSearchSession.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.appfunctions;
+
+import android.annotation.NonNull;
+import android.app.appsearch.AppSearchManager;
+import android.app.appsearch.AppSearchResult;
+import android.app.appsearch.GlobalSearchSession;
+import android.app.appsearch.exceptions.AppSearchException;
+import android.app.appsearch.observer.ObserverCallback;
+import android.app.appsearch.observer.ObserverSpec;
+import android.util.Slog;
+
+import com.android.internal.infra.AndroidFuture;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.concurrent.Executor;
+
+/** A wrapper around {@link GlobalSearchSession} that provides a future-based API. */
+public class FutureGlobalSearchSession implements Closeable {
+ private static final String TAG = FutureGlobalSearchSession.class.getSimpleName();
+ private final Executor mExecutor;
+ private final AndroidFuture<AppSearchResult<GlobalSearchSession>> mSettableSessionFuture;
+
+ public FutureGlobalSearchSession(
+ @NonNull AppSearchManager appSearchManager, @NonNull Executor executor) {
+ this.mExecutor = executor;
+ mSettableSessionFuture = new AndroidFuture<>();
+ appSearchManager.createGlobalSearchSession(mExecutor, mSettableSessionFuture::complete);
+ }
+
+ private AndroidFuture<GlobalSearchSession> getSessionAsync() {
+ return mSettableSessionFuture.thenApply(
+ result -> {
+ if (result.isSuccess()) {
+ return result.getResultValue();
+ } else {
+ throw new RuntimeException(
+ FutureAppSearchSession.failedResultToException(result));
+ }
+ });
+ }
+
+ /**
+ * Registers an observer callback for the given target package name.
+ *
+ * @param targetPackageName The package name of the target app.
+ * @param spec The observer spec.
+ * @param executor The executor to run the observer callback on.
+ * @param observer The observer callback to register.
+ * @return A future that completes once the observer is registered.
+ */
+ public AndroidFuture<Void> registerObserverCallbackAsync(
+ String targetPackageName,
+ ObserverSpec spec,
+ Executor executor,
+ ObserverCallback observer) {
+ return getSessionAsync()
+ .thenCompose(
+ session -> {
+ try {
+ session.registerObserverCallback(
+ targetPackageName, spec, executor, observer);
+ return AndroidFuture.completedFuture(null);
+ } catch (AppSearchException e) {
+ throw new RuntimeException(e);
+ }
+ });
+ }
+
+ @Override
+ public void close() throws IOException {
+ try {
+ getSessionAsync().get().close();
+ } catch (Exception ex) {
+ Slog.e(TAG, "Failed to close global search session", ex);
+ }
+ }
+}
diff --git a/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java b/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java
new file mode 100644
index 0000000..01e1008
--- /dev/null
+++ b/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.appfunctions;
+
+import android.annotation.NonNull;
+import android.annotation.WorkerThread;
+import android.app.appsearch.PropertyPath;
+import android.app.appsearch.SearchResult;
+import android.app.appsearch.SearchSpec;
+import android.util.ArrayMap;
+import android.util.ArraySet;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.appfunctions.FutureAppSearchSession.FutureSearchResults;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Executor;
+
+/**
+ * This class implements helper methods for synchronously interacting with AppSearch while
+ * synchronizing AppFunction runtime and static metadata.
+ */
+public class MetadataSyncAdapter {
+ private final FutureAppSearchSession mFutureAppSearchSession;
+ private final Executor mSyncExecutor;
+
+ public MetadataSyncAdapter(
+ @NonNull Executor syncExecutor,
+ @NonNull FutureAppSearchSession futureAppSearchSession) {
+ mSyncExecutor = Objects.requireNonNull(syncExecutor);
+ mFutureAppSearchSession = Objects.requireNonNull(futureAppSearchSession);
+ }
+
+ /**
+ * This method returns a map of package names to a set of function ids that are in the static
+ * metadata but not in the runtime metadata.
+ *
+ * @param staticPackageToFunctionMap A map of package names to a set of function ids from the
+ * static metadata.
+ * @param runtimePackageToFunctionMap A map of package names to a set of function ids from the
+ * runtime metadata.
+ * @return A map of package names to a set of function ids that are in the static metadata but
+ * not in the runtime metadata.
+ */
+ @NonNull
+ @VisibleForTesting
+ static ArrayMap<String, ArraySet<String>> getAddedFunctionsDiffMap(
+ @NonNull ArrayMap<String, ArraySet<String>> staticPackageToFunctionMap,
+ @NonNull ArrayMap<String, ArraySet<String>> runtimePackageToFunctionMap) {
+ Objects.requireNonNull(staticPackageToFunctionMap);
+ Objects.requireNonNull(runtimePackageToFunctionMap);
+
+ return getFunctionsDiffMap(staticPackageToFunctionMap, runtimePackageToFunctionMap);
+ }
+
+ /**
+ * This method returns a map of package names to a set of function ids that are in the runtime
+ * metadata but not in the static metadata.
+ *
+ * @param staticPackageToFunctionMap A map of package names to a set of function ids from the
+ * static metadata.
+ * @param runtimePackageToFunctionMap A map of package names to a set of function ids from the
+ * runtime metadata.
+ * @return A map of package names to a set of function ids that are in the runtime metadata but
+ * not in the static metadata.
+ */
+ @NonNull
+ @VisibleForTesting
+ static ArrayMap<String, ArraySet<String>> getRemovedFunctionsDiffMap(
+ @NonNull ArrayMap<String, ArraySet<String>> staticPackageToFunctionMap,
+ @NonNull ArrayMap<String, ArraySet<String>> runtimePackageToFunctionMap) {
+ Objects.requireNonNull(staticPackageToFunctionMap);
+ Objects.requireNonNull(runtimePackageToFunctionMap);
+
+ return getFunctionsDiffMap(runtimePackageToFunctionMap, staticPackageToFunctionMap);
+ }
+
+ @NonNull
+ private static ArrayMap<String, ArraySet<String>> getFunctionsDiffMap(
+ @NonNull ArrayMap<String, ArraySet<String>> packageToFunctionMapA,
+ @NonNull ArrayMap<String, ArraySet<String>> packageToFunctionMapB) {
+ Objects.requireNonNull(packageToFunctionMapA);
+ Objects.requireNonNull(packageToFunctionMapB);
+
+ ArrayMap<String, ArraySet<String>> diffMap = new ArrayMap<>();
+ for (String packageName : packageToFunctionMapA.keySet()) {
+ if (!packageToFunctionMapB.containsKey(packageName)) {
+ diffMap.put(packageName, packageToFunctionMapA.get(packageName));
+ continue;
+ }
+ ArraySet<String> diffFunctions = new ArraySet<>();
+ for (String functionId :
+ Objects.requireNonNull(packageToFunctionMapA.get(packageName))) {
+ if (!Objects.requireNonNull(packageToFunctionMapB.get(packageName))
+ .contains(functionId)) {
+ diffFunctions.add(functionId);
+ }
+ }
+ if (!diffFunctions.isEmpty()) {
+ diffMap.put(packageName, diffFunctions);
+ }
+ }
+ return diffMap;
+ }
+
+ /**
+ * This method returns a map of package names to a set of function ids from the AppFunction
+ * metadata.
+ *
+ * @param schemaType The name space of the AppFunction metadata.
+ * @return A map of package names to a set of function ids from the AppFunction metadata.
+ */
+ @NonNull
+ @VisibleForTesting
+ @WorkerThread
+ ArrayMap<String, ArraySet<String>> getPackageToFunctionIdMap(
+ @NonNull String schemaType,
+ @NonNull String propertyFunctionId,
+ @NonNull String propertyPackageName)
+ throws ExecutionException, InterruptedException {
+ Objects.requireNonNull(schemaType);
+ Objects.requireNonNull(propertyFunctionId);
+ Objects.requireNonNull(propertyPackageName);
+ ArrayMap<String, ArraySet<String>> packageToFunctionIds = new ArrayMap<>();
+
+ FutureSearchResults futureSearchResults =
+ mFutureAppSearchSession
+ .search(
+ "",
+ buildMetadataSearchSpec(
+ schemaType, propertyFunctionId, propertyPackageName))
+ .get();
+ List<SearchResult> searchResultsList = futureSearchResults.getNextPage().get();
+ // TODO(b/357551503): This could be expensive if we have more functions
+ while (!searchResultsList.isEmpty()) {
+ for (SearchResult searchResult : searchResultsList) {
+ String packageName =
+ searchResult.getGenericDocument().getPropertyString(propertyPackageName);
+ String functionId =
+ searchResult.getGenericDocument().getPropertyString(propertyFunctionId);
+ packageToFunctionIds
+ .computeIfAbsent(packageName, k -> new ArraySet<>())
+ .add(functionId);
+ }
+ searchResultsList = futureSearchResults.getNextPage().get();
+ }
+ return packageToFunctionIds;
+ }
+
+ /**
+ * This method returns a {@link SearchSpec} for searching the AppFunction metadata.
+ *
+ * @param schemaType The schema type of the AppFunction metadata.
+ * @param propertyFunctionId The property name of the function id in the AppFunction metadata.
+ * @param propertyPackageName The property name of the package name in the AppFunction metadata.
+ * @return A {@link SearchSpec} for searching the AppFunction metadata.
+ */
+ @NonNull
+ private static SearchSpec buildMetadataSearchSpec(
+ @NonNull String schemaType,
+ @NonNull String propertyFunctionId,
+ @NonNull String propertyPackageName) {
+ Objects.requireNonNull(schemaType);
+ Objects.requireNonNull(propertyFunctionId);
+ Objects.requireNonNull(propertyPackageName);
+ return new SearchSpec.Builder()
+ .addFilterSchemas(schemaType)
+ .addProjectionPaths(
+ schemaType,
+ List.of(
+ new PropertyPath(propertyFunctionId),
+ new PropertyPath(propertyPackageName)))
+ .build();
+ }
+}
diff --git a/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCaller.java b/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCaller.java
index 98903ae..58597c3 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCaller.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCaller.java
@@ -25,7 +25,6 @@
* services are properly unbound after the operation completes or a timeout occurs.
*
* @param <T> Class of wrapped service.
- * @hide
*/
public interface RemoteServiceCaller<T> {
diff --git a/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCallerImpl.java b/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCallerImpl.java
index 0e18705..eea17ee 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCallerImpl.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/RemoteServiceCallerImpl.java
@@ -34,7 +34,6 @@
* Context#bindService}.
*
* @param <T> Class of wrapped service.
- * @hide
*/
public class RemoteServiceCallerImpl<T> implements RemoteServiceCaller<T> {
private static final String TAG = "AppFunctionsServiceCall";
diff --git a/services/appfunctions/java/com/android/server/appfunctions/SyncAppSearchCallHelper.java b/services/appfunctions/java/com/android/server/appfunctions/SyncAppSearchCallHelper.java
deleted file mode 100644
index e56f81f0..0000000
--- a/services/appfunctions/java/com/android/server/appfunctions/SyncAppSearchCallHelper.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server.appfunctions;
-
-import static android.app.appfunctions.flags.Flags.FLAG_ENABLE_APP_FUNCTION_MANAGER;
-
-import android.annotation.FlaggedApi;
-import android.annotation.NonNull;
-import android.app.appsearch.AppSearchManager;
-import android.app.appsearch.AppSearchManager.SearchContext;
-import android.app.appsearch.AppSearchResult;
-import android.app.appsearch.AppSearchSession;
-import android.app.appsearch.GetSchemaResponse;
-import android.app.appsearch.SetSchemaRequest;
-import android.app.appsearch.SetSchemaResponse;
-import android.util.Slog;
-
-import com.android.internal.infra.AndroidFuture;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.Objects;
-import java.util.concurrent.Executor;
-
-/**
- * Helper class for interacting with a system server local appsearch session asynchronously.
- *
- * <p>Converts the AppSearch Callback API to {@link AndroidFuture}.
- */
-@FlaggedApi(FLAG_ENABLE_APP_FUNCTION_MANAGER)
-public class SyncAppSearchCallHelper implements Closeable {
- private static final String TAG = SyncAppSearchCallHelper.class.getSimpleName();
- private final Executor mExecutor;
- private final AppSearchManager mAppSearchManager;
- private final AndroidFuture<AppSearchResult<AppSearchSession>> mSettableSessionFuture;
-
- public SyncAppSearchCallHelper(
- @NonNull AppSearchManager appSearchManager,
- @NonNull Executor executor,
- @NonNull SearchContext appSearchContext) {
- Objects.requireNonNull(appSearchManager);
- Objects.requireNonNull(executor);
- Objects.requireNonNull(appSearchContext);
-
- mExecutor = executor;
- mAppSearchManager = appSearchManager;
- mSettableSessionFuture = new AndroidFuture<>();
- mAppSearchManager.createSearchSession(
- appSearchContext, mExecutor, mSettableSessionFuture::complete);
- }
-
- /** Converts a failed app search result codes into an exception. */
- @NonNull
- private static Exception failedResultToException(@NonNull AppSearchResult appSearchResult) {
- return switch (appSearchResult.getResultCode()) {
- case AppSearchResult.RESULT_INVALID_ARGUMENT ->
- new IllegalArgumentException(appSearchResult.getErrorMessage());
- case AppSearchResult.RESULT_IO_ERROR ->
- new IOException(appSearchResult.getErrorMessage());
- case AppSearchResult.RESULT_SECURITY_ERROR ->
- new SecurityException(appSearchResult.getErrorMessage());
- default -> new IllegalStateException(appSearchResult.getErrorMessage());
- };
- }
-
- private AndroidFuture<AppSearchSession> getSessionAsync() {
- return mSettableSessionFuture.thenApply(
- result -> {
- if (result.isSuccess()) {
- return result.getResultValue();
- } else {
- throw new RuntimeException(failedResultToException(result));
- }
- });
- }
-
- /** Gets the schema for a given app search session. */
- public AndroidFuture<GetSchemaResponse> getSchema() {
- return getSessionAsync()
- .thenComposeAsync(
- session -> {
- AndroidFuture<AppSearchResult<GetSchemaResponse>>
- settableSchemaResponse = new AndroidFuture<>();
- session.getSchema(mExecutor, settableSchemaResponse::complete);
- return settableSchemaResponse.thenApply(
- result -> {
- if (result.isSuccess()) {
- return result.getResultValue();
- } else {
- throw new RuntimeException(
- failedResultToException(result));
- }
- });
- },
- mExecutor);
- }
-
- /** Sets the schema for a given app search session. */
- public AndroidFuture<SetSchemaResponse> setSchema(@NonNull SetSchemaRequest setSchemaRequest) {
- return getSessionAsync()
- .thenComposeAsync(
- session -> {
- AndroidFuture<AppSearchResult<SetSchemaResponse>>
- settableSchemaResponse = new AndroidFuture<>();
- session.setSchema(
- setSchemaRequest,
- mExecutor,
- mExecutor,
- settableSchemaResponse::complete);
- return settableSchemaResponse.thenApply(
- result -> {
- if (result.isSuccess()) {
- return result.getResultValue();
- } else {
- throw new RuntimeException(
- failedResultToException(result));
- }
- });
- },
- mExecutor);
- }
-
- @Override
- public void close() throws IOException {
- try {
- getSessionAsync().get().close();
- } catch (Exception ex) {
- Slog.e(TAG, "Failed to close app search session", ex);
- }
- }
-}
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index 3068398..b53bf98 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -220,6 +220,15 @@
// See {@link Provider#pendingDeletedWidgetIds}.
private static final String PENDING_DELETED_IDS_ATTR = "pending_deleted_ids";
+ // Hard limit of number of hosts an app can create, note that the app that hosts the widgets
+ // can have multiple instances of {@link AppWidgetHost}, typically in respect to different
+ // surfaces in the host app.
+ // @see AppWidgetHost
+ // @see AppWidgetHost#mHostId
+ private static final int MAX_NUMBER_OF_HOSTS_PER_PACKAGE = 20;
+ // Hard limit of number of widgets can be pinned by a host.
+ private static final int MAX_NUMBER_OF_WIDGETS_PER_HOST = 200;
+
// Handles user and package related broadcasts.
// See {@link #registerBroadcastReceiver}
private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@@ -2284,7 +2293,7 @@
if (host != null) {
return host;
}
-
+ ensureHostCountBeforeAddLocked(id);
host = new Host();
host.id = id;
mHosts.add(host);
@@ -2292,6 +2301,24 @@
return host;
}
+ /**
+ * Ensures that the number of hosts for a package is less than the maximum number of hosts per
+ * package. If the number of hosts is greater than the maximum number of hosts per package, then
+ * removes the oldest host.
+ */
+ private void ensureHostCountBeforeAddLocked(@NonNull final HostId hostId) {
+ final List<Host> hosts = new ArrayList<>();
+ for (Host host : mHosts) {
+ if (host.id.uid == hostId.uid
+ && host.id.packageName.equals(hostId.packageName)) {
+ hosts.add(host);
+ }
+ }
+ while (hosts.size() >= MAX_NUMBER_OF_HOSTS_PER_PACKAGE) {
+ deleteHostLocked(hosts.remove(0));
+ }
+ }
+
private void deleteHostLocked(Host host) {
if (DEBUG) {
Slog.i(TAG, "deleteHostLocked() " + host);
@@ -2377,6 +2404,11 @@
}
@Override
+ public void onNullBinding(ComponentName name) {
+ mContext.unbindService(this);
+ }
+
+ @Override
public void onServiceDisconnected(ComponentName name) {
// Do nothing
}
@@ -2524,6 +2556,11 @@
}
@Override
+ public void onNullBinding(ComponentName name) {
+ mContext.unbindService(this);
+ }
+
+ @Override
public void onServiceDisconnected(android.content.ComponentName name) {
// Do nothing
}
@@ -3582,12 +3619,33 @@
if (DEBUG) {
Slog.i(TAG, "addWidgetLocked() " + widget);
}
+ ensureWidgetCountBeforeAddLocked(widget);
mWidgets.add(widget);
onWidgetProviderAddedOrChangedLocked(widget);
}
/**
+ * Ensures that the widget count for the widget's host is not greater than the maximum
+ * number of widgets per host. If the count is greater than the maximum, removes oldest widgets
+ * from the host until the count is less than or equal to the maximum.
+ */
+ private void ensureWidgetCountBeforeAddLocked(@NonNull final Widget widget) {
+ if (widget.host == null || widget.host.id == null) {
+ return;
+ }
+ final List<Widget> widgetsInSameHost = new ArrayList<>();
+ for (Widget w : mWidgets) {
+ if (w.host != null && widget.host.id.equals(w.host.id)) {
+ widgetsInSameHost.add(w);
+ }
+ }
+ while (widgetsInSameHost.size() >= MAX_NUMBER_OF_WIDGETS_PER_HOST) {
+ removeWidgetLocked(widgetsInSameHost.remove(0));
+ }
+ }
+
+ /**
* Checks if the provider is assigned and updates the mWidgetPackages to track packages
* that have bound widgets.
*/
diff --git a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
index 5044e93..2c261fe 100644
--- a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
+++ b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
@@ -842,9 +842,13 @@
+ "event");
return;
}
+
PresentationStatsEventInternal event = mEventInternal.get();
+ boolean ignoreLogging = !event.mIsDatasetAvailable;
+
if (sVerbose) {
Slog.v(TAG, "(" + caller + ") "
+ + (ignoreLogging ? "IGNORING - following event won't be logged: " : "")
+ "Log AutofillPresentationEventReported:"
+ " requestId=" + event.mRequestId
+ " sessionId=" + mSessionId
@@ -907,7 +911,8 @@
}
// TODO(b/234185326): Distinguish empty responses from other no presentation reasons.
- if (!event.mIsDatasetAvailable) {
+ if (ignoreLogging) {
+ Slog.w(TAG, "Empty dataset. Autofill ignoring log");
mEventInternal = Optional.empty();
return;
}
diff --git a/services/core/java/com/android/server/BatteryService.java b/services/core/java/com/android/server/BatteryService.java
index 1470e9a..6657c1c 100644
--- a/services/core/java/com/android/server/BatteryService.java
+++ b/services/core/java/com/android/server/BatteryService.java
@@ -238,13 +238,16 @@
final SomeArgs args = (SomeArgs) msg.obj;
final Context context;
final Intent intent;
+ final boolean forceUpdate;
try {
context = (Context) args.arg1;
intent = (Intent) args.arg2;
+ forceUpdate = (Boolean) args.arg3;
} finally {
args.recycle();
}
- broadcastBatteryChangedIntent(context, intent, BATTERY_CHANGED_OPTIONS);
+ broadcastBatteryChangedIntent(context, intent, BATTERY_CHANGED_OPTIONS,
+ forceUpdate);
return true;
}
case MSG_BROADCAST_POWER_CONNECTION_CHANGED: {
@@ -798,7 +801,7 @@
// We are doing this after sending the above broadcasts, so anything processing
// them will get the new sequence number at that point. (See for example how testing
// of JobScheduler's BatteryController works.)
- sendBatteryChangedIntentLocked();
+ sendBatteryChangedIntentLocked(force);
if (mLastBatteryLevel != mHealthInfo.batteryLevel || mLastPlugType != mPlugType) {
sendBatteryLevelChangedIntentLocked();
}
@@ -829,7 +832,7 @@
}
}
- private void sendBatteryChangedIntentLocked() {
+ private void sendBatteryChangedIntentLocked(boolean forceUpdate) {
// Pack up the values and broadcast them to everyone
final Intent intent = new Intent(Intent.ACTION_BATTERY_CHANGED);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY
@@ -869,15 +872,17 @@
final SomeArgs args = SomeArgs.obtain();
args.arg1 = mContext;
args.arg2 = intent;
+ args.arg3 = forceUpdate;
mHandler.obtainMessage(MSG_BROADCAST_BATTERY_CHANGED, args).sendToTarget();
} else {
mHandler.post(() -> broadcastBatteryChangedIntent(mContext,
- intent, BATTERY_CHANGED_OPTIONS));
+ intent, BATTERY_CHANGED_OPTIONS, forceUpdate));
}
}
private static void broadcastBatteryChangedIntent(Context context, Intent intent,
- Bundle options) {
+ Bundle options, boolean forceUpdate) {
+ traceBatteryChangedBroadcastEvent(intent, forceUpdate);
// TODO (293959093): It is important that SystemUI receives this broadcast as soon as
// possible. Ideally, it should be using binder callbacks but until then, dispatch this
// as a foreground broadcast to SystemUI.
@@ -895,6 +900,53 @@
AppOpsManager.OP_NONE, options, UserHandle.USER_ALL);
}
+ private static void traceBatteryChangedBroadcastEvent(Intent intent, boolean forceUpdate) {
+ if (!com.android.server.flags.Flags.traceBatteryChangedBroadcastEvent()) {
+ return;
+ }
+ if (!Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) return;
+
+ final StringBuilder builder = new StringBuilder();
+ builder.append("broadcastBatteryChanged; ");
+ builder.append("force="); builder.append(forceUpdate);
+ builder.append(",seq="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_SEQUENCE, -1));
+ builder.append(",s="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_STATUS, -1));
+ builder.append(",h="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_HEALTH, -1));
+ builder.append(",p="); builder.append(intent.getBooleanExtra(
+ BatteryManager.EXTRA_PRESENT, false));
+ builder.append(",l="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_LEVEL, -1));
+ builder.append(",bl="); builder.append(intent.getBooleanExtra(
+ BatteryManager.EXTRA_BATTERY_LOW, false));
+ builder.append(",sc="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_SCALE, -1));
+ builder.append(",pt="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_PLUGGED, -1));
+ builder.append(",v="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_VOLTAGE, -1));
+ builder.append(",t="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_TEMPERATURE, -1));
+ builder.append(",tech="); builder.append(intent.getStringExtra(
+ BatteryManager.EXTRA_TECHNOLOGY));
+ builder.append(",invc="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_INVALID_CHARGER, -1));
+ builder.append(",mcc="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_MAX_CHARGING_CURRENT, -1));
+ builder.append(",mcv="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE, -1));
+ builder.append(",chc="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_CHARGE_COUNTER, -1));
+ builder.append(",cc="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_CYCLE_COUNT, -1));
+ builder.append(",chs="); builder.append(intent.getIntExtra(
+ BatteryManager.EXTRA_CHARGING_STATUS, -1));
+
+ Trace.instant(Trace.TRACE_TAG_SYSTEM_SERVER, builder.toString());
+ }
+
private void sendBatteryLevelChangedIntentLocked() {
Bundle event = new Bundle();
long now = SystemClock.elapsedRealtime();
diff --git a/services/core/java/com/android/server/TEST_MAPPING b/services/core/java/com/android/server/TEST_MAPPING
index 556fae3..30f3fd2 100644
--- a/services/core/java/com/android/server/TEST_MAPPING
+++ b/services/core/java/com/android/server/TEST_MAPPING
@@ -78,24 +78,11 @@
"file_patterns": ["StorageManagerService\\.java"]
},
{
- "name": "FrameworksServicesTests",
- "options": [
- {
- "include-filter": "com.android.server.BinaryTransparencyServiceTest"
- }
- ],
+ "name": "FrameworksServicesTests_binary_transparency",
"file_patterns": ["BinaryTransparencyService\\.java"]
},
{
- "name": "FrameworksServicesTests",
- "options": [
- {
- "include-filter": "com.android.server.PinnerServiceTest"
- },
- {
- "exclude-annotation": "org.junit.Ignore"
- }
- ],
+ "name": "FrameworksServicesTests_pinner_service",
"file_patterns": ["PinnerService\\.java"]
},
{
@@ -176,15 +163,7 @@
"name": "CtsPackageManagerTestCases"
},
{
- "name": "FrameworksServicesTests",
- "options": [
- {
- "include-filter": "com.android.server.PinnerServiceTest"
- },
- {
- "exclude-annotation": "org.junit.Ignore"
- }
- ],
+ "name": "FrameworksServicesTests_pinner_service",
"file_patterns": ["PinnerService\\.java"]
},
{
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index d4f729c..3666524 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -1516,9 +1516,8 @@
serviceName, FrameworkStatsLog.SERVICE_STATE_CHANGED__STATE__START);
mAm.mBatteryStatsService.noteServiceStartRunning(uid, packageName, serviceName);
final ProcessRecord hostApp = r.app;
- final boolean wasStopped = hostApp == null ? wasStopped(r) : false;
- final boolean firstLaunch =
- hostApp == null ? !mAm.wasPackageEverLaunched(r.packageName, r.userId) : false;
+ final boolean wasStopped = hostApp == null ? r.appInfo.isStopped() : false;
+ final boolean firstLaunch = hostApp == null ? r.appInfo.isNotLaunched() : false;
String error = bringUpServiceLocked(r, service.getFlags(), callerFg,
false /* whileRestarting */,
@@ -4308,9 +4307,8 @@
true, UNKNOWN_ADJ);
}
- final boolean wasStopped = hostApp == null ? wasStopped(s) : false;
- final boolean firstLaunch =
- hostApp == null ? !mAm.wasPackageEverLaunched(s.packageName, s.userId) : false;
+ final boolean wasStopped = hostApp == null ? s.appInfo.isStopped() : false;
+ final boolean firstLaunch = hostApp == null ? s.appInfo.isNotLaunched() : false;
boolean needOomAdj = false;
if (c.hasFlag(Context.BIND_AUTO_CREATE)) {
@@ -9350,8 +9348,4 @@
return mCachedDeviceProvisioningPackage != null
&& mCachedDeviceProvisioningPackage.equals(packageName);
}
-
- private boolean wasStopped(ServiceRecord serviceRecord) {
- return (serviceRecord.appInfo.flags & ApplicationInfo.FLAG_STOPPED) != 0;
- }
}
diff --git a/services/core/java/com/android/server/am/AppStartInfoTracker.java b/services/core/java/com/android/server/am/AppStartInfoTracker.java
index 1b00cec..6aadcdc 100644
--- a/services/core/java/com/android/server/am/AppStartInfoTracker.java
+++ b/services/core/java/com/android/server/am/AppStartInfoTracker.java
@@ -33,6 +33,7 @@
import android.content.pm.PackageManager;
import android.icu.text.SimpleDateFormat;
import android.os.Binder;
+import android.os.Debug;
import android.os.FileUtils;
import android.os.Handler;
import android.os.IBinder.DeathRecipient;
@@ -495,6 +496,10 @@
private void addBaseFieldsFromProcessRecord(ApplicationStartInfo start, ProcessRecord app) {
if (app == null) {
+ if (DEBUG) {
+ Slog.w(TAG,
+ "app is null in addBaseFieldsFromProcessRecord: " + Debug.getCallers(4));
+ }
return;
}
final int definingUid = app.getHostingRecord() != null
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 955b75d..3f4902d 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -1122,7 +1122,11 @@
throw new UnsupportedOperationException("Unknown tagId=" + atomTag);
}
final byte[] statsProto = bus.getStatsProto();
-
+ try {
+ bus.close();
+ } catch (IOException e) {
+ Slog.w(TAG, "Failure close BatteryUsageStats", e);
+ }
data.add(FrameworkStatsLog.buildStatsEvent(atomTag, statsProto));
return StatsManager.PULL_SUCCESS;
diff --git a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
index 8fe33d1..9e4666c 100644
--- a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
+++ b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
@@ -1005,13 +1005,10 @@
final ApplicationInfo info = ((ResolveInfo) receiver).activityInfo.applicationInfo;
final ComponentName component = ((ResolveInfo) receiver).activityInfo.getComponentName();
- if ((info.flags & ApplicationInfo.FLAG_STOPPED) != 0) {
- queue.setActiveWasStopped(true);
- }
- final int intentFlags = r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND;
- final boolean firstLaunch = !mService.wasPackageEverLaunched(info.packageName, r.userId);
- queue.setActiveFirstLaunch(firstLaunch);
+ queue.setActiveWasStopped(info.isStopped());
+ queue.setActiveFirstLaunch(info.isNotLaunched());
+ final int intentFlags = r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND;
final HostingRecord hostingRecord = new HostingRecord(HostingRecord.HOSTING_TYPE_BROADCAST,
component, r.intent.getAction(), r.getHostingRecordTriggerType());
final boolean isActivityCapable = (r.options != null
diff --git a/services/core/java/com/android/server/am/CachedAppOptimizer.java b/services/core/java/com/android/server/am/CachedAppOptimizer.java
index 8f52f67..416c110 100644
--- a/services/core/java/com/android/server/am/CachedAppOptimizer.java
+++ b/services/core/java/com/android/server/am/CachedAppOptimizer.java
@@ -86,7 +86,6 @@
import dalvik.annotation.optimization.NeverCompile;
-import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
@@ -2318,6 +2317,7 @@
Slog.d(TAG_AM, "Skipping freeze because process is marked "
+ "should not be frozen");
}
+ reportProcessFreezableChangedLocked(proc);
return;
}
diff --git a/services/core/java/com/android/server/am/ContentProviderHelper.java b/services/core/java/com/android/server/am/ContentProviderHelper.java
index 1314521..da40826 100644
--- a/services/core/java/com/android/server/am/ContentProviderHelper.java
+++ b/services/core/java/com/android/server/am/ContentProviderHelper.java
@@ -554,13 +554,11 @@
callingProcessState, proc.mState.getCurProcState(),
false, 0L);
} else {
- final boolean stopped =
- (cpr.appInfo.flags & ApplicationInfo.FLAG_STOPPED) != 0;
+ final boolean stopped = cpr.appInfo.isStopped();
final int packageState = stopped
? PROVIDER_ACQUISITION_EVENT_REPORTED__PACKAGE_STOPPED_STATE__PACKAGE_STATE_STOPPED
: PROVIDER_ACQUISITION_EVENT_REPORTED__PACKAGE_STOPPED_STATE__PACKAGE_STATE_NORMAL;
- final boolean firstLaunch = !mService.wasPackageEverLaunched(
- cpi.packageName, userId);
+ final boolean firstLaunch = cpr.appInfo.isNotLaunched();
checkTime(startTime, "getContentProviderImpl: before start process");
proc = mService.startProcessLocked(
cpi.processName, cpr.appInfo, false, 0,
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 3f54cfc..f0cc09f 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -1923,7 +1923,6 @@
int procState;
int capability = cycleReEval ? getInitialCapability(app) : 0;
- boolean foregroundActivities = false;
boolean hasVisibleActivities = false;
if (app == topApp && PROCESS_STATE_CUR_TOP == PROCESS_STATE_TOP) {
// The last app on the list is the foreground app.
@@ -1937,7 +1936,6 @@
schedGroup = SCHED_GROUP_DEFAULT;
state.setAdjType("intermediate-top-activity");
}
- foregroundActivities = true;
hasVisibleActivities = true;
procState = PROCESS_STATE_TOP;
if (DEBUG_OOM_ADJ_REASON || logUid == appUid) {
@@ -1988,7 +1986,6 @@
adj = FOREGROUND_APP_ADJ;
schedGroup = SCHED_GROUP_BACKGROUND;
state.setAdjType("top-sleeping");
- foregroundActivities = true;
procState = PROCESS_STATE_CUR_TOP;
if (DEBUG_OOM_ADJ_REASON || logUid == appUid) {
reportOomAdjMessageLocked(TAG_OOM_ADJ, "Making top (sleeping): " + app);
@@ -2008,7 +2005,8 @@
}
}
- // Examine all activities if not already foreground.
+ // Examine all non-top activities.
+ boolean foregroundActivities = app == topApp;
if (!foregroundActivities && state.getCachedHasActivities()) {
state.computeOomAdjFromActivitiesIfNecessary(mTmpComputeOomAdjWindowCallback,
adj, foregroundActivities, hasVisibleActivities, procState, schedGroup,
@@ -2532,25 +2530,6 @@
}
}
- state.setCurRawAdj(adj);
- adj = psr.modifyRawOomAdj(adj);
- if (adj > state.getMaxAdj()) {
- adj = state.getMaxAdj();
- if (adj <= PERCEPTIBLE_LOW_APP_ADJ) {
- schedGroup = SCHED_GROUP_DEFAULT;
- }
- }
-
- // Put bound foreground services in a special sched group for additional
- // restrictions on screen off
- if (procState >= PROCESS_STATE_BOUND_FOREGROUND_SERVICE
- && mService.mWakefulness.get() != PowerManagerInternal.WAKEFULNESS_AWAKE
- && !state.shouldScheduleLikeTopApp()) {
- if (schedGroup > SCHED_GROUP_RESTRICTED) {
- schedGroup = SCHED_GROUP_RESTRICTED;
- }
- }
-
// apply capability from FGS.
if (psr.hasForegroundServices()) {
capability |= capabilityFromFGS;
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index bb0c24b..4898f10 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -2390,8 +2390,8 @@
}
String volumeUuid = packageState.getVolumeUuid();
long inode = packageState.getUserStateOrDefault(userId).getCeDataInode();
- if (inode == 0) {
- Slog.w(TAG, packageName + " inode == 0 (b/152760674)");
+ if (inode <= 0) {
+ Slog.w(TAG, packageName + " inode == 0 or app uninstalled with keep-data");
return null;
}
result.put(packageName, Pair.create(volumeUuid, inode));
@@ -3394,24 +3394,37 @@
hostingRecord.getDefiningUid(), hostingRecord.getDefiningProcessName());
final ProcessStateRecord state = r.mState;
- final boolean wasStopped = (info.flags & ApplicationInfo.FLAG_STOPPED) != 0;
+ final boolean wasStopped = info.isStopped();
// Check if we should mark the processrecord for first launch after force-stopping
if (wasStopped) {
+ boolean wasEverLaunched = false;
+ if (android.app.Flags.useAppInfoNotLaunched()) {
+ wasEverLaunched = !info.isNotLaunched();
+ } else {
+ try {
+ wasEverLaunched = mService.getPackageManagerInternal()
+ .wasPackageEverLaunched(r.getApplicationInfo().packageName, r.userId);
+ } catch (IllegalArgumentException e) {
+ // Package doesn't have state yet, assume not launched
+ }
+ }
// Check if the hosting record is for an activity or not. Since the stopped
// state tracking is handled differently to avoid WM calling back into AM,
// store the state in the correct record
if (hostingRecord.isTypeActivity()) {
- final boolean wasPackageEverLaunched = mService
- .wasPackageEverLaunched(r.getApplicationInfo().packageName, r.userId);
// If the package was launched in the past but is currently stopped, only then
// should it be considered as force-stopped.
- @WindowProcessController.StoppedState int stoppedState = wasPackageEverLaunched
+ @WindowProcessController.StoppedState int stoppedState = wasEverLaunched
? STOPPED_STATE_FORCE_STOPPED
: STOPPED_STATE_FIRST_LAUNCH;
r.getWindowProcessController().setStoppedState(stoppedState);
} else {
- r.setWasForceStopped(true);
- // first launch is computed just before logging, for non-activity types
+ if (android.app.Flags.useAppInfoNotLaunched()) {
+ // If it was launched before, then it must be a force-stop
+ r.setWasForceStopped(wasEverLaunched);
+ } else {
+ r.setWasForceStopped(true);
+ }
}
}
@@ -4112,19 +4125,6 @@
return false;
}
- private static int procStateToImportance(int procState, int memAdj,
- ActivityManager.RunningAppProcessInfo currApp,
- int clientTargetSdk) {
- int imp = ActivityManager.RunningAppProcessInfo.procStateToImportanceForTargetSdk(
- procState, clientTargetSdk);
- if (imp == ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND) {
- currApp.lru = memAdj;
- } else {
- currApp.lru = 0;
- }
- return imp;
- }
-
@GuardedBy(anyOf = {"mService", "mProcLock"})
void fillInProcMemInfoLOSP(ProcessRecord app,
ActivityManager.RunningAppProcessInfo outInfo,
@@ -4142,14 +4142,20 @@
}
outInfo.lastTrimLevel = app.mProfile.getTrimMemoryLevel();
final ProcessStateRecord state = app.mState;
- int adj = state.getCurAdj();
- int procState = state.getCurProcState();
- outInfo.importance = procStateToImportance(procState, adj, outInfo,
- clientTargetSdk);
+ final int procState = state.getCurProcState();
+ outInfo.importance = ActivityManager.RunningAppProcessInfo
+ .procStateToImportanceForTargetSdk(procState, clientTargetSdk);
+ if (outInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND) {
+ outInfo.lru = state.getCurAdj();
+ } else {
+ outInfo.lru = 0;
+ }
outInfo.importanceReasonCode = state.getAdjTypeCode();
outInfo.processState = procState;
outInfo.isFocused = (app == mService.getTopApp());
outInfo.lastActivityTime = app.getLastActivityTime();
+ // Note: ActivityManager$RunningAppProcessInfo.copyTo() must be updated if what gets
+ // "filled into" outInfo in this method changes.
}
@GuardedBy(anyOf = {"mService", "mProcLock"})
diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
index 2937307..439bca0 100644
--- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
@@ -139,6 +139,7 @@
static final String[] sDeviceConfigAconfigScopes = new String[] {
"accessibility",
"android_core_networking",
+ "android_health_services",
"android_sdk",
"android_stylus",
"aoc",
@@ -235,7 +236,6 @@
"wear_connectivity",
"wear_esim_carriers",
"wear_frameworks",
- "wear_health_services",
"wear_media",
"wear_offload",
"wear_security",
@@ -453,7 +453,9 @@
proto.write(StorageRequestMessage.FlagOverrideMessage.PACKAGE_NAME, packageName);
proto.write(StorageRequestMessage.FlagOverrideMessage.FLAG_NAME, flagName);
proto.write(StorageRequestMessage.FlagOverrideMessage.FLAG_VALUE, flagValue);
- proto.write(StorageRequestMessage.FlagOverrideMessage.IS_LOCAL, isLocal);
+ proto.write(StorageRequestMessage.FlagOverrideMessage.OVERRIDE_TYPE, isLocal
+ ? StorageRequestMessage.LOCAL_ON_REBOOT
+ : StorageRequestMessage.SERVER_ON_REBOOT);
proto.end(msgToken);
proto.end(msgsToken);
}
diff --git a/services/core/java/com/android/server/am/TEST_MAPPING b/services/core/java/com/android/server/am/TEST_MAPPING
index 6e8eb7d..ab5e2d0 100644
--- a/services/core/java/com/android/server/am/TEST_MAPPING
+++ b/services/core/java/com/android/server/am/TEST_MAPPING
@@ -94,12 +94,7 @@
],
"postsubmit": [
{
- "name": "FrameworksServicesTests",
- "options": [
- {
- "include-filter": "com.android.server.am."
- }
- ]
+ "name": "FrameworksServicesTests_android_server_am"
},
{
"name": "CtsAppDataIsolationHostTestCases"
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 780eda6..6daf0d0 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -12712,11 +12712,6 @@
if (mController == null)
return;
try {
- // TODO: remove this when deprecating STREAM_BLUETOOTH_SCO
- if (isStreamBluetoothSco(streamType)) {
- // TODO: notify both sco and voice_call about volume changes
- streamType = AudioSystem.STREAM_BLUETOOTH_SCO;
- }
mController.volumeChanged(streamType, flags);
} catch (RemoteException e) {
Log.w(TAG, "Error calling volumeChanged", e);
@@ -14727,6 +14722,7 @@
@Override
/** @see AudioManager#permissionUpdateBarrier() */
public void permissionUpdateBarrier() {
+ if (!audioserverPermissions()) return;
mAudioSystem.triggerSystemPropertyUpdate(mSysPropListenerNativeHandle);
List<Future> snapshot;
synchronized (mScheduledPermissionTasks) {
diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
index 2a16872..5d85089 100644
--- a/services/core/java/com/android/server/biometrics/AuthService.java
+++ b/services/core/java/com/android/server/biometrics/AuthService.java
@@ -50,7 +50,6 @@
import android.hardware.biometrics.SensorLocationInternal;
import android.hardware.biometrics.SensorPropertiesInternal;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.fingerprint.IFingerprint;
import android.hardware.face.FaceSensorConfigurations;
import android.hardware.face.FaceSensorProperties;
import android.hardware.face.FaceSensorPropertiesInternal;
@@ -74,6 +73,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.server.SystemService;
+import com.android.server.biometrics.sensors.fingerprint.FingerprintService;
import com.android.server.companion.virtual.VirtualDeviceManagerInternal;
import java.util.ArrayList;
@@ -203,7 +203,7 @@
*/
@VisibleForTesting
public String[] getFingerprintAidlInstances() {
- return ServiceManager.getDeclaredInstances(IFingerprint.DESCRIPTOR);
+ return FingerprintService.getDeclaredInstances();
}
/**
@@ -850,10 +850,28 @@
return;
}
+ boolean tempResetLockoutRequiresChallenge = false;
+
+ if (hidlConfigStrings != null && hidlConfigStrings.length > 0) {
+ for (String configString : hidlConfigStrings) {
+ try {
+ SensorConfig sensor = new SensorConfig(configString);
+ switch (sensor.modality) {
+ case BiometricAuthenticator.TYPE_FACE:
+ tempResetLockoutRequiresChallenge = true;
+ break;
+ }
+ } catch (Exception e) {
+ Slog.e(TAG, "Error parsing configString: " + configString, e);
+ }
+ }
+ }
+
+ final boolean resetLockoutRequiresChallenge = tempResetLockoutRequiresChallenge;
+
handlerProvider.getFaceHandler().post(() -> {
final FaceSensorConfigurations mFaceSensorConfigurations =
- new FaceSensorConfigurations(hidlConfigStrings != null
- && hidlConfigStrings.length > 0);
+ new FaceSensorConfigurations(resetLockoutRequiresChallenge);
if (hidlConfigStrings != null && hidlConfigStrings.length > 0) {
mFaceSensorConfigurations.addHidlConfigs(hidlConfigStrings, context);
diff --git a/services/core/java/com/android/server/biometrics/PreAuthInfo.java b/services/core/java/com/android/server/biometrics/PreAuthInfo.java
index ac3c028..b2c616a 100644
--- a/services/core/java/com/android/server/biometrics/PreAuthInfo.java
+++ b/services/core/java/com/android/server/biometrics/PreAuthInfo.java
@@ -316,6 +316,7 @@
Pair<BiometricSensor, Integer> sensorNotEnrolled = null;
Pair<BiometricSensor, Integer> sensorLockout = null;
Pair<BiometricSensor, Integer> hardwareNotDetected = null;
+ Pair<BiometricSensor, Integer> biometricAppNotAllowed = null;
for (Pair<BiometricSensor, Integer> pair : ineligibleSensors) {
final int status = pair.second;
if (status == BIOMETRIC_LOCKOUT_TIMED || status == BIOMETRIC_LOCKOUT_PERMANENT) {
@@ -327,6 +328,9 @@
if (status == BIOMETRIC_HARDWARE_NOT_DETECTED) {
hardwareNotDetected = pair;
}
+ if (status == BIOMETRIC_NOT_ENABLED_FOR_APPS) {
+ biometricAppNotAllowed = pair;
+ }
}
// If there is a sensor locked out, prioritize lockout over other sensor's error.
@@ -339,6 +343,10 @@
return hardwareNotDetected;
}
+ if (Flags.mandatoryBiometrics() && biometricAppNotAllowed != null) {
+ return biometricAppNotAllowed;
+ }
+
// If the caller requested STRONG, and the device contains both STRONG and non-STRONG
// sensors, prioritize BIOMETRIC_NOT_ENROLLED over the weak sensor's
// BIOMETRIC_INSUFFICIENT_STRENGTH error.
diff --git a/services/core/java/com/android/server/biometrics/Utils.java b/services/core/java/com/android/server/biometrics/Utils.java
index 8711214..407ef1e 100644
--- a/services/core/java/com/android/server/biometrics/Utils.java
+++ b/services/core/java/com/android/server/biometrics/Utils.java
@@ -321,6 +321,9 @@
case BiometricConstants.BIOMETRIC_ERROR_MANDATORY_NOT_ACTIVE:
biometricManagerCode = BiometricManager.BIOMETRIC_ERROR_MANDATORY_NOT_ACTIVE;
break;
+ case BiometricConstants.BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS:
+ biometricManagerCode = BiometricManager.BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS;
+ break;
default:
Slog.e(BiometricService.TAG, "Unhandled result code: " + biometricConstantsCode);
biometricManagerCode = BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE;
@@ -384,9 +387,12 @@
return BiometricConstants.BIOMETRIC_ERROR_SENSOR_PRIVACY_ENABLED;
case MANDATORY_BIOMETRIC_UNAVAILABLE_ERROR:
return BiometricConstants.BIOMETRIC_ERROR_MANDATORY_NOT_ACTIVE;
+ case BIOMETRIC_NOT_ENABLED_FOR_APPS:
+ if (Flags.mandatoryBiometrics()) {
+ return BiometricConstants.BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS;
+ }
case BIOMETRIC_DISABLED_BY_DEVICE_POLICY:
case BIOMETRIC_HARDWARE_NOT_DETECTED:
- case BIOMETRIC_NOT_ENABLED_FOR_APPS:
default:
return BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE;
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
index 60cfd5a..2f6ba0b 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/FingerprintService.java
@@ -26,6 +26,7 @@
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_USER_CANCELED;
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_VENDOR;
import static android.hardware.biometrics.SensorProperties.STRENGTH_STRONG;
+import static android.hardware.fingerprint.FingerprintSensorConfigurations.getIFingerprint;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -78,6 +79,7 @@
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.widget.LockPatternUtils;
import com.android.server.SystemService;
@@ -1015,7 +1017,7 @@
this(context, BiometricContext.getInstance(context),
() -> IBiometricService.Stub.asInterface(
ServiceManager.getService(Context.BIOMETRIC_SERVICE)),
- () -> ServiceManager.getDeclaredInstances(IFingerprint.DESCRIPTOR),
+ () -> getDeclaredInstances(),
null /* fingerprintProvider */,
null /* fingerprintProviderFunction */);
}
@@ -1039,8 +1041,7 @@
mFingerprintProvider = fingerprintProvider != null ? fingerprintProvider :
(name) -> {
final String fqName = IFingerprint.DESCRIPTOR + "/" + name;
- final IFingerprint fp = IFingerprint.Stub.asInterface(
- Binder.allowBlocking(ServiceManager.waitForDeclaredService(fqName)));
+ final IFingerprint fp = getIFingerprint(fqName);
if (fp != null) {
try {
return new FingerprintProvider(getContext(),
@@ -1129,6 +1130,24 @@
publishBinderService(Context.FINGERPRINT_SERVICE, mServiceWrapper);
}
+ /**
+ * Get all fingerprint hal instances declared in manifest
+ * @return instance names
+ */
+ public static String[] getDeclaredInstances() {
+ String[] a = ServiceManager.getDeclaredInstances(IFingerprint.DESCRIPTOR);
+ Slog.i(TAG, "Before:getDeclaredInstances: IFingerprint instance found, a.length="
+ + a.length);
+ if (!ArrayUtils.contains(a, "virtual")) {
+ // Now, the virtual hal is registered with IVirtualHal interface and it is also
+ // moved from vendor to system_ext partition without a device manifest. So
+ // if the old vhal is not declared, add here.
+ a = ArrayUtils.appendElement(String.class, a, "virtual");
+ }
+ Slog.i(TAG, "After:getDeclaredInstances: a.length=" + a.length);
+ return a;
+ }
+
@NonNull
private List<Fingerprint> getEnrolledFingerprintsDeprecated(int userId, String opPackageName) {
final Pair<Integer, ServiceProvider> provider = mRegistry.getSingleProvider();
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 caa2c1c..fd3d996 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
@@ -20,9 +20,9 @@
import android.content.Context;
import android.hardware.biometrics.ITestSession;
import android.hardware.biometrics.ITestSessionCallback;
-import android.hardware.biometrics.fingerprint.AcquiredInfoAndVendorCode;
-import android.hardware.biometrics.fingerprint.EnrollmentProgressStep;
-import android.hardware.biometrics.fingerprint.NextEnrollment;
+import android.hardware.biometrics.fingerprint.virtualhal.AcquiredInfoAndVendorCode;
+import android.hardware.biometrics.fingerprint.virtualhal.EnrollmentProgressStep;
+import android.hardware.biometrics.fingerprint.virtualhal.NextEnrollment;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintEnrollOptions;
import android.hardware.fingerprint.FingerprintManager;
@@ -300,4 +300,4 @@
super.getSensorId_enforcePermission();
return mSensorId;
}
-}
\ No newline at end of file
+}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
index 9edaa4e..8195efe 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
@@ -17,6 +17,8 @@
package com.android.server.biometrics.sensors.fingerprint.aidl;
import static android.hardware.fingerprint.FingerprintManager.SENSOR_ID_ANY;
+import static android.hardware.fingerprint.FingerprintSensorConfigurations.getIFingerprint;
+import static android.hardware.fingerprint.FingerprintSensorConfigurations.remapFqName;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -34,9 +36,9 @@
import android.hardware.biometrics.ITestSessionCallback;
import android.hardware.biometrics.SensorLocationInternal;
import android.hardware.biometrics.fingerprint.IFingerprint;
-import android.hardware.biometrics.fingerprint.IVirtualHal;
import android.hardware.biometrics.fingerprint.PointerContext;
import android.hardware.biometrics.fingerprint.SensorProps;
+import android.hardware.biometrics.fingerprint.virtualhal.IVirtualHal;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintAuthenticateOptions;
import android.hardware.fingerprint.FingerprintEnrollOptions;
@@ -291,7 +293,8 @@
if (mTestHalEnabled) {
return true;
}
- return (ServiceManager.checkService(IFingerprint.DESCRIPTOR + "/" + mHalInstanceName)
+ return (ServiceManager.checkService(
+ remapFqName(IFingerprint.DESCRIPTOR + "/" + mHalInstanceName))
!= null);
}
@@ -330,10 +333,7 @@
Slog.d(getTag(), "Daemon was null, reconnecting");
- mDaemon = IFingerprint.Stub.asInterface(
- Binder.allowBlocking(
- ServiceManager.waitForDeclaredService(
- IFingerprint.DESCRIPTOR + "/" + mHalInstanceNameCurrent)));
+ mDaemon = getIFingerprint(IFingerprint.DESCRIPTOR + "/" + mHalInstanceNameCurrent);
if (mDaemon == null) {
Slog.e(getTag(), "Unable to get daemon");
return null;
@@ -905,8 +905,8 @@
void setTestHalEnabled(boolean enabled) {
final boolean changed = enabled != mTestHalEnabled;
mTestHalEnabled = enabled;
- Slog.i(getTag(), "setTestHalEnabled(): useVhalForTesting=" + Flags.useVhalForTesting()
- + "mTestHalEnabled=" + mTestHalEnabled + " changed=" + changed);
+ Slog.i(getTag(), "setTestHalEnabled(): useVhalForTestingFlags=" + Flags.useVhalForTesting()
+ + " mTestHalEnabled=" + mTestHalEnabled + " changed=" + changed);
if (changed && useVhalForTesting()) {
getHalInstance();
}
@@ -999,12 +999,13 @@
*/
public IVirtualHal getVhal() throws RemoteException {
if (mVhal == null && useVhalForTesting()) {
- mVhal = IVirtualHal.Stub.asInterface(mDaemon.asBinder().getExtension());
- if (mVhal == null) {
- Slog.e(getTag(), "Unable to get fingerprint virtualhal interface");
- }
+ mVhal = IVirtualHal.Stub.asInterface(
+ Binder.allowBlocking(
+ ServiceManager.waitForService(
+ IVirtualHal.DESCRIPTOR + "/"
+ + mHalInstanceNameCurrent)));
+ Slog.d(getTag(), "getVhal " + mHalInstanceNameCurrent);
}
-
return mVhal;
}
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 d12d7b2..25d1fe7 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
@@ -16,6 +16,8 @@
package com.android.server.biometrics.sensors.fingerprint.aidl;
+import static android.hardware.fingerprint.FingerprintSensorConfigurations.remapFqName;
+
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
@@ -356,8 +358,8 @@
if (mTestHalEnabled) {
return true;
}
- return (ServiceManager.checkService(IFingerprint.DESCRIPTOR + "/" + halInstance)
- != null);
+ return (ServiceManager.checkService(
+ remapFqName(IFingerprint.DESCRIPTOR + "/" + halInstance)) != null);
}
@NonNull protected BiometricContext getBiometricContext() {
diff --git a/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java b/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java
index 028b9b0..fcbcb02 100644
--- a/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java
+++ b/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java
@@ -32,8 +32,9 @@
public BroadcastRadioService(Context context) {
super(context);
ArrayList<String> serviceNameList = IRadioServiceAidlImpl.getServicesNames();
- mServiceImpl = serviceNameList.isEmpty() ? new IRadioServiceHidlImpl(this)
- : new IRadioServiceAidlImpl(this, serviceNameList);
+ RadioServiceUserController userController = new RadioServiceUserControllerImpl();
+ mServiceImpl = serviceNameList.isEmpty() ? new IRadioServiceHidlImpl(this, userController)
+ : new IRadioServiceAidlImpl(this, serviceNameList, userController);
}
@Override
diff --git a/services/core/java/com/android/server/broadcastradio/IRadioServiceAidlImpl.java b/services/core/java/com/android/server/broadcastradio/IRadioServiceAidlImpl.java
index 16514fa..332958d 100644
--- a/services/core/java/com/android/server/broadcastradio/IRadioServiceAidlImpl.java
+++ b/services/core/java/com/android/server/broadcastradio/IRadioServiceAidlImpl.java
@@ -69,8 +69,9 @@
return serviceList;
}
- IRadioServiceAidlImpl(BroadcastRadioService service, ArrayList<String> serviceList) {
- this(service, new BroadcastRadioServiceImpl(serviceList));
+ IRadioServiceAidlImpl(BroadcastRadioService service, List<String> serviceList,
+ RadioServiceUserController userController) {
+ this(service, new BroadcastRadioServiceImpl(serviceList, userController));
Slogf.i(TAG, "Initialize BroadcastRadioServiceAidl(%s)", service);
}
diff --git a/services/core/java/com/android/server/broadcastradio/IRadioServiceHidlImpl.java b/services/core/java/com/android/server/broadcastradio/IRadioServiceHidlImpl.java
index ab08342..67d3c95 100644
--- a/services/core/java/com/android/server/broadcastradio/IRadioServiceHidlImpl.java
+++ b/services/core/java/com/android/server/broadcastradio/IRadioServiceHidlImpl.java
@@ -59,13 +59,16 @@
@GuardedBy("mLock")
private final List<RadioManager.ModuleProperties> mV1Modules;
- IRadioServiceHidlImpl(BroadcastRadioService service) {
+ IRadioServiceHidlImpl(BroadcastRadioService service,
+ RadioServiceUserController userController) {
mService = Objects.requireNonNull(service, "broadcast radio service cannot be null");
- mHal1Client = new com.android.server.broadcastradio.hal1.BroadcastRadioService();
+ Objects.requireNonNull(userController, "user controller cannot be null");
+ mHal1Client = new com.android.server.broadcastradio.hal1.BroadcastRadioService(
+ userController);
mV1Modules = mHal1Client.loadModules();
OptionalInt max = mV1Modules.stream().mapToInt(RadioManager.ModuleProperties::getId).max();
mHal2Client = new com.android.server.broadcastradio.hal2.BroadcastRadioService(
- max.isPresent() ? max.getAsInt() + 1 : 0);
+ max.isPresent() ? max.getAsInt() + 1 : 0, userController);
}
@VisibleForTesting
diff --git a/services/core/java/com/android/server/broadcastradio/RadioServiceUserController.java b/services/core/java/com/android/server/broadcastradio/RadioServiceUserController.java
index c705ebe..c15ccf1 100644
--- a/services/core/java/com/android/server/broadcastradio/RadioServiceUserController.java
+++ b/services/core/java/com/android/server/broadcastradio/RadioServiceUserController.java
@@ -16,19 +16,11 @@
package com.android.server.broadcastradio;
-import android.app.ActivityManager;
-import android.os.Binder;
-import android.os.UserHandle;
-
/**
- * Controller to handle users in {@link com.android.server.broadcastradio.BroadcastRadioService}
+ * Controller interface to handle users in
+ * {@link com.android.server.broadcastradio.BroadcastRadioService}
*/
-public final class RadioServiceUserController {
-
- private RadioServiceUserController() {
- throw new UnsupportedOperationException(
- "RadioServiceUserController class is noninstantiable");
- }
+public interface RadioServiceUserController {
/**
* Check if the user calling the method in Broadcast Radio Service is the current user or the
@@ -37,26 +29,20 @@
* @return {@code true} if the user calling this method is the current user of system user,
* {@code false} otherwise.
*/
- public static boolean isCurrentOrSystemUser() {
- int callingUser = Binder.getCallingUserHandle().getIdentifier();
- return callingUser == getCurrentUser() || callingUser == UserHandle.USER_SYSTEM;
- }
+ boolean isCurrentOrSystemUser();
/**
* Get current foreground user for Broadcast Radio Service
*
* @return foreground user id.
*/
- public static int getCurrentUser() {
- int userId = UserHandle.USER_NULL;
- final long identity = Binder.clearCallingIdentity();
- try {
- userId = ActivityManager.getCurrentUser();
- } catch (RuntimeException e) {
- // Activity manager not running, nothing we can do assume user 0.
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
- return userId;
- }
-}
+ int getCurrentUser();
+
+ /**
+ * Get id of the user handle assigned to the process that sent the binder transaction that is
+ * being processed
+ *
+ * @return Id of the user handle
+ */
+ int getCallingUserId();
+}
\ No newline at end of file
diff --git a/services/core/java/com/android/server/broadcastradio/RadioServiceUserControllerImpl.java b/services/core/java/com/android/server/broadcastradio/RadioServiceUserControllerImpl.java
new file mode 100644
index 0000000..e305d20
--- /dev/null
+++ b/services/core/java/com/android/server/broadcastradio/RadioServiceUserControllerImpl.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.broadcastradio;
+
+import android.app.ActivityManager;
+import android.os.Binder;
+import android.os.UserHandle;
+
+/**
+ * Implementation for the controller to handle users in
+ * {@link com.android.server.broadcastradio.BroadcastRadioService}
+ */
+public final class RadioServiceUserControllerImpl implements RadioServiceUserController {
+
+ /**
+ * @see RadioServiceUserController#isCurrentOrSystemUser()
+ */
+ @Override
+ public boolean isCurrentOrSystemUser() {
+ int callingUser = getCallingUserId();
+ return callingUser == getCurrentUser() || callingUser == UserHandle.USER_SYSTEM;
+ }
+
+ /**
+ * @see RadioServiceUserController#getCurrentUser()
+ */
+ @Override
+ public int getCurrentUser() {
+ int userId = UserHandle.USER_NULL;
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ userId = ActivityManager.getCurrentUser();
+ } catch (RuntimeException e) {
+ // Activity manager not running, nothing we can do assume user 0.
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ return userId;
+ }
+
+ /**
+ * @see RadioServiceUserController#getCallingUserId()
+ */
+ @Override
+ public int getCallingUserId() {
+ return Binder.getCallingUserHandle().getIdentifier();
+ }
+}
diff --git a/services/core/java/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImpl.java b/services/core/java/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImpl.java
index 7b50465..06024b5 100644
--- a/services/core/java/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImpl.java
+++ b/services/core/java/com/android/server/broadcastradio/aidl/BroadcastRadioServiceImpl.java
@@ -51,6 +51,7 @@
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private final Object mLock = new Object();
+ private final RadioServiceUserController mUserController;
@GuardedBy("mLock")
private int mNextModuleId;
@@ -77,7 +78,7 @@
}
RadioModule radioModule =
- RadioModule.tryLoadingModule(moduleId, name, newBinder);
+ RadioModule.tryLoadingModule(moduleId, name, newBinder, mUserController);
if (radioModule == null) {
Slogf.w(TAG, "No module %s with id %d (HAL AIDL)", name, moduleId);
return;
@@ -141,9 +142,12 @@
* BroadcastRadio HAL services
*
* @param serviceNameList list of names of AIDL BroadcastRadio HAL services
+ * @param userController User controller implementation
*/
- public BroadcastRadioServiceImpl(ArrayList<String> serviceNameList) {
+ public BroadcastRadioServiceImpl(List<String> serviceNameList,
+ RadioServiceUserController userController) {
mNextModuleId = 0;
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
if (DEBUG) {
Slogf.d(TAG, "Initializing BroadcastRadioServiceImpl %s", IBroadcastRadio.DESCRIPTOR);
}
@@ -202,7 +206,7 @@
if (DEBUG) {
Slogf.d(TAG, "Open AIDL radio session");
}
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.e(TAG, "Cannot open tuner on AIDL HAL client for non-current user");
throw new IllegalStateException("Cannot open session for non-current user");
}
diff --git a/services/core/java/com/android/server/broadcastradio/aidl/RadioModule.java b/services/core/java/com/android/server/broadcastradio/aidl/RadioModule.java
index a176a32..20ee49e 100644
--- a/services/core/java/com/android/server/broadcastradio/aidl/RadioModule.java
+++ b/services/core/java/com/android/server/broadcastradio/aidl/RadioModule.java
@@ -62,6 +62,7 @@
private final Handler mHandler;
private final RadioEventLogger mLogger;
private final RadioManager.ModuleProperties mProperties;
+ private final RadioServiceUserController mUserController;
/**
* Tracks antenna state reported by HAL (if any).
@@ -194,15 +195,18 @@
};
@VisibleForTesting
- RadioModule(IBroadcastRadio service, RadioManager.ModuleProperties properties) {
+ RadioModule(IBroadcastRadio service, RadioManager.ModuleProperties properties,
+ RadioServiceUserController userController) {
mProperties = Objects.requireNonNull(properties, "properties cannot be null");
mService = Objects.requireNonNull(service, "service cannot be null");
mHandler = new Handler(Looper.getMainLooper());
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
mLogger = new RadioEventLogger(TAG, RADIO_EVENT_LOGGER_QUEUE_SIZE);
}
@Nullable
- static RadioModule tryLoadingModule(int moduleId, String moduleName, IBinder serviceBinder) {
+ static RadioModule tryLoadingModule(int moduleId, String moduleName, IBinder serviceBinder,
+ RadioServiceUserController userController) {
try {
Slogf.i(TAG, "Try loading module for module id = %d, module name = %s",
moduleId, moduleName);
@@ -232,7 +236,7 @@
RadioManager.ModuleProperties prop = ConversionUtils.propertiesFromHalProperties(
moduleId, moduleName, service.getProperties(), amfmConfig, dabConfig);
- return new RadioModule(service, prop);
+ return new RadioModule(service, prop, userController);
} catch (RemoteException ex) {
Slogf.e(TAG, ex, "Failed to load module %s", moduleName);
return null;
@@ -256,7 +260,7 @@
RadioManager.ProgramInfo currentProgramInfo;
synchronized (mLock) {
boolean isFirstTunerSession = mAidlTunerSessions.isEmpty();
- tunerSession = new TunerSession(this, mService, userCb);
+ tunerSession = new TunerSession(this, mService, userCb, mUserController);
mAidlTunerSessions.add(tunerSession);
antennaConnected = mAntennaConnected;
currentProgramInfo = mCurrentProgramInfo;
@@ -440,7 +444,7 @@
@GuardedBy("mLock")
private void fanoutAidlCallbackLocked(AidlCallbackRunnable runnable) {
- int currentUserId = RadioServiceUserController.getCurrentUser();
+ int currentUserId = mUserController.getCurrentUser();
List<TunerSession> deadSessions = null;
for (int i = 0; i < mAidlTunerSessions.size(); i++) {
if (mAidlTunerSessions.valueAt(i).mUserId != currentUserId
diff --git a/services/core/java/com/android/server/broadcastradio/aidl/TunerSession.java b/services/core/java/com/android/server/broadcastradio/aidl/TunerSession.java
index e90a1dd..f22661b 100644
--- a/services/core/java/com/android/server/broadcastradio/aidl/TunerSession.java
+++ b/services/core/java/com/android/server/broadcastradio/aidl/TunerSession.java
@@ -52,6 +52,7 @@
final android.hardware.radio.ITunerCallback mCallback;
private final int mUid;
private final IBroadcastRadio mService;
+ private final RadioServiceUserController mUserController;
@GuardedBy("mLock")
private boolean mIsClosed;
@@ -65,11 +66,13 @@
private RadioManager.BandConfig mPlaceHolderConfig;
TunerSession(RadioModule radioModule, IBroadcastRadio service,
- android.hardware.radio.ITunerCallback callback) {
+ android.hardware.radio.ITunerCallback callback,
+ RadioServiceUserController userController) {
mModule = Objects.requireNonNull(radioModule, "radioModule cannot be null");
mService = Objects.requireNonNull(service, "service cannot be null");
- mUserId = Binder.getCallingUserHandle().getIdentifier();
mCallback = Objects.requireNonNull(callback, "callback cannot be null");
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
+ mUserId = mUserController.getCallingUserId();
mUid = Binder.getCallingUid();
mLogger = new RadioEventLogger(TAG, TUNER_EVENT_LOGGER_QUEUE_SIZE);
}
@@ -126,7 +129,7 @@
@Override
public void setConfiguration(RadioManager.BandConfig config) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set configuration for AIDL HAL client from non-current user");
return;
}
@@ -169,7 +172,7 @@
public void step(boolean directionDown, boolean skipSubChannel) throws RemoteException {
mLogger.logRadioEvent("Step with direction %s, skipSubChannel? %s",
directionDown ? "down" : "up", skipSubChannel ? "yes" : "no");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot step on AIDL HAL client from non-current user");
return;
}
@@ -187,7 +190,7 @@
public void seek(boolean directionDown, boolean skipSubChannel) throws RemoteException {
mLogger.logRadioEvent("Seek with direction %s, skipSubChannel? %s",
directionDown ? "down" : "up", skipSubChannel ? "yes" : "no");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot scan on AIDL HAL client from non-current user");
return;
}
@@ -204,7 +207,7 @@
@Override
public void tune(ProgramSelector selector) throws RemoteException {
mLogger.logRadioEvent("Tune with selector %s", selector);
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot tune on AIDL HAL client from non-current user");
return;
}
@@ -226,7 +229,7 @@
@Override
public void cancel() {
Slogf.i(TAG, "Cancel");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot cancel on AIDL HAL client from non-current user");
return;
}
@@ -255,7 +258,7 @@
@Override
public boolean startBackgroundScan() {
Slogf.w(TAG, "Explicit background scan trigger is not supported with HAL AIDL");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot start background scan on AIDL HAL client from non-current user");
return false;
}
@@ -268,7 +271,7 @@
@Override
public void startProgramListUpdates(ProgramList.Filter filter) throws RemoteException {
mLogger.logRadioEvent("Start programList updates %s", filter);
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot start program list updates on AIDL HAL client from non-current user");
return;
@@ -344,7 +347,7 @@
@Override
public void stopProgramListUpdates() throws RemoteException {
mLogger.logRadioEvent("Stop programList updates");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot stop program list updates on AIDL HAL client from non-current user");
return;
@@ -389,7 +392,7 @@
public void setConfigFlag(int flag, boolean value) throws RemoteException {
mLogger.logRadioEvent("set ConfigFlag %s to %b ",
ConfigFlag.$.toString(flag), value);
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set config flag for AIDL HAL client from non-current user");
return;
}
@@ -406,7 +409,7 @@
@Override
public Map<String, String> setParameters(Map<String, String> parameters) {
mLogger.logRadioEvent("Set parameters ");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set parameters for AIDL HAL client from non-current user");
return new ArrayMap<>();
}
diff --git a/services/core/java/com/android/server/broadcastradio/hal1/BroadcastRadioService.java b/services/core/java/com/android/server/broadcastradio/hal1/BroadcastRadioService.java
index fb42c94..6a6a3ae 100644
--- a/services/core/java/com/android/server/broadcastradio/hal1/BroadcastRadioService.java
+++ b/services/core/java/com/android/server/broadcastradio/hal1/BroadcastRadioService.java
@@ -35,6 +35,7 @@
* This field is used by native code, do not access or modify.
*/
private final long mNativeContext = nativeInit();
+ private final RadioServiceUserController mUserController;
private final Object mLock = new Object();
@@ -50,6 +51,10 @@
private native Tuner nativeOpenTuner(long nativeContext, int moduleId,
RadioManager.BandConfig config, boolean withAudio, ITunerCallback callback);
+ public BroadcastRadioService(RadioServiceUserController userController) {
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
+ }
+
public @NonNull List<RadioManager.ModuleProperties> loadModules() {
synchronized (mLock) {
return Objects.requireNonNull(nativeLoadModules(mNativeContext));
@@ -58,7 +63,7 @@
public ITuner openTuner(int moduleId, RadioManager.BandConfig bandConfig,
boolean withAudio, ITunerCallback callback) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.e(TAG, "Cannot open tuner on HAL 1.x client for non-current user");
throw new IllegalStateException("Cannot open tuner for non-current user");
}
diff --git a/services/core/java/com/android/server/broadcastradio/hal1/Tuner.java b/services/core/java/com/android/server/broadcastradio/hal1/Tuner.java
index 7cac409..8e64600d2 100644
--- a/services/core/java/com/android/server/broadcastradio/hal1/Tuner.java
+++ b/services/core/java/com/android/server/broadcastradio/hal1/Tuner.java
@@ -28,6 +28,7 @@
import android.os.RemoteException;
import com.android.server.broadcastradio.RadioServiceUserController;
+import com.android.server.broadcastradio.RadioServiceUserControllerImpl;
import com.android.server.utils.Slogf;
import java.util.List;
@@ -51,6 +52,7 @@
private boolean mIsMuted = false;
private int mRegion;
private final boolean mWithAudio;
+ private final RadioServiceUserController mUserController = new RadioServiceUserControllerImpl();
Tuner(@NonNull ITunerCallback clientCallback, int halRev,
int region, boolean withAudio, int band) {
@@ -127,7 +129,7 @@
@Override
public void setConfiguration(RadioManager.BandConfig config) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set configuration for HAL 1.x client from non-current user");
return;
}
@@ -176,7 +178,7 @@
@Override
public void step(boolean directionDown, boolean skipSubChannel) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot step on HAL 1.x client from non-current user");
return;
}
@@ -189,7 +191,7 @@
@Override
public void seek(boolean directionDown, boolean skipSubChannel) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot seek on HAL 1.x client from non-current user");
return;
}
@@ -202,7 +204,7 @@
@Override
public void tune(ProgramSelector selector) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot tune on HAL 1.x client from non-current user");
return;
}
@@ -219,7 +221,7 @@
@Override
public void cancel() {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot cancel on HAL 1.x client from non-current user");
return;
}
@@ -231,7 +233,7 @@
@Override
public void cancelAnnouncement() {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot cancel announcement on HAL 1.x client from non-current user");
return;
}
@@ -260,7 +262,7 @@
@Override
public boolean startBackgroundScan() {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot start background scan on HAL 1.x client from non-current user");
return false;
@@ -285,7 +287,7 @@
@Override
public void startProgramListUpdates(ProgramList.Filter filter) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot start program list updates on HAL 1.x client from non-current user");
return;
@@ -295,7 +297,7 @@
@Override
public void stopProgramListUpdates() {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot stop program list updates on HAL 1.x client from non-current user");
return;
@@ -321,7 +323,7 @@
@Override
public void setConfigFlag(int flag, boolean value) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set config flag for HAL 1.x client from non-current user");
return;
}
diff --git a/services/core/java/com/android/server/broadcastradio/hal2/BroadcastRadioService.java b/services/core/java/com/android/server/broadcastradio/hal2/BroadcastRadioService.java
index a4efa2e..3227afd 100644
--- a/services/core/java/com/android/server/broadcastradio/hal2/BroadcastRadioService.java
+++ b/services/core/java/com/android/server/broadcastradio/hal2/BroadcastRadioService.java
@@ -50,6 +50,8 @@
private final Object mLock = new Object();
+ private final RadioServiceUserController mUserController;
+
@GuardedBy("mLock")
private int mNextModuleId;
@@ -75,7 +77,8 @@
moduleId = mNextModuleId;
}
- RadioModule radioModule = RadioModule.tryLoadingModule(moduleId, serviceName);
+ RadioModule radioModule = RadioModule.tryLoadingModule(moduleId, serviceName,
+ mUserController);
if (radioModule == null) {
return;
}
@@ -123,8 +126,9 @@
}
};
- public BroadcastRadioService(int nextModuleId) {
+ public BroadcastRadioService(int nextModuleId, RadioServiceUserController userController) {
mNextModuleId = nextModuleId;
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
try {
IServiceManager manager = IServiceManager.getService();
if (manager == null) {
@@ -138,8 +142,10 @@
}
@VisibleForTesting
- BroadcastRadioService(int nextModuleId, IServiceManager manager) {
+ BroadcastRadioService(int nextModuleId, IServiceManager manager,
+ RadioServiceUserController userController) {
mNextModuleId = nextModuleId;
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
Objects.requireNonNull(manager, "Service manager cannot be null");
try {
manager.registerForNotifications(IBroadcastRadio.kInterfaceName, "", mServiceListener);
@@ -171,7 +177,7 @@
public ITuner openSession(int moduleId, @Nullable RadioManager.BandConfig legacyConfig,
boolean withAudio, @NonNull ITunerCallback callback) throws RemoteException {
Slogf.v(TAG, "Open HIDL 2.0 session with module id " + moduleId);
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.e(TAG, "Cannot open tuner on HAL 2.0 client for non-current user");
throw new IllegalStateException("Cannot open session for non-current user");
}
diff --git a/services/core/java/com/android/server/broadcastradio/hal2/RadioModule.java b/services/core/java/com/android/server/broadcastradio/hal2/RadioModule.java
index d3b2448..a0d6cc2 100644
--- a/services/core/java/com/android/server/broadcastradio/hal2/RadioModule.java
+++ b/services/core/java/com/android/server/broadcastradio/hal2/RadioModule.java
@@ -66,6 +66,7 @@
private final Object mLock = new Object();
private final Handler mHandler;
private final RadioEventLogger mEventLogger;
+ private final RadioServiceUserController mUserController;
@GuardedBy("mLock")
private ITunerSession mHalTunerSession;
@@ -148,16 +149,18 @@
private final Set<TunerSession> mAidlTunerSessions = new ArraySet<>();
@VisibleForTesting
- RadioModule(@NonNull IBroadcastRadio service,
- @NonNull RadioManager.ModuleProperties properties) {
+ RadioModule(IBroadcastRadio service, RadioManager.ModuleProperties properties,
+ RadioServiceUserController userController) {
mProperties = Objects.requireNonNull(properties);
mService = Objects.requireNonNull(service);
mHandler = new Handler(Looper.getMainLooper());
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
mEventLogger = new RadioEventLogger(TAG, RADIO_EVENT_LOGGER_QUEUE_SIZE);
}
@Nullable
- static RadioModule tryLoadingModule(int idx, @NonNull String fqName) {
+ static RadioModule tryLoadingModule(int idx, String fqName,
+ RadioServiceUserController controller) {
try {
Slogf.i(TAG, "Try loading module for idx " + idx + ", fqName " + fqName);
IBroadcastRadio service = IBroadcastRadio.getService(fqName);
@@ -179,7 +182,7 @@
RadioManager.ModuleProperties prop = Convert.propertiesFromHal(idx, fqName,
service.getProperties(), amfmConfig.value, dabConfig.value);
- return new RadioModule(service, prop);
+ return new RadioModule(service, prop, controller);
} catch (RemoteException ex) {
Slogf.e(TAG, "Failed to load module " + fqName, ex);
return null;
@@ -208,7 +211,8 @@
});
mHalTunerSession = Objects.requireNonNull(hwSession.value);
}
- TunerSession tunerSession = new TunerSession(this, mHalTunerSession, userCb);
+ TunerSession tunerSession = new TunerSession(this, mHalTunerSession, userCb,
+ mUserController);
mAidlTunerSessions.add(tunerSession);
// Propagate state to new client. Note: These callbacks are invoked while holding mLock
@@ -375,7 +379,7 @@
@GuardedBy("mLock")
private void fanoutAidlCallbackLocked(AidlCallbackRunnable runnable) {
- int currentUserId = RadioServiceUserController.getCurrentUser();
+ int currentUserId = mUserController.getCurrentUser();
List<TunerSession> deadSessions = null;
for (TunerSession tunerSession : mAidlTunerSessions) {
if (tunerSession.mUserId != currentUserId && tunerSession.mUserId
diff --git a/services/core/java/com/android/server/broadcastradio/hal2/TunerSession.java b/services/core/java/com/android/server/broadcastradio/hal2/TunerSession.java
index 80efacd..dc164b1 100644
--- a/services/core/java/com/android/server/broadcastradio/hal2/TunerSession.java
+++ b/services/core/java/com/android/server/broadcastradio/hal2/TunerSession.java
@@ -16,7 +16,6 @@
package com.android.server.broadcastradio.hal2;
-import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Bitmap;
import android.hardware.broadcastradio.V2_0.ConfigFlag;
@@ -27,7 +26,6 @@
import android.hardware.radio.ProgramList;
import android.hardware.radio.ProgramSelector;
import android.hardware.radio.RadioManager;
-import android.os.Binder;
import android.os.RemoteException;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -55,6 +53,7 @@
private final ITunerSession mHwSession;
final int mUserId;
final android.hardware.radio.ITunerCallback mCallback;
+ private final RadioServiceUserController mUserController;
@GuardedBy("mLock")
private boolean mIsClosed = false;
@@ -66,12 +65,14 @@
// necessary only for older APIs compatibility
private RadioManager.BandConfig mDummyConfig = null;
- TunerSession(@NonNull RadioModule module, @NonNull ITunerSession hwSession,
- @NonNull android.hardware.radio.ITunerCallback callback) {
+ TunerSession(RadioModule module, ITunerSession hwSession,
+ android.hardware.radio.ITunerCallback callback,
+ RadioServiceUserController userController) {
mModule = Objects.requireNonNull(module);
mHwSession = Objects.requireNonNull(hwSession);
- mUserId = Binder.getCallingUserHandle().getIdentifier();
mCallback = Objects.requireNonNull(callback);
+ mUserController = Objects.requireNonNull(userController, "User controller can not be null");
+ mUserId = mUserController.getCallingUserId();
mEventLogger = new RadioEventLogger(TAG, TUNER_EVENT_LOGGER_QUEUE_SIZE);
}
@@ -120,7 +121,7 @@
@Override
public void setConfiguration(RadioManager.BandConfig config) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set configuration for HAL 2.0 client from non-current user");
return;
}
@@ -162,7 +163,7 @@
public void step(boolean directionDown, boolean skipSubChannel) throws RemoteException {
mEventLogger.logRadioEvent("Step with direction %s, skipSubChannel? %s",
directionDown ? "down" : "up", skipSubChannel ? "yes" : "no");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot step on HAL 2.0 client from non-current user");
return;
}
@@ -177,7 +178,7 @@
public void seek(boolean directionDown, boolean skipSubChannel) throws RemoteException {
mEventLogger.logRadioEvent("Seek with direction %s, skipSubChannel? %s",
directionDown ? "down" : "up", skipSubChannel ? "yes" : "no");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot scan on HAL 2.0 client from non-current user");
return;
}
@@ -191,7 +192,7 @@
@Override
public void tune(ProgramSelector selector) throws RemoteException {
mEventLogger.logRadioEvent("Tune with selector %s", selector);
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot tune on HAL 2.0 client from non-current user");
return;
}
@@ -205,7 +206,7 @@
@Override
public void cancel() {
Slogf.i(TAG, "Cancel");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot cancel on HAL 2.0 client from non-current user");
return;
}
@@ -230,7 +231,7 @@
@Override
public boolean startBackgroundScan() {
Slogf.w(TAG, "Explicit background scan trigger is not supported with HAL 2.0");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot start background scan on HAL 2.0 client from non-current user");
return false;
@@ -242,7 +243,7 @@
@Override
public void startProgramListUpdates(ProgramList.Filter filter) {
mEventLogger.logRadioEvent("start programList updates %s", filter);
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot start program list updates on HAL 2.0 client from non-current user");
return;
@@ -306,7 +307,7 @@
@Override
public void stopProgramListUpdates() throws RemoteException {
mEventLogger.logRadioEvent("Stop programList updates");
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG,
"Cannot stop program list updates on HAL 2.0 client from non-current user");
return;
@@ -355,7 +356,7 @@
@Override
public void setConfigFlag(int flag, boolean value) throws RemoteException {
mEventLogger.logRadioEvent("Set ConfigFlag %s = %b", ConfigFlag.toString(flag), value);
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set config flag for HAL 2.0 client from non-current user");
return;
}
@@ -368,7 +369,7 @@
@Override
public Map<String, String> setParameters(Map<String, String> parameters) {
- if (!RadioServiceUserController.isCurrentOrSystemUser()) {
+ if (!mUserController.isCurrentOrSystemUser()) {
Slogf.w(TAG, "Cannot set parameters for HAL 2.0 client from non-current user");
return new ArrayMap<>();
}
diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java
index 17835b2..05fc6bc 100644
--- a/services/core/java/com/android/server/camera/CameraServiceProxy.java
+++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java
@@ -379,12 +379,8 @@
streamCount = mStreamStats.size();
}
if (CameraServiceProxy.DEBUG) {
- String ultrawideDebug = Flags.logUltrawideUsage()
- ? ", wideAngleUsage " + mUsedUltraWide
- : "";
- String zoomOverrideDebug = Flags.logZoomOverrideUsage()
- ? ", zoomOverrideUsage " + mUsedZoomOverride
- : "";
+ String ultrawideDebug = ", wideAngleUsage " + mUsedUltraWide;
+ String zoomOverrideDebug = ", zoomOverrideUsage " + mUsedZoomOverride;
String mostRequestedFpsRangeDebug = Flags.analytics24q3()
? ", mostRequestedFpsRange " + mMostRequestedFpsRange
: "";
@@ -1338,9 +1334,8 @@
List<CameraStreamStats> streamStats = cameraState.getStreamStats();
String userTag = cameraState.getUserTag();
int videoStabilizationMode = cameraState.getVideoStabilizationMode();
- boolean usedUltraWide = Flags.logUltrawideUsage() ? cameraState.getUsedUltraWide() : false;
- boolean usedZoomOverride =
- Flags.logZoomOverrideUsage() ? cameraState.getUsedZoomOverride() : false;
+ boolean usedUltraWide = cameraState.getUsedUltraWide();
+ boolean usedZoomOverride = cameraState.getUsedZoomOverride();
long logId = cameraState.getLogId();
int sessionIdx = cameraState.getSessionIndex();
CameraExtensionSessionStats extSessionStats = cameraState.getExtensionSessionStats();
diff --git a/services/core/java/com/android/server/display/AutomaticBrightnessController.java b/services/core/java/com/android/server/display/AutomaticBrightnessController.java
index 907e7c6..86015ac 100644
--- a/services/core/java/com/android/server/display/AutomaticBrightnessController.java
+++ b/services/core/java/com/android/server/display/AutomaticBrightnessController.java
@@ -938,7 +938,7 @@
setAmbientLux(mFastAmbientLux);
if (mLoggingEnabled) {
Slog.d(TAG, "updateAmbientLux: "
- + ((mFastAmbientLux > mAmbientLux) ? "Brightened" : "Darkened") + ": "
+ + ((mFastAmbientLux > mPreThresholdLux) ? "Brightened" : "Darkened") + ": "
+ "mAmbientBrighteningThreshold=" + mAmbientBrighteningThreshold + ", "
+ "mAmbientDarkeningThreshold=" + mAmbientDarkeningThreshold + ", "
+ "mAmbientLightRingBuffer=" + mAmbientLightRingBuffer + ", "
diff --git a/services/core/java/com/android/server/display/BrightnessRangeController.java b/services/core/java/com/android/server/display/BrightnessRangeController.java
index 8a3e392..1d68ee54 100644
--- a/services/core/java/com/android/server/display/BrightnessRangeController.java
+++ b/services/core/java/com/android/server/display/BrightnessRangeController.java
@@ -16,6 +16,7 @@
package com.android.server.display;
+import android.annotation.Nullable;
import android.hardware.display.BrightnessInfo;
import android.os.Handler;
import android.os.IBinder;
@@ -92,7 +93,7 @@
return mHbmController.getNormalBrightnessMax();
}
- void loadFromConfig(HighBrightnessModeMetadata hbmMetadata, IBinder token,
+ void loadFromConfig(@Nullable HighBrightnessModeMetadata hbmMetadata, IBinder token,
DisplayDeviceInfo info, DisplayDeviceConfig displayDeviceConfig) {
applyChanges(
() -> mNormalBrightnessModeController.resetNbmData(
diff --git a/services/core/java/com/android/server/display/DisplayBrightnessState.java b/services/core/java/com/android/server/display/DisplayBrightnessState.java
index 334dda0..01bbd2f 100644
--- a/services/core/java/com/android/server/display/DisplayBrightnessState.java
+++ b/services/core/java/com/android/server/display/DisplayBrightnessState.java
@@ -17,6 +17,7 @@
package com.android.server.display;
import android.hardware.display.BrightnessInfo;
+import android.os.PowerManager;
import android.text.TextUtils;
import com.android.server.display.brightness.BrightnessEvent;
@@ -255,7 +256,7 @@
private String mDisplayBrightnessStrategyName;
private boolean mShouldUseAutoBrightness;
private boolean mIsSlowChange;
- private float mMaxBrightness;
+ private float mMaxBrightness = PowerManager.BRIGHTNESS_MAX;
private float mMinBrightness;
private float mCustomAnimationRate = CUSTOM_ANIMATION_RATE_NOT_SET;
private boolean mShouldUpdateScreenBrightnessSetting;
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index 2b732ea..9644b1d 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -134,6 +134,7 @@
import android.util.EventLog;
import android.util.IndentingPrintWriter;
import android.util.IntArray;
+import android.util.MathUtils;
import android.util.Pair;
import android.util.Slog;
import android.util.SparseArray;
@@ -1275,6 +1276,9 @@
|| isUidPresentOnDisplayInternal(callingUid, displayId)) {
return info;
}
+ } else if (displayId == Display.DEFAULT_DISPLAY) {
+ Slog.e(TAG, "Default display is null for info request from uid "
+ + callingUid);
}
return null;
}
@@ -2166,9 +2170,7 @@
HighBrightnessModeMetadata hbmMetadata =
mHighBrightnessModeMetadataMapper.getHighBrightnessModeMetadataLocked(display);
- if (hbmMetadata != null) {
- dpc.onDisplayChanged(hbmMetadata, leadDisplayId);
- }
+ dpc.onDisplayChanged(hbmMetadata, leadDisplayId);
}
}
@@ -2223,10 +2225,11 @@
if (display.isValidLocked()) {
applyDisplayChangedLocked(display);
}
- return;
+ } else {
+ releaseDisplayAndEmitEvent(display, DisplayManagerGlobal.EVENT_DISPLAY_REMOVED);
}
- releaseDisplayAndEmitEvent(display, DisplayManagerGlobal.EVENT_DISPLAY_REMOVED);
+ Slog.i(TAG, "Logical display removed: " + display.getDisplayIdLocked());
}
private void releaseDisplayAndEmitEvent(LogicalDisplay display, int event) {
@@ -2286,9 +2289,7 @@
HighBrightnessModeMetadata hbmMetadata =
mHighBrightnessModeMetadataMapper.getHighBrightnessModeMetadataLocked(display);
- if (hbmMetadata != null) {
- dpc.onDisplayChanged(hbmMetadata, leadDisplayId);
- }
+ dpc.onDisplayChanged(hbmMetadata, leadDisplayId);
}
}
@@ -3098,6 +3099,7 @@
/**
* Get internal or external viewport. Create it if does not currently exist.
+ *
* @param viewportType - either INTERNAL or EXTERNAL
* @return the viewport with the requested type
*/
@@ -3554,6 +3556,18 @@
DisplayManagerFlags getFlags() {
return new DisplayManagerFlags();
}
+
+ DisplayPowerController getDisplayPowerController(Context context,
+ DisplayPowerController.Injector injector,
+ DisplayManagerInternal.DisplayPowerCallbacks callbacks, Handler handler,
+ SensorManager sensorManager, DisplayBlanker blanker, LogicalDisplay logicalDisplay,
+ BrightnessTracker brightnessTracker, BrightnessSetting brightnessSetting,
+ Runnable onBrightnessChangeRunnable, HighBrightnessModeMetadata hbmMetadata,
+ boolean bootCompleted, DisplayManagerFlags flags) {
+ return new DisplayPowerController(context, injector, callbacks, handler, sensorManager,
+ blanker, logicalDisplay, brightnessTracker, brightnessSetting,
+ onBrightnessChangeRunnable, hbmMetadata, bootCompleted, flags);
+ }
}
@VisibleForTesting
@@ -3606,7 +3620,7 @@
// with the corresponding displaydevice.
HighBrightnessModeMetadata hbmMetadata =
mHighBrightnessModeMetadataMapper.getHighBrightnessModeMetadataLocked(display);
- displayPowerController = new DisplayPowerController(
+ displayPowerController = mInjector.getDisplayPowerController(
mContext, /* injector= */ null, mDisplayPowerCallbacks, mPowerHandler,
mSensorManager, mDisplayBlanker, display, mBrightnessTracker, brightnessSetting,
() -> handleBrightnessChange(display), hbmMetadata, mBootCompleted, mFlags);
@@ -4413,7 +4427,6 @@
}
-
@Override // Binder call
public BrightnessConfiguration getBrightnessConfigurationForUser(int userId) {
final String uniqueId;
@@ -4492,10 +4505,12 @@
@Override // Binder call
public void setBrightness(int displayId, float brightness) {
setBrightness_enforcePermission();
- if (!isValidBrightness(brightness)) {
- Slog.w(TAG, "Attempted to set invalid brightness" + brightness);
+ if (Float.isNaN(brightness)) {
+ Slog.w(TAG, "Attempted to set invalid brightness: " + brightness);
return;
}
+ MathUtils.constrain(brightness, PowerManager.BRIGHTNESS_MIN,
+ PowerManager.BRIGHTNESS_MAX);
final long token = Binder.clearCallingIdentity();
try {
synchronized (mSyncRoot) {
@@ -4791,12 +4806,6 @@
}
}
- private static boolean isValidBrightness(float brightness) {
- return !Float.isNaN(brightness)
- && (brightness >= PowerManager.BRIGHTNESS_MIN)
- && (brightness <= PowerManager.BRIGHTNESS_MAX);
- }
-
@VisibleForTesting
void overrideSensorManager(SensorManager sensorManager) {
synchronized (mSyncRoot) {
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index bb2bed7..c3faec0 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -849,7 +849,8 @@
*
* Make sure DisplayManagerService.mSyncRoot lock is held when this is called
*/
- public void onDisplayChanged(HighBrightnessModeMetadata hbmMetadata, int leadDisplayId) {
+ public void onDisplayChanged(@Nullable HighBrightnessModeMetadata hbmMetadata,
+ int leadDisplayId) {
mLeadDisplayId = leadDisplayId;
final DisplayDevice device = mLogicalDisplay.getPrimaryDisplayDeviceLocked();
if (device == null) {
@@ -949,7 +950,7 @@
}
private void loadFromDisplayDeviceConfig(IBinder token, DisplayDeviceInfo info,
- HighBrightnessModeMetadata hbmMetadata) {
+ @Nullable HighBrightnessModeMetadata hbmMetadata) {
// All properties that depend on the associated DisplayDevice and the DDC must be
// updated here.
mScreenBrightnessDozeConfig = BrightnessUtils.clampAbsoluteBrightness(
@@ -2222,6 +2223,7 @@
unblockScreenOn();
}
mWindowManagerPolicy.screenTurningOn(mDisplayId, mPendingScreenOnUnblocker);
+ Slog.i(TAG, "Window Manager Policy screenTurningOn complete");
}
// Return true if the screen isn't blocked.
diff --git a/services/core/java/com/android/server/display/HighBrightnessModeController.java b/services/core/java/com/android/server/display/HighBrightnessModeController.java
index da9eef2..135cab6 100644
--- a/services/core/java/com/android/server/display/HighBrightnessModeController.java
+++ b/services/core/java/com/android/server/display/HighBrightnessModeController.java
@@ -266,7 +266,7 @@
mSettingsObserver.stopObserving();
}
- void setHighBrightnessModeMetadata(HighBrightnessModeMetadata hbmInfo) {
+ void setHighBrightnessModeMetadata(@Nullable HighBrightnessModeMetadata hbmInfo) {
mHighBrightnessModeMetadata = hbmInfo;
}
diff --git a/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamper.java b/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamper.java
index 40e9198..cf44ac0 100644
--- a/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamper.java
+++ b/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamper.java
@@ -73,7 +73,6 @@
abstract void stop();
protected enum Type {
- THERMAL,
POWER,
WEAR_BEDTIME_MODE,
}
diff --git a/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamperController.java b/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamperController.java
index d3be33f..9404034 100644
--- a/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamperController.java
+++ b/services/core/java/com/android/server/display/brightness/clamper/BrightnessClamperController.java
@@ -72,6 +72,8 @@
private final List<DisplayDeviceDataListener> mDisplayDeviceDataListeners = new ArrayList<>();
private final List<StatefulModifier> mStatefulModifiers = new ArrayList<>();
private final List<UserSwitchListener> mUserSwitchListeners = new ArrayList<>();
+ private final List<DeviceConfigListener> mDeviceConfigListeners = new ArrayList<>();
+
private ModifiersAggregatedState mModifiersAggregatedState = new ModifiersAggregatedState();
private final DeviceConfig.OnPropertiesChangedListener mOnPropertiesChangedListener;
@@ -144,9 +146,14 @@
if (m instanceof UserSwitchListener l) {
mUserSwitchListeners.add(l);
}
+ if (m instanceof DeviceConfigListener l) {
+ mDeviceConfigListeners.add(l);
+ }
});
- mOnPropertiesChangedListener =
- properties -> mClampers.forEach(BrightnessClamper::onDeviceConfigChanged);
+ mOnPropertiesChangedListener = properties -> {
+ mClampers.forEach(BrightnessClamper::onDeviceConfigChanged);
+ mDeviceConfigListeners.forEach(DeviceConfigListener::onDeviceConfigChanged);
+ };
mLightSensorController.configure(data.getAmbientLightSensor(), data.getDisplayId());
start();
}
@@ -209,8 +216,6 @@
private int getBrightnessMaxReason() {
if (mClamperType == null) {
return BrightnessInfo.BRIGHTNESS_MAX_REASON_NONE;
- } else if (mClamperType == Type.THERMAL) {
- return BrightnessInfo.BRIGHTNESS_MAX_REASON_THERMAL;
} else if (mClamperType == Type.POWER) {
return BrightnessInfo.BRIGHTNESS_MAX_REASON_POWER_IC;
} else if (mClamperType == Type.WEAR_BEDTIME_MODE) {
@@ -225,7 +230,7 @@
* Called when the user switches.
*/
public void onUserSwitch() {
- mUserSwitchListeners.forEach(listener -> listener.onSwitchUser());
+ mUserSwitchListeners.forEach(UserSwitchListener::onSwitchUser);
}
/**
@@ -294,11 +299,14 @@
state2.mMaxDesiredHdrRatio)
|| !BrightnessSynchronizer.floatEquals(state1.mMaxHdrBrightness,
state2.mMaxHdrBrightness)
- || state1.mSdrHdrRatioSpline != state2.mSdrHdrRatioSpline;
+ || state1.mSdrHdrRatioSpline != state2.mSdrHdrRatioSpline
+ || state1.mMaxBrightnessReason != state2.mMaxBrightnessReason
+ || !BrightnessSynchronizer.floatEquals(state1.mMaxBrightness,
+ state2.mMaxBrightness);
}
private void start() {
- if (!mClampers.isEmpty()) {
+ if (!mClampers.isEmpty() || !mDeviceConfigListeners.isEmpty()) {
mDeviceConfigParameterProvider.addOnPropertiesChangedListener(
mExecutor, mOnPropertiesChangedListener);
}
@@ -333,8 +341,7 @@
ClamperChangeListener clamperChangeListener, DisplayDeviceData data,
DisplayManagerFlags flags, Context context, float currentBrightness) {
List<BrightnessClamper<? super DisplayDeviceData>> clampers = new ArrayList<>();
- clampers.add(
- new BrightnessThermalClamper(handler, clamperChangeListener, data));
+
if (flags.isPowerThrottlingClamperEnabled()) {
// Check if power-throttling config is present.
PowerThrottlingConfigData configData = data.getPowerThrottlingConfigData();
@@ -354,6 +361,8 @@
Handler handler, ClamperChangeListener listener,
DisplayDeviceData data) {
List<BrightnessStateModifier> modifiers = new ArrayList<>();
+ modifiers.add(new BrightnessThermalModifier(handler, listener, data));
+
modifiers.add(new DisplayDimModifier(context));
modifiers.add(new BrightnessLowPowerModeModifier());
if (flags.isEvenDimmerEnabled() && data.mDisplayDeviceConfig.isEvenDimmerAvailable()) {
@@ -384,7 +393,7 @@
/**
* Config Data for clampers/modifiers
*/
- public static class DisplayDeviceData implements BrightnessThermalClamper.ThermalData,
+ public static class DisplayDeviceData implements BrightnessThermalModifier.ThermalData,
BrightnessPowerClamper.PowerData,
BrightnessWearBedtimeModeClamper.WearBedtimeModeData {
@NonNull
@@ -498,13 +507,23 @@
}
/**
+ * Modifier should implement this interface in order to receive device config updates
+ */
+ interface DeviceConfigListener {
+ void onDeviceConfigChanged();
+ }
+
+ /**
* StatefulModifiers contribute to AggregatedState, that is used to decide if brightness
- * adjustement is needed
+ * adjustment is needed
*/
public static class ModifiersAggregatedState {
float mMaxDesiredHdrRatio = HdrBrightnessModifier.DEFAULT_MAX_HDR_SDR_RATIO;
float mMaxHdrBrightness = PowerManager.BRIGHTNESS_MAX;
@Nullable
Spline mSdrHdrRatioSpline = null;
+ @BrightnessInfo.BrightnessMaxReason
+ int mMaxBrightnessReason = BrightnessInfo.BRIGHTNESS_MAX_REASON_NONE;
+ float mMaxBrightness = PowerManager.BRIGHTNESS_MAX;
}
}
diff --git a/services/core/java/com/android/server/display/brightness/clamper/BrightnessThermalClamper.java b/services/core/java/com/android/server/display/brightness/clamper/BrightnessThermalModifier.java
similarity index 77%
rename from services/core/java/com/android/server/display/brightness/clamper/BrightnessThermalClamper.java
rename to services/core/java/com/android/server/display/brightness/clamper/BrightnessThermalModifier.java
index 4498258..21ef309 100644
--- a/services/core/java/com/android/server/display/brightness/clamper/BrightnessThermalClamper.java
+++ b/services/core/java/com/android/server/display/brightness/clamper/BrightnessThermalModifier.java
@@ -22,6 +22,8 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
+import android.hardware.display.BrightnessInfo;
+import android.hardware.display.DisplayManagerInternal;
import android.os.Handler;
import android.os.IThermalEventListener;
import android.os.IThermalService;
@@ -33,8 +35,10 @@
import android.util.Slog;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.display.DisplayBrightnessState;
import com.android.server.display.DisplayDeviceConfig.ThermalBrightnessThrottlingData;
import com.android.server.display.DisplayDeviceConfig.ThermalBrightnessThrottlingData.ThrottlingLevel;
+import com.android.server.display.brightness.BrightnessReason;
import com.android.server.display.config.SensorData;
import com.android.server.display.feature.DeviceConfigParameterProvider;
import com.android.server.display.utils.DeviceConfigParsingUtils;
@@ -43,12 +47,15 @@
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Function;
-class BrightnessThermalClamper extends
- BrightnessClamper<BrightnessThermalClamper.ThermalData> {
+class BrightnessThermalModifier implements BrightnessStateModifier,
+ BrightnessClamperController.DisplayDeviceDataListener,
+ BrightnessClamperController.StatefulModifier,
+ BrightnessClamperController.DeviceConfigListener {
private static final String TAG = "BrightnessThermalClamper";
@NonNull
@@ -58,6 +65,11 @@
// data from DeviceConfig, for all displays, for all dataSets
// mapOf(uniqueDisplayId to mapOf(dataSetId to ThermalBrightnessThrottlingData))
@NonNull
+ protected final Handler mHandler;
+ @NonNull
+ protected final BrightnessClamperController.ClamperChangeListener mChangeListener;
+
+ @NonNull
private Map<String, Map<String, ThermalBrightnessThrottlingData>>
mThermalThrottlingDataOverride = Map.of();
// data from DisplayDeviceConfig, for particular display+dataSet
@@ -73,6 +85,8 @@
private String mDataId = null;
@Temperature.ThrottlingStatus
private int mThrottlingStatus = Temperature.THROTTLING_NONE;
+ private float mBrightnessCap = PowerManager.BRIGHTNESS_MAX;
+ private boolean mApplied = false;
private final BiFunction<String, String, ThrottlingLevel> mDataPointMapper = (key, value) -> {
try {
@@ -88,53 +102,51 @@
mDataSetMapper = ThermalBrightnessThrottlingData::create;
- BrightnessThermalClamper(Handler handler, ClamperChangeListener listener,
- ThermalData thermalData) {
- this(new Injector(), handler, listener, thermalData);
+ BrightnessThermalModifier(Handler handler, ClamperChangeListener listener,
+ BrightnessClamperController.DisplayDeviceData data) {
+ this(new Injector(), handler, listener, data);
}
@VisibleForTesting
- BrightnessThermalClamper(Injector injector, Handler handler,
- ClamperChangeListener listener, ThermalData thermalData) {
- super(handler, listener);
+ BrightnessThermalModifier(Injector injector, @NonNull Handler handler,
+ @NonNull ClamperChangeListener listener,
+ @NonNull BrightnessClamperController.DisplayDeviceData data) {
+ mHandler = handler;
+ mChangeListener = listener;
mConfigParameterProvider = injector.getDeviceConfigParameterProvider();
mThermalStatusObserver = new ThermalStatusObserver(injector, handler);
mHandler.post(() -> {
- setDisplayData(thermalData);
- loadOverrideData();
- });
-
- }
-
- @Override
- @NonNull
- Type getType() {
- return Type.THERMAL;
- }
-
- @Override
- void onDeviceConfigChanged() {
- mHandler.post(() -> {
- loadOverrideData();
- recalculateActiveData();
- });
- }
-
- @Override
- void onDisplayChanged(ThermalData data) {
- mHandler.post(() -> {
setDisplayData(data);
- recalculateActiveData();
+ loadOverrideData();
});
}
+ //region BrightnessStateModifier
+ @Override
+ public void apply(DisplayManagerInternal.DisplayPowerRequest request,
+ DisplayBrightnessState.Builder stateBuilder) {
+ if (stateBuilder.getMaxBrightness() > mBrightnessCap) {
+ stateBuilder.setMaxBrightness(mBrightnessCap);
+ stateBuilder.setBrightness(Math.min(stateBuilder.getBrightness(), mBrightnessCap));
+ stateBuilder.setBrightnessMaxReason(BrightnessInfo.BRIGHTNESS_MAX_REASON_THERMAL);
+ stateBuilder.getBrightnessReason().addModifier(BrightnessReason.MODIFIER_THROTTLED);
+ // set fast change only when modifier is activated.
+ // this will allow auto brightness to apply slow change even when modifier is active
+ if (!mApplied) {
+ stateBuilder.setIsSlowChange(false);
+ }
+ mApplied = true;
+ } else {
+ mApplied = false;
+ }
+ }
@Override
- void stop() {
+ public void stop() {
mThermalStatusObserver.stopObserving();
}
@Override
- void dump(PrintWriter writer) {
+ public void dump(PrintWriter writer) {
writer.println("BrightnessThermalClamper:");
writer.println(" mThrottlingStatus: " + mThrottlingStatus);
writer.println(" mUniqueDisplayId: " + mUniqueDisplayId);
@@ -142,10 +154,53 @@
writer.println(" mDataOverride: " + mThermalThrottlingDataOverride);
writer.println(" mDataFromDeviceConfig: " + mThermalThrottlingDataFromDeviceConfig);
writer.println(" mDataActive: " + mThermalThrottlingDataActive);
+ writer.println(" mBrightnessCap:" + mBrightnessCap);
+ writer.println(" mApplied:" + mApplied);
mThermalStatusObserver.dump(writer);
- super.dump(writer);
}
+ @Override
+ public boolean shouldListenToLightSensor() {
+ return false;
+ }
+
+ @Override
+ public void setAmbientLux(float lux) {
+ // noop
+ }
+ //endregion
+
+ //region DisplayDeviceDataListener
+ @Override
+ public void onDisplayChanged(BrightnessClamperController.DisplayDeviceData data) {
+ mHandler.post(() -> {
+ setDisplayData(data);
+ recalculateActiveData();
+ });
+ }
+ //endregion
+
+ //region StatefulModifier
+ @Override
+ public void applyStateChange(
+ BrightnessClamperController.ModifiersAggregatedState aggregatedState) {
+ if (aggregatedState.mMaxBrightness > mBrightnessCap) {
+ aggregatedState.mMaxBrightness = mBrightnessCap;
+ aggregatedState.mMaxBrightnessReason = BrightnessInfo.BRIGHTNESS_MAX_REASON_THERMAL;
+ }
+ }
+ //endregion
+
+ //region DeviceConfigListener
+ @Override
+ public void onDeviceConfigChanged() {
+ mHandler.post(() -> {
+ loadOverrideData();
+ recalculateActiveData();
+ });
+ }
+ //endregion
+
private void recalculateActiveData() {
if (mUniqueDisplayId == null || mDataId == null) {
return;
@@ -176,14 +231,11 @@
private void recalculateBrightnessCap() {
float brightnessCap = PowerManager.BRIGHTNESS_MAX;
- boolean isActive = false;
-
if (mThermalThrottlingDataActive != null) {
// Throttling levels are sorted by increasing severity
for (ThrottlingLevel level : mThermalThrottlingDataActive.throttlingLevels) {
if (level.thermalStatus <= mThrottlingStatus) {
brightnessCap = level.brightness;
- isActive = true;
} else {
// Throttling levels that are greater than the current status are irrelevant
break;
@@ -191,9 +243,8 @@
}
}
- if (brightnessCap != mBrightnessCap || mIsActive != isActive) {
+ if (brightnessCap != mBrightnessCap) {
mBrightnessCap = brightnessCap;
- mIsActive = isActive;
mChangeListener.onChanged();
}
}
@@ -205,7 +256,6 @@
}
}
-
private final class ThermalStatusObserver extends IThermalEventListener.Stub {
private final Injector mInjector;
private final Handler mHandler;
@@ -228,7 +278,7 @@
String curType = mObserverTempSensor.type;
mObserverTempSensor = tempSensor;
- if (curType.equals(tempSensor.type)) {
+ if (Objects.equals(curType, tempSensor.type)) {
Slog.d(TAG, "Thermal status observer already started");
return;
}
diff --git a/services/core/java/com/android/server/flags/services.aconfig b/services/core/java/com/android/server/flags/services.aconfig
index 649678c..69ba785 100644
--- a/services/core/java/com/android/server/flags/services.aconfig
+++ b/services/core/java/com/android/server/flags/services.aconfig
@@ -56,3 +56,14 @@
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ namespace: "backstage_power"
+ name: "trace_battery_changed_broadcast_event"
+ description: "Add tracing to record battery changed broadcast event"
+ bug: "365410144"
+ is_fixed_read_only: true
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
index 81204ef..a8d5696 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -927,12 +927,14 @@
protected int handleVendorCommandWithId(HdmiCecMessage message) {
byte[] params = message.getParams();
int vendorId = HdmiUtils.threeBytesToInt(params);
- if (message.getDestination() == Constants.ADDR_BROADCAST
- || message.getSource() == Constants.ADDR_UNREGISTERED) {
- Slog.v(TAG, "Wrong broadcast vendor command. Ignoring");
- } else if (!mService.invokeVendorCommandListenersOnReceived(
+ if (!mService.invokeVendorCommandListenersOnReceived(
mDeviceType, message.getSource(), message.getDestination(), params, true)) {
- return Constants.ABORT_REFUSED;
+ if (message.getDestination() == Constants.ADDR_BROADCAST
+ || message.getSource() == Constants.ADDR_UNREGISTERED) {
+ Slog.v(TAG, "Broadcast vendor command with no listeners. Ignoring");
+ } else {
+ return Constants.ABORT_REFUSED;
+ }
}
return Constants.HANDLED;
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index 4b85217..101596d 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -1150,6 +1150,13 @@
return Constants.ABORT_REFUSED;
}
+ if (mArcEstablished) {
+ HdmiLogger.debug("ARC is already established.");
+ HdmiCecMessage command = HdmiCecMessageBuilder.buildReportArcInitiated(
+ getDeviceInfo().getLogicalAddress(), message.getSource());
+ mService.sendCecCommand(command);
+ return Constants.HANDLED;
+ }
// In case where <Initiate Arc> is started by <Request ARC Initiation>, this message is
// handled in RequestArcInitiationAction as well.
SetArcTransmissionStateAction action = new SetArcTransmissionStateAction(this,
diff --git a/services/core/java/com/android/server/hdmi/RequestSadAction.java b/services/core/java/com/android/server/hdmi/RequestSadAction.java
index 0188e96..2566300 100644
--- a/services/core/java/com/android/server/hdmi/RequestSadAction.java
+++ b/services/core/java/com/android/server/hdmi/RequestSadAction.java
@@ -19,6 +19,8 @@
import android.hardware.hdmi.HdmiControlManager;
import android.util.Slog;
+import com.android.internal.annotations.VisibleForTesting;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -36,7 +38,8 @@
// State in which the action is waiting for <Report Short Audio Descriptor>.
private static final int STATE_WAITING_FOR_REPORT_SAD = 1;
private static final int MAX_SAD_PER_REQUEST = 4;
- private static final int RETRY_COUNTER_MAX = 1;
+ @VisibleForTesting
+ public static final int RETRY_COUNTER_MAX = 3;
private final int mTargetAddress;
private final RequestSadCallback mCallback;
private final List<Integer> mCecCodecsToQuery = new ArrayList<>();
diff --git a/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java b/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java
index 5ab22e1..e6abcb9 100644
--- a/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java
+++ b/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java
@@ -60,6 +60,12 @@
boolean start() {
// Seq #37.
if (mEnabled) {
+ // Avoid triggering duplicate RequestSadAction events.
+ // This could lead to unexpected responses from the AVR and cause the TV to receive data
+ // out of order. The SAD report does not provide information about the order of events.
+ if ((tv().hasAction(RequestSadAction.class))) {
+ return true;
+ }
// Request SADs before enabling ARC
RequestSadAction action = new RequestSadAction(
localDevice(), Constants.ADDR_AUDIO_SYSTEM,
diff --git a/services/core/java/com/android/server/hdmi/TEST_MAPPING b/services/core/java/com/android/server/hdmi/TEST_MAPPING
index 1c85c7f..d116087d 100644
--- a/services/core/java/com/android/server/hdmi/TEST_MAPPING
+++ b/services/core/java/com/android/server/hdmi/TEST_MAPPING
@@ -6,15 +6,7 @@
],
"postsubmit": [
{
- "name": "FrameworksServicesTests",
- "options": [
- {
- "include-filter": "com.android.server.hdmi"
- },
- {
- "exclude-annotation": "org.junit.Ignore"
- }
- ]
+ "name": "FrameworksServicesTests_android_server_hdmi"
}
],
// Postsubmit tests for TV devices
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index 84cee7e..dfcea9f 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -2269,13 +2269,9 @@
// Native callback.
@SuppressWarnings("unused")
private void notifyTouchpadHardwareState(TouchpadHardwareState hardwareStates, int deviceId) {
- // TODO(b/286551975): sent the touchpad hardware state data here to TouchpadDebugActivity
- Slog.d(TAG, "notifyTouchpadHardwareState: Time: "
- + hardwareStates.getTimestamp() + ", No. Buttons: "
- + hardwareStates.getButtonsDown() + ", No. Fingers: "
- + hardwareStates.getFingerCount() + ", No. Touch: "
- + hardwareStates.getTouchCount() + ", Id: "
- + deviceId);
+ if (mTouchpadDebugViewController != null) {
+ mTouchpadDebugViewController.updateTouchpadHardwareState(hardwareStates, deviceId);
+ }
}
// Native callback.
diff --git a/services/core/java/com/android/server/input/debug/TouchpadDebugView.java b/services/core/java/com/android/server/input/debug/TouchpadDebugView.java
index 7785ffb..486d4af 100644
--- a/services/core/java/com/android/server/input/debug/TouchpadDebugView.java
+++ b/services/core/java/com/android/server/input/debug/TouchpadDebugView.java
@@ -22,6 +22,7 @@
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Rect;
+import android.hardware.input.InputManager;
import android.util.Slog;
import android.view.Gravity;
import android.view.MotionEvent;
@@ -30,6 +31,10 @@
import android.widget.LinearLayout;
import android.widget.TextView;
+import com.android.server.input.TouchpadFingerState;
+import com.android.server.input.TouchpadHardwareProperties;
+import com.android.server.input.TouchpadHardwareState;
+
import java.util.Objects;
public class TouchpadDebugView extends LinearLayout {
@@ -52,13 +57,19 @@
private int mScreenHeight;
private int mWindowLocationBeforeDragX;
private int mWindowLocationBeforeDragY;
+ @NonNull
+ private TouchpadHardwareState mLastTouchpadState =
+ new TouchpadHardwareState(0, 0 /* buttonsDown */, 0, 0,
+ new TouchpadFingerState[0]);
+ private TouchpadVisualizationView mTouchpadVisualizationView;
- public TouchpadDebugView(Context context, int touchpadId) {
+ public TouchpadDebugView(Context context, int touchpadId,
+ TouchpadHardwareProperties touchpadHardwareProperties) {
super(context);
mTouchpadId = touchpadId;
mWindowManager =
Objects.requireNonNull(getContext().getSystemService(WindowManager.class));
- init(context);
+ init(context, touchpadHardwareProperties, touchpadId);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
// TODO(b/360137366): Use the hardware properties to initialise layout parameters.
@@ -81,32 +92,43 @@
mWindowLayoutParams.gravity = Gravity.TOP | Gravity.LEFT;
}
- private void init(Context context) {
+ private void init(Context context, TouchpadHardwareProperties touchpadHardwareProperties,
+ int touchpadId) {
setOrientation(VERTICAL);
- setLayoutParams(new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.WRAP_CONTENT));
+ setLayoutParams(new LayoutParams(
+ LayoutParams.WRAP_CONTENT,
+ LayoutParams.WRAP_CONTENT));
setBackgroundColor(Color.TRANSPARENT);
- // TODO(b/286551975): Replace this content with the touchpad debug view.
- TextView textView1 = new TextView(context);
- textView1.setBackgroundColor(Color.parseColor("#FFFF0000"));
- textView1.setTextSize(20);
- textView1.setText("Touchpad Debug View 1");
- textView1.setGravity(Gravity.CENTER);
- textView1.setTextColor(Color.WHITE);
- textView1.setLayoutParams(new LayoutParams(1000, 200));
+ TextView nameView = new TextView(context);
+ nameView.setBackgroundColor(Color.RED);
+ nameView.setTextSize(20);
+ nameView.setText(Objects.requireNonNull(Objects.requireNonNull(
+ mContext.getSystemService(InputManager.class))
+ .getInputDevice(touchpadId)).getName());
+ nameView.setGravity(Gravity.CENTER);
+ nameView.setTextColor(Color.WHITE);
+ nameView.setLayoutParams(new LayoutParams(1000, 200));
- TextView textView2 = new TextView(context);
- textView2.setBackgroundColor(Color.BLUE);
- textView2.setTextSize(20);
- textView2.setText("Touchpad Debug View 2");
- textView2.setGravity(Gravity.CENTER);
- textView2.setTextColor(Color.WHITE);
- textView2.setLayoutParams(new LayoutParams(1000, 200));
+ mTouchpadVisualizationView = new TouchpadVisualizationView(context,
+ touchpadHardwareProperties);
+ mTouchpadVisualizationView.setBackgroundColor(Color.WHITE);
+ //TODO(b/365568238): set the view size according to the touchpad size from the
+ // TouchpadHardwareProperties
+ mTouchpadVisualizationView.setLayoutParams(new LayoutParams(778, 500));
- addView(textView1);
- addView(textView2);
+ //TODO(b/365562952): Add a display for recognized gesture info here
+ TextView gestureInfoView = new TextView(context);
+ gestureInfoView.setBackgroundColor(Color.GRAY);
+ gestureInfoView.setTextSize(20);
+ gestureInfoView.setText("Touchpad Debug View 3");
+ gestureInfoView.setGravity(Gravity.CENTER);
+ gestureInfoView.setTextColor(Color.BLACK);
+ gestureInfoView.setLayoutParams(new LayoutParams(1000, 200));
+
+ addView(nameView);
+ addView(mTouchpadVisualizationView);
+ addView(gestureInfoView);
updateScreenDimensions();
}
@@ -126,9 +148,7 @@
case MotionEvent.ACTION_MOVE:
deltaX = event.getRawX() - mWindowLayoutParams.x - mTouchDownX;
deltaY = event.getRawY() - mWindowLayoutParams.y - mTouchDownY;
- Slog.d("TouchpadDebugView", "Slop = " + mTouchSlop);
if (isSlopExceeded(deltaX, deltaY)) {
- Slog.d("TouchpadDebugView", "Slop exceeded");
mWindowLayoutParams.x =
Math.max(0, Math.min((int) (event.getRawX() - mTouchDownX),
mScreenWidth - this.getWidth()));
@@ -136,9 +156,6 @@
Math.max(0, Math.min((int) (event.getRawY() - mTouchDownY),
mScreenHeight - this.getHeight()));
- Slog.d("TouchpadDebugView", "New position X: "
- + mWindowLayoutParams.x + ", Y: " + mWindowLayoutParams.y);
-
mWindowManager.updateViewLayout(this, mWindowLayoutParams);
}
return true;
@@ -166,7 +183,7 @@
@Override
public boolean performClick() {
super.performClick();
- Slog.d("TouchpadDebugView", "You clicked me!");
+ Slog.d("TouchpadDebugView", "You tapped the window!");
return true;
}
@@ -201,4 +218,39 @@
public WindowManager.LayoutParams getWindowLayoutParams() {
return mWindowLayoutParams;
}
+
+ /**
+ * Notify the view of a change in the hardware state of a touchpad. The view should
+ * update its content to reflect the new state.
+ *
+ * @param touchpadHardwareState the hardware state of a touchpad
+ * @param deviceId the deviceId of the touchpad that is sending the hardware state
+ */
+ public void updateHardwareState(TouchpadHardwareState touchpadHardwareState, int deviceId) {
+ if (deviceId != mTouchpadId) {
+ return;
+ }
+
+ mTouchpadVisualizationView.onTouchpadHardwareStateNotified(touchpadHardwareState);
+ if (mLastTouchpadState.getButtonsDown() == 0) {
+ if (touchpadHardwareState.getButtonsDown() > 0) {
+ onTouchpadButtonPress();
+ }
+ } else {
+ if (touchpadHardwareState.getButtonsDown() == 0) {
+ onTouchpadButtonRelease();
+ }
+ }
+ mLastTouchpadState = touchpadHardwareState;
+ }
+
+ private void onTouchpadButtonPress() {
+ Slog.d("TouchpadDebugView", "You clicked me!");
+ getChildAt(0).setBackgroundColor(Color.BLUE);
+ }
+
+ private void onTouchpadButtonRelease() {
+ Slog.d("TouchpadDebugView", "You released the click");
+ getChildAt(0).setBackgroundColor(Color.RED);
+ }
}
diff --git a/services/core/java/com/android/server/input/debug/TouchpadDebugViewController.java b/services/core/java/com/android/server/input/debug/TouchpadDebugViewController.java
index c28e74a..b4b357a 100644
--- a/services/core/java/com/android/server/input/debug/TouchpadDebugViewController.java
+++ b/services/core/java/com/android/server/input/debug/TouchpadDebugViewController.java
@@ -27,6 +27,7 @@
import com.android.server.input.InputManagerService;
import com.android.server.input.TouchpadHardwareProperties;
+import com.android.server.input.TouchpadHardwareState;
import java.util.Objects;
@@ -67,6 +68,13 @@
@Override
public void onInputDeviceRemoved(int deviceId) {
hideDebugView(deviceId);
+ if (mTouchpadDebugView == null) {
+ final InputManager inputManager = Objects.requireNonNull(
+ mContext.getSystemService(InputManager.class));
+ for (int id : inputManager.getInputDeviceIds()) {
+ onInputDeviceAdded(id);
+ }
+ }
}
@Override
@@ -104,18 +112,20 @@
final WindowManager wm = Objects.requireNonNull(
mContext.getSystemService(WindowManager.class));
- mTouchpadDebugView = new TouchpadDebugView(mContext, touchpadId);
+ TouchpadHardwareProperties touchpadHardwareProperties =
+ mInputManagerService.getTouchpadHardwareProperties(
+ touchpadId);
+
+ mTouchpadDebugView = new TouchpadDebugView(mContext, touchpadId,
+ touchpadHardwareProperties);
final WindowManager.LayoutParams mWindowLayoutParams =
mTouchpadDebugView.getWindowLayoutParams();
wm.addView(mTouchpadDebugView, mWindowLayoutParams);
Slog.d(TAG, "Touchpad debug view created.");
- TouchpadHardwareProperties mTouchpadHardwareProperties =
- mInputManagerService.getTouchpadHardwareProperties(
- touchpadId);
- if (mTouchpadHardwareProperties != null) {
- Slog.d(TAG, mTouchpadHardwareProperties.toString());
+ if (touchpadHardwareProperties != null) {
+ Slog.d(TAG, touchpadHardwareProperties.toString());
} else {
Slog.w(TAG, "Failed to retrieve touchpad hardware properties for "
+ "device ID: " + touchpadId);
@@ -132,4 +142,17 @@
mTouchpadDebugView = null;
Slog.d(TAG, "Touchpad debug view removed.");
}
+
+ /**
+ * Notifies about an update in the touchpad's hardware state.
+ *
+ * @param touchpadHardwareState the hardware state of a touchpad
+ * @param deviceId the deviceId of the touchpad that is sending the hardware state
+ */
+ public void updateTouchpadHardwareState(TouchpadHardwareState touchpadHardwareState,
+ int deviceId) {
+ if (mTouchpadDebugView != null) {
+ mTouchpadDebugView.updateHardwareState(touchpadHardwareState, deviceId);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java b/services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java
new file mode 100644
index 0000000..9ba7d0a
--- /dev/null
+++ b/services/core/java/com/android/server/input/debug/TouchpadVisualizationView.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.input.debug;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.RectF;
+import android.util.Slog;
+import android.view.View;
+
+import com.android.server.input.TouchpadFingerState;
+import com.android.server.input.TouchpadHardwareProperties;
+import com.android.server.input.TouchpadHardwareState;
+
+public class TouchpadVisualizationView extends View {
+ private static final String TAG = "TouchpadVizMain";
+ private static final boolean DEBUG = true;
+
+ private final TouchpadHardwareProperties mTouchpadHardwareProperties;
+
+ TouchpadHardwareState mLatestHardwareState = new TouchpadHardwareState(0, 0, 0, 0,
+ new TouchpadFingerState[]{});
+
+ private final Paint mOvalPaint;
+
+ public TouchpadVisualizationView(Context context,
+ TouchpadHardwareProperties touchpadHardwareProperties) {
+ super(context);
+ mTouchpadHardwareProperties = touchpadHardwareProperties;
+ mOvalPaint = new Paint();
+ mOvalPaint.setAntiAlias(true);
+ mOvalPaint.setARGB(255, 0, 0, 0);
+ mOvalPaint.setStyle(Paint.Style.STROKE);
+ }
+
+ private final RectF mOvalRect = new RectF();
+
+ private void drawOval(Canvas canvas, float x, float y, float major, float minor, float angle,
+ Paint paint) {
+ canvas.save(Canvas.MATRIX_SAVE_FLAG);
+ canvas.rotate(angle, x, y);
+ mOvalRect.left = x - minor / 2;
+ mOvalRect.right = x + minor / 2;
+ mOvalRect.top = y - major / 2;
+ mOvalRect.bottom = y + major / 2;
+ canvas.drawOval(mOvalRect, paint);
+ canvas.restore();
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ for (TouchpadFingerState touchpadFingerState : mLatestHardwareState.getFingerStates()) {
+ float newX = translateRange(mTouchpadHardwareProperties.getLeft(),
+ mTouchpadHardwareProperties.getRight(), 0, getWidth(),
+ touchpadFingerState.getPositionX());
+
+ float newY = translateRange(mTouchpadHardwareProperties.getTop(),
+ mTouchpadHardwareProperties.getBottom(), 0, getHeight(),
+ touchpadFingerState.getPositionY());
+
+ float newAngle = -translateRange(mTouchpadHardwareProperties.getOrientationMinimum(),
+ mTouchpadHardwareProperties.getOrientationMaximum(), 0, 360,
+ touchpadFingerState.getOrientation());
+
+ float newTouchMajor =
+ touchpadFingerState.getTouchMajor() / mTouchpadHardwareProperties.getResX();
+ float newTouchMinor =
+ touchpadFingerState.getTouchMinor() / mTouchpadHardwareProperties.getResY();
+
+ drawOval(canvas, newX, newY, newTouchMajor, newTouchMinor, newAngle, mOvalPaint);
+ }
+ }
+
+ /**
+ * Receiving the touchpad hardware state and based on it update the latest hardware state.
+ *
+ * @param schs The new hardware state received.
+ */
+ public void onTouchpadHardwareStateNotified(TouchpadHardwareState schs) {
+ if (DEBUG) {
+ logHardwareState(schs);
+ }
+
+ mLatestHardwareState = schs;
+
+ invalidate();
+ }
+
+ private float translateRange(float rangeBeforeMin, float rangeBeforeMax,
+ float rangeAfterMin, float rangeAfterMax, float value) {
+ return rangeAfterMin + (value - rangeBeforeMin) / (rangeBeforeMax - rangeBeforeMin) * (
+ rangeAfterMax - rangeAfterMin);
+ }
+
+ private void logHardwareState(TouchpadHardwareState schs) {
+ Slog.d(TAG, "notifyTouchpadHardwareState: Time: "
+ + schs.getTimestamp() + ", No. Buttons: "
+ + schs.getButtonsDown() + ", No. Fingers: "
+ + schs.getFingerCount() + ", No. Touch: "
+ + schs.getTouchCount());
+
+ for (TouchpadFingerState finger : schs.getFingerStates()) {
+ Slog.d(TAG, "Finger #" + finger.getTrackingId()
+ + ": touchMajor= " + finger.getTouchMajor()
+ + ", touchMinor= " + finger.getTouchMinor()
+ + ", widthMajor= " + finger.getWidthMajor()
+ + ", widthMinor= " + finger.getWidthMinor()
+ + ", pressure= " + finger.getPressure()
+ + ", orientation= " + finger.getOrientation()
+ + ", positionX= " + finger.getPositionX()
+ + ", positionY= " + finger.getPositionY());
+ }
+ }
+
+}
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index af0ccf9..f747879 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -4678,6 +4678,7 @@
}
}
+ // TODO(b/356239178): Make dump proto multi-user aware.
private void dumpDebug(ProtoOutputStream proto, long fieldId) {
synchronized (ImfLock.class) {
final int userId = mCurrentImeUserId;
@@ -6103,17 +6104,40 @@
@BinderThread
private void dumpAsStringNoCheck(FileDescriptor fd, PrintWriter pw, String[] args,
boolean isCritical) {
+ final int argUserId = parseUserIdFromDumpArgs(args);
+ final Printer p = new PrintWriterPrinter(pw);
+ p.println("Current Input Method Manager state:");
+ p.println(" concurrentMultiUserModeEnabled=" + mConcurrentMultiUserModeEnabled);
+ if (mConcurrentMultiUserModeEnabled && argUserId == UserHandle.USER_NULL) {
+ mUserDataRepository.forAllUserData(
+ u -> dumpAsStringNoCheckForUser(u, fd, pw, args, isCritical));
+ } else {
+ final int userId = argUserId != UserHandle.USER_NULL ? argUserId : mCurrentImeUserId;
+ final var userData = getUserData(userId);
+ dumpAsStringNoCheckForUser(userData, fd, pw, args, isCritical);
+ }
+ }
+
+ @UserIdInt
+ private static int parseUserIdFromDumpArgs(String[] args) {
+ final int userIdx = Arrays.binarySearch(args, "--user");
+ if (userIdx == -1 || userIdx == args.length - 1) {
+ return UserHandle.USER_NULL;
+ }
+ return Integer.parseInt(args[userIdx + 1]);
+ }
+
+ // TODO(b/356239178): Update dump format output to better group per-user info.
+ @BinderThread
+ private void dumpAsStringNoCheckForUser(UserData userData, FileDescriptor fd, PrintWriter pw,
+ String[] args, boolean isCritical) {
+ final Printer p = new PrintWriterPrinter(pw);
IInputMethodInvoker method;
ClientState client;
-
- final Printer p = new PrintWriterPrinter(pw);
-
+ p.println(" UserId=" + userData.mUserId);
synchronized (ImfLock.class) {
- final int userId = mCurrentImeUserId;
- final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
- final var userData = getUserData(userId);
- p.println("Current Input Method Manager state:");
- p.println(" concurrentMultiUserModeEnabled" + mConcurrentMultiUserModeEnabled);
+ final InputMethodSettings settings = InputMethodSettingsRepository.get(
+ userData.mUserId);
final List<InputMethodInfo> methodList = settings.getMethodList();
int numImes = methodList.size();
p.println(" Input Methods:");
@@ -6133,7 +6157,7 @@
p.println(" sessionRequested="
+ c.mSessionRequested);
p.println(" sessionRequestedForAccessibility="
- + c.mSessionRequestedForAccessibility);
+ + c.mSessionRequestedForAccessibility);
p.println(" curSession=" + c.mCurSession);
p.println(" selfReportedDisplayId=" + c.mSelfReportedDisplayId);
p.println(" uid=" + c.mUid);
@@ -6141,7 +6165,6 @@
};
mClientController.forAllClients(clientControllerDump);
final var bindingController = userData.mBindingController;
- p.println(" mCurrentImeUserId=" + userData.mUserId);
p.println(" mCurMethodId=" + bindingController.getSelectedMethodId());
client = userData.mCurClient;
p.println(" mCurClient=" + client + " mCurSeq="
@@ -6234,8 +6257,6 @@
p.println("No input method client.");
}
synchronized (ImfLock.class) {
- final int userId = mCurrentImeUserId;
- final var userData = getUserData(userId);
if (userData.mImeBindingState.mFocusedWindowClient != null
&& client != userData.mImeBindingState.mFocusedWindowClient) {
p.println(" ");
diff --git a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
index a439f16..1740010 100644
--- a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
+++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
@@ -80,8 +80,8 @@
"ENABLE_PSDS_PERIODIC_DOWNLOAD";
private static final String CONFIG_ENABLE_ACTIVE_SIM_EMERGENCY_SUPL =
"ENABLE_ACTIVE_SIM_EMERGENCY_SUPL";
- private static final String CONFIG_ENABLE_NI_SUPL_MESSAGE_INJECTION =
- "ENABLE_NI_SUPL_MESSAGE_INJECTION";
+ private static final String CONFIG_ENABLE_NI_SUPL_MESSAGE_INJECTION_BOOL =
+ "ENABLE_NI_SUPL_MESSAGE_INJECTION_BOOL";
static final String CONFIG_LONGTERM_PSDS_SERVER_1 = "LONGTERM_PSDS_SERVER_1";
static final String CONFIG_LONGTERM_PSDS_SERVER_2 = "LONGTERM_PSDS_SERVER_2";
static final String CONFIG_LONGTERM_PSDS_SERVER_3 = "LONGTERM_PSDS_SERVER_3";
@@ -230,7 +230,8 @@
* Default false if not set.
*/
boolean isNiSuplMessageInjectionEnabled() {
- return getBooleanConfig(CONFIG_ENABLE_NI_SUPL_MESSAGE_INJECTION, false);
+ return getBooleanConfig(CONFIG_ENABLE_NI_SUPL_MESSAGE_INJECTION_BOOL,
+ false);
}
/**
diff --git a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
index 1938150..4b2c12a 100644
--- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
@@ -68,6 +68,7 @@
import android.location.LocationRequest;
import android.location.LocationResult;
import android.location.LocationResult.BadLocationException;
+import android.location.flags.Flags;
import android.location.provider.ProviderProperties;
import android.location.provider.ProviderRequest;
import android.location.util.identity.CallerIdentity;
@@ -310,6 +311,7 @@
private String mC2KServerHost;
private int mC2KServerPort;
private boolean mSuplEsEnabled = false;
+ private boolean mNiSuplMessageListenerRegistered = false;
private final LocationExtras mLocationExtras = new LocationExtras();
private final NetworkTimeHelper mNetworkTimeHelper;
@@ -387,6 +389,10 @@
// Reload gnss config for no SIM case
mGnssConfiguration.reloadGpsProperties();
}
+ if (Flags.enableNiSuplMessageInjectionByCarrierConfig()) {
+ updateNiSuplMessageListenerRegistration(
+ mGnssConfiguration.isNiSuplMessageInjectionEnabled());
+ }
}
private void reloadGpsProperties() {
@@ -532,28 +538,9 @@
intentFilter.addAction(TelephonyManager.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED);
mContext.registerReceiver(mIntentReceiver, intentFilter, null, mHandler);
- if (mNetworkConnectivityHandler.isNativeAgpsRilSupported()
- && mGnssConfiguration.isNiSuplMessageInjectionEnabled()) {
- // Listen to WAP PUSH NI SUPL message.
- // See User Plane Location Protocol Candidate Version 3.0,
- // OMA-TS-ULP-V3_0-20110920-C, Section 8.3 OMA Push.
- intentFilter = new IntentFilter();
- intentFilter.addAction(Intents.WAP_PUSH_RECEIVED_ACTION);
- try {
- intentFilter.addDataType("application/vnd.omaloc-supl-init");
- } catch (IntentFilter.MalformedMimeTypeException e) {
- Log.w(TAG, "Malformed SUPL init mime type");
- }
- mContext.registerReceiver(mIntentReceiver, intentFilter, null, mHandler);
-
- // Listen to MT SMS NI SUPL message.
- // See User Plane Location Protocol Candidate Version 3.0,
- // OMA-TS-ULP-V3_0-20110920-C, Section 8.4 MT SMS.
- intentFilter = new IntentFilter();
- intentFilter.addAction(Intents.DATA_SMS_RECEIVED_ACTION);
- intentFilter.addDataScheme("sms");
- intentFilter.addDataAuthority("localhost", "7275");
- mContext.registerReceiver(mIntentReceiver, intentFilter, null, mHandler);
+ if (!Flags.enableNiSuplMessageInjectionByCarrierConfig()) {
+ updateNiSuplMessageListenerRegistration(
+ mGnssConfiguration.isNiSuplMessageInjectionEnabled());
}
mNetworkConnectivityHandler.registerNetworkCallbacks();
@@ -592,6 +579,20 @@
case TelephonyManager.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED:
subscriptionOrCarrierConfigChanged();
break;
+ }
+ }
+ };
+
+ private BroadcastReceiver mNiSuplIntentReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (DEBUG) Log.d(TAG, "receive broadcast intent, action: " + action);
+ if (action == null) {
+ return;
+ }
+
+ switch (action) {
case Intents.WAP_PUSH_RECEIVED_ACTION:
case Intents.DATA_SMS_RECEIVED_ACTION:
injectSuplInit(intent);
@@ -1442,6 +1443,46 @@
mGnssMetrics.logSvStatus(gnssStatus);
}
+ private void updateNiSuplMessageListenerRegistration(boolean shouldRegister) {
+ if (!mNetworkConnectivityHandler.isNativeAgpsRilSupported()) {
+ return;
+ }
+ if (mNiSuplMessageListenerRegistered == shouldRegister) {
+ return;
+ }
+
+ // WAP PUSH NI SUPL message intent filter.
+ // See User Plane Location Protocol Candidate Version 3.0,
+ // OMA-TS-ULP-V3_0-20110920-C, Section 8.3 OMA Push.
+ IntentFilter wapPushNiIntentFilter = new IntentFilter();
+ wapPushNiIntentFilter.addAction(Intents.WAP_PUSH_RECEIVED_ACTION);
+ try {
+ wapPushNiIntentFilter
+ .addDataType("application/vnd.omaloc-supl-init");
+ } catch (IntentFilter.MalformedMimeTypeException e) {
+ Log.w(TAG, "Malformed SUPL init mime type");
+ }
+
+ // MT SMS NI SUPL message intent filter.
+ // See User Plane Location Protocol Candidate Version 3.0,
+ // OMA-TS-ULP-V3_0-20110920-C, Section 8.4 MT SMS.
+ IntentFilter mtSmsNiIntentFilter = new IntentFilter();
+ mtSmsNiIntentFilter.addAction(Intents.DATA_SMS_RECEIVED_ACTION);
+ mtSmsNiIntentFilter.addDataScheme("sms");
+ mtSmsNiIntentFilter.addDataAuthority("localhost", "7275");
+
+ if (shouldRegister) {
+ mContext.registerReceiver(mNiSuplIntentReceiver,
+ wapPushNiIntentFilter, null, mHandler);
+ mContext.registerReceiver(mNiSuplIntentReceiver,
+ mtSmsNiIntentFilter, null, mHandler);
+ mNiSuplMessageListenerRegistered = true;
+ } else {
+ mContext.unregisterReceiver(mNiSuplIntentReceiver);
+ mNiSuplMessageListenerRegistered = false;
+ }
+ }
+
private void restartLocationRequest() {
if (DEBUG) Log.d(TAG, "restartLocationRequest");
setStarted(false);
@@ -1631,6 +1672,10 @@
if (dumpAll) {
mNetworkTimeHelper.dump(pw);
pw.println("mSupportsPsds=" + mSupportsPsds);
+ if (Flags.enableNiSuplMessageInjectionByCarrierConfig()) {
+ pw.println("mNiSuplMessageListenerRegistered="
+ + mNiSuplMessageListenerRegistered);
+ }
pw.println(
"PsdsServerConfigured=" + mGnssConfiguration.isLongTermPsdsServerConfigured());
pw.println("native internal state: ");
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java
index 4fcf27d..7d44ba1 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsService.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java
@@ -889,8 +889,14 @@
// Hide notification first, as tie profile lock takes time
hideEncryptionNotification(new UserHandle(userId));
- if (isCredentialSharableWithParent(userId)) {
- tieProfileLockIfNecessary(userId, LockscreenCredential.createNone());
+ if (android.app.admin.flags.Flags.fixRaceConditionInTieProfileLock()) {
+ synchronized (mSpManager) {
+ tieProfileLockIfNecessary(userId, LockscreenCredential.createNone());
+ }
+ } else {
+ if (isCredentialSharableWithParent(userId)) {
+ tieProfileLockIfNecessary(userId, LockscreenCredential.createNone());
+ }
}
}
});
@@ -1287,7 +1293,13 @@
mStorage.removeChildProfileLock(userId);
removeKeystoreProfileKey(userId);
} else {
- tieProfileLockIfNecessary(userId, profileUserPassword);
+ if (android.app.admin.flags.Flags.fixRaceConditionInTieProfileLock()) {
+ synchronized (mSpManager) {
+ tieProfileLockIfNecessary(userId, profileUserPassword);
+ }
+ } else {
+ tieProfileLockIfNecessary(userId, profileUserPassword);
+ }
}
} catch (IllegalStateException e) {
setBoolean(SEPARATE_PROFILE_CHALLENGE_KEY, old, userId);
@@ -3403,8 +3415,13 @@
// It's OK to dump the credential type since anyone with physical access can just
// observe it from the keyguard directly.
pw.println("Quality: " + getKeyguardStoredQuality(userId));
- pw.println("CredentialType: " + LockPatternUtils.credentialTypeToString(
- getCredentialTypeInternal(userId)));
+ final int credentialType = getCredentialTypeInternal(userId);
+ pw.println("CredentialType: "
+ + LockPatternUtils.credentialTypeToString(credentialType));
+ if (credentialType == CREDENTIAL_TYPE_NONE) {
+ pw.println("IsLockScreenDisabled: "
+ + getBoolean(LockPatternUtils.DISABLE_LOCKSCREEN_KEY, false, userId));
+ }
pw.println("SeparateChallenge: " + getSeparateProfileChallengeEnabledInternal(userId));
pw.println(TextUtils.formatSimple("Metrics: %s",
getUserPasswordMetrics(userId) != null ? "known" : "unknown"));
diff --git a/services/core/java/com/android/server/logcat/TEST_MAPPING b/services/core/java/com/android/server/logcat/TEST_MAPPING
index 5b07cd9..688dbe9 100644
--- a/services/core/java/com/android/server/logcat/TEST_MAPPING
+++ b/services/core/java/com/android/server/logcat/TEST_MAPPING
@@ -1,15 +1,12 @@
{
"presubmit": [
{
- "name": "FrameworksServicesTests_android_server_logcat_Presubmit"
+ "name": "FrameworksServicesTests_android_server_logcat"
}
],
"postsubmit": [
{
- "name": "FrameworksServicesTests",
- "options": [
- {"include-filter": "com.android.server.logcat"}
- ]
+ "name": "FrameworksServicesTests_android_server_logcat"
}
]
}
diff --git a/services/core/java/com/android/server/notification/BubbleExtractor.java b/services/core/java/com/android/server/notification/BubbleExtractor.java
index b8900d7..3d6f9cf 100644
--- a/services/core/java/com/android/server/notification/BubbleExtractor.java
+++ b/services/core/java/com/android/server/notification/BubbleExtractor.java
@@ -27,10 +27,11 @@
import android.app.ActivityManager;
import android.app.Notification;
import android.app.NotificationChannel;
-import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.util.Slog;
@@ -47,6 +48,7 @@
private ShortcutHelper mShortcutHelper;
private RankingConfig mConfig;
private ActivityManager mActivityManager;
+ private PackageManager mPackageManager;
private Context mContext;
boolean mSupportsBubble;
@@ -76,6 +78,11 @@
return null;
}
+ if (mPackageManager == null) {
+ if (DBG) Slog.d(TAG, "missing package manager");
+ return null;
+ }
+
boolean notifCanPresentAsBubble = canPresentAsBubble(record)
&& !mActivityManager.isLowRamDevice()
&& record.isConversation()
@@ -133,6 +140,10 @@
mShortcutHelper = helper;
}
+ public void setPackageManager(PackageManager packageManager) {
+ mPackageManager = packageManager;
+ }
+
@VisibleForTesting
public void setActivityManager(ActivityManager manager) {
mActivityManager = manager;
@@ -176,30 +187,25 @@
// TODO: check the shortcut intent / ensure it can show in activity view
return true;
}
- return canLaunchInTaskView(mContext, metadata.getIntent(), pkg);
+ return canLaunchInTaskView(metadata.getIntent().getIntent(), pkg,
+ r.getUser().getIdentifier());
}
/**
- * Whether an intent is properly configured to display in an {@link
- * TaskView} for bubbling.
+ * Whether an intent is properly configured to display in a TaskView for bubbling.
*
- * @param context the context to use.
- * @param pendingIntent the pending intent of the bubble.
- * @param packageName the notification package name for this bubble.
+ * @param intent the intent of the bubble.
+ * @param packageName the notification package name for this bubble.
*/
- // Keep checks in sync with BubbleController#canLaunchInTaskView.
- @VisibleForTesting
- protected boolean canLaunchInTaskView(Context context, PendingIntent pendingIntent,
- String packageName) {
- if (pendingIntent == null) {
+ // Keep checks in sync with BubbleController#isResizableActivity.
+ private boolean canLaunchInTaskView(Intent intent, String packageName, int userId) {
+ if (intent == null) {
Slog.w(TAG, "Unable to create bubble -- no intent");
return false;
}
- Intent intent = pendingIntent.getIntent();
- ActivityInfo info = intent != null
- ? intent.resolveActivityInfo(context.getPackageManager(), 0)
- : null;
+ ResolveInfo resolveInfo = mPackageManager.resolveActivityAsUser(intent, 0, userId);
+ ActivityInfo info = resolveInfo != null ? resolveInfo.activityInfo : null;
if (info == null) {
FrameworkStatsLog.write(FrameworkStatsLog.BUBBLE_DEVELOPER_ERROR_REPORTED,
packageName,
diff --git a/services/core/java/com/android/server/notification/DefaultDeviceEffectsApplier.java b/services/core/java/com/android/server/notification/DefaultDeviceEffectsApplier.java
index bad959a..925ba17 100644
--- a/services/core/java/com/android/server/notification/DefaultDeviceEffectsApplier.java
+++ b/services/core/java/com/android/server/notification/DefaultDeviceEffectsApplier.java
@@ -22,6 +22,7 @@
import static com.android.server.notification.ZenLog.traceApplyDeviceEffect;
import static com.android.server.notification.ZenLog.traceScheduleApplyDeviceEffect;
+import android.app.KeyguardManager;
import android.app.UiModeManager;
import android.app.WallpaperManager;
import android.content.BroadcastReceiver;
@@ -53,6 +54,7 @@
private final Context mContext;
private final ColorDisplayManager mColorDisplayManager;
+ private final KeyguardManager mKeyguardManager;
private final PowerManager mPowerManager;
private final UiModeManager mUiModeManager;
private final WallpaperManager mWallpaperManager;
@@ -67,6 +69,7 @@
DefaultDeviceEffectsApplier(Context context) {
mContext = context;
mColorDisplayManager = context.getSystemService(ColorDisplayManager.class);
+ mKeyguardManager = context.getSystemService(KeyguardManager.class);
mPowerManager = context.getSystemService(PowerManager.class);
mUiModeManager = context.getSystemService(UiModeManager.class);
WallpaperManager wallpaperManager = context.getSystemService(WallpaperManager.class);
@@ -133,12 +136,14 @@
// Changing the theme can be disruptive for the user (Activities are likely recreated, may
// lose some state). Therefore we only apply the change immediately if the rule was
- // activated manually, or we are initializing, or the screen is currently off/dreaming.
+ // activated manually, or we are initializing, or the screen is currently off/dreaming,
+ // or if the device is locked.
if (origin == ZenModeConfig.ORIGIN_INIT
|| origin == ZenModeConfig.ORIGIN_INIT_USER
|| origin == ZenModeConfig.ORIGIN_USER_IN_SYSTEMUI
|| origin == ZenModeConfig.ORIGIN_USER_IN_APP
- || !mPowerManager.isInteractive()) {
+ || !mPowerManager.isInteractive()
+ || (android.app.Flags.modesUi() && mKeyguardManager.isKeyguardLocked())) {
unregisterScreenOffReceiver();
updateNightModeImmediately(useNightMode);
} else {
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index 0cc50e6..03fc60c 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -103,7 +103,7 @@
* - A remote interface definition (aidl) provided by the service used for communication.
*/
abstract public class ManagedServices {
- protected final String TAG = getClass().getSimpleName();
+ protected final String TAG = getClass().getSimpleName().replace('$', '.');
protected final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private static final int ON_BINDING_DIED_REBIND_DELAY_MS = 10000;
@@ -1094,7 +1094,7 @@
return info;
}
throw new SecurityException("Disallowed call from unknown " + getCaption() + ": "
- + service + " " + service.getClass());
+ + service.asBinder() + " " + service.getClass());
}
public boolean isSameUser(IInterface service, int userId) {
@@ -1585,6 +1585,9 @@
// after the rebind delay
if (isPackageOrComponentAllowedWithPermission(cn, userId)) {
registerService(cn, userId);
+ } else {
+ if (DEBUG) Slog.v(TAG, "skipped reregisterService cn=" + cn + " u=" + userId
+ + " because of isPackageOrComponentAllowedWithPermission check");
}
}
@@ -1918,6 +1921,7 @@
.append(",targetSdkVersion=").append(targetSdkVersion)
.append(",connection=").append(connection == null ? null : "<connection>")
.append(",service=").append(service)
+ .append(",serviceAsBinder=").append(service != null ? service.asBinder() : null)
.append(']').toString();
}
@@ -1956,7 +1960,7 @@
@Override
public void binderDied() {
- if (DEBUG) Slog.d(TAG, "binderDied");
+ if (DEBUG) Slog.d(TAG, "binderDied " + this);
// Remove the service, but don't unbind from the service. The system will bring the
// service back up, and the onServiceConnected handler will read the service with the
// new binding. If this isn't a bound service, and is just a registered
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 54e9189..e2ec006 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3020,6 +3020,7 @@
BubbleExtractor bubbsExtractor = mRankingHelper.findExtractor(BubbleExtractor.class);
if (bubbsExtractor != null) {
bubbsExtractor.setShortcutHelper(mShortcutHelper);
+ bubbsExtractor.setPackageManager(mPackageManagerClient);
}
registerNotificationPreferencesPullers();
if (mLockUtils == null) {
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index e541246..b9f0968 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -330,10 +330,19 @@
}
final long[] vibrationPattern = channel.getVibrationPattern();
- if (vibrationPattern == null) {
- return helper.createDefaultVibration(insistent);
+ if (vibrationPattern != null) {
+ return helper.createWaveformVibration(vibrationPattern, insistent);
}
- return helper.createWaveformVibration(vibrationPattern, insistent);
+
+ if (com.android.server.notification.Flags.notificationVibrationInSoundUri()) {
+ final VibrationEffect vibrationEffectFromSoundUri =
+ helper.createVibrationEffectFromSoundUri(channel.getSound());
+ if (vibrationEffectFromSoundUri != null) {
+ return vibrationEffectFromSoundUri;
+ }
+ }
+
+ return helper.createDefaultVibration(insistent);
}
private VibrationEffect calculateVibration() {
diff --git a/services/core/java/com/android/server/notification/VibratorHelper.java b/services/core/java/com/android/server/notification/VibratorHelper.java
index 8a0e595..fbe7772 100644
--- a/services/core/java/com/android/server/notification/VibratorHelper.java
+++ b/services/core/java/com/android/server/notification/VibratorHelper.java
@@ -24,6 +24,9 @@
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.media.AudioAttributes;
+import android.media.RingtoneManager;
+import android.media.Utils;
+import android.net.Uri;
import android.os.Process;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
@@ -51,6 +54,7 @@
@Nullable private final float[] mDefaultPwlePattern;
@Nullable private final float[] mFallbackPwlePattern;
private final int mDefaultVibrationAmplitude;
+ private final Context mContext;
public VibratorHelper(Context context) {
mVibrator = context.getSystemService(Vibrator.class);
@@ -68,6 +72,7 @@
com.android.internal.R.array.config_notificationFallbackVibeWaveform);
mDefaultVibrationAmplitude = context.getResources().getInteger(
com.android.internal.R.integer.config_defaultVibrationAmplitude);
+ mContext = context;
}
/**
@@ -184,6 +189,16 @@
* @param insistent {@code true} if the vibration should loop until it is cancelled.
*/
public VibrationEffect createDefaultVibration(boolean insistent) {
+ if (com.android.server.notification.Flags.notificationVibrationInSoundUri()) {
+ final Uri defaultRingtoneUri = RingtoneManager.getActualDefaultRingtoneUri(mContext,
+ RingtoneManager.TYPE_NOTIFICATION);
+ final VibrationEffect vibrationEffectFromSoundUri =
+ createVibrationEffectFromSoundUri(defaultRingtoneUri);
+ if (vibrationEffectFromSoundUri != null) {
+ return vibrationEffectFromSoundUri;
+ }
+ }
+
if (mVibrator.hasFrequencyControl()) {
VibrationEffect effect = createPwleWaveformVibration(mDefaultPwlePattern, insistent);
if (effect != null) {
@@ -193,6 +208,22 @@
return createWaveformVibration(mDefaultPattern, insistent);
}
+ /**
+ * Safely create a {@link VibrationEffect} from given an uri {@code Uri}.
+ * with query parameter "vibration_uri"
+ *
+ * Use this function if the {@code Uri} is with a query parameter "vibration_uri" and the
+ * vibration_uri represents a valid vibration effect in xml
+ *
+ * @param uri {@code Uri} an uri including query parameter "vibraiton_uri"
+ */
+ public @Nullable VibrationEffect createVibrationEffectFromSoundUri(Uri uri) {
+ if (uri == null) {
+ return null;
+ }
+ return Utils.parseVibrationEffect(mVibrator, Utils.getVibrationUri(uri));
+ }
+
/** Returns if a given vibration can be played by the vibrator that does notification buzz. */
public boolean areEffectComponentsSupported(VibrationEffect effect) {
return mVibrator.areVibrationFeaturesSupported(effect);
diff --git a/services/core/java/com/android/server/notification/flags.aconfig b/services/core/java/com/android/server/notification/flags.aconfig
index aac2c40..be3adc1 100644
--- a/services/core/java/com/android/server/notification/flags.aconfig
+++ b/services/core/java/com/android/server/notification/flags.aconfig
@@ -156,3 +156,10 @@
description: "This flag enables forced auto-grouping conversations"
bug: "336488844"
}
+
+flag {
+ name: "notification_vibration_in_sound_uri"
+ namespace: "systemui"
+ description: "This flag enables sound uri with vibration source"
+ bug: "358524009"
+}
diff --git a/services/core/java/com/android/server/om/OverlayManagerService.java b/services/core/java/com/android/server/om/OverlayManagerService.java
index 6303ecd..a41675a 100644
--- a/services/core/java/com/android/server/om/OverlayManagerService.java
+++ b/services/core/java/com/android/server/om/OverlayManagerService.java
@@ -298,12 +298,13 @@
restoreSettings();
- // Wipe all shell overlays on boot, to recover from a potentially broken device
- String shellPkgName = TextUtils.emptyIfNull(
- getContext().getString(android.R.string.config_systemShell));
- mSettings.removeIf(overlayInfo -> overlayInfo.isFabricated
- && shellPkgName.equals(overlayInfo.packageName));
-
+ if (Build.IS_USER) {
+ // Wipe all shell overlays on boot, to recover from a potentially broken device
+ String shellPkgName = TextUtils.emptyIfNull(
+ getContext().getString(android.R.string.config_systemShell));
+ mSettings.removeIf(overlayInfo -> overlayInfo.isFabricated
+ && shellPkgName.equals(overlayInfo.packageName));
+ }
initIfNeeded();
onStartUser(UserHandle.USER_SYSTEM);
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index 43a285c..f449126 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -1882,10 +1882,16 @@
}
if (!oldSharedUid.equals(newSharedUid)) {
- throw new PrepareFailure(INSTALL_FAILED_UID_CHANGED,
- "Package " + parsedPackage.getPackageName()
- + " shared user changed from "
- + oldSharedUid + " to " + newSharedUid);
+ if (!(oldSharedUid.equals("<nothing>") && ps.getPkg() == null
+ && ps.isArchivedOnAnyUser(allUsers))) {
+ // Only allow changing sharedUserId if unarchiving
+ // TODO(b/361558423): remove this check after pre-archiving installs
+ // accept a sharedUserId param in the API
+ throw new PrepareFailure(INSTALL_FAILED_UID_CHANGED,
+ "Package " + parsedPackage.getPackageName()
+ + " shared user changed from "
+ + oldSharedUid + " to " + newSharedUid);
+ }
}
// APK should not re-join shared UID
diff --git a/services/core/java/com/android/server/pm/PackageArchiver.java b/services/core/java/com/android/server/pm/PackageArchiver.java
index 5e45b4c..76ea0b9 100644
--- a/services/core/java/com/android/server/pm/PackageArchiver.java
+++ b/services/core/java/com/android/server/pm/PackageArchiver.java
@@ -283,10 +283,7 @@
return START_CLASS_NOT_FOUND;
}
- String currentLauncherPackageName = getCurrentLauncherPackageName(getParentUserId(userId));
- if ((currentLauncherPackageName == null || !TextUtils.equals(callerPackageName,
- currentLauncherPackageName)) && callingUid != Process.SHELL_UID) {
- // TODO(b/311619990): Remove dependency on SHELL_UID for testing
+ if (!isCallerQualifiedForUnarchival(callerPackageName, callingUid, userId)) {
Slog.e(TAG, TextUtils.formatSimple(
"callerPackageName: %s does not qualify for unarchival of package: " + "%s!",
callerPackageName, packageName));
@@ -335,6 +332,37 @@
return START_ABORTED;
}
+ private boolean isCallerQualifiedForUnarchival(String callerPackageName, int callingUid,
+ int userId) {
+ // TODO(b/311619990): Remove dependency on SHELL_UID for testing
+ if (callingUid == Process.SHELL_UID) {
+ return true;
+ }
+ String currentLauncherPackageName = getCurrentLauncherPackageName(getParentUserId(userId));
+ if (currentLauncherPackageName != null && TextUtils.equals(
+ callerPackageName, currentLauncherPackageName)) {
+ return true;
+ }
+ Slog.w(TAG, TextUtils.formatSimple(
+ "Requester of unarchival: %s is not the default launcher package: %s.",
+ callerPackageName, currentLauncherPackageName));
+ // When the default launcher is not set, or when the current caller is not the default
+ // launcher, allow the caller to directly request unarchive if it is a launcher app
+ // that is a pre-installed system app.
+ final Computer snapshot = mPm.snapshotComputer();
+ final PackageStateInternal ps = snapshot.getPackageStateInternal(callerPackageName);
+ final boolean isSystem = ps != null && ps.isSystem();
+ return isSystem && isLauncherApp(snapshot, callerPackageName, userId);
+ }
+
+ private boolean isLauncherApp(Computer snapshot, String packageName, int userId) {
+ final Intent intent = snapshot.getHomeIntent();
+ intent.setPackage(packageName);
+ List<ResolveInfo> launcherActivities = snapshot.queryIntentActivitiesInternal(
+ intent, null /* resolvedType */, 0 /* flags */, userId);
+ return !launcherActivities.isEmpty();
+ }
+
// Profiles share their UI and default apps, so we have to get the profile parent before
// fetching the default launcher.
private int getParentUserId(int userId) {
@@ -936,13 +964,9 @@
* <p> In the rare case the app had multiple launcher activities, only one of the icons is
* returned arbitrarily.
*
- * <p> By default, the icon will be overlay'd with a cloud icon on top. A launcher app can
+ * <p> By default, the icon will be overlay'd with a cloud icon on top. An app can
* disable the cloud overlay via the
* {@link LauncherApps.ArchiveCompatibilityParams#setEnableIconOverlay(boolean)} API.
- * The default launcher's cloud overlay mode determines the cloud overlay status returned by
- * any other callers. That is, if the current launcher has the cloud overlay disabled, any other
- * app that fetches the app icon will also get an icon that has the cloud overlay disabled.
- * This is to prevent style mismatch caused by icons that are fetched by different callers.
*/
@Nullable
public Bitmap getArchivedAppIcon(@NonNull String packageName, @NonNull UserHandle user,
diff --git a/services/core/java/com/android/server/pm/PackageSetting.java b/services/core/java/com/android/server/pm/PackageSetting.java
index 9fb9e71..9428de7 100644
--- a/services/core/java/com/android/server/pm/PackageSetting.java
+++ b/services/core/java/com/android/server/pm/PackageSetting.java
@@ -925,6 +925,18 @@
return PackageArchiver.isArchived(readUserState(userId));
}
+ /**
+ * @return if the package is archived in any of the users
+ */
+ boolean isArchivedOnAnyUser(int[] userIds) {
+ for (int user : userIds) {
+ if (isArchived(user)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
int getInstallReason(int userId) {
return readUserState(userId).getInstallReason();
}
diff --git a/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java b/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
index 1c70af0..5ca5fda 100644
--- a/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
+++ b/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
@@ -397,6 +397,8 @@
ai.privateFlags |= flag(state.isInstantApp(), ApplicationInfo.PRIVATE_FLAG_INSTANT)
| flag(state.isVirtualPreload(), ApplicationInfo.PRIVATE_FLAG_VIRTUAL_PRELOAD)
| flag(state.isHidden(), ApplicationInfo.PRIVATE_FLAG_HIDDEN);
+ ai.privateFlagsExt |=
+ flag(state.isNotLaunched(), ApplicationInfo.PRIVATE_FLAG_EXT_NOT_LAUNCHED);
if (state.getEnabledState() == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
ai.enabled = true;
} else if (state.getEnabledState()
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 749025b..ed9dcfa 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -535,7 +535,7 @@
volatile boolean mRequestedOrSleepingDefaultDisplay;
/**
- * This is used to check whether to invoke {@link #updateScreenOffSleepToken} when screen is
+ * This is used to check whether to acquire screen-off sleep token when screen is
* turned off. E.g. if it is false when screen is turned off and the display is swapping, it
* is expected that the screen will be on in a short time. Then it is unnecessary to acquire
* screen-off-sleep-token, so it can avoid intermediate visibility or lifecycle changes.
@@ -610,7 +610,6 @@
private boolean mPendingKeyguardOccluded;
private boolean mKeyguardOccludedChanged;
- private ActivityTaskManagerInternal.SleepTokenAcquirer mScreenOffSleepTokenAcquirer;
Intent mHomeIntent;
Intent mCarDockIntent;
Intent mDeskDockIntent;
@@ -810,7 +809,7 @@
event.recycle();
break;
case MSG_HANDLE_ALL_APPS:
- launchAllAppsAction();
+ launchAllAppsAction((KeyEvent) msg.obj);
break;
case MSG_RINGER_TOGGLE_CHORD:
handleRingerChordGesture();
@@ -1879,26 +1878,31 @@
}
}
- private void launchAllAppsAction() {
- Intent intent = new Intent(Intent.ACTION_ALL_APPS);
- if (mHasFeatureLeanback) {
- Intent intentLauncher = new Intent(Intent.ACTION_MAIN);
- intentLauncher.addCategory(Intent.CATEGORY_HOME);
- ResolveInfo resolveInfo = mPackageManager.resolveActivityAsUser(intentLauncher,
- PackageManager.MATCH_SYSTEM_ONLY,
- mCurrentUserId);
- if (resolveInfo != null) {
- intent.setPackage(resolveInfo.activityInfo.packageName);
+ private void launchAllAppsAction(KeyEvent event) {
+ if (mHasFeatureLeanback || mHasFeatureWatch) {
+ // TV and watch support the all apps intent
+ notifyKeyGestureCompleted(event,
+ KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS);
+ Intent intent = new Intent(Intent.ACTION_ALL_APPS);
+ if (mHasFeatureLeanback) {
+ Intent intentLauncher = new Intent(Intent.ACTION_MAIN);
+ intentLauncher.addCategory(Intent.CATEGORY_HOME);
+ ResolveInfo resolveInfo = mPackageManager.resolveActivityAsUser(intentLauncher,
+ PackageManager.MATCH_SYSTEM_ONLY,
+ mCurrentUserId);
+ if (resolveInfo != null) {
+ intent.setPackage(resolveInfo.activityInfo.packageName);
+ }
}
- }
- startActivityAsUser(intent, UserHandle.CURRENT);
- }
-
- private void launchAllAppsViaA11y() {
- AccessibilityManagerInternal accessibilityManager = getAccessibilityManagerInternal();
- if (accessibilityManager != null) {
- accessibilityManager.performSystemAction(
- AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS);
+ startActivityAsUser(intent, UserHandle.CURRENT);
+ } else {
+ notifyKeyGestureCompleted(event,
+ KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS);
+ AccessibilityManagerInternal accessibilityManager = getAccessibilityManagerInternal();
+ if (accessibilityManager != null) {
+ accessibilityManager.performSystemAction(
+ AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS);
+ }
}
dismissKeyboardShortcutsMenu();
}
@@ -2076,15 +2080,7 @@
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, "Home - Long Press");
switch (mLongPressOnHomeBehavior) {
case LONG_PRESS_HOME_ALL_APPS:
- if (mHasFeatureLeanback) {
- launchAllAppsAction();
- notifyKeyGestureCompleted(event,
- KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS);
- } else {
- launchAllAppsViaA11y();
- notifyKeyGestureCompleted(event,
- KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS);
- }
+ launchAllAppsAction(event);
break;
case LONG_PRESS_HOME_ASSIST:
notifyKeyGestureCompleted(event,
@@ -2223,9 +2219,6 @@
mLockPatternUtils = new LockPatternUtils(mContext);
mLogger = new MetricsLogger();
- mScreenOffSleepTokenAcquirer = mActivityTaskManagerInternal
- .createSleepTokenAcquirer("ScreenOff");
-
Resources res = mContext.getResources();
mWakeOnDpadKeyPress =
res.getBoolean(com.android.internal.R.bool.config_wakeOnDpadKeyPress);
@@ -3695,18 +3688,11 @@
break;
case KeyEvent.KEYCODE_ALL_APPS:
if (firstDown) {
- if (mHasFeatureLeanback) {
- mHandler.removeMessages(MSG_HANDLE_ALL_APPS);
- Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS);
- msg.setAsynchronous(true);
- msg.sendToTarget();
- notifyKeyGestureCompleted(event,
- KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS);
- } else {
- launchAllAppsViaA11y();
- notifyKeyGestureCompleted(event,
- KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS);
- }
+ mHandler.removeMessages(MSG_HANDLE_ALL_APPS);
+
+ Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS, new KeyEvent(event));
+ msg.setAsynchronous(true);
+ msg.sendToTarget();
}
return true;
case KeyEvent.KEYCODE_NOTIFICATION:
@@ -3759,9 +3745,7 @@
KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_CAPS_LOCK);
} else if (mPendingMetaAction) {
if (!canceled) {
- launchAllAppsViaA11y();
- notifyKeyGestureCompleted(event,
- KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS);
+ launchAllAppsAction(event);
}
mPendingMetaAction = false;
}
@@ -5533,13 +5517,6 @@
mRequestedOrSleepingDefaultDisplay = true;
mIsGoingToSleepDefaultDisplay = true;
- // In case startedGoingToSleep is called after screenTurnedOff (the source caller is in
- // order but the methods run on different threads) and updateScreenOffSleepToken was
- // skipped. Then acquire sleep token if screen was off.
- if (!mDefaultDisplayPolicy.isScreenOnFully() && !mDefaultDisplayPolicy.isScreenOnEarly()) {
- updateScreenOffSleepToken(true /* acquire */);
- }
-
if (mKeyguardDelegate != null) {
mKeyguardDelegate.onStartedGoingToSleep(pmSleepReason);
}
@@ -5700,11 +5677,9 @@
if (DEBUG_WAKEUP) Slog.i(TAG, "Display" + displayId + " turned off...");
if (displayId == DEFAULT_DISPLAY) {
- if (!isSwappingDisplay || mIsGoingToSleepDefaultDisplay) {
- updateScreenOffSleepToken(true /* acquire */);
- }
+ final boolean acquireSleepToken = !isSwappingDisplay || mIsGoingToSleepDefaultDisplay;
mRequestedOrSleepingDefaultDisplay = false;
- mDefaultDisplayPolicy.screenTurnedOff();
+ mDefaultDisplayPolicy.screenTurnedOff(acquireSleepToken);
synchronized (mLock) {
if (mKeyguardDelegate != null) {
mKeyguardDelegate.onScreenTurnedOff();
@@ -5760,7 +5735,6 @@
if (displayId == DEFAULT_DISPLAY) {
Trace.asyncTraceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "screenTurningOn",
0 /* cookie */);
- updateScreenOffSleepToken(false /* acquire */);
mDefaultDisplayPolicy.screenTurningOn(screenOnListener);
mBootAnimationDismissable = false;
@@ -6267,15 +6241,6 @@
}
}
- // TODO (multidisplay): Support multiple displays in WindowManagerPolicy.
- private void updateScreenOffSleepToken(boolean acquire) {
- if (acquire) {
- mScreenOffSleepTokenAcquirer.acquire(DEFAULT_DISPLAY);
- } else {
- mScreenOffSleepTokenAcquirer.release(DEFAULT_DISPLAY);
- }
- }
-
/** {@inheritDoc} */
@Override
public void enableScreenAfterBoot() {
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 12e7fd0..71cb882 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -3668,7 +3668,7 @@
mBrightWhenDozingConfig);
int wakefulness = powerGroup.getWakefulnessLocked();
if (DEBUG_SPEW) {
- Slog.d(TAG, "updateDisplayPowerStateLocked: displayReady=" + ready
+ Slog.d(TAG, "updatePowerGroupsLocked: displayReady=" + ready
+ ", groupId=" + groupId
+ ", policy=" + policyToString(powerGroup.getPolicyLocked())
+ ", mWakefulness="
diff --git a/services/core/java/com/android/server/power/TEST_MAPPING b/services/core/java/com/android/server/power/TEST_MAPPING
index 4ce01d2..935a238 100644
--- a/services/core/java/com/android/server/power/TEST_MAPPING
+++ b/services/core/java/com/android/server/power/TEST_MAPPING
@@ -30,10 +30,7 @@
]
},
{
- "name": "FrameworksServicesTests",
- "options": [
- {"include-filter": "com.android.server.power"}
- ]
+ "name": "FrameworksServicesTests_android_server_power"
},
{
"name": "PowerServiceTests",
diff --git a/services/core/java/com/android/server/power/hint/HintManagerService.java b/services/core/java/com/android/server/power/hint/HintManagerService.java
index f6c3d8e..1346a29 100644
--- a/services/core/java/com/android/server/power/hint/HintManagerService.java
+++ b/services/core/java/com/android/server/power/hint/HintManagerService.java
@@ -160,6 +160,8 @@
private static final String PROPERTY_SF_ENABLE_CPU_HINT = "debug.sf.enable_adpf_cpu_hint";
private static final String PROPERTY_HWUI_ENABLE_HINT_MANAGER = "debug.hwui.use_hint_manager";
+ private Boolean mFMQUsesIntegratedEventFlag = false;
+
@VisibleForTesting final IHintManager.Stub mService = new BinderService();
public HintManagerService(Context context) {
@@ -1032,7 +1034,7 @@
@Override
public IHintSession createHintSessionWithConfig(@NonNull IBinder token,
@NonNull int[] tids, long durationNanos, @SessionTag int tag,
- @Nullable SessionConfig config) {
+ SessionConfig config) {
if (!isHalSupported()) {
throw new UnsupportedOperationException("PowerHAL is not supported!");
}
@@ -1070,7 +1072,7 @@
default -> tag = SessionTag.APP;
}
}
-
+ config.id = -1;
Long halSessionPtr = null;
if (mConfigCreationSupport.get()) {
try {
@@ -1109,7 +1111,7 @@
}
}
- final long sessionId = config != null ? config.id : halSessionPtr;
+ final long sessionId = config.id != -1 ? config.id : halSessionPtr;
logPerformanceHintSessionAtom(
callingUid, sessionId, durationNanos, tids, tag);
@@ -1144,14 +1146,23 @@
}
@Override
- public ChannelConfig getSessionChannel(IBinder token) {
- if (mPowerHalVersion < 5 || !adpfUseFmqChannel()) {
+ public @Nullable ChannelConfig getSessionChannel(IBinder token) {
+ if (mPowerHalVersion < 5 || !adpfUseFmqChannel()
+ || mFMQUsesIntegratedEventFlag) {
return null;
}
java.util.Objects.requireNonNull(token);
final int callingTgid = Process.getThreadGroupLeader(Binder.getCallingPid());
final int callingUid = Binder.getCallingUid();
ChannelItem item = getOrCreateMappedChannelItem(callingTgid, callingUid, token);
+ // FMQ V1 requires a separate event flag to be passed, and the default no-op
+ // implmenentation in PowerHAL does not return such a shared flag. This helps
+ // avoid using the FMQ on a default impl that does not support it.
+ if (item.getConfig().eventFlagDescriptor == null) {
+ mFMQUsesIntegratedEventFlag = true;
+ closeSessionChannel();
+ return null;
+ }
return item.getConfig();
};
@@ -1270,8 +1281,14 @@
@VisibleForTesting
boolean updateHintAllowedByProcState(boolean allowed) {
synchronized (this) {
- if (allowed && !mUpdateAllowedByProcState && !mShouldForcePause) resume();
- if (!allowed && mUpdateAllowedByProcState) pause();
+ if (allowed && !mUpdateAllowedByProcState && !mShouldForcePause) {
+ Slogf.e(TAG, "ADPF IS GETTING RESUMED? UID: " + mUid + " TAG: " + mTag);
+ resume();
+ }
+ if (!allowed && mUpdateAllowedByProcState) {
+ Slogf.e(TAG, "ADPF IS GETTING PAUSED? UID: " + mUid + " TAG: " + mTag);
+ pause();
+ }
mUpdateAllowedByProcState = allowed;
return mUpdateAllowedByProcState;
}
diff --git a/services/core/java/com/android/server/power/stats/PowerStatsCollector.java b/services/core/java/com/android/server/power/stats/PowerStatsCollector.java
index 291f0e3..e5b990e 100644
--- a/services/core/java/com/android/server/power/stats/PowerStatsCollector.java
+++ b/services/core/java/com/android/server/power/stats/PowerStatsCollector.java
@@ -432,9 +432,6 @@
EnergyConsumerResult[] energy =
mConsumedEnergyRetriever.getConsumedEnergy(mEnergyConsumerIds);
- System.out.println("mEnergyConsumerIds = " + Arrays.toString(mEnergyConsumerIds) + " "
- + "energy = "
- + Arrays.toString(energy));
if (energy == null) {
return false;
}
diff --git a/services/core/java/com/android/server/rollback/WatchdogRollbackLogger.java b/services/core/java/com/android/server/rollback/WatchdogRollbackLogger.java
index d763199..79560ce 100644
--- a/services/core/java/com/android/server/rollback/WatchdogRollbackLogger.java
+++ b/services/core/java/com/android/server/rollback/WatchdogRollbackLogger.java
@@ -16,6 +16,7 @@
package com.android.server.rollback;
+import static com.android.server.crashrecovery.CrashRecoveryUtils.logCrashRecoveryEvent;
import static com.android.server.crashrecovery.proto.CrashRecoveryStatsLog.WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_REASON__REASON_APP_CRASH;
import static com.android.server.crashrecovery.proto.CrashRecoveryStatsLog.WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_REASON__REASON_APP_NOT_RESPONDING;
import static com.android.server.crashrecovery.proto.CrashRecoveryStatsLog.WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_REASON__REASON_BOOT_LOOPING;
@@ -39,7 +40,7 @@
import android.content.rollback.RollbackInfo;
import android.os.SystemProperties;
import android.text.TextUtils;
-import android.util.ArraySet;
+import android.util.Log;
import android.util.Slog;
import com.android.internal.annotations.VisibleForTesting;
@@ -47,7 +48,6 @@
import com.android.server.crashrecovery.proto.CrashRecoveryStatsLog;
import java.util.List;
-import java.util.Set;
/**
* This class handles the logic for logging Watchdog-triggered rollback events.
@@ -101,22 +101,6 @@
return loggingParent;
}
-
- /**
- * Gets the set of parent packages for a given set of failed package names. In the case that
- * multiple sessions have failed, we want to log failure for each of the parent packages.
- * Even if multiple failed packages have the same parent, we only log the parent package once.
- */
- private static Set<VersionedPackage> getLogPackages(Context context,
- @NonNull List<String> failedPackageNames) {
- Set<VersionedPackage> parentPackages = new ArraySet<>();
- for (String failedPackageName: failedPackageNames) {
- parentPackages.add(getLogPackage(context, new VersionedPackage(failedPackageName, 0)));
- }
- return parentPackages;
- }
-
-
static void logRollbackStatusOnBoot(Context context, int rollbackId, String logPackageName,
List<RollbackInfo> recentlyCommittedRollbacks) {
PackageInstaller packageInstaller = context.getPackageManager().getPackageInstaller();
@@ -174,10 +158,11 @@
*/
public static void logEvent(@Nullable VersionedPackage logPackage, int type,
int rollbackReason, @NonNull String failingPackageName) {
- Slog.i(TAG, "Watchdog event occurred with type: " + rollbackTypeToString(type)
+ String logMsg = "Watchdog event occurred with type: " + rollbackTypeToString(type)
+ " logPackage: " + logPackage
+ " rollbackReason: " + rollbackReasonToString(rollbackReason)
- + " failedPackageName: " + failingPackageName);
+ + " failedPackageName: " + failingPackageName;
+ Slog.i(TAG, logMsg);
if (logPackage != null) {
CrashRecoveryStatsLog.write(
CrashRecoveryStatsLog.WATCHDOG_ROLLBACK_OCCURRED,
@@ -200,33 +185,19 @@
new byte[]{});
}
- logTestProperties(logPackage, type, rollbackReason, failingPackageName);
+ logTestProperties(logMsg);
}
/**
* Writes properties which will be used by rollback tests to check if particular rollback
* events have occurred.
- *
- * persist.sys.rollbacktest.enabled: true if rollback tests are running
- * persist.sys.rollbacktest.EVENT_TYPE: true if a particular rollback event has occurred
- * ex: persist.sys.rollbacktest.ROLLBACK_INITIATE is true if ROLLBACK_INITIATE has happened
- * persist.sys.rollbacktest.EVENT_TYPE.logPackage: the package to associate the rollback with
- * persist.sys.rollbacktest.EVENT_TYPE.rollbackReason: the reason Watchdog triggered a rollback
- * persist.sys.rollbacktest.EVENT_TYPE.failedPackageName: the failing package or process which
- * triggered the rollback
*/
- private static void logTestProperties(@Nullable VersionedPackage logPackage, int type,
- int rollbackReason, @NonNull String failingPackageName) {
+ private static void logTestProperties(String logMsg) {
// This property should be on only during the tests
- final String prefix = "persist.sys.rollbacktest.";
- if (!SystemProperties.getBoolean(prefix + "enabled", false)) {
+ if (!SystemProperties.getBoolean("persist.sys.rollbacktest.enabled", false)) {
return;
}
- String key = prefix + rollbackTypeToString(type);
- SystemProperties.set(key, String.valueOf(true));
- SystemProperties.set(key + ".logPackage", logPackage != null ? logPackage.toString() : "");
- SystemProperties.set(key + ".rollbackReason", rollbackReasonToString(rollbackReason));
- SystemProperties.set(key + ".failedPackageName", failingPackageName);
+ logCrashRecoveryEvent(Log.DEBUG, logMsg);
}
@VisibleForTesting
diff --git a/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java b/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
index 06a2565..8121701 100644
--- a/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
+++ b/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
@@ -51,6 +51,7 @@
import static android.hardware.SensorPrivacyManager.TOGGLE_TYPE_HARDWARE;
import static android.hardware.SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE;
import static android.os.UserHandle.USER_NULL;
+import static android.os.UserHandle.getCallingUserId;
import static android.service.SensorPrivacyIndividualEnabledSensorProto.UNKNOWN;
import static com.android.internal.util.FrameworkStatsLog.PRIVACY_SENSOR_TOGGLE_INTERACTION;
@@ -187,6 +188,7 @@
private final TelephonyManager mTelephonyManager;
private final PackageManagerInternal mPackageManagerInternal;
private final NotificationManager mNotificationManager;
+ private final UserManager mUserManager;
private CameraPrivacyLightController mCameraPrivacyLightController;
@@ -214,6 +216,7 @@
mTelephonyManager = context.getSystemService(TelephonyManager.class);
mPackageManagerInternal = getLocalService(PackageManagerInternal.class);
mNotificationManager = mContext.getSystemService(NotificationManager.class);
+ mUserManager = context.getSystemService(UserManager.class);
mSensorPrivacyServiceImpl = new SensorPrivacyServiceImpl();
for (String entry : SystemConfig.getInstance().getCameraPrivacyAllowlist()) {
mCameraPrivacyAllowlist.add(entry);
@@ -379,14 +382,23 @@
public void onUserRestrictionsChanged(int userId, Bundle newRestrictions,
Bundle prevRestrictions) {
// Reset sensor privacy when restriction is added
+ // Note: isValidCallingUser needs to be called before resetting sensor privacy
+ // because DISALLOW_CAMERA_TOGGLE and DISALLOW_MICROPHONE_TOGGLE are applied on
+ // visible background users in Automotive's Multi Display configuration but we don't
+ // allow sensor privacy to be set on a visible background user.
if (!prevRestrictions.getBoolean(UserManager.DISALLOW_CAMERA_TOGGLE)
&& newRestrictions.getBoolean(UserManager.DISALLOW_CAMERA_TOGGLE)) {
- setToggleSensorPrivacyUnchecked(TOGGLE_TYPE_SOFTWARE, userId, OTHER, CAMERA, false);
+ if (isValidCallingUser(userId)) {
+ setToggleSensorPrivacyUnchecked(TOGGLE_TYPE_SOFTWARE, userId, OTHER, CAMERA,
+ false);
+ }
}
if (!prevRestrictions.getBoolean(UserManager.DISALLOW_MICROPHONE_TOGGLE)
&& newRestrictions.getBoolean(UserManager.DISALLOW_MICROPHONE_TOGGLE)) {
- setToggleSensorPrivacyUnchecked(TOGGLE_TYPE_SOFTWARE, userId, OTHER, MICROPHONE,
- false);
+ if (isValidCallingUser(userId)) {
+ setToggleSensorPrivacyUnchecked(TOGGLE_TYPE_SOFTWARE, userId, OTHER, MICROPHONE,
+ false);
+ }
}
}
@@ -779,6 +791,10 @@
@Override
public void setSensorPrivacy(boolean enable) {
enforceManageSensorPrivacyPermission();
+
+ // Enforce valid calling user on devices that enable visible background users.
+ enforceValidCallingUser(getCallingUserId());
+
mSensorPrivacyStateController.setAllSensorState(enable);
}
@@ -795,11 +811,15 @@
+ " enable=" + enable
+ ")");
}
+
enforceManageSensorPrivacyPermission();
if (userId == UserHandle.USER_CURRENT) {
userId = mCurrentUser;
}
+ // Enforce valid calling user on devices that enable visible background users.
+ enforceValidCallingUser(userId);
+
if (!canChangeToggleSensorPrivacy(userId, sensor)) {
return;
}
@@ -831,6 +851,9 @@
userId = mCurrentUser;
}
+ // Enforce valid calling user on devices that enable visible background users.
+ enforceValidCallingUser(userId);
+
if (!canChangeToggleSensorPrivacy(userId, sensor)) {
return;
}
@@ -1151,6 +1174,42 @@
});
}
+ // This method enforces valid calling user on devices that enable visible background users.
+ // Only system user or current user or the user that belongs to the same profile group
+ // as the current user is permitted to toggle sensor privacy.
+ // Visible background users are not permitted to toggle sensor privacy.
+ private void enforceValidCallingUser(@UserIdInt int userId) {
+ if (!isValidCallingUser(userId)) {
+ throw new SecurityException("User " + userId
+ + " is not permitted to toggle sensor privacy");
+ }
+ }
+
+ private boolean isValidCallingUser(@UserIdInt int userId) {
+ // Check whether visible background users are enabled.
+ // Visible background users are non current but can have UI access.
+ // The main use case for visible background users is the passenger in Automotive's
+ // Multi-Display configuration.
+ if (!UserManager.isVisibleBackgroundUsersEnabled()) {
+ return true;
+ }
+
+ if (userId == UserHandle.USER_SYSTEM || userId == mCurrentUser) {
+ return true;
+ }
+
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ if (mUserManager.isSameProfileGroup(userId, mCurrentUser)) {
+ return true;
+ }
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+
+ return false;
+ }
+
/**
* Enforces the caller contains the necessary permission to change the state of sensor
* privacy.
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
index 09d2a02..83cb72e 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
@@ -35,7 +35,8 @@
public interface StatusBarManagerInternal {
void setNotificationDelegate(NotificationDelegate delegate);
- void showScreenPinningRequest(int taskId);
+ /** Show a screen pinning request for a specific task. */
+ void showScreenPinningRequest(int taskId, int userId);
void showAssistDisclosure();
void preloadRecentApps();
@@ -136,7 +137,7 @@
*
* @param hidesStatusBar whether it is being hidden
*/
- void setTopAppHidesStatusBar(boolean hidesStatusBar);
+ void setTopAppHidesStatusBar(int displayId, boolean hidesStatusBar);
boolean showShutdownUi(boolean isReboot, String requestString);
@@ -149,17 +150,18 @@
/**
* Notify System UI that the system get into or exit immersive mode.
+ * @param displayId The changed display Id.
* @param rootDisplayAreaId The changed display area Id.
* @param isImmersiveMode {@code true} if the display area get into immersive mode.
*/
- void immersiveModeChanged(int rootDisplayAreaId, boolean isImmersiveMode);
+ void immersiveModeChanged(int displayId, int rootDisplayAreaId, boolean isImmersiveMode);
/**
* Show a rotation suggestion that a user may approve to rotate the screen.
*
* @param rotation rotation suggestion
*/
- void onProposedRotationChanged(int rotation, boolean isValid);
+ void onProposedRotationChanged(int displayId, int rotation, boolean isValid);
/**
* Notifies System UI that the display is ready to show system decorations.
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 0fd5967..908f51b 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -119,6 +119,7 @@
import com.android.server.UiThread;
import com.android.server.inputmethod.InputMethodManagerInternal;
import com.android.server.notification.NotificationDelegate;
+import com.android.server.pm.UserManagerInternal;
import com.android.server.pm.UserManagerService;
import com.android.server.policy.GlobalActionsProvider;
import com.android.server.power.ShutdownCheckPoints;
@@ -185,6 +186,7 @@
private final ActivityManagerInternal mActivityManagerInternal;
private final ActivityTaskManagerInternal mActivityTaskManager;
private final PackageManagerInternal mPackageManagerInternal;
+ private final UserManagerInternal mUserManagerInternal;
private final SessionMonitor mSessionMonitor;
private int mCurrentUserId;
private boolean mTracingEnabled;
@@ -304,6 +306,7 @@
mActivityTaskManager = LocalServices.getService(ActivityTaskManagerInternal.class);
mPackageManagerInternal = LocalServices.getService(PackageManagerInternal.class);
mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
+ mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
mTileRequestTracker = new TileRequestTracker(mContext);
mSessionMonitor = new SessionMonitor(mContext);
@@ -360,7 +363,14 @@
}
@Override
- public void showScreenPinningRequest(int taskId) {
+ public void showScreenPinningRequest(int taskId, int userId) {
+ if (isVisibleBackgroundUser(userId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping showScreenPinningRequest for visible background user "
+ + userId);
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -439,6 +449,13 @@
@Override
public void appTransitionFinished(int displayId) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping appTransitionFinished for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
enforceStatusBarService();
IStatusBar bar = mBar;
if (bar != null) {
@@ -588,6 +605,13 @@
@Override
public void setWindowState(int displayId, int window, int state) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping setWindowState for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -598,6 +622,13 @@
@Override
public void appTransitionPending(int displayId) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping appTransitionPending for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -608,6 +639,13 @@
@Override
public void appTransitionCancelled(int displayId) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping appTransitionCancelled for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -619,6 +657,13 @@
@Override
public void appTransitionStarting(int displayId, long statusBarAnimationsStartTime,
long statusBarAnimationsDuration) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping appTransitionStarting for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -629,7 +674,14 @@
}
@Override
- public void setTopAppHidesStatusBar(boolean hidesStatusBar) {
+ public void setTopAppHidesStatusBar(int displayId, boolean hidesStatusBar) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping setTopAppHidesStatusBar for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -665,10 +717,18 @@
}
@Override
- public void immersiveModeChanged(int rootDisplayAreaId, boolean isImmersiveMode) {
+ public void immersiveModeChanged(int displayId, int rootDisplayAreaId,
+ boolean isImmersiveMode) {
if (mBar == null) {
return;
}
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping immersiveModeChanged for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
if (!CLIENT_TRANSIENT) {
// Only call from here when the client transient is not enabled.
try {
@@ -680,7 +740,14 @@
// TODO(b/118592525): support it per display if necessary.
@Override
- public void onProposedRotationChanged(int rotation, boolean isValid) {
+ public void onProposedRotationChanged(int displayId, int rotation, boolean isValid) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping onProposedRotationChanged for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
if (mBar != null){
try {
mBar.onProposedRotationChanged(rotation, isValid);
@@ -690,6 +757,13 @@
@Override
public void onDisplayReady(int displayId) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping onDisplayReady for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -703,6 +777,13 @@
AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme,
@Behavior int behavior, @InsetsType int requestedVisibleTypes,
String packageName, LetterboxDetails[] letterboxDetails) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping onSystemBarAttributesChanged for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
getUiState(displayId).setBarAttributes(appearance, appearanceRegions,
navbarColorManagedByIme, behavior, requestedVisibleTypes, packageName,
letterboxDetails);
@@ -719,6 +800,13 @@
@Override
public void showTransient(int displayId, @InsetsType int types,
boolean isGestureOnSystemBar) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping showTransient for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
getUiState(displayId).showTransient(types);
IStatusBar bar = mBar;
if (bar != null) {
@@ -730,6 +818,13 @@
@Override
public void abortTransient(int displayId, @InsetsType int types) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping abortTransient for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
getUiState(displayId).clearTransient(types);
IStatusBar bar = mBar;
if (bar != null) {
@@ -776,6 +871,15 @@
@Override
public void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG,
+ "Skipping setNavigationBarLumaSamplingEnabled for visible background "
+ + "user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
IStatusBar bar = mBar;
if (bar != null) {
try {
@@ -1416,6 +1520,13 @@
}
private void setDisableFlags(int displayId, int flags, String cause) {
+ if (isVisibleBackgroundUserOnDisplay(displayId)) {
+ if (SPEW) {
+ Slog.d(TAG, "Skipping setDisableFlags for visible background user "
+ + mUserManagerInternal.getUserAssignedToDisplay(displayId));
+ }
+ return;
+ }
// also allows calls from window manager which is in this process.
enforceStatusBarService();
@@ -2713,16 +2824,30 @@
if (callingUserId == USER_SYSTEM || callingUserId == mCurrentUserId) {
return;
}
- final long ident = Binder.clearCallingIdentity();
- try {
- if (mUserManager.isSameProfileGroup(callingUserId, mCurrentUserId)) {
- return;
- }
- } finally {
- Binder.restoreCallingIdentity(ident);
+ if (!isVisibleBackgroundUser(callingUserId)) {
+ return;
}
throw new SecurityException("User " + callingUserId
+ " is not permitted to use this method");
}
-}
+
+ private boolean isVisibleBackgroundUser(int userId) {
+ if (!mVisibleBackgroundUsersEnabled) {
+ return false;
+ }
+ // The main use case for visible background users is the Automotive multi-display
+ // configuration where a passenger can use a secondary display while the driver is
+ // using the main display.
+ // TODO(b/341604160) - Support visible background users properly and remove carve outs
+ return mUserManagerInternal.isVisibleBackgroundFullUser(userId);
+ }
+
+ private boolean isVisibleBackgroundUserOnDisplay(int displayId) {
+ if (!mVisibleBackgroundUsersEnabled) {
+ return false;
+ }
+ int userId = mUserManagerInternal.getUserAssignedToDisplay(displayId);
+ return isVisibleBackgroundUser(userId);
+ }
+}
\ No newline at end of file
diff --git a/services/core/java/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java b/services/core/java/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java
index 47425322..5f704a0 100644
--- a/services/core/java/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java
+++ b/services/core/java/com/android/server/vcn/routeselection/IpSecPacketLossDetector.java
@@ -276,7 +276,7 @@
// enabled on the last one as a sample
mInboundTransform = inboundTransform;
- if (!Flags.allowDisableIpsecLossDetector() || canStart()) {
+ if (canStart()) {
start();
}
}
@@ -292,7 +292,7 @@
mMaxSeqNumIncreasePerSecond = getMaxSeqNumIncreasePerSecond(carrierConfig);
}
- if (Flags.allowDisableIpsecLossDetector() && canStart() != isStarted()) {
+ if (canStart() != isStarted()) {
if (canStart()) {
start();
} else {
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index f53dda6..78359bd 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -2224,15 +2224,21 @@
public ParcelFileDescriptor getWallpaperWithFeature(String callingPkg, String callingFeatureId,
IWallpaperManagerCallback cb, final int which, Bundle outParams, int wallpaperUserId,
boolean getCropped) {
- final boolean hasPrivilege = hasPermission(READ_WALLPAPER_INTERNAL)
- || hasPermission(MANAGE_EXTERNAL_STORAGE);
+ final int callingPid = Binder.getCallingPid();
+ final int callingUid = Binder.getCallingUid();
+ final boolean hasPrivilege = hasPermission(READ_WALLPAPER_INTERNAL);
if (!hasPrivilege) {
- mContext.getSystemService(StorageManager.class).checkPermissionReadImages(true,
- Binder.getCallingPid(), Binder.getCallingUid(), callingPkg, callingFeatureId);
+ boolean hasManageExternalStorage = hasPermission(MANAGE_EXTERNAL_STORAGE)
+ || hasAppOpPermission(MANAGE_EXTERNAL_STORAGE, callingUid, callingPkg,
+ callingFeatureId, "getWallpaperWithFeature from package: " + callingPkg);
+ if (!hasManageExternalStorage) {
+ mContext.getSystemService(StorageManager.class).checkPermissionReadImages(true,
+ callingPid, callingUid, callingPkg, callingFeatureId);
+ }
}
- wallpaperUserId = ActivityManager.handleIncomingUser(Binder.getCallingPid(),
- Binder.getCallingUid(), wallpaperUserId, false, true, "getWallpaper", null);
+ wallpaperUserId = ActivityManager.handleIncomingUser(callingPid, callingUid,
+ wallpaperUserId, false, true, "getWallpaper", null);
if (which != FLAG_SYSTEM && which != FLAG_LOCK) {
throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to read");
@@ -2348,6 +2354,22 @@
return mContext.checkCallingOrSelfPermission(permission) == PERMISSION_GRANTED;
}
+ private boolean hasAppOpPermission(String permission, int callingUid, String callingPackage,
+ String attributionTag, String message) {
+ final String op = AppOpsManager.permissionToOp(permission);
+ final int opMode = mAppOpsManager.noteOpNoThrow(op, callingUid, callingPackage,
+ attributionTag, message);
+ switch (opMode) {
+ case AppOpsManager.MODE_ALLOWED:
+ case AppOpsManager.MODE_FOREGROUND:
+ return true;
+ case AppOpsManager.MODE_DEFAULT:
+ return hasPermission(permission);
+ default:
+ return false;
+ }
+ }
+
@Override
public WallpaperInfo getWallpaperInfo(int userId) {
return getWallpaperInfoWithFlags(FLAG_SYSTEM, userId);
@@ -3169,7 +3191,8 @@
final WallpaperDestinationChangeHandler
liveSync = new WallpaperDestinationChangeHandler(
newWallpaper);
- boolean same = changingToSame(name, newWallpaper);
+ boolean same = changingToSame(name, newWallpaper.connection,
+ newWallpaper.wallpaperComponent);
/*
* If we have a shared system+lock wallpaper, and we reapply the same wallpaper
@@ -3257,14 +3280,15 @@
return name == null || name.equals(mDefaultWallpaperComponent);
}
- private boolean changingToSame(ComponentName componentName, WallpaperData wallpaper) {
- if (wallpaper.connection != null) {
- final ComponentName wallpaperName = wallpaper.wallpaperComponent;
- if (isDefaultComponent(componentName) && isDefaultComponent(wallpaperName)) {
+ private boolean changingToSame(ComponentName newComponentName,
+ WallpaperConnection currentConnection, ComponentName currentComponentName) {
+ if (currentConnection != null) {
+ if (isDefaultComponent(newComponentName) && isDefaultComponent(currentComponentName)) {
if (DEBUG) Slog.v(TAG, "changingToSame: still using default");
// Still using default wallpaper.
return true;
- } else if (wallpaperName != null && wallpaperName.equals(componentName)) {
+ } else if (currentComponentName != null && currentComponentName.equals(
+ newComponentName)) {
// Changing to same wallpaper.
if (DEBUG) Slog.v(TAG, "same wallpaper");
return true;
@@ -3279,7 +3303,8 @@
Slog.v(TAG, "bindWallpaperComponentLocked: componentName=" + componentName);
}
// Has the component changed?
- if (!force && changingToSame(componentName, wallpaper)) {
+ if (!force && changingToSame(componentName, wallpaper.connection,
+ wallpaper.wallpaperComponent)) {
try {
if (DEBUG_LIVE) {
Slog.v(TAG, "Changing to the same component, ignoring");
diff --git a/services/core/java/com/android/server/wm/ActivityClientController.java b/services/core/java/com/android/server/wm/ActivityClientController.java
index e27b2be..c1e859d 100644
--- a/services/core/java/com/android/server/wm/ActivityClientController.java
+++ b/services/core/java/com/android/server/wm/ActivityClientController.java
@@ -864,8 +864,9 @@
if (transition != null) {
if (changed) {
// Always set as scene transition because it expects to be a jump-cut.
- transition.setOverrideAnimation(TransitionInfo.AnimationOptions
- .makeSceneTransitionAnimOptions(), null, null);
+ transition.setOverrideAnimation(
+ TransitionInfo.AnimationOptions.makeSceneTransitionAnimOptions(), r,
+ null, null);
r.mTransitionController.requestStartTransition(transition,
null /*startTask */, null /* remoteTransition */,
null /* displayChange */);
@@ -910,8 +911,9 @@
&& under.returningOptions.getAnimationType()
== ANIM_SCENE_TRANSITION) {
// Pass along the scene-transition animation-type
- transition.setOverrideAnimation(TransitionInfo.AnimationOptions
- .makeSceneTransitionAnimOptions(), null, null);
+ transition.setOverrideAnimation(TransitionInfo
+ .AnimationOptions.makeSceneTransitionAnimOptions(), r,
+ null, null);
}
} else {
transition.abort();
@@ -1508,7 +1510,7 @@
r.mOverrideTaskTransition);
r.mTransitionController.setOverrideAnimation(
TransitionInfo.AnimationOptions.makeCustomAnimOptions(packageName,
- enterAnim, exitAnim, backgroundColor, r.mOverrideTaskTransition),
+ enterAnim, exitAnim, backgroundColor, r.mOverrideTaskTransition), r,
null /* startCallback */, null /* finishCallback */);
}
}
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 99747e0..f52a74f 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -2848,7 +2848,7 @@
final boolean hasImeSurface;
if (mStartingData != null) {
if (mStartingData.mWaitForSyncTransactionCommit
- || mTransitionController.isCollecting(this)) {
+ || mSyncState != SYNC_STATE_NONE) {
mStartingData.mRemoveAfterTransaction = AFTER_TRANSACTION_REMOVE_DIRECTLY;
mStartingData.mPrepareRemoveAnimation = prepareAnimation;
return;
@@ -5048,7 +5048,7 @@
// controller but don't clear the animation information from the options since they
// need to be sent to the animating activity.
mTransitionController.setOverrideAnimation(
- AnimationOptions.makeSceneTransitionAnimOptions(), null, null);
+ AnimationOptions.makeSceneTransitionAnimOptions(), this, null, null);
return;
}
applyOptionsAnimation(mPendingOptions, intent);
@@ -5171,7 +5171,8 @@
}
if (options != null) {
- mTransitionController.setOverrideAnimation(options, startCallback, finishCallback);
+ mTransitionController.setOverrideAnimation(options, this, startCallback,
+ finishCallback);
}
}
@@ -6079,9 +6080,10 @@
return false;
}
- // Check if the activity is on a sleeping display, canTurnScreenOn will also check
- // keyguard visibility
- if (mDisplayContent.isSleeping()) {
+ // Check if the activity is on a sleeping display and keyguard is not going away (to
+ // align with TaskFragment#shouldSleepActivities), canTurnScreenOn will also check keyguard
+ // visibility
+ if (mDisplayContent.isSleeping() && !mDisplayContent.isKeyguardGoingAway()) {
return canTurnScreenOn();
} else {
return mTaskSupervisor.getKeyguardController().checkKeyguardVisibility(this);
@@ -8149,7 +8151,8 @@
*/
@Override
protected int getOverrideOrientation() {
- if (mWmService.mConstants.mIgnoreActivityOrientationRequest) {
+ if (mWmService.mConstants.mIgnoreActivityOrientationRequest
+ && info.applicationInfo.category != ApplicationInfo.CATEGORY_GAME) {
return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
return mAppCompatController.getOrientationPolicy()
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java b/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java
index b8ce02ed..3d6b64b 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java
@@ -130,35 +130,6 @@
}
/**
- * Sleep tokens cause the activity manager to put the top activity to sleep.
- * They are used by components such as dreams that may hide and block interaction
- * with underlying activities.
- * The Acquirer provides an interface that encapsulates the underlying work, so the user does
- * not need to handle the token by him/herself.
- */
- public interface SleepTokenAcquirer {
-
- /**
- * Acquires a sleep token.
- * @param displayId The display to apply to.
- */
- void acquire(int displayId);
-
- /**
- * Releases the sleep token.
- * @param displayId The display to apply to.
- */
- void release(int displayId);
- }
-
- /**
- * Creates a sleep token acquirer for the specified display with the specified tag.
- *
- * @param tag A string identifying the purpose (eg. "Dream").
- */
- public abstract SleepTokenAcquirer createSleepTokenAcquirer(@NonNull String tag);
-
- /**
* Returns home activity for the specified user.
*
* @param userId ID of the user or {@link android.os.UserHandle#USER_ALL}
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index e25d940d..49ca698 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -4356,6 +4356,7 @@
mTaskOrganizerController.dump(pw, " ");
mVisibleActivityProcessTracker.dump(pw, " ");
mActiveUids.dump(pw, " ");
+ pw.println(" SleepTokens=" + mRootWindowContainer.mSleepTokens);
if (mDemoteTopAppReasons != 0) {
pw.println(" mDemoteTopAppReasons=" + mDemoteTopAppReasons);
}
@@ -5071,17 +5072,16 @@
EventLogTags.writeWmSetResumedActivity(r.mUserId, r.shortComponentName, reason);
}
- final class SleepTokenAcquirerImpl implements ActivityTaskManagerInternal.SleepTokenAcquirer {
+ final class SleepTokenAcquirer {
private final String mTag;
private final SparseArray<RootWindowContainer.SleepToken> mSleepTokens =
new SparseArray<>();
- SleepTokenAcquirerImpl(@NonNull String tag) {
+ SleepTokenAcquirer(@NonNull String tag) {
mTag = tag;
}
- @Override
- public void acquire(int displayId) {
+ void acquire(int displayId) {
synchronized (mGlobalLock) {
if (!mSleepTokens.contains(displayId)) {
mSleepTokens.append(displayId,
@@ -5091,8 +5091,7 @@
}
}
- @Override
- public void release(int displayId) {
+ void release(int displayId) {
synchronized (mGlobalLock) {
final RootWindowContainer.SleepToken token = mSleepTokens.get(displayId);
if (token != null) {
@@ -5955,11 +5954,6 @@
}
final class LocalService extends ActivityTaskManagerInternal {
- @Override
- public SleepTokenAcquirer createSleepTokenAcquirer(@NonNull String tag) {
- Objects.requireNonNull(tag);
- return new SleepTokenAcquirerImpl(tag);
- }
@Override
public ComponentName getHomeActivityForUser(int userId) {
diff --git a/services/core/java/com/android/server/wm/AppCompatAspectRatioPolicy.java b/services/core/java/com/android/server/wm/AppCompatAspectRatioPolicy.java
index b23e75a..51ef87d 100644
--- a/services/core/java/com/android/server/wm/AppCompatAspectRatioPolicy.java
+++ b/services/core/java/com/android/server/wm/AppCompatAspectRatioPolicy.java
@@ -122,9 +122,12 @@
if (aspectRatioOverrides.shouldApplyUserMinAspectRatioOverride()) {
return aspectRatioOverrides.getUserMinAspectRatio();
}
+ final DisplayContent displayContent = mActivityRecord.getDisplayContent();
+ final boolean shouldOverrideMinAspectRatioForCamera = displayContent != null
+ && displayContent.mAppCompatCameraPolicy.shouldOverrideMinAspectRatioForCamera(
+ mActivityRecord);
if (!aspectRatioOverrides.shouldOverrideMinAspectRatio()
- && !mAppCompatOverrides.getAppCompatCameraOverrides()
- .shouldOverrideMinAspectRatioForCamera()) {
+ && !shouldOverrideMinAspectRatioForCamera) {
return info.getMinAspectRatio();
}
diff --git a/services/core/java/com/android/server/wm/AppCompatCameraOverrides.java b/services/core/java/com/android/server/wm/AppCompatCameraOverrides.java
index d8abf69..241390c1 100644
--- a/services/core/java/com/android/server/wm/AppCompatCameraOverrides.java
+++ b/services/core/java/com/android/server/wm/AppCompatCameraOverrides.java
@@ -85,9 +85,10 @@
}
/**
- * Whether we should apply the min aspect ratio per-app override only when an app is connected
- * to the camera.
- * When this override is applied the min aspect ratio given in the app's manifest will be
+ * Whether applying the min aspect ratio per-app override only when an app is connected
+ * to the camera is allowed.
+ *
+ * <p>When this override is applied the min aspect ratio given in the app's manifest will be
* overridden to the largest enabled aspect ratio treatment unless the app's manifest value
* is higher. The treatment will also apply if no value is provided in the manifest.
*
@@ -97,9 +98,8 @@
* <li>Per-app override is enabled
* </ul>
*/
- boolean shouldOverrideMinAspectRatioForCamera() {
- return isCameraActive() && mAllowMinAspectRatioOverrideOptProp
- .shouldEnableWithOptInOverrideAndOptOutProperty(
+ boolean isOverrideMinAspectRatioForCameraEnabled() {
+ return mAllowMinAspectRatioOverrideOptProp.shouldEnableWithOptInOverrideAndOptOutProperty(
isChangeEnabled(mActivityRecord,
OVERRIDE_MIN_ASPECT_RATIO_ONLY_FOR_CAMERA));
}
@@ -174,24 +174,6 @@
OVERRIDE_CAMERA_COMPAT_DISABLE_FREEFORM_WINDOWING_TREATMENT);
}
- /**
- * @return {@code true} if the Camera is active for the current activity
- */
- boolean isCameraActive() {
- return mActivityRecord.mDisplayContent != null
- && mActivityRecord.mDisplayContent.mAppCompatCameraPolicy
- .isCameraActive(mActivityRecord, /* mustBeFullscreen */ true);
- }
-
- /**
- * @return {@code true} if the configuration needs to be recomputed after a camera state update.
- */
- boolean shouldRecomputeConfigurationForCameraCompat() {
- return isOverrideOrientationOnlyForCameraEnabled()
- || isCameraCompatSplitScreenAspectRatioAllowed()
- || shouldOverrideMinAspectRatioForCamera();
- }
-
boolean isOverrideOrientationOnlyForCameraEnabled() {
return isChangeEnabled(mActivityRecord, OVERRIDE_ORIENTATION_ONLY_FOR_CAMERA);
}
diff --git a/services/core/java/com/android/server/wm/AppCompatCameraPolicy.java b/services/core/java/com/android/server/wm/AppCompatCameraPolicy.java
index a42b879..67bfd76 100644
--- a/services/core/java/com/android/server/wm/AppCompatCameraPolicy.java
+++ b/services/core/java/com/android/server/wm/AppCompatCameraPolicy.java
@@ -166,6 +166,9 @@
: SCREEN_ORIENTATION_UNSPECIFIED;
}
+ /**
+ * @return {@code true} if the Camera is active for the provided {@link ActivityRecord}.
+ */
boolean isCameraActive(@NonNull ActivityRecord activity, boolean mustBeFullscreen) {
return mDisplayRotationCompatPolicy != null
&& mDisplayRotationCompatPolicy.isCameraActive(activity, mustBeFullscreen);
@@ -179,4 +182,13 @@
return null;
}
+ /**
+ * Whether we should apply the min aspect ratio per-app override only when an app is connected
+ * to the camera.
+ */
+ boolean shouldOverrideMinAspectRatioForCamera(@NonNull ActivityRecord activityRecord) {
+ return isCameraActive(activityRecord, /* mustBeFullscreen= */ true)
+ && activityRecord.mAppCompatController.getAppCompatCameraOverrides()
+ .isOverrideMinAspectRatioForCameraEnabled();
+ }
}
diff --git a/services/core/java/com/android/server/wm/AppCompatOrientationPolicy.java b/services/core/java/com/android/server/wm/AppCompatOrientationPolicy.java
index c5506de..7477c62 100644
--- a/services/core/java/com/android/server/wm/AppCompatOrientationPolicy.java
+++ b/services/core/java/com/android/server/wm/AppCompatOrientationPolicy.java
@@ -58,13 +58,16 @@
&& displayContent.getIgnoreOrientationRequest();
final boolean shouldApplyUserFullscreenOverride = mAppCompatOverrides
.getAppCompatAspectRatioOverrides().shouldApplyUserFullscreenOverride();
+ final boolean isCameraActive = displayContent != null
+ && displayContent.mAppCompatCameraPolicy.isCameraActive(mActivityRecord,
+ /* mustBeFullscreen */ true);
if (shouldApplyUserFullscreenOverride && isIgnoreOrientationRequestEnabled
// Do not override orientation to fullscreen for camera activities.
// Fixed-orientation activities are rarely tested in other orientations, and it
// often results in sideways or stretched previews. As the camera compat treatment
// targets fixed-orientation activities, overriding the orientation disables the
// treatment.
- && !mAppCompatOverrides.getAppCompatCameraOverrides().isCameraActive()) {
+ && !isCameraActive) {
Slog.v(TAG, "Requested orientation " + screenOrientationToString(candidate)
+ " for " + mActivityRecord + " is overridden to "
+ screenOrientationToString(SCREEN_ORIENTATION_USER)
@@ -110,7 +113,7 @@
// often results in sideways or stretched previews. As the camera compat treatment
// targets fixed-orientation activities, overriding the orientation disables the
// treatment.
- && !mAppCompatOverrides.getAppCompatCameraOverrides().isCameraActive()) {
+ && !isCameraActive) {
Slog.v(TAG, "Requested orientation " + screenOrientationToString(candidate)
+ " for " + mActivityRecord + " is overridden to "
+ screenOrientationToString(SCREEN_ORIENTATION_USER));
diff --git a/services/core/java/com/android/server/wm/BackNavigationController.java b/services/core/java/com/android/server/wm/BackNavigationController.java
index 4e4616d..dd86a14 100644
--- a/services/core/java/com/android/server/wm/BackNavigationController.java
+++ b/services/core/java/com/android/server/wm/BackNavigationController.java
@@ -1072,8 +1072,10 @@
return close.asWindowState() != null;
}
- private void initiate(@NonNull WindowContainer close, @NonNull WindowContainer[] open,
+ private void initiate(ScheduleAnimationBuilder builder,
@NonNull ActivityRecord[] openingActivities) {
+ WindowContainer close = builder.mCloseTarget;
+ WindowContainer[] open = builder.mOpenTargets;
if (isActivitySwitch(close, open)) {
mSwitchType = ACTIVITY_SWITCH;
if (Flags.migratePredictiveBackTransition()) {
@@ -1091,9 +1093,17 @@
return;
}
- mCloseAdaptor = createAdaptor(close, false, mSwitchType);
+ final Transition prepareTransition = builder.prepareTransitionIfNeeded(
+ openingActivities);
+ final SurfaceControl.Transaction st = openingActivities[0].getSyncTransaction();
+ final SurfaceControl.Transaction ct = prepareTransition != null
+ ? st : close.getPendingTransaction();
+ mCloseAdaptor = createAdaptor(close, false, mSwitchType, ct);
if (mCloseAdaptor.mAnimationTarget == null) {
Slog.w(TAG, "composeNewAnimations fail, skip");
+ if (prepareTransition != null) {
+ prepareTransition.abort();
+ }
clearBackAnimateTarget(true /* cancel */);
return;
}
@@ -1110,12 +1120,17 @@
next.getWindowConfiguration().getRotation());
}
}
- mOpenAnimAdaptor = new BackWindowAnimationAdaptorWrapper(true, mSwitchType, open);
+ mOpenAnimAdaptor = new BackWindowAnimationAdaptorWrapper(
+ true, mSwitchType, st, open);
if (!mOpenAnimAdaptor.isValid()) {
Slog.w(TAG, "compose animations fail, skip");
+ if (prepareTransition != null) {
+ prepareTransition.abort();
+ }
clearBackAnimateTarget(true /* cancel */);
return;
}
+ mOpenAnimAdaptor.mPreparedOpenTransition = prepareTransition;
mOpenActivities = openingActivities;
}
@@ -1147,19 +1162,21 @@
return new Pair<>(replaceClose, replaceOpen);
}
- private boolean composeAnimations(@NonNull WindowContainer close,
- @NonNull WindowContainer[] open, @NonNull ActivityRecord[] openingActivities) {
+ private boolean composeAnimations(@NonNull ScheduleAnimationBuilder builder,
+ @NonNull ActivityRecord[] openingActivities) {
if (mComposed || mWaitTransition) {
Slog.e(TAG, "Previous animation is running " + this);
return false;
}
clearBackAnimateTarget(true /* cancel */);
- if (close == null || open == null || open.length == 0 || open.length > 2) {
+ final WindowContainer[] open = builder.mOpenTargets;
+ if (builder.mCloseTarget == null || open == null || open.length == 0
+ || open.length > 2) {
Slog.e(TAG, "reset animation with null target close: "
- + close + " open: " + Arrays.toString(open));
+ + builder.mCloseTarget + " open: " + Arrays.toString(open));
return false;
}
- initiate(close, open, openingActivities);
+ initiate(builder, openingActivities);
if (mSwitchType == UNKNOWN) {
return false;
}
@@ -1384,10 +1401,10 @@
}
@NonNull private static BackWindowAnimationAdaptor createAdaptor(
- @NonNull WindowContainer target, boolean isOpen, int switchType) {
+ @NonNull WindowContainer target, boolean isOpen, int switchType,
+ SurfaceControl.Transaction st) {
final BackWindowAnimationAdaptor adaptor =
new BackWindowAnimationAdaptor(target, isOpen, switchType);
- final SurfaceControl.Transaction pt = target.getPendingTransaction();
// Workaround to show TaskFragment which can be hide in Transitions and won't show
// during isAnimating.
if (isOpen && target.asActivityRecord() != null) {
@@ -1395,10 +1412,10 @@
if (fragment != null) {
// Ensure task fragment surface has updated, in case configuration has changed.
fragment.updateOrganizedTaskFragmentSurface();
- pt.show(fragment.mSurfaceControl);
+ st.show(fragment.mSurfaceControl);
}
}
- target.startAnimation(pt, adaptor, false /* hidden */, ANIMATION_TYPE_PREDICT_BACK);
+ target.startAnimation(st, adaptor, false /* hidden */, ANIMATION_TYPE_PREDICT_BACK);
return adaptor;
}
@@ -1417,12 +1434,12 @@
private Transition mPreparedOpenTransition;
BackWindowAnimationAdaptorWrapper(boolean isOpen, int switchType,
- @NonNull WindowContainer... targets) {
+ SurfaceControl.Transaction st, @NonNull WindowContainer... targets) {
mAdaptors = new BackWindowAnimationAdaptor[targets.length];
for (int i = targets.length - 1; i >= 0; --i) {
- mAdaptors[i] = createAdaptor(targets[i], isOpen, switchType);
+ mAdaptors[i] = createAdaptor(targets[i], isOpen, switchType, st);
}
- mRemoteAnimationTarget = targets.length > 1 ? createWrapTarget()
+ mRemoteAnimationTarget = targets.length > 1 ? createWrapTarget(st)
: mAdaptors[0].mAnimationTarget;
}
@@ -1448,7 +1465,7 @@
mPreparedOpenTransition = null;
}
- private RemoteAnimationTarget createWrapTarget() {
+ private RemoteAnimationTarget createWrapTarget(SurfaceControl.Transaction st) {
// Special handle for opening two activities together.
// If we animate both activities separately, the animation area and rounded corner
// would also being handled separately. To make them seem like "open" together, wrap
@@ -1470,12 +1487,11 @@
.build();
mCloseTransaction = new SurfaceControl.Transaction();
mCloseTransaction.reparent(leashSurface, null);
- final SurfaceControl.Transaction pt = wc.getPendingTransaction();
- pt.setLayer(leashSurface, wc.getLastLayer());
+ st.setLayer(leashSurface, wc.getLastLayer());
for (int i = mAdaptors.length - 1; i >= 0; --i) {
BackWindowAnimationAdaptor adaptor = mAdaptors[i];
- pt.reparent(adaptor.mAnimationTarget.leash, leashSurface);
- pt.setPosition(adaptor.mAnimationTarget.leash,
+ st.reparent(adaptor.mAnimationTarget.leash, leashSurface);
+ st.setPosition(adaptor.mAnimationTarget.leash,
adaptor.mAnimationTarget.localBounds.left,
adaptor.mAnimationTarget.localBounds.top);
// For adjacent activity embedded, reparent Activity to TaskFragment when
@@ -1738,6 +1754,7 @@
WindowContainer mCloseTarget;
WindowContainer[] mOpenTargets;
boolean mIsLaunchBehind;
+ TaskSnapshot mSnapshot;
ScheduleAnimationBuilder(int type, BackAnimationAdapter adapter,
NavigationMonitor monitor) {
@@ -1771,6 +1788,13 @@
return wc == mCloseTarget || mCloseTarget.hasChild(wc) || wc.hasChild(mCloseTarget);
}
+ private Transition prepareTransitionIfNeeded(ActivityRecord[] visibleOpenActivities) {
+ if (mSnapshot == null) {
+ return setLaunchBehind(visibleOpenActivities);
+ }
+ return null;
+ }
+
/**
* Apply preview strategy on the opening target
*
@@ -1780,26 +1804,17 @@
private void applyPreviewStrategy(
@NonNull BackWindowAnimationAdaptorWrapper openAnimationAdaptor,
@NonNull ActivityRecord[] visibleOpenActivities) {
- boolean needsLaunchBehind = true;
if (isSupportWindowlessSurface() && mShowWindowlessSurface && !mIsLaunchBehind) {
boolean activitiesAreDrawn = false;
for (int i = visibleOpenActivities.length - 1; i >= 0; --i) {
// If the activity hasn't stopped, it's window should remain drawn.
activitiesAreDrawn |= visibleOpenActivities[i].firstWindowDrawn;
}
- final WindowContainer mainOpen = openAnimationAdaptor.mAdaptors[0].mTarget;
- final TaskSnapshot snapshot = getSnapshot(mainOpen, visibleOpenActivities);
// Don't create starting surface if previous activities haven't stopped or
// the snapshot does not exist.
- if (snapshot != null || !activitiesAreDrawn) {
- openAnimationAdaptor.createStartingSurface(snapshot);
+ if (mSnapshot != null || !activitiesAreDrawn) {
+ openAnimationAdaptor.createStartingSurface(mSnapshot);
}
- // Only use LaunchBehind if snapshot does not exist.
- needsLaunchBehind = snapshot == null;
- }
- if (needsLaunchBehind) {
- openAnimationAdaptor.mPreparedOpenTransition =
- setLaunchBehind(visibleOpenActivities);
}
// Force update mLastSurfaceShowing for opening activity and its task.
if (mWindowManagerService.mRoot.mTransitionController.isShellTransitionsEnabled()) {
@@ -1821,7 +1836,11 @@
return null;
}
- if (!composeAnimations(mCloseTarget, mOpenTargets, openingActivities)) {
+ if (!shouldLaunchBehind && mShowWindowlessSurface) {
+ mSnapshot = getSnapshot(mOpenTargets[0], openingActivities);
+ }
+
+ if (!composeAnimations(this, openingActivities)) {
return null;
}
mCloseTarget.mTransitionController.mSnapshotController
@@ -1983,6 +2002,7 @@
final Transition prepareOpen = migrateBackTransition && !tc.isCollecting()
? tc.createTransition(TRANSIT_PREPARE_BACK_NAVIGATION) : null;
+ DisplayContent commonDisplay = null;
for (int i = affects.size() - 1; i >= 0; --i) {
final ActivityRecord activity = affects.get(i);
if (!migrateBackTransition && !activity.isVisibleRequested()) {
@@ -2005,13 +2025,15 @@
activity.mTaskSupervisor.mStoppingActivities.remove(activity);
if (!migrateBackTransition) {
- activity.getDisplayContent().ensureActivitiesVisible(null /* starting */,
- true /* notifyClients */);
+ commonDisplay = activity.getDisplayContent();
} else if (activity.shouldBeVisible()) {
activity.ensureActivityConfiguration(true /* ignoreVisibility */);
activity.makeVisibleIfNeeded(null /* starting */, true /* notifyToClient */);
}
}
+ if (commonDisplay != null) {
+ commonDisplay.ensureActivitiesVisible(null /* starting */, true /* notifyClients */);
+ }
if (prepareOpen != null) {
if (prepareOpen.hasChanges()) {
tc.requestStartTransition(prepareOpen,
diff --git a/services/core/java/com/android/server/wm/DesktopAppCompatAspectRatioPolicy.java b/services/core/java/com/android/server/wm/DesktopAppCompatAspectRatioPolicy.java
index ff1742b..1924691 100644
--- a/services/core/java/com/android/server/wm/DesktopAppCompatAspectRatioPolicy.java
+++ b/services/core/java/com/android/server/wm/DesktopAppCompatAspectRatioPolicy.java
@@ -198,9 +198,11 @@
return aspectRatioOverrides.getUserMinAspectRatio();
}
+ final DisplayContent dc = task.mDisplayContent;
+ final boolean shouldOverrideMinAspectRatioForCamera = dc != null
+ && dc.mAppCompatCameraPolicy.shouldOverrideMinAspectRatioForCamera(mActivityRecord);
if (!aspectRatioOverrides.shouldOverrideMinAspectRatio()
- && !mAppCompatOverrides.getAppCompatCameraOverrides()
- .shouldOverrideMinAspectRatioForCamera()) {
+ && !shouldOverrideMinAspectRatioForCamera) {
return info.getMinAspectRatio();
}
diff --git a/services/core/java/com/android/server/wm/Dimmer.java b/services/core/java/com/android/server/wm/Dimmer.java
index 2d1eb41..c5643ea 100644
--- a/services/core/java/com/android/server/wm/Dimmer.java
+++ b/services/core/java/com/android/server/wm/Dimmer.java
@@ -55,7 +55,7 @@
SurfaceControl mDimSurface;
final WindowContainer<?> mHostContainer;
// The last container to request to dim
- private WindowContainer<?> mLastRequestedDimContainer;
+ private WindowState mLastDimmingWindow;
/** Animation */
private final DimmerAnimationHelper mAnimationHelper;
boolean mSkipAnimation = false;
@@ -129,8 +129,8 @@
* Set the parameters to prepare the dim to be relative parented to the dimming container
*/
void prepareReparent(@NonNull WindowContainer<?> geometryParent,
- @NonNull WindowContainer<?> relativeParent, int relativeLayer) {
- mAnimationHelper.setRequestedRelativeParent(relativeParent, relativeLayer);
+ @NonNull WindowState relativeParent) {
+ mAnimationHelper.setRequestedRelativeParent(relativeParent);
mAnimationHelper.setRequestedGeometryParent(geometryParent);
}
@@ -146,7 +146,7 @@
* Whether anyone is currently requesting the dim
*/
boolean isDimming() {
- return mLastRequestedDimContainer != null
+ return mLastDimmingWindow != null
&& (mHostContainer.isVisibleRequested() || !Flags.useTasksDimOnly());
}
@@ -186,7 +186,7 @@
*/
void resetDimStates() {
if (mDimState != null) {
- mDimState.mLastRequestedDimContainer = null;
+ mDimState.mLastDimmingWindow = null;
}
}
@@ -200,7 +200,7 @@
* @param alpha Dim amount
* @param blurRadius Blur amount
*/
- protected void adjustAppearance(@NonNull WindowContainer<?> dimmingContainer,
+ protected void adjustAppearance(@NonNull WindowState dimmingContainer,
float alpha, int blurRadius) {
final DimState d = obtainDimState(dimmingContainer);
d.prepareLookChange(alpha, blurRadius);
@@ -218,14 +218,13 @@
* continue dimming. Indeed, this method won't be able to keep dimming or get a new DimState
* without also adjusting the appearance.
* @param geometryParent The container that defines the geometry of the dim
- * @param dimmingContainer The container which to dim above. Should be a child of the host.
- * @param relativeLayer The position of the dim wrt the container
+ * @param dimmingContainer The container that is dimming. The dim layer will be rel-z
+ * parented below it
*/
public void adjustPosition(@NonNull WindowContainer<?> geometryParent,
- @NonNull WindowContainer<?> dimmingContainer,
- int relativeLayer) {
+ @NonNull WindowState dimmingContainer) {
if (mDimState != null) {
- mDimState.prepareReparent(geometryParent, dimmingContainer, relativeLayer);
+ mDimState.prepareReparent(geometryParent, dimmingContainer);
}
}
@@ -250,9 +249,9 @@
if (!Flags.useTasksDimOnly()) {
mDimState.adjustSurfaceLayout(t);
}
- final WindowState ws = mDimState.mLastRequestedDimContainer.asWindowState();
- if (!mDimState.mIsVisible && ws != null && ws.mActivityRecord != null
- && ws.mActivityRecord.mStartingData != null) {
+ if (!mDimState.mIsVisible && mDimState.mLastDimmingWindow != null
+ && mDimState.mLastDimmingWindow.mActivityRecord != null
+ && mDimState.mLastDimmingWindow.mActivityRecord.mStartingData != null) {
// Skip enter animation while starting window is on top of its activity
mDimState.mSkipAnimation = true;
}
@@ -262,11 +261,11 @@
}
@NonNull
- private DimState obtainDimState(@NonNull WindowContainer<?> container) {
+ private DimState obtainDimState(@NonNull WindowState window) {
if (mDimState == null) {
mDimState = new DimState();
}
- mDimState.mLastRequestedDimContainer = container;
+ mDimState.mLastDimmingWindow = window;
return mDimState;
}
diff --git a/services/core/java/com/android/server/wm/DimmerAnimationHelper.java b/services/core/java/com/android/server/wm/DimmerAnimationHelper.java
index 4abf806..faf6dc6 100644
--- a/services/core/java/com/android/server/wm/DimmerAnimationHelper.java
+++ b/services/core/java/com/android/server/wm/DimmerAnimationHelper.java
@@ -48,9 +48,8 @@
static class Change {
private float mAlpha = -1f;
private int mBlurRadius = -1;
- private WindowContainer<?> mDimmingContainer = null;
+ private WindowState mDimmingContainer = null;
private WindowContainer<?> mGeometryParent = null;
- private int mRelativeLayer = -1;
private static final float EPSILON = 0.0001f;
Change() {}
@@ -64,7 +63,6 @@
mBlurRadius = other.mBlurRadius;
mDimmingContainer = other.mDimmingContainer;
mGeometryParent = other.mGeometryParent;
- mRelativeLayer = other.mRelativeLayer;
}
// Same alpha and blur
@@ -84,7 +82,7 @@
@Override
public String toString() {
return "Dim state: alpha=" + mAlpha + ", blur=" + mBlurRadius + ", container="
- + mDimmingContainer + ", relativePosition=" + mRelativeLayer;
+ + mDimmingContainer + ", geometryParent " + mGeometryParent;
}
}
@@ -100,14 +98,13 @@
}
void setExitParameters() {
- setRequestedRelativeParent(mRequestedProperties.mDimmingContainer, -1 /* relativeLayer */);
+ setRequestedRelativeParent(mRequestedProperties.mDimmingContainer);
setRequestedAppearance(0f /* alpha */, 0 /* blur */);
}
// Sets a requested change without applying it immediately
- void setRequestedRelativeParent(@NonNull WindowContainer<?> relativeParent, int relativeLayer) {
+ void setRequestedRelativeParent(@NonNull WindowState relativeParent) {
mRequestedProperties.mDimmingContainer = relativeParent;
- mRequestedProperties.mRelativeLayer = relativeLayer;
}
// Sets the requested layer to reparent the dim to without applying it immediately
@@ -124,7 +121,7 @@
/**
* Commit the last changes we received. Called after
* {@link Change#setExitParameters()},
- * {@link Change#setRequestedRelativeParent(WindowContainer, int)}, or
+ * {@link Change#setRequestedRelativeParent(WindowContainer)}, or
* {@link Change#setRequestedAppearance(float, int)}
*/
void applyChanges(@NonNull SurfaceControl.Transaction t, @NonNull Dimmer.DimState dim) {
@@ -147,8 +144,8 @@
reparent(dim.mDimSurface,
startProperties.mGeometryParent != mRequestedProperties.mGeometryParent
? mRequestedProperties.mGeometryParent.getSurfaceControl() : null,
- mRequestedProperties.mDimmingContainer.getSurfaceControl(),
- mRequestedProperties.mRelativeLayer, t);
+ mRequestedProperties.mDimmingContainer != startProperties.mDimmingContainer
+ ? mRequestedProperties.mDimmingContainer.getSurfaceControl() : null, t);
if (!startProperties.hasSameVisualProperties(mRequestedProperties)) {
stopCurrentAnimation(dim.mDimSurface);
@@ -187,9 +184,11 @@
mLocalAnimationAdapter.startAnimation(dim.mDimSurface, t,
ANIMATION_TYPE_DIMMER, /* finishCallback */ (type, animator) -> {
synchronized (dim.mHostContainer.mWmService.mGlobalLock) {
- setCurrentAlphaBlur(dim.mDimSurface, t);
+ SurfaceControl.Transaction finishTransaction =
+ dim.mHostContainer.getSyncTransaction();
+ setCurrentAlphaBlur(dim.mDimSurface, finishTransaction);
if (targetAlpha == 0f && !dim.isDimming()) {
- dim.remove(t);
+ dim.remove(finishTransaction);
}
mLocalAnimationAdapter = null;
mAlphaAnimationSpec = null;
@@ -232,14 +231,15 @@
*/
static void reparent(@NonNull SurfaceControl dimLayer,
@Nullable SurfaceControl newGeometryParent,
- @NonNull SurfaceControl relativeParent,
- int relativePosition,
+ @Nullable SurfaceControl newRelativeParent,
@NonNull SurfaceControl.Transaction t) {
try {
if (newGeometryParent != null) {
t.reparent(dimLayer, newGeometryParent);
}
- t.setRelativeLayer(dimLayer, relativeParent, relativePosition);
+ if (newRelativeParent != null) {
+ t.setRelativeLayer(dimLayer, newRelativeParent, -1);
+ }
} catch (NullPointerException e) {
Log.w(TAG, "Tried to change parent of dim " + dimLayer + " after remove", e);
}
@@ -256,10 +256,13 @@
private static long getDimDuration(@NonNull WindowContainer<?> container) {
// Use the same duration as the animation on the WindowContainer
- AnimationAdapter animationAdapter = container.mSurfaceAnimator.getAnimation();
- final float durationScale = container.mWmService.getTransitionAnimationScaleLocked();
- return animationAdapter == null ? (long) (DEFAULT_DIM_ANIM_DURATION_MS * durationScale)
- : animationAdapter.getDurationHint();
+ if (container.mSurfaceAnimator != null) {
+ AnimationAdapter animationAdapter = container.mSurfaceAnimator.getAnimation();
+ final float durationScale = container.mWmService.getTransitionAnimationScaleLocked();
+ return animationAdapter == null ? (long) (DEFAULT_DIM_ANIM_DURATION_MS * durationScale)
+ : animationAdapter.getDurationHint();
+ }
+ return 0;
}
/**
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index e8a3951..10e0641 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -735,8 +735,6 @@
/** All tokens used to put activities on this root task to sleep (including mOffToken) */
final ArrayList<RootWindowContainer.SleepToken> mAllSleepTokens = new ArrayList<>();
- /** The token acquirer to put root tasks on the display to sleep */
- private final ActivityTaskManagerInternal.SleepTokenAcquirer mOffTokenAcquirer;
private boolean mSleeping;
@@ -1131,7 +1129,6 @@
mDisplay = display;
mDisplayId = display.getDisplayId();
mCurrentUniqueDisplayId = display.getUniqueId();
- mOffTokenAcquirer = mRootWindowContainer.mDisplayOffTokenAcquirer;
mWallpaperController = new WallpaperController(mWmService, this);
mWallpaperController.resetLargestDisplay(display);
display.getDisplayInfo(mDisplayInfo);
@@ -6157,9 +6154,9 @@
final int displayState = mDisplayInfo.state;
if (displayId != DEFAULT_DISPLAY) {
if (displayState == Display.STATE_OFF) {
- mOffTokenAcquirer.acquire(mDisplayId);
+ mRootWindowContainer.mDisplayOffTokenAcquirer.acquire(mDisplayId);
} else if (displayState == Display.STATE_ON) {
- mOffTokenAcquirer.release(mDisplayId);
+ mRootWindowContainer.mDisplayOffTokenAcquirer.release(mDisplayId);
}
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
"Content Recording: Display %d state was (%d), is now (%d), so update "
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 5c62120..0fa1a21 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -804,6 +804,14 @@
mAwake /* waiting */);
if (!awake) {
onDisplaySwitchFinished();
+ // In case PhoneWindowManager's startedGoingToSleep is called after screenTurnedOff
+ // (the source caller is in order but the methods run on different threads) and
+ // updateScreenOffSleepToken was skipped by mIsGoingToSleepDefaultDisplay. Then
+ // acquire sleep token if screen is off.
+ if (!mScreenOnEarly && !mScreenOnFully && !mDisplayContent.isSleeping()) {
+ Slog.w(TAG, "Late acquire sleep token for " + mDisplayContent);
+ mService.mRoot.mDisplayOffTokenAcquirer.acquire(mDisplayContent.mDisplayId);
+ }
}
}
}
@@ -851,6 +859,7 @@
public void screenTurningOn(ScreenOnListener screenOnListener) {
WindowProcessController visibleDozeUiProcess = null;
synchronized (mLock) {
+ mService.mRoot.mDisplayOffTokenAcquirer.release(mDisplayContent.mDisplayId);
mScreenOnEarly = true;
mScreenOnFully = false;
mKeyguardDrawComplete = false;
@@ -875,8 +884,12 @@
onDisplaySwitchFinished();
}
- public void screenTurnedOff() {
+ /** It is called after {@link #screenTurningOn}. This runs on PowerManager's thread. */
+ public void screenTurnedOff(boolean acquireSleepToken) {
synchronized (mLock) {
+ if (acquireSleepToken) {
+ mService.mRoot.mDisplayOffTokenAcquirer.acquire(mDisplayContent.mDisplayId);
+ }
mScreenOnEarly = false;
mScreenOnFully = false;
mKeyguardDrawComplete = false;
@@ -2504,7 +2517,7 @@
if (getStatusBar() != null) {
final StatusBarManagerInternal statusBar = getStatusBarManagerInternal();
if (statusBar != null) {
- statusBar.setTopAppHidesStatusBar(topAppHidesStatusBar);
+ statusBar.setTopAppHidesStatusBar(getDisplayId(), topAppHidesStatusBar);
}
}
@@ -2531,9 +2544,9 @@
mService.mPolicy.isUserSetupComplete(),
isNavBarEmpty(disableFlags));
} else {
- // TODO (b/277290737): Move this to the client side, instead of using a proxy.
- callStatusBarSafely(statusBar -> statusBar.immersiveModeChanged(rootDisplayAreaId,
- isImmersiveMode));
+ // TODO(b/277290737): Move this to the client side, instead of using a proxy.
+ callStatusBarSafely(statusBar -> statusBar.immersiveModeChanged(getDisplayId(),
+ rootDisplayAreaId, isImmersiveMode));
}
}
diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java
index 5200e82..8c06cfe 100644
--- a/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/services/core/java/com/android/server/wm/DisplayRotation.java
@@ -81,7 +81,6 @@
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.ProtoLog;
-import com.android.server.LocalServices;
import com.android.server.UiThread;
import com.android.server.policy.WindowManagerPolicy;
import com.android.server.statusbar.StatusBarManagerInternal;
@@ -136,7 +135,6 @@
private final RotationLockHistory mRotationLockHistory = new RotationLockHistory();
private OrientationListener mOrientationListener;
- private StatusBarManagerInternal mStatusBarManagerInternal;
private SettingsObserver mSettingsObserver;
@NonNull
private final DeviceStateController mDeviceStateController;
@@ -1559,11 +1557,9 @@
/** Notify the StatusBar that system rotation suggestion has changed. */
private void sendProposedRotationChangeToStatusBarInternal(int rotation, boolean isValid) {
- if (mStatusBarManagerInternal == null) {
- mStatusBarManagerInternal = LocalServices.getService(StatusBarManagerInternal.class);
- }
- if (mStatusBarManagerInternal != null) {
- mStatusBarManagerInternal.onProposedRotationChanged(rotation, isValid);
+ final StatusBarManagerInternal bar = mDisplayPolicy.getStatusBarManagerInternal();
+ if (bar != null) {
+ bar.onProposedRotationChanged(mDisplayContent.getDisplayId(), rotation, isValid);
}
}
diff --git a/services/core/java/com/android/server/wm/DisplayRotationCompatPolicy.java b/services/core/java/com/android/server/wm/DisplayRotationCompatPolicy.java
index 27d9767..efc3843 100644
--- a/services/core/java/com/android/server/wm/DisplayRotationCompatPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayRotationCompatPolicy.java
@@ -408,9 +408,26 @@
private void recomputeConfigurationForCameraCompatIfNeeded(
@NonNull ActivityRecord activityRecord) {
- if (activityRecord.mAppCompatController.getAppCompatCameraOverrides()
- .shouldRecomputeConfigurationForCameraCompat()) {
+ if (shouldRecomputeConfigurationForCameraCompat(activityRecord)) {
activityRecord.recomputeConfiguration();
}
}
+
+ /**
+ * @return {@code true} if the configuration needs to be recomputed after a camera state update.
+ */
+ private boolean shouldRecomputeConfigurationForCameraCompat(
+ @NonNull ActivityRecord activityRecord) {
+ final AppCompatCameraOverrides overrides = activityRecord.mAppCompatController
+ .getAppCompatCameraOverrides();
+ return overrides.isOverrideOrientationOnlyForCameraEnabled()
+ || overrides.isCameraCompatSplitScreenAspectRatioAllowed()
+ || shouldOverrideMinAspectRatio(activityRecord);
+ }
+
+ private boolean shouldOverrideMinAspectRatio(@NonNull ActivityRecord activityRecord) {
+ return activityRecord.mAppCompatController.getAppCompatCameraOverrides()
+ .isOverrideMinAspectRatioForCameraEnabled()
+ && isCameraActive(activityRecord, /* mustBeFullscreen= */ true);
+ }
}
diff --git a/services/core/java/com/android/server/wm/InsetsStateController.java b/services/core/java/com/android/server/wm/InsetsStateController.java
index 0daddc0..481ecd3 100644
--- a/services/core/java/com/android/server/wm/InsetsStateController.java
+++ b/services/core/java/com/android/server/wm/InsetsStateController.java
@@ -380,7 +380,6 @@
if (android.view.inputmethod.Flags.refactorInsetsController()) {
notifyInsetsChanged();
mDisplayContent.updateSystemGestureExclusion();
- mDisplayContent.updateKeepClearAreas();
mDisplayContent.getDisplayPolicy().updateSystemBarAttributes();
}
}
diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java
index 5d8a96c..0c489d6 100644
--- a/services/core/java/com/android/server/wm/KeyguardController.java
+++ b/services/core/java/com/android/server/wm/KeyguardController.java
@@ -87,7 +87,7 @@
private final SparseArray<KeyguardDisplayState> mDisplayStates = new SparseArray<>();
private final ActivityTaskManagerService mService;
private RootWindowContainer mRootWindowContainer;
- private final ActivityTaskManagerInternal.SleepTokenAcquirer mSleepTokenAcquirer;
+ private final ActivityTaskManagerService.SleepTokenAcquirer mSleepTokenAcquirer;
private boolean mWaitingForWakeTransition;
private Transition.ReadyCondition mWaitAodHide = null;
@@ -95,7 +95,7 @@
ActivityTaskSupervisor taskSupervisor) {
mService = service;
mTaskSupervisor = taskSupervisor;
- mSleepTokenAcquirer = mService.new SleepTokenAcquirerImpl(KEYGUARD_SLEEP_TOKEN_TAG);
+ mSleepTokenAcquirer = mService.new SleepTokenAcquirer(KEYGUARD_SLEEP_TOKEN_TAG);
}
void setWindowManager(WindowManagerService windowManager) {
@@ -658,10 +658,10 @@
private boolean mRequestDismissKeyguard;
private final ActivityTaskManagerService mService;
- private final ActivityTaskManagerInternal.SleepTokenAcquirer mSleepTokenAcquirer;
+ private final ActivityTaskManagerService.SleepTokenAcquirer mSleepTokenAcquirer;
KeyguardDisplayState(ActivityTaskManagerService service, int displayId,
- ActivityTaskManagerInternal.SleepTokenAcquirer acquirer) {
+ ActivityTaskManagerService.SleepTokenAcquirer acquirer) {
mService = service;
mDisplayId = displayId;
mSleepTokenAcquirer = acquirer;
diff --git a/services/core/java/com/android/server/wm/LockTaskController.java b/services/core/java/com/android/server/wm/LockTaskController.java
index 0dadade..e65396e 100644
--- a/services/core/java/com/android/server/wm/LockTaskController.java
+++ b/services/core/java/com/android/server/wm/LockTaskController.java
@@ -659,7 +659,7 @@
StatusBarManagerInternal statusBarManager = LocalServices.getService(
StatusBarManagerInternal.class);
if (statusBarManager != null) {
- statusBarManager.showScreenPinningRequest(task.mTaskId);
+ statusBarManager.showScreenPinningRequest(task.mTaskId, task.mUserId);
}
return;
} else if (mLockTaskModeState == LOCK_TASK_MODE_PINNED) {
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 866dcd5..8f5612c 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -215,7 +215,7 @@
private static final String DISPLAY_OFF_SLEEP_TOKEN_TAG = "Display-off";
/** The token acquirer to put root tasks on the displays to sleep */
- final ActivityTaskManagerInternal.SleepTokenAcquirer mDisplayOffTokenAcquirer;
+ final ActivityTaskManagerService.SleepTokenAcquirer mDisplayOffTokenAcquirer;
/**
* The modes which affect which tasks are returned when calling
@@ -450,7 +450,7 @@
mService = service.mAtmService;
mTaskSupervisor = mService.mTaskSupervisor;
mTaskSupervisor.mRootWindowContainer = this;
- mDisplayOffTokenAcquirer = mService.new SleepTokenAcquirerImpl(DISPLAY_OFF_SLEEP_TOKEN_TAG);
+ mDisplayOffTokenAcquirer = mService.new SleepTokenAcquirer(DISPLAY_OFF_SLEEP_TOKEN_TAG);
mDeviceStateController = new DeviceStateController(service.mContext, service.mGlobalLock);
mDisplayRotationCoordinator = new DisplayRotationCoordinator();
}
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 6f91041..3490b3e 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -3192,13 +3192,6 @@
return "Task=" + mTaskId;
}
- WindowContainer<?> getDimmerParent() {
- if (!inMultiWindowMode() && isTranslucentForTransition()) {
- return getRootDisplayArea();
- }
- return this;
- }
-
@Deprecated
@Override
Dimmer getDimmer() {
@@ -3222,6 +3215,13 @@
return mDimmer;
}
+ boolean isSuitableForDimming() {
+ // If the window is in multi-window mode, we want to dim at the Task level to ensure the dim
+ // bounds match the area the app lives in.
+ // If translucent, we will move the dim to the display area
+ return inMultiWindowMode() || !isTranslucentAndVisible();
+ }
+
@Override
void prepareSurfaces() {
mDimmer.resetDimStates();
diff --git a/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java b/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
index 5aa34d2..92953e5 100644
--- a/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
+++ b/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
@@ -17,6 +17,8 @@
package com.android.server.wm;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
+import static android.window.TaskFragmentOrganizer.KEY_RESTORE_TASK_FRAGMENTS_INFO;
+import static android.window.TaskFragmentOrganizer.KEY_RESTORE_TASK_FRAGMENT_PARENT_INFO;
import static android.window.TaskFragmentOrganizer.putErrorInfoInBundle;
import static android.window.TaskFragmentTransaction.TYPE_ACTIVITY_REPARENTED_TO_TASK;
import static android.window.TaskFragmentTransaction.TYPE_TASK_FRAGMENT_APPEARED;
@@ -206,7 +208,13 @@
mOrganizerPid = pid;
mAppThread = getAppThread(pid, mOrganizerUid);
for (int i = mOrganizedTaskFragments.size() - 1; i >= 0; i--) {
- mOrganizedTaskFragments.get(i).onTaskFragmentOrganizerRestarted(organizer);
+ final TaskFragment taskFragment = mOrganizedTaskFragments.get(i);
+ if (taskFragment.isAttached()
+ && taskFragment.getTopNonFinishingActivity() != null) {
+ taskFragment.onTaskFragmentOrganizerRestarted(organizer);
+ } else {
+ mOrganizedTaskFragments.remove(taskFragment);
+ }
}
try {
mOrganizer.asBinder().linkToDeath(this, 0 /*flags*/);
@@ -575,8 +583,29 @@
}
mCachedTaskFragmentOrganizerStates.remove(cachedState);
- outSavedState.putAll(cachedState.mSavedState);
cachedState.restore(organizer, pid);
+ outSavedState.putAll(cachedState.mSavedState);
+
+ // Collect the organized TfInfo and TfParentInfo in the system.
+ final ArrayList<TaskFragmentInfo> infos = new ArrayList<>();
+ final ArrayMap<Integer, Task> tasks = new ArrayMap<>();
+ final int fragmentCount = cachedState.mOrganizedTaskFragments.size();
+ for (int j = 0; j < fragmentCount; j++) {
+ final TaskFragment tf = cachedState.mOrganizedTaskFragments.get(j);
+ infos.add(tf.getTaskFragmentInfo());
+ if (!tasks.containsKey(tf.getTask().mTaskId)) {
+ tasks.put(tf.getTask().mTaskId, tf.getTask());
+ }
+ }
+ outSavedState.putParcelableArrayList(KEY_RESTORE_TASK_FRAGMENTS_INFO, infos);
+
+ final ArrayList<TaskFragmentParentInfo> parentInfos = new ArrayList<>();
+ for (int j = tasks.size() - 1; j >= 0; j--) {
+ parentInfos.add(tasks.valueAt(j).getTaskFragmentParentInfo());
+ }
+ outSavedState.putParcelableArrayList(KEY_RESTORE_TASK_FRAGMENT_PARENT_INFO,
+ parentInfos);
+
mTaskFragmentOrganizerState.put(organizer.asBinder(), cachedState);
mPendingTaskFragmentEvents.put(organizer.asBinder(), new ArrayList<>());
return true;
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index e6226ab..4eba36f 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -73,6 +73,7 @@
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_PREDICT_BACK;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowState.BLAST_TIMEOUT_DURATION;
+import static com.android.window.flags.Flags.enableDisplayFocusInShellTransitions;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -223,6 +224,13 @@
private final ArrayList<Task> mOnTopTasksAtReady = new ArrayList<>();
/**
+ * Tracks the top display like top tasks so we can trigger a MOVED_TO_TOP transition even when
+ * a display gets moved to front but there's no change in per-display focused tasks.
+ */
+ private DisplayContent mOnTopDisplayStart = null;
+ private DisplayContent mOnTopDisplayAtReady = null;
+
+ /**
* Set of participating windowtokens (activity/wallpaper) which are visible at the end of
* the transition animation.
*/
@@ -484,12 +492,8 @@
boolean canApplyDim(@NonNull Task task) {
if (mTransientLaunches == null) return true;
if (Flags.useTasksDimOnly()) {
- WindowContainer<?> dimmerParent = task.getDimmerParent();
- if (dimmerParent == null) {
- return false;
- }
- // Always allow to dim if the host only affects its task.
- if (dimmerParent.asTask() == task) {
+ if (task.isSuitableForDimming()) {
+ // Always allow to dim if the dimming occurs at task level (dim parented to task)
return true;
}
} else {
@@ -772,6 +776,10 @@
if (dc == null || mTargetDisplays.contains(dc)) return;
mTargetDisplays.add(dc);
addOnTopTasks(dc, mOnTopTasksStart);
+ if (mOnTopDisplayStart == null) {
+ mOnTopDisplayStart =
+ mController.mAtm.mRootWindowContainer.getTopFocusedDisplayContent();
+ }
// Handle the case {transition.start(); applyTransaction(wct);} that the animating state
// is set before collecting participants.
if (mController.isAnimating()) {
@@ -953,10 +961,13 @@
* Set animation options for collecting transition by ActivityRecord.
* @param options AnimationOptions captured from ActivityOptions
*/
- void setOverrideAnimation(@Nullable AnimationOptions options,
+ void setOverrideAnimation(@Nullable AnimationOptions options, @NonNull ActivityRecord r,
@Nullable IRemoteCallback startCallback, @Nullable IRemoteCallback finishCallback) {
if (!isCollecting()) return;
mOverrideOptions = options;
+ if (mOverrideOptions != null) {
+ mOverrideOptions.setUserId(r.mUserId);
+ }
sendRemoteCallback(mClientAnimationStartCallback);
mClientAnimationStartCallback = startCallback;
mClientAnimationFinishCallback = finishCallback;
@@ -995,6 +1006,8 @@
for (int i = 0; i < mTargetDisplays.size(); ++i) {
addOnTopTasks(mTargetDisplays.get(i), mOnTopTasksAtReady);
}
+ mOnTopDisplayAtReady =
+ mController.mAtm.mRootWindowContainer.getTopFocusedDisplayContent();
mController.onTransitionPopulated(this);
}
}
@@ -2079,6 +2092,10 @@
return true;
}
}
+ if (enableDisplayFocusInShellTransitions() && mOnTopDisplayStart
+ != mController.mAtm.mRootWindowContainer.getTopFocusedDisplayContent()) {
+ return true;
+ }
return false;
}
@@ -2110,6 +2127,8 @@
includesOrderChange = true;
break;
}
+ includesOrderChange |= enableDisplayFocusInShellTransitions()
+ && mOnTopDisplayStart != mOnTopDisplayAtReady;
if (!includesOrderChange && !reportCurrent) {
// This transition doesn't include an order change, so if it isn't required to report
// the current focus (eg. it's the last of a cluster of transitions), then don't
@@ -2120,6 +2139,8 @@
// latest state and compare with the last reported state (or our start state if no
// reported state exists).
ArrayList<Task> onTopTasksEnd = new ArrayList<>();
+ final DisplayContent onTopDisplayEnd =
+ mController.mAtm.mRootWindowContainer.getTopFocusedDisplayContent();
for (int d = 0; d < mTargetDisplays.size(); ++d) {
addOnTopTasks(mTargetDisplays.get(d), onTopTasksEnd);
final int displayId = mTargetDisplays.get(d).mDisplayId;
@@ -2127,11 +2148,15 @@
for (int i = onTopTasksEnd.size() - 1; i >= 0; --i) {
final Task task = onTopTasksEnd.get(i);
if (task.getDisplayId() != displayId) continue;
- // If it didn't change since last report, don't report
- if (reportedOnTop == null) {
- if (mOnTopTasksStart.contains(task)) continue;
- } else if (reportedOnTop.contains(task)) {
- continue;
+ if (!enableDisplayFocusInShellTransitions()
+ || mOnTopDisplayStart == onTopDisplayEnd
+ || displayId != onTopDisplayEnd.mDisplayId) {
+ // If it didn't change since last report, don't report
+ if (reportedOnTop == null) {
+ if (mOnTopTasksStart.contains(task)) continue;
+ } else if (reportedOnTop.contains(task)) {
+ continue;
+ }
}
// Need to report it.
mParticipants.add(task);
@@ -2333,10 +2358,7 @@
// Place the nav bar on top of anything else in the top activity.
t.setLayer(navSurfaceControl, Integer.MAX_VALUE);
}
- final StatusBarManagerInternal bar = dc.getDisplayPolicy().getStatusBarManagerInternal();
- if (bar != null) {
- bar.setNavigationBarLumaSamplingEnabled(mRecentsDisplayId, false);
- }
+ sendLumaSamplingEnabledToStatusBarInternal(dc, false);
}
/** @see RecentsAnimationController#restoreNavigationBarFromApp */
@@ -2354,10 +2376,7 @@
final DisplayContent dc =
mController.mAtm.mRootWindowContainer.getDisplayContent(recentsDisplayId);
- final StatusBarManagerInternal bar = dc.getDisplayPolicy().getStatusBarManagerInternal();
- if (bar != null) {
- bar.setNavigationBarLumaSamplingEnabled(recentsDisplayId, true);
- }
+ sendLumaSamplingEnabledToStatusBarInternal(dc, true);
final WindowState navWindow = dc.getDisplayPolicy().getNavigationBar();
if (navWindow == null) return;
navWindow.setSurfaceTranslationY(0);
@@ -2391,6 +2410,14 @@
dc.mWmService.scheduleAnimationLocked();
}
+ private void sendLumaSamplingEnabledToStatusBarInternal(@NonNull DisplayContent dc,
+ boolean enabled) {
+ final StatusBarManagerInternal bar = dc.getDisplayPolicy().getStatusBarManagerInternal();
+ if (bar != null) {
+ bar.setNavigationBarLumaSamplingEnabled(dc.getDisplayId(), enabled);
+ }
+ }
+
private void reportStartReasonsToLogger() {
// Record transition start in metrics logger. We just assume everything is "DRAWN"
// at this point since splash-screen is a presentation (shell) detail.
@@ -2990,7 +3017,7 @@
// Create the options based on this change's custom animations and layout
// parameters
animOptions = getOptions(activityRecord /* customAnimActivity */,
- activityRecord /* animLpActivity */);
+ activityRecord /* animLpActivity */);
if (!change.hasFlags(FLAG_TRANSLUCENT)) {
// If this change is not translucent, its options are going to be
// inherited by the changes below
@@ -3012,6 +3039,7 @@
params.getOpenAnimationResId(), params.getChangeAnimationResId(),
params.getCloseAnimationResId(), 0 /* backgroundColor */,
false /* overrideTaskTransition */);
+ animOptions.setUserId(taskFragment.getTask().mUserId);
}
}
if (animOptions != null) {
@@ -3092,6 +3120,7 @@
} else {
animOptions = TransitionInfo.AnimationOptions
.makeAnimOptionsFromLayoutParameters(animLp);
+ animOptions.setUserId(animLpActivity.mUserId);
}
}
return animOptions;
@@ -3117,6 +3146,7 @@
if (animOptions == null) {
animOptions = TransitionInfo.AnimationOptions
.makeCommonAnimOptions(activity.packageName);
+ animOptions.setUserId(activity.mUserId);
}
animOptions.addCustomActivityTransition(open, customAnim.mEnterAnim,
customAnim.mExitAnim, customAnim.mBackgroundColor);
@@ -3901,9 +3931,9 @@
/** @return true if all tracked subtrees are ready. */
boolean allReady() {
- ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, " allReady query: used=%b "
- + "override=%b defer=%d states=[%s]", mUsed, mReadyOverride, mDeferReadyDepth,
- groupsToString());
+ ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
+ " allReady query: used=%b " + "override=%b defer=%d states=[%s]", mUsed,
+ mReadyOverride, mDeferReadyDepth, groupsToString());
// If the readiness has never been touched, mUsed will be false. We never want to
// consider a transition ready if nothing has been reported on it.
if (!mUsed) return false;
diff --git a/services/core/java/com/android/server/wm/TransitionController.java b/services/core/java/com/android/server/wm/TransitionController.java
index 50fe69c..1d2a605 100644
--- a/services/core/java/com/android/server/wm/TransitionController.java
+++ b/services/core/java/com/android/server/wm/TransitionController.java
@@ -52,8 +52,8 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.protolog.ProtoLogGroup;
import com.android.internal.protolog.ProtoLog;
+import com.android.internal.protolog.ProtoLogGroup;
import com.android.server.FgThread;
import com.android.window.flags.Flags;
@@ -880,10 +880,10 @@
}
/** @see Transition#setOverrideAnimation */
- void setOverrideAnimation(TransitionInfo.AnimationOptions options,
+ void setOverrideAnimation(TransitionInfo.AnimationOptions options, ActivityRecord r,
@Nullable IRemoteCallback startCallback, @Nullable IRemoteCallback finishCallback) {
if (mCollectingTransition == null) return;
- mCollectingTransition.setOverrideAnimation(options, startCallback, finishCallback);
+ mCollectingTransition.setOverrideAnimation(options, r, startCallback, finishCallback);
}
void setNoAnimation(WindowContainer wc) {
diff --git a/services/core/java/com/android/server/wm/TransparentPolicy.java b/services/core/java/com/android/server/wm/TransparentPolicy.java
index f1941af..85a118d 100644
--- a/services/core/java/com/android/server/wm/TransparentPolicy.java
+++ b/services/core/java/com/android/server/wm/TransparentPolicy.java
@@ -16,6 +16,7 @@
package com.android.server.wm;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
import static android.content.res.Configuration.ORIENTATION_UNDEFINED;
import static android.content.res.Configuration.SCREEN_HEIGHT_DP_UNDEFINED;
@@ -331,6 +332,11 @@
}
private boolean isPolicyEnabled() {
+ // Disable transparent policy if task is null or in freeform.
+ final Task task = mActivityRecord.getTask();
+ if (task == null || task.getWindowingMode() == WINDOWING_MODE_FREEFORM) {
+ return false;
+ }
if (!mActivityRecord.mWmService.mFlags.mRespectNonTopVisibleFixedOrientation) {
return true;
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerConstants.java b/services/core/java/com/android/server/wm/WindowManagerConstants.java
index 47c42f4..e0f24d8 100644
--- a/services/core/java/com/android/server/wm/WindowManagerConstants.java
+++ b/services/core/java/com/android/server/wm/WindowManagerConstants.java
@@ -34,7 +34,7 @@
*/
final class WindowManagerConstants {
- /** The orientation of activity will be always "unspecified". */
+ /** The orientation of activity will be always "unspecified" except for game apps. */
private static final String KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST =
"ignore_activity_orientation_request";
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index fb57a1b..459a509 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -90,6 +90,7 @@
import static android.view.WindowManager.REMOVE_CONTENT_MODE_UNDEFINED;
import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.WindowManager.fixScale;
import static android.view.WindowManagerGlobal.ADD_OKAY;
import static android.view.WindowManagerGlobal.RELAYOUT_RES_CANCEL_AND_REDRAW;
@@ -158,6 +159,7 @@
import static com.android.server.wm.WindowManagerServiceDumpProto.WINDOW_FRAMES_VALID;
import static com.android.window.flags.Flags.multiCrop;
import static com.android.window.flags.Flags.setScPropertiesInClient;
+import static com.android.window.flags.Flags.enableDisplayFocusInShellTransitions;
import android.Manifest;
import android.Manifest.permission;
@@ -1545,7 +1547,23 @@
return WindowManagerGlobal.ADD_APP_EXITING;
}
- final DisplayContent displayContent = getDisplayContentOrCreate(displayId, attrs.token);
+ if (type >= FIRST_SUB_WINDOW && type <= LAST_SUB_WINDOW) {
+ parentWindow = windowForClientLocked(null, attrs.token, false);
+ if (parentWindow == null) {
+ ProtoLog.w(WM_ERROR, "Attempted to add window with token that is not a window: "
+ + "%s. Aborting.", attrs.token);
+ return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN;
+ }
+ if (parentWindow.mAttrs.type >= FIRST_SUB_WINDOW
+ && parentWindow.mAttrs.type <= LAST_SUB_WINDOW) {
+ ProtoLog.w(WM_ERROR, "Attempted to add window with token that is a sub-window: "
+ + "%s. Aborting.", attrs.token);
+ return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN;
+ }
+ }
+ final DisplayContent displayContent = parentWindow != null
+ ? parentWindow.mDisplayContent
+ : getDisplayContentOrCreate(displayId, attrs.token);
if (displayContent == null) {
ProtoLog.w(WM_ERROR, "Attempted to add window to a display that does "
@@ -1565,21 +1583,6 @@
return WindowManagerGlobal.ADD_DUPLICATE_ADD;
}
- if (type >= FIRST_SUB_WINDOW && type <= LAST_SUB_WINDOW) {
- parentWindow = windowForClientLocked(null, attrs.token, false);
- if (parentWindow == null) {
- ProtoLog.w(WM_ERROR, "Attempted to add window with token that is not a window: "
- + "%s. Aborting.", attrs.token);
- return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN;
- }
- if (parentWindow.mAttrs.type >= FIRST_SUB_WINDOW
- && parentWindow.mAttrs.type <= LAST_SUB_WINDOW) {
- ProtoLog.w(WM_ERROR, "Attempted to add window with token that is a sub-window: "
- + "%s. Aborting.", attrs.token);
- return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN;
- }
- }
-
if (type == TYPE_PRESENTATION || type == TYPE_PRIVATE_PRESENTATION) {
mDisplayManagerInternal.onPresentation(displayContent.getDisplay().getDisplayId(),
/*isShown=*/ true);
@@ -3238,9 +3241,28 @@
return;
}
+ Transition transition = null;
+ boolean transitionNewlyCreated = false;
+ if (enableDisplayFocusInShellTransitions()) {
+ transition = mAtmService.getTransitionController().requestTransitionIfNeeded(
+ TRANSIT_TO_FRONT, 0 /* flags */, null /* trigger */,
+ displayContent);
+ if (transition != null) {
+ transitionNewlyCreated = true;
+ } else {
+ transition =
+ mAtmService.getTransitionController().getCollectingTransition();
+ }
+ if (transition != null) {
+ transition.recordTaskOrder(displayContent);
+ }
+ }
// Nothing prevented us from moving the display to the top. Let's do it!
displayContent.getParent().positionChildAt(WindowContainer.POSITION_TOP,
displayContent, true /* includingParents */);
+ if (transitionNewlyCreated) {
+ transition.setReady(displayContent, true /* ready */);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 256d0c6..021be57 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -5196,14 +5196,8 @@
Dimmer dimmer;
WindowContainer<?> geometryParent = task;
if (Flags.useTasksDimOnly()) {
- if (task != null) {
- geometryParent = task.getDimmerParent();
- dimmer = task.mDimmer;
- } else {
- RootDisplayArea displayArea = getRootDisplayArea();
- geometryParent = displayArea;
- dimmer = displayArea != null ? displayArea.getDimmer() : null;
- }
+ geometryParent = getDimParent();
+ dimmer = getDimController();
if (dimmer == null) {
ProtoLog.e(WM_DEBUG_DIMMER, "WindowState %s does not have task or"
+ " display area for dimming", this);
@@ -5216,11 +5210,30 @@
if (isVisibleNow()) {
dimmer.adjustAppearance(this, dimAmount, blurRadius);
}
- dimmer.adjustPosition(geometryParent,
- this /* relativeParent */, -1 /* relativeLayer */);
+ dimmer.adjustPosition(geometryParent, this /* relativeParent */);
}
}
+ private Dimmer getDimController() {
+ Task task = getTask();
+ if (task != null) {
+ return task.mDimmer;
+ }
+ RootDisplayArea displayArea = getRootDisplayArea();
+ if (displayArea != null) {
+ return displayArea.getDimmer();
+ }
+ return null;
+ }
+
+ private WindowContainer<?> getDimParent() {
+ Task task = getTask();
+ if (task != null && task.isSuitableForDimming()) {
+ return task;
+ }
+ return getRootDisplayArea();
+ }
+
private boolean shouldDrawBlurBehind() {
return (mAttrs.flags & FLAG_BLUR_BEHIND) != 0
&& mWmService.mBlurController.getBlurEnabled();
diff --git a/services/core/jni/com_android_server_hint_HintManagerService.cpp b/services/core/jni/com_android_server_hint_HintManagerService.cpp
index 2307ace..febfb9f 100644
--- a/services/core/jni/com_android_server_hint_HintManagerService.cpp
+++ b/services/core/jni/com_android_server_hint_HintManagerService.cpp
@@ -109,7 +109,7 @@
return session_ptr;
} else if (result.isUnsupported()) {
throwUnsupported(env, result.errorMessage());
- return -1;
+ return 0;
}
throwFailed(env, result.errorMessage());
return 0;
@@ -190,7 +190,7 @@
hal::SessionConfig config;
jlong out = createHintSessionWithConfig(env, tgid, uid, std::move(threadIds), durationNanos,
sessionTag, config);
- if (out <= 0) {
+ if (out == 0) {
return out;
}
static jclass configClass = env->FindClass("android/hardware/power/SessionConfig");
diff --git a/services/core/jni/com_android_server_vibrator_VibratorController.cpp b/services/core/jni/com_android_server_vibrator_VibratorController.cpp
index 5c5ac28..39c0c3e 100644
--- a/services/core/jni/com_android_server_vibrator_VibratorController.cpp
+++ b/services/core/jni/com_android_server_vibrator_VibratorController.cpp
@@ -54,6 +54,9 @@
jmethodID setCompositionSizeMax;
jmethodID setQFactor;
jmethodID setFrequencyProfile;
+ jmethodID setMaxEnvelopeEffectSize;
+ jmethodID setMinEnvelopeEffectControlPointDurationMillis;
+ jmethodID setMaxEnvelopeEffectControlPointDurationMillis;
} sVibratorInfoBuilderClassInfo;
static struct {
jfieldID id;
@@ -484,6 +487,25 @@
env->CallObjectMethod(vibratorInfoBuilder, sVibratorInfoBuilderClassInfo.setQFactor,
static_cast<jfloat>(info.qFactor.value()));
}
+ if (info.maxEnvelopeEffectSize.isOk()) {
+ env->CallObjectMethod(vibratorInfoBuilder,
+ sVibratorInfoBuilderClassInfo.setMaxEnvelopeEffectSize,
+ static_cast<jint>(info.maxEnvelopeEffectSize.value()));
+ }
+ if (info.minEnvelopeEffectControlPointDuration.isOk()) {
+ env->CallObjectMethod(vibratorInfoBuilder,
+ sVibratorInfoBuilderClassInfo
+ .setMinEnvelopeEffectControlPointDurationMillis,
+ static_cast<jint>(
+ info.minEnvelopeEffectControlPointDuration.value().count()));
+ }
+ if (info.maxEnvelopeEffectControlPointDuration.isOk()) {
+ env->CallObjectMethod(vibratorInfoBuilder,
+ sVibratorInfoBuilderClassInfo
+ .setMaxEnvelopeEffectControlPointDurationMillis,
+ static_cast<jint>(
+ info.maxEnvelopeEffectControlPointDuration.value().count()));
+ }
jfloat minFrequency = static_cast<jfloat>(info.minFrequency.valueOr(NAN));
jfloat resonantFrequency = static_cast<jfloat>(info.resonantFrequency.valueOr(NAN));
@@ -580,6 +602,17 @@
GetMethodIDOrDie(env, vibratorInfoBuilderClass, "setFrequencyProfile",
"(Landroid/os/VibratorInfo$FrequencyProfile;)"
"Landroid/os/VibratorInfo$Builder;");
+ sVibratorInfoBuilderClassInfo.setMaxEnvelopeEffectSize =
+ GetMethodIDOrDie(env, vibratorInfoBuilderClass, "setMaxEnvelopeEffectSize",
+ "(I)Landroid/os/VibratorInfo$Builder;");
+ sVibratorInfoBuilderClassInfo.setMinEnvelopeEffectControlPointDurationMillis =
+ GetMethodIDOrDie(env, vibratorInfoBuilderClass,
+ "setMinEnvelopeEffectControlPointDurationMillis",
+ "(I)Landroid/os/VibratorInfo$Builder;");
+ sVibratorInfoBuilderClassInfo.setMaxEnvelopeEffectControlPointDurationMillis =
+ GetMethodIDOrDie(env, vibratorInfoBuilderClass,
+ "setMaxEnvelopeEffectControlPointDurationMillis",
+ "(I)Landroid/os/VibratorInfo$Builder;");
return jniRegisterNativeMethods(env,
"com/android/server/vibrator/VibratorController$NativeWrapper",
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 85e24c1..b6e45fc8 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -14799,7 +14799,8 @@
}
@Override
- public void setSecondaryLockscreenEnabled(ComponentName who, boolean enabled) {
+ public void setSecondaryLockscreenEnabled(ComponentName who, boolean enabled,
+ PersistableBundle options) {
Objects.requireNonNull(who, "ComponentName is null");
// Check can set secondary lockscreen enabled
@@ -18644,11 +18645,9 @@
toggleBackupServiceActive(caller.getUserId(), enabled);
- if (Flags.backupServiceSecurityLogEventEnabled()) {
- if (SecurityLog.isLoggingEnabled()) {
- SecurityLog.writeEvent(SecurityLog.TAG_BACKUP_SERVICE_TOGGLED,
- caller.getPackageName(), caller.getUserId(), enabled ? 1 : 0);
- }
+ if (SecurityLog.isLoggingEnabled()) {
+ SecurityLog.writeEvent(SecurityLog.TAG_BACKUP_SERVICE_TOGGLED,
+ caller.getPackageName(), caller.getUserId(), enabled ? 1 : 0);
}
}
diff --git a/services/foldables/devicestateprovider/tests/Android.bp b/services/foldables/devicestateprovider/tests/Android.bp
index 84a6df3..4352c15 100644
--- a/services/foldables/devicestateprovider/tests/Android.bp
+++ b/services/foldables/devicestateprovider/tests/Android.bp
@@ -6,9 +6,9 @@
name: "foldable-device-state-provider-tests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
jni_libs: [
"libdexmakerjvmtiagent",
diff --git a/services/tests/InputMethodSystemServerTests/Android.bp b/services/tests/InputMethodSystemServerTests/Android.bp
index 9044259..e6ff506 100644
--- a/services/tests/InputMethodSystemServerTests/Android.bp
+++ b/services/tests/InputMethodSystemServerTests/Android.bp
@@ -50,9 +50,9 @@
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
@@ -79,8 +79,8 @@
"services",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
srcs: [
"src/com/android/server/inputmethod/**/ClientControllerTest.java",
@@ -121,9 +121,9 @@
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
diff --git a/services/tests/PackageManagerServiceTests/host/Android.bp b/services/tests/PackageManagerServiceTests/host/Android.bp
index 75db316..b46a6ff 100644
--- a/services/tests/PackageManagerServiceTests/host/Android.bp
+++ b/services/tests/PackageManagerServiceTests/host/Android.bp
@@ -95,3 +95,10 @@
test_suites: ["device-tests"],
include_filters: ["com.android.server.pm.test.OverlayActorVisibilityTest"],
}
+
+test_module_config_host {
+ name: "PackageManagerServiceHostTests_android_server_pm_Presubmit",
+ base: "PackageManagerServiceHostTests",
+ test_suites: ["device-tests"],
+ include_annotations: ["android.platform.test.annotations.Presubmit"],
+}
diff --git a/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp b/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp
index 73cec6c..71ada2e 100644
--- a/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp
+++ b/services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp
@@ -29,7 +29,7 @@
sdk_version: "test_current",
srcs: ["src/**/*.kt"],
libs: [
- "android.test.base",
+ "android.test.base.stubs.test",
],
static_libs: [
"androidx.annotation_annotation",
diff --git a/services/tests/PackageManagerServiceTests/server/Android.bp b/services/tests/PackageManagerServiceTests/server/Android.bp
index e26213e..f5b0015 100644
--- a/services/tests/PackageManagerServiceTests/server/Android.bp
+++ b/services/tests/PackageManagerServiceTests/server/Android.bp
@@ -65,9 +65,9 @@
"android.hardware.tv.cec-V1.0-java",
"android.hardware.vibrator-V3-java",
"android.hidl.manager-V1.0-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
platform_apis: true,
@@ -186,3 +186,13 @@
include_filters: ["com.android.server.pm."],
include_annotations: ["android.platform.test.annotations.Postsubmit"],
}
+
+test_module_config {
+ name: "PackageManagerServiceServerTests_Presubmit",
+ base: "PackageManagerServiceServerTests",
+ test_suites: [
+ "automotive-tests",
+ "device-tests",
+ ],
+ include_annotations: ["android.platform.test.annotations.Presubmit"],
+}
diff --git a/services/tests/VpnTests/Android.bp b/services/tests/VpnTests/Android.bp
index a5011a8..0568892 100644
--- a/services/tests/VpnTests/Android.bp
+++ b/services/tests/VpnTests/Android.bp
@@ -38,8 +38,15 @@
"framework-connectivity-t.impl",
"framework",
"framework-res",
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
],
}
+
+test_module_config {
+ name: "FrameworksVpnTests_android_server_connectivity",
+ base: "FrameworksVpnTests",
+ test_suites: ["device-tests"],
+ exclude_annotations: ["com.android.testutils.SkipPresubmit"],
+}
diff --git a/services/tests/appfunctions/Android.bp b/services/tests/appfunctions/Android.bp
new file mode 100644
index 0000000..b5cf986
--- /dev/null
+++ b/services/tests/appfunctions/Android.bp
@@ -0,0 +1,59 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "frameworks_base_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+android_test {
+ name: "FrameworksAppFunctionsTests",
+ team: "trendy_team_machine_learning",
+ defaults: [
+ "modules-utils-testable-device-config-defaults",
+ ],
+
+ srcs: [
+ "src/**/*.kt",
+ ],
+
+ static_libs: [
+ "androidx.test.core",
+ "androidx.test.runner",
+ "androidx.test.ext.truth",
+ "platform-test-annotations",
+ "services.appfunctions",
+ "servicestests-core-utils",
+ "truth",
+ "frameworks-base-testutils",
+ "androidx.test.rules",
+ ],
+
+ libs: [
+ "android.test.base",
+ "android.test.runner",
+ ],
+
+ certificate: "platform",
+ platform_apis: true,
+ test_suites: ["device-tests"],
+
+ optimize: {
+ enabled: false,
+ },
+}
diff --git a/services/tests/appfunctions/AndroidManifest.xml b/services/tests/appfunctions/AndroidManifest.xml
new file mode 100644
index 0000000..1d42b17
--- /dev/null
+++ b/services/tests/appfunctions/AndroidManifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.frameworks.appfunctionstests">
+
+ <application android:testOnly="true"
+ android:debuggable="true">
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <instrumentation
+ android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="com.android.frameworks.appfunctionstests"
+ android:label="Frameworks AppFunctions Services Tests" />
+
+</manifest>
\ No newline at end of file
diff --git a/services/tests/appfunctions/AndroidTest.xml b/services/tests/appfunctions/AndroidTest.xml
new file mode 100644
index 0000000..0650120
--- /dev/null
+++ b/services/tests/appfunctions/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Runs Frameworks AppFunctions Services Tests.">
+ <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+ <option name="cleanup-apks" value="true" />
+ <option name="install-arg" value="-t" />
+ <option name="test-file-name" value="FrameworksAppFunctionsTests.apk" />
+ </target_preparer>
+
+ <option name="test-tag" value="FrameworksAppFunctionsTests" />
+
+ <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+ <option name="package" value="com.android.frameworks.appfunctionstests" />
+ <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
+ <option name="hidden-api-checks" value="false"/>
+ </test>
+</configuration>
\ No newline at end of file
diff --git a/services/tests/appfunctions/src/android/app/appfunctions/AppFunctionRuntimeMetadataTest.kt b/services/tests/appfunctions/src/android/app/appfunctions/AppFunctionRuntimeMetadataTest.kt
new file mode 100644
index 0000000..650e520
--- /dev/null
+++ b/services/tests/appfunctions/src/android/app/appfunctions/AppFunctionRuntimeMetadataTest.kt
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.app.appfunctions
+
+import android.app.appsearch.AppSearchSchema
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class AppFunctionRuntimeMetadataTest {
+
+ @Test
+ fun getRuntimeSchemaNameForPackage() {
+ val actualSchemaName =
+ AppFunctionRuntimeMetadata.getRuntimeSchemaNameForPackage("com.example.app")
+
+ assertThat(actualSchemaName).isEqualTo("AppFunctionRuntimeMetadata-com.example.app")
+ }
+
+ @Test
+ fun testCreateChildRuntimeSchema() {
+ val runtimeSchema: AppSearchSchema =
+ AppFunctionRuntimeMetadata.createAppFunctionRuntimeSchema("com.example.app")
+
+ assertThat(runtimeSchema.schemaType).isEqualTo("AppFunctionRuntimeMetadata-com.example.app")
+ val propertyNameSet = runtimeSchema.properties.map { it.name }.toSet()
+ assertThat(propertyNameSet.contains(AppFunctionRuntimeMetadata.PROPERTY_FUNCTION_ID))
+ .isTrue()
+ assertThat(propertyNameSet.contains(AppFunctionRuntimeMetadata.PROPERTY_PACKAGE_NAME))
+ .isTrue()
+ assertThat(propertyNameSet.contains(AppFunctionRuntimeMetadata.PROPERTY_ENABLED)).isTrue()
+ assertThat(
+ propertyNameSet.contains(
+ AppFunctionRuntimeMetadata.PROPERTY_APP_FUNCTION_STATIC_METADATA_QUALIFIED_ID
+ )
+ )
+ .isTrue()
+ }
+
+ @Test
+ fun testCreateParentRuntimeSchema() {
+ val runtimeSchema: AppSearchSchema =
+ AppFunctionRuntimeMetadata.createParentAppFunctionRuntimeSchema()
+
+ assertThat(runtimeSchema.schemaType).isEqualTo("AppFunctionRuntimeMetadata")
+ val propertyNameSet = runtimeSchema.properties.map { it.name }.toSet()
+ assertThat(propertyNameSet.contains(AppFunctionRuntimeMetadata.PROPERTY_FUNCTION_ID))
+ .isTrue()
+ assertThat(propertyNameSet.contains(AppFunctionRuntimeMetadata.PROPERTY_PACKAGE_NAME))
+ .isTrue()
+ assertThat(propertyNameSet.contains(AppFunctionRuntimeMetadata.PROPERTY_ENABLED)).isTrue()
+ assertThat(
+ propertyNameSet.contains(
+ AppFunctionRuntimeMetadata.PROPERTY_APP_FUNCTION_STATIC_METADATA_QUALIFIED_ID
+ )
+ )
+ .isTrue()
+ }
+
+ @Test
+ fun testGetPackageNameFromSchema() {
+ val expectedPackageName = "com.foo.test"
+ val expectedPackageName2 = "com.bar.test"
+ val testSchemaType =
+ AppFunctionRuntimeMetadata.createAppFunctionRuntimeSchema(expectedPackageName)
+ .schemaType
+ val testSchemaType2 =
+ AppFunctionRuntimeMetadata.createAppFunctionRuntimeSchema(expectedPackageName2)
+ .schemaType
+
+ val actualPackageName = AppFunctionRuntimeMetadata.getPackageNameFromSchema(testSchemaType)
+ val actualPackageName2 =
+ AppFunctionRuntimeMetadata.getPackageNameFromSchema(testSchemaType2)
+
+ assertThat(actualPackageName).isEqualTo(expectedPackageName)
+ assertThat(actualPackageName2).isEqualTo(expectedPackageName2)
+ }
+
+ @Test
+ fun testGetPackageNameFromParentSchema() {
+ val expectedPackageName = AppFunctionRuntimeMetadata.APP_FUNCTION_INDEXER_PACKAGE
+ val testSchemaType =
+ AppFunctionRuntimeMetadata.createParentAppFunctionRuntimeSchema().schemaType
+
+ val actualPackageName = AppFunctionRuntimeMetadata.getPackageNameFromSchema(testSchemaType)
+
+ assertThat(actualPackageName).isEqualTo(expectedPackageName)
+ }
+}
diff --git a/services/tests/appfunctions/src/android/app/appfunctions/AppFunctionStaticMetadataHelperTest.kt b/services/tests/appfunctions/src/android/app/appfunctions/AppFunctionStaticMetadataHelperTest.kt
new file mode 100644
index 0000000..d8ce393
--- /dev/null
+++ b/services/tests/appfunctions/src/android/app/appfunctions/AppFunctionStaticMetadataHelperTest.kt
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.app.appfunctions
+
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class AppFunctionStaticMetadataHelperTest {
+
+ @Test
+ fun getStaticSchemaNameForPackage() {
+ val actualSchemaName =
+ AppFunctionStaticMetadataHelper.getStaticSchemaNameForPackage("com.example.app")
+
+ assertThat(actualSchemaName).isEqualTo("AppFunctionStaticMetadata-com.example.app")
+ }
+
+ @Test
+ fun getDocumentIdForAppFunction() {
+ val packageName = "com.example.app"
+ val functionId = "someFunction"
+
+ val actualDocumentId =
+ AppFunctionStaticMetadataHelper.getDocumentIdForAppFunction(packageName, functionId)
+
+ assertThat(actualDocumentId).isEqualTo("com.example.app/someFunction")
+ }
+
+ @Test
+ fun getStaticMetadataQualifiedId() {
+ val packageName = "com.example.app"
+ val functionId = "someFunction"
+
+ val actualQualifiedId =
+ AppFunctionStaticMetadataHelper.getStaticMetadataQualifiedId(packageName, functionId)
+
+ assertThat(actualQualifiedId)
+ .isEqualTo("android\$apps-db/app_functions#com.example.app/someFunction")
+ }
+}
diff --git a/services/tests/appfunctions/src/com/android/server/appfunctions/FutureAppSearchSessionTest.kt b/services/tests/appfunctions/src/com/android/server/appfunctions/FutureAppSearchSessionTest.kt
new file mode 100644
index 0000000..edcbb9e
--- /dev/null
+++ b/services/tests/appfunctions/src/com/android/server/appfunctions/FutureAppSearchSessionTest.kt
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.server.appfunctions
+
+import android.app.appfunctions.AppFunctionRuntimeMetadata
+import android.app.appfunctions.AppFunctionRuntimeMetadata.APP_FUNCTION_RUNTIME_NAMESPACE
+import android.app.appfunctions.AppFunctionRuntimeMetadata.createAppFunctionRuntimeSchema
+import android.app.appfunctions.AppFunctionRuntimeMetadata.createParentAppFunctionRuntimeSchema
+import android.app.appsearch.AppSearchBatchResult
+import android.app.appsearch.AppSearchManager
+import android.app.appsearch.GenericDocument
+import android.app.appsearch.GetByDocumentIdRequest
+import android.app.appsearch.PutDocumentsRequest
+import android.app.appsearch.RemoveByDocumentIdRequest
+import android.app.appsearch.SearchSpec
+import android.app.appsearch.SetSchemaRequest
+import androidx.test.platform.app.InstrumentationRegistry
+import com.google.common.truth.Truth.assertThat
+import com.google.common.util.concurrent.MoreExecutors
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class FutureAppSearchSessionTest {
+ private val context = InstrumentationRegistry.getInstrumentation().targetContext
+ private val appSearchManager = context.getSystemService(AppSearchManager::class.java)
+ private val testExecutor = MoreExecutors.directExecutor()
+
+ @Before
+ @After
+ fun clearData() {
+ val searchContext = AppSearchManager.SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use {
+ val setSchemaRequest = SetSchemaRequest.Builder().setForceOverride(true).build()
+ it.setSchema(setSchemaRequest).get()
+ }
+ }
+
+ @Test
+ fun setSchema() {
+ val searchContext = AppSearchManager.SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use { session ->
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(
+ createParentAppFunctionRuntimeSchema(),
+ createAppFunctionRuntimeSchema(TEST_PACKAGE_NAME),
+ )
+ .build()
+
+ val schema = session.setSchema(setSchemaRequest)
+
+ assertThat(schema.get()).isNotNull()
+ }
+ }
+
+ @Test
+ fun put() {
+ val searchContext = AppSearchManager.SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use { session ->
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(
+ createParentAppFunctionRuntimeSchema(),
+ createAppFunctionRuntimeSchema(TEST_PACKAGE_NAME),
+ )
+ .build()
+ val schema = session.setSchema(setSchemaRequest)
+ assertThat(schema.get()).isNotNull()
+ val appFunctionRuntimeMetadata =
+ AppFunctionRuntimeMetadata.Builder(TEST_PACKAGE_NAME, TEST_FUNCTION_ID, "").build()
+ val putDocumentsRequest: PutDocumentsRequest =
+ PutDocumentsRequest.Builder()
+ .addGenericDocuments(appFunctionRuntimeMetadata)
+ .build()
+
+ val putResult = session.put(putDocumentsRequest)
+
+ assertThat(putResult.get().isSuccess).isTrue()
+ }
+ }
+
+ @Test
+ fun remove() {
+ val searchContext = AppSearchManager.SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use { session ->
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(
+ createParentAppFunctionRuntimeSchema(),
+ createAppFunctionRuntimeSchema(TEST_PACKAGE_NAME),
+ )
+ .build()
+ val schema = session.setSchema(setSchemaRequest)
+ assertThat(schema.get()).isNotNull()
+ val appFunctionRuntimeMetadata =
+ AppFunctionRuntimeMetadata.Builder(TEST_PACKAGE_NAME, TEST_FUNCTION_ID, "").build()
+ val putDocumentsRequest: PutDocumentsRequest =
+ PutDocumentsRequest.Builder()
+ .addGenericDocuments(appFunctionRuntimeMetadata)
+ .build()
+ val putResult = session.put(putDocumentsRequest)
+ assertThat(putResult.get().isSuccess).isTrue()
+ val removeDocumentRequest =
+ RemoveByDocumentIdRequest.Builder(APP_FUNCTION_RUNTIME_NAMESPACE)
+ .addIds(appFunctionRuntimeMetadata.id)
+ .build()
+
+ val removeResult: AppSearchBatchResult<String, Void> =
+ session.remove(removeDocumentRequest).get()
+
+ assertThat(removeResult).isNotNull()
+ assertThat(removeResult.isSuccess).isTrue()
+ }
+ }
+
+ @Test
+ fun search() {
+ val searchContext = AppSearchManager.SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use { session ->
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(
+ createParentAppFunctionRuntimeSchema(),
+ createAppFunctionRuntimeSchema(TEST_PACKAGE_NAME),
+ )
+ .build()
+ val schema = session.setSchema(setSchemaRequest)
+ assertThat(schema.get()).isNotNull()
+ val appFunctionRuntimeMetadata =
+ AppFunctionRuntimeMetadata.Builder(TEST_PACKAGE_NAME, TEST_FUNCTION_ID, "").build()
+ val putDocumentsRequest: PutDocumentsRequest =
+ PutDocumentsRequest.Builder()
+ .addGenericDocuments(appFunctionRuntimeMetadata)
+ .build()
+ val putResult = session.put(putDocumentsRequest)
+ assertThat(putResult.get().isSuccess).isTrue()
+
+ val searchResult = session.search("", SearchSpec.Builder().build())
+
+ val genericDocs =
+ searchResult.get().nextPage.get().stream().map { it.genericDocument }.toList()
+ assertThat(genericDocs).hasSize(1)
+ val foundAppFunctionRuntimeMetadata = AppFunctionRuntimeMetadata(genericDocs[0])
+ assertThat(foundAppFunctionRuntimeMetadata.functionId).isEqualTo(TEST_FUNCTION_ID)
+ }
+ }
+
+ @Test
+ fun getByDocumentId() {
+ val searchContext = AppSearchManager.SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use { session ->
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(
+ createParentAppFunctionRuntimeSchema(),
+ createAppFunctionRuntimeSchema(TEST_PACKAGE_NAME),
+ )
+ .build()
+ session.setSchema(setSchemaRequest).get()
+ val appFunctionRuntimeMetadata =
+ AppFunctionRuntimeMetadata.Builder(TEST_PACKAGE_NAME, TEST_FUNCTION_ID, "").build()
+ val putDocumentsRequest: PutDocumentsRequest =
+ PutDocumentsRequest.Builder()
+ .addGenericDocuments(appFunctionRuntimeMetadata)
+ .build()
+ session.put(putDocumentsRequest)
+ val getRequest =
+ GetByDocumentIdRequest.Builder(APP_FUNCTION_RUNTIME_NAMESPACE)
+ .addIds(appFunctionRuntimeMetadata.id)
+ .build()
+
+ val genericDocument: GenericDocument? =
+ session.getByDocumentId(getRequest).get().successes[appFunctionRuntimeMetadata.id]
+
+ assertThat(genericDocument).isNotNull()
+ val foundAppFunctionRuntimeMetadata = AppFunctionRuntimeMetadata(genericDocument!!)
+ assertThat(foundAppFunctionRuntimeMetadata.functionId).isEqualTo(TEST_FUNCTION_ID)
+ }
+ }
+
+ private companion object {
+ const val TEST_DB: String = "test_db"
+ const val TEST_PACKAGE_NAME: String = "test_pkg"
+ const val TEST_FUNCTION_ID: String = "print"
+ }
+}
diff --git a/services/tests/appfunctions/src/com/android/server/appfunctions/FutureGlobalSearchSessionTest.kt b/services/tests/appfunctions/src/com/android/server/appfunctions/FutureGlobalSearchSessionTest.kt
new file mode 100644
index 0000000..38cba65
--- /dev/null
+++ b/services/tests/appfunctions/src/com/android/server/appfunctions/FutureGlobalSearchSessionTest.kt
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.server.appfunctions
+
+import android.app.appfunctions.AppFunctionRuntimeMetadata
+import android.app.appfunctions.AppFunctionRuntimeMetadata.createAppFunctionRuntimeSchema
+import android.app.appfunctions.AppFunctionRuntimeMetadata.createParentAppFunctionRuntimeSchema
+import android.app.appsearch.AppSearchManager
+import android.app.appsearch.AppSearchManager.SearchContext
+import android.app.appsearch.PutDocumentsRequest
+import android.app.appsearch.SetSchemaRequest
+import android.app.appsearch.observer.DocumentChangeInfo
+import android.app.appsearch.observer.ObserverCallback
+import android.app.appsearch.observer.ObserverSpec
+import android.app.appsearch.observer.SchemaChangeInfo
+import androidx.test.platform.app.InstrumentationRegistry
+import com.android.internal.infra.AndroidFuture
+import com.google.common.truth.Truth.assertThat
+import com.google.common.util.concurrent.MoreExecutors
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class FutureGlobalSearchSessionTest {
+ private val context = InstrumentationRegistry.getInstrumentation().targetContext
+ private val appSearchManager = context.getSystemService(AppSearchManager::class.java)
+ private val testExecutor = MoreExecutors.directExecutor()
+
+ @Before
+ @After
+ fun clearData() {
+ val searchContext = SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use {
+ val setSchemaRequest = SetSchemaRequest.Builder().setForceOverride(true).build()
+ it.setSchema(setSchemaRequest).get()
+ }
+ }
+
+ @Test
+ fun registerDocumentChangeObserverCallback() {
+ val packageObserverSpec: ObserverSpec =
+ ObserverSpec.Builder()
+ .addFilterSchemas(
+ AppFunctionRuntimeMetadata.getRuntimeSchemaNameForPackage(TEST_TARGET_PKG_NAME)
+ )
+ .build()
+ val settableDocumentChangeInfo: AndroidFuture<DocumentChangeInfo> = AndroidFuture()
+ val observer: ObserverCallback =
+ object : ObserverCallback {
+ override fun onSchemaChanged(changeInfo: SchemaChangeInfo) {}
+
+ override fun onDocumentChanged(changeInfo: DocumentChangeInfo) {
+ settableDocumentChangeInfo.complete(changeInfo)
+ }
+ }
+ val futureGlobalSearchSession = FutureGlobalSearchSession(appSearchManager, testExecutor)
+
+ val registerPackageObserver: Void? =
+ futureGlobalSearchSession
+ .registerObserverCallbackAsync(
+ TEST_TARGET_PKG_NAME,
+ packageObserverSpec,
+ testExecutor,
+ observer,
+ )
+ .get()
+ assertThat(registerPackageObserver).isNull()
+ // Trigger document change
+ val searchContext = SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use { session ->
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(
+ createParentAppFunctionRuntimeSchema(),
+ createAppFunctionRuntimeSchema(TEST_TARGET_PKG_NAME),
+ )
+ .build()
+ val schema = session.setSchema(setSchemaRequest)
+ assertThat(schema.get()).isNotNull()
+ val appFunctionRuntimeMetadata =
+ AppFunctionRuntimeMetadata.Builder(TEST_TARGET_PKG_NAME, TEST_FUNCTION_ID, "")
+ .build()
+ val putDocumentsRequest: PutDocumentsRequest =
+ PutDocumentsRequest.Builder()
+ .addGenericDocuments(appFunctionRuntimeMetadata)
+ .build()
+ val putResult = session.put(putDocumentsRequest).get()
+ assertThat(putResult.isSuccess).isTrue()
+ }
+ assertThat(
+ settableDocumentChangeInfo
+ .get()
+ .changedDocumentIds
+ .contains(
+ AppFunctionRuntimeMetadata.getDocumentIdForAppFunction(
+ TEST_TARGET_PKG_NAME,
+ TEST_FUNCTION_ID,
+ )
+ )
+ )
+ .isTrue()
+ }
+
+ private companion object {
+ const val TEST_DB: String = "test_db"
+ const val TEST_TARGET_PKG_NAME = "com.android.frameworks.appfunctionstests"
+ const val TEST_FUNCTION_ID: String = "print"
+ }
+}
diff --git a/services/tests/appfunctions/src/com/android/server/appfunctions/MetadataSyncAdapterTest.kt b/services/tests/appfunctions/src/com/android/server/appfunctions/MetadataSyncAdapterTest.kt
new file mode 100644
index 0000000..3ebf689
--- /dev/null
+++ b/services/tests/appfunctions/src/com/android/server/appfunctions/MetadataSyncAdapterTest.kt
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.server.appfunctions
+
+import android.app.appfunctions.AppFunctionRuntimeMetadata
+import android.app.appsearch.AppSearchManager
+import android.app.appsearch.AppSearchManager.SearchContext
+import android.app.appsearch.PutDocumentsRequest
+import android.app.appsearch.SetSchemaRequest
+import android.util.ArrayMap
+import android.util.ArraySet
+import androidx.test.platform.app.InstrumentationRegistry
+import com.google.common.truth.Truth.assertThat
+import com.google.common.util.concurrent.MoreExecutors
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class MetadataSyncAdapterTest {
+ private val context = InstrumentationRegistry.getInstrumentation().targetContext
+ private val appSearchManager = context.getSystemService(AppSearchManager::class.java)
+ private val testExecutor = MoreExecutors.directExecutor()
+
+ @Before
+ @After
+ fun clearData() {
+ val searchContext = SearchContext.Builder(TEST_DB).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use {
+ val setSchemaRequest = SetSchemaRequest.Builder().setForceOverride(true).build()
+ it.setSchema(setSchemaRequest).get()
+ }
+ }
+
+ @Test
+ fun getPackageToFunctionIdMap() {
+ val searchContext: SearchContext = SearchContext.Builder(TEST_DB).build()
+ val functionRuntimeMetadata =
+ AppFunctionRuntimeMetadata.Builder(TEST_TARGET_PKG_NAME, "testFunctionId", "").build()
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(AppFunctionRuntimeMetadata.createParentAppFunctionRuntimeSchema())
+ .addSchemas(
+ AppFunctionRuntimeMetadata.createAppFunctionRuntimeSchema(TEST_TARGET_PKG_NAME)
+ )
+ .build()
+ val putDocumentsRequest: PutDocumentsRequest =
+ PutDocumentsRequest.Builder().addGenericDocuments(functionRuntimeMetadata).build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use {
+ val setSchemaResponse = it.setSchema(setSchemaRequest).get()
+ assertThat(setSchemaResponse).isNotNull()
+ val appSearchBatchResult = it.put(putDocumentsRequest).get()
+ assertThat(appSearchBatchResult.isSuccess).isTrue()
+ }
+
+ val metadataSyncAdapter =
+ MetadataSyncAdapter(
+ testExecutor,
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext),
+ )
+ val packageToFunctionIdMap =
+ metadataSyncAdapter.getPackageToFunctionIdMap(
+ AppFunctionRuntimeMetadata.RUNTIME_SCHEMA_TYPE,
+ AppFunctionRuntimeMetadata.PROPERTY_FUNCTION_ID,
+ AppFunctionRuntimeMetadata.PROPERTY_PACKAGE_NAME,
+ )
+
+ assertThat(packageToFunctionIdMap).isNotNull()
+ assertThat(packageToFunctionIdMap[TEST_TARGET_PKG_NAME]).containsExactly("testFunctionId")
+ }
+
+ @Test
+ fun getPackageToFunctionIdMap_multipleDocuments() {
+ val searchContext: SearchContext = SearchContext.Builder(TEST_DB).build()
+ val functionRuntimeMetadata =
+ AppFunctionRuntimeMetadata.Builder(TEST_TARGET_PKG_NAME, "testFunctionId", "").build()
+ val functionRuntimeMetadata1 =
+ AppFunctionRuntimeMetadata.Builder(TEST_TARGET_PKG_NAME, "testFunctionId1", "").build()
+ val functionRuntimeMetadata2 =
+ AppFunctionRuntimeMetadata.Builder(TEST_TARGET_PKG_NAME, "testFunctionId2", "").build()
+ val functionRuntimeMetadata3 =
+ AppFunctionRuntimeMetadata.Builder(TEST_TARGET_PKG_NAME, "testFunctionId3", "").build()
+ val setSchemaRequest =
+ SetSchemaRequest.Builder()
+ .addSchemas(AppFunctionRuntimeMetadata.createParentAppFunctionRuntimeSchema())
+ .addSchemas(
+ AppFunctionRuntimeMetadata.createAppFunctionRuntimeSchema(TEST_TARGET_PKG_NAME)
+ )
+ .build()
+ val putDocumentsRequest: PutDocumentsRequest =
+ PutDocumentsRequest.Builder()
+ .addGenericDocuments(
+ functionRuntimeMetadata,
+ functionRuntimeMetadata1,
+ functionRuntimeMetadata2,
+ functionRuntimeMetadata3,
+ )
+ .build()
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext).use {
+ val setSchemaResponse = it.setSchema(setSchemaRequest).get()
+ assertThat(setSchemaResponse).isNotNull()
+ val appSearchBatchResult = it.put(putDocumentsRequest).get()
+ assertThat(appSearchBatchResult.isSuccess).isTrue()
+ }
+
+ val metadataSyncAdapter =
+ MetadataSyncAdapter(
+ testExecutor,
+ FutureAppSearchSessionImpl(appSearchManager, testExecutor, searchContext),
+ )
+ val packageToFunctionIdMap =
+ metadataSyncAdapter.getPackageToFunctionIdMap(
+ AppFunctionRuntimeMetadata.RUNTIME_SCHEMA_TYPE,
+ AppFunctionRuntimeMetadata.PROPERTY_FUNCTION_ID,
+ AppFunctionRuntimeMetadata.PROPERTY_PACKAGE_NAME,
+ )
+
+ assertThat(packageToFunctionIdMap).isNotNull()
+ assertThat(packageToFunctionIdMap[TEST_TARGET_PKG_NAME])
+ .containsExactly(
+ "testFunctionId",
+ "testFunctionId1",
+ "testFunctionId2",
+ "testFunctionId3",
+ )
+ }
+
+ @Test
+ fun getAddedFunctionsDiffMap_noDiff() {
+ val staticPackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ staticPackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1")))
+ )
+ val runtimePackageToFunctionMap: ArrayMap<String, ArraySet<String>> =
+ ArrayMap(staticPackageToFunctionMap)
+
+ val addedFunctionsDiffMap =
+ MetadataSyncAdapter.getAddedFunctionsDiffMap(
+ staticPackageToFunctionMap,
+ runtimePackageToFunctionMap,
+ )
+
+ assertThat(addedFunctionsDiffMap.isEmpty()).isEqualTo(true)
+ }
+
+ @Test
+ fun getAddedFunctionsDiffMap_addedFunction() {
+ val staticPackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ staticPackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1", "testFunction2")))
+ )
+ val runtimePackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ runtimePackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1")))
+ )
+
+ val addedFunctionsDiffMap =
+ MetadataSyncAdapter.getAddedFunctionsDiffMap(
+ staticPackageToFunctionMap,
+ runtimePackageToFunctionMap,
+ )
+
+ assertThat(addedFunctionsDiffMap.size).isEqualTo(1)
+ assertThat(addedFunctionsDiffMap[TEST_TARGET_PKG_NAME]).containsExactly("testFunction2")
+ }
+
+ @Test
+ fun getAddedFunctionsDiffMap_addedFunctionNewPackage() {
+ val staticPackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ staticPackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1")))
+ )
+ val runtimePackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+
+ val addedFunctionsDiffMap =
+ MetadataSyncAdapter.getAddedFunctionsDiffMap(
+ staticPackageToFunctionMap,
+ runtimePackageToFunctionMap,
+ )
+
+ assertThat(addedFunctionsDiffMap.size).isEqualTo(1)
+ assertThat(addedFunctionsDiffMap[TEST_TARGET_PKG_NAME]).containsExactly("testFunction1")
+ }
+
+ @Test
+ fun getAddedFunctionsDiffMap_removedFunction() {
+ val staticPackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ val runtimePackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ runtimePackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1")))
+ )
+
+ val addedFunctionsDiffMap =
+ MetadataSyncAdapter.getAddedFunctionsDiffMap(
+ staticPackageToFunctionMap,
+ runtimePackageToFunctionMap,
+ )
+
+ assertThat(addedFunctionsDiffMap.isEmpty()).isEqualTo(true)
+ }
+
+ @Test
+ fun getRemovedFunctionsDiffMap_noDiff() {
+ val staticPackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ staticPackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1")))
+ )
+ val runtimePackageToFunctionMap: ArrayMap<String, ArraySet<String>> =
+ ArrayMap(staticPackageToFunctionMap)
+
+ val removedFunctionsDiffMap =
+ MetadataSyncAdapter.getRemovedFunctionsDiffMap(
+ staticPackageToFunctionMap,
+ runtimePackageToFunctionMap,
+ )
+
+ assertThat(removedFunctionsDiffMap.isEmpty()).isEqualTo(true)
+ }
+
+ @Test
+ fun getRemovedFunctionsDiffMap_removedFunction() {
+ val staticPackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ val runtimePackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ runtimePackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1")))
+ )
+
+ val removedFunctionsDiffMap =
+ MetadataSyncAdapter.getRemovedFunctionsDiffMap(
+ staticPackageToFunctionMap,
+ runtimePackageToFunctionMap,
+ )
+
+ assertThat(removedFunctionsDiffMap.size).isEqualTo(1)
+ assertThat(removedFunctionsDiffMap[TEST_TARGET_PKG_NAME]).containsExactly("testFunction1")
+ }
+
+ @Test
+ fun getRemovedFunctionsDiffMap_addedFunction() {
+ val staticPackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+ staticPackageToFunctionMap.putAll(
+ mapOf(TEST_TARGET_PKG_NAME to ArraySet(setOf("testFunction1")))
+ )
+ val runtimePackageToFunctionMap: ArrayMap<String, ArraySet<String>> = ArrayMap()
+
+ val removedFunctionsDiffMap =
+ MetadataSyncAdapter.getRemovedFunctionsDiffMap(
+ staticPackageToFunctionMap,
+ runtimePackageToFunctionMap,
+ )
+
+ assertThat(removedFunctionsDiffMap.isEmpty()).isEqualTo(true)
+ }
+
+ private companion object {
+ const val TEST_DB: String = "test_db"
+ const val TEST_TARGET_PKG_NAME = "com.android.frameworks.appfunctionstests"
+ }
+}
diff --git a/services/tests/displayservicetests/Android.bp b/services/tests/displayservicetests/Android.bp
index 61350bf..fe73025 100644
--- a/services/tests/displayservicetests/Android.bp
+++ b/services/tests/displayservicetests/Android.bp
@@ -16,7 +16,7 @@
],
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
diff --git a/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java b/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java
index 5bb8ded..76c8e686 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java
@@ -107,6 +107,7 @@
import android.os.IBinder;
import android.os.Looper;
import android.os.MessageQueue;
+import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemProperties;
@@ -142,6 +143,7 @@
import com.android.server.display.DisplayManagerService.SyncRoot;
import com.android.server.display.config.SensorData;
import com.android.server.display.feature.DisplayManagerFlags;
+import com.android.server.display.layout.Layout;
import com.android.server.display.notifications.DisplayNotificationManager;
import com.android.server.input.InputManagerInternal;
import com.android.server.lights.LightsManager;
@@ -3053,6 +3055,74 @@
}
@Test
+ public void testBrightnessUpdates() {
+ DisplayManagerService displayManager =
+ new DisplayManagerService(mContext, mShortMockedInjector);
+ DisplayManagerInternal localService = displayManager.new LocalService();
+ DisplayManagerService.BinderService displayManagerBinderService =
+ displayManager.new BinderService();
+ registerDefaultDisplays(displayManager);
+ initDisplayPowerController(localService);
+
+ final float invalidBrightness = -0.3f;
+ final float brightnessOff = -1.0f;
+ final float minimumBrightness = 0.0f;
+ final float validBrightness = 0.5f;
+
+ Settings.System.putInt(mContext.getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS_MODE,
+ Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
+
+ // set and check valid brightness
+ waitForIdleHandler(mPowerHandler);
+ displayManagerBinderService.setBrightness(Display.DEFAULT_DISPLAY, validBrightness);
+ waitForIdleHandler(mPowerHandler);
+ assertEquals(validBrightness,
+ displayManagerBinderService.getBrightness(Display.DEFAULT_DISPLAY),
+ FLOAT_TOLERANCE);
+
+ // set and check invalid brightness
+ waitForIdleHandler(mPowerHandler);
+ displayManagerBinderService.setBrightness(Display.DEFAULT_DISPLAY, invalidBrightness);
+ waitForIdleHandler(mPowerHandler);
+ assertEquals(PowerManager.BRIGHTNESS_MIN,
+ displayManagerBinderService.getBrightness(Display.DEFAULT_DISPLAY),
+ FLOAT_TOLERANCE);
+
+ // reset and check valid brightness
+ waitForIdleHandler(mPowerHandler);
+ displayManagerBinderService.setBrightness(Display.DEFAULT_DISPLAY, validBrightness);
+ waitForIdleHandler(mPowerHandler);
+ assertEquals(validBrightness,
+ displayManagerBinderService.getBrightness(Display.DEFAULT_DISPLAY),
+ FLOAT_TOLERANCE);
+
+ // set and check brightness off
+ waitForIdleHandler(mPowerHandler);
+ displayManagerBinderService.setBrightness(Display.DEFAULT_DISPLAY, brightnessOff);
+ waitForIdleHandler(mPowerHandler);
+ assertEquals(PowerManager.BRIGHTNESS_MIN,
+ displayManagerBinderService.getBrightness(Display.DEFAULT_DISPLAY),
+ FLOAT_TOLERANCE);
+
+ // reset and check valid brightness
+ waitForIdleHandler(mPowerHandler);
+ displayManagerBinderService.setBrightness(Display.DEFAULT_DISPLAY, validBrightness);
+ waitForIdleHandler(mPowerHandler);
+ assertEquals(validBrightness,
+ displayManagerBinderService.getBrightness(Display.DEFAULT_DISPLAY),
+ FLOAT_TOLERANCE);
+
+ // set and check minimum brightness
+ waitForIdleHandler(mPowerHandler);
+ displayManagerBinderService.setBrightness(Display.DEFAULT_DISPLAY, minimumBrightness);
+ waitForIdleHandler(mPowerHandler);
+ assertEquals(PowerManager.BRIGHTNESS_MIN,
+ displayManagerBinderService.getBrightness(Display.DEFAULT_DISPLAY),
+ FLOAT_TOLERANCE);
+ }
+
+ @Test
public void testResolutionChangeGetsBackedUp() throws Exception {
when(mMockFlags.isResolutionBackupRestoreEnabled()).thenReturn(true);
DisplayManagerService displayManager =
@@ -3132,6 +3202,45 @@
argThat(matchesFilter));
}
+ @Test
+ public void testOnDisplayChanged_HbmMetadataNull() {
+ DisplayPowerController dpc = mock(DisplayPowerController.class);
+ DisplayManagerService.Injector injector = new BasicInjector() {
+ @Override
+ DisplayPowerController getDisplayPowerController(Context context,
+ DisplayPowerController.Injector injector,
+ DisplayManagerInternal.DisplayPowerCallbacks callbacks, Handler handler,
+ SensorManager sensorManager, DisplayBlanker blanker,
+ LogicalDisplay logicalDisplay, BrightnessTracker brightnessTracker,
+ BrightnessSetting brightnessSetting, Runnable onBrightnessChangeRunnable,
+ HighBrightnessModeMetadata hbmMetadata, boolean bootCompleted,
+ DisplayManagerFlags flags) {
+ return dpc;
+ }
+ };
+ DisplayManagerService displayManager = new DisplayManagerService(mContext, injector);
+ DisplayManagerInternal localService = displayManager.new LocalService();
+ registerDefaultDisplays(displayManager);
+ displayManager.onBootPhase(SystemService.PHASE_WAIT_FOR_DEFAULT_DISPLAY);
+
+ // Add the FakeDisplayDevice
+ FakeDisplayDevice displayDevice = new FakeDisplayDevice();
+ DisplayDeviceInfo displayDeviceInfo = new DisplayDeviceInfo();
+ displayDeviceInfo.state = Display.STATE_ON;
+ displayDevice.setDisplayDeviceInfo(displayDeviceInfo);
+ displayManager.getDisplayDeviceRepository()
+ .onDisplayDeviceEvent(displayDevice, DisplayAdapter.DISPLAY_DEVICE_EVENT_ADDED);
+ initDisplayPowerController(localService);
+
+ // Simulate DisplayDevice change
+ DisplayDeviceInfo displayDeviceInfo2 = new DisplayDeviceInfo();
+ displayDeviceInfo2.copyFrom(displayDeviceInfo);
+ displayDeviceInfo2.state = Display.STATE_DOZE;
+ updateDisplayDeviceInfo(displayManager, displayDevice, displayDeviceInfo2);
+
+ verify(dpc).onDisplayChanged(/* hbmMetadata= */ null, Layout.NO_LEAD_DISPLAY);
+ }
+
private void initDisplayPowerController(DisplayManagerInternal localService) {
localService.initPowerManagement(new DisplayManagerInternal.DisplayPowerCallbacks() {
@Override
diff --git a/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessClamperControllerTest.java b/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessClamperControllerTest.java
index f9dc122..da79f30 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessClamperControllerTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessClamperControllerTest.java
@@ -226,7 +226,7 @@
float clampedBrightness = 0.6f;
float customAnimationRate = 0.01f;
when(mMockClamper.getBrightnessCap()).thenReturn(clampedBrightness);
- when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.THERMAL);
+ when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.POWER);
when(mMockClamper.getCustomAnimationRate()).thenReturn(customAnimationRate);
when(mMockClamper.isActive()).thenReturn(false);
mTestInjector.mCapturedChangeListener.onChanged();
@@ -250,7 +250,7 @@
float clampedBrightness = 0.6f;
float customAnimationRate = 0.01f;
when(mMockClamper.getBrightnessCap()).thenReturn(clampedBrightness);
- when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.THERMAL);
+ when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.POWER);
when(mMockClamper.getCustomAnimationRate()).thenReturn(customAnimationRate);
when(mMockClamper.isActive()).thenReturn(true);
mTestInjector.mCapturedChangeListener.onChanged();
@@ -274,7 +274,7 @@
float clampedBrightness = 0.8f;
float customAnimationRate = 0.01f;
when(mMockClamper.getBrightnessCap()).thenReturn(clampedBrightness);
- when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.THERMAL);
+ when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.POWER);
when(mMockClamper.getCustomAnimationRate()).thenReturn(customAnimationRate);
when(mMockClamper.isActive()).thenReturn(true);
mTestInjector.mCapturedChangeListener.onChanged();
@@ -298,7 +298,7 @@
float clampedBrightness = 0.6f;
float customAnimationRate = 0.01f;
when(mMockClamper.getBrightnessCap()).thenReturn(clampedBrightness);
- when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.THERMAL);
+ when(mMockClamper.getType()).thenReturn(BrightnessClamper.Type.POWER);
when(mMockClamper.getCustomAnimationRate()).thenReturn(customAnimationRate);
when(mMockClamper.isActive()).thenReturn(true);
mTestInjector.mCapturedChangeListener.onChanged();
diff --git a/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessThermalClamperTest.java b/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessThermalClamperTest.java
deleted file mode 100644
index 9d16594..0000000
--- a/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessThermalClamperTest.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server.display.brightness.clamper;
-
-import static com.android.server.display.config.DisplayDeviceConfigTestUtilsKt.createSensorData;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
-
-import android.hardware.display.DisplayManager;
-import android.os.IThermalEventListener;
-import android.os.IThermalService;
-import android.os.PowerManager;
-import android.os.RemoteException;
-import android.os.Temperature;
-import android.provider.DeviceConfig;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-import com.android.internal.annotations.Keep;
-import com.android.server.display.DisplayDeviceConfig;
-import com.android.server.display.DisplayDeviceConfig.ThermalBrightnessThrottlingData;
-import com.android.server.display.DisplayDeviceConfig.ThermalBrightnessThrottlingData.ThrottlingLevel;
-import com.android.server.display.config.SensorData;
-import com.android.server.display.feature.DeviceConfigParameterProvider;
-import com.android.server.testutils.FakeDeviceConfigInterface;
-import com.android.server.testutils.TestHandler;
-
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-import java.util.List;
-
-@RunWith(JUnitParamsRunner.class)
-public class BrightnessThermalClamperTest {
-
- private static final float FLOAT_TOLERANCE = 0.001f;
-
- private static final String DISPLAY_ID = "displayId";
- @Mock
- private IThermalService mMockThermalService;
- @Mock
- private BrightnessClamperController.ClamperChangeListener mMockClamperChangeListener;
-
- private final FakeDeviceConfigInterface mFakeDeviceConfigInterface =
- new FakeDeviceConfigInterface();
- private final TestHandler mTestHandler = new TestHandler(null);
- private BrightnessThermalClamper mClamper;
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
- mClamper = new BrightnessThermalClamper(new TestInjector(), mTestHandler,
- mMockClamperChangeListener, new TestThermalData());
- mTestHandler.flush();
- }
-
- @Test
- public void testTypeIsThermal() {
- assertEquals(BrightnessClamper.Type.THERMAL, mClamper.getType());
- }
-
- @Test
- public void testNoThrottlingData() {
- assertFalse(mClamper.isActive());
- assertEquals(PowerManager.BRIGHTNESS_MAX, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
- }
-
- @Keep
- private static Object[][] testThrottlingData() {
- // throttlingLevels, throttlingStatus, expectedActive, expectedBrightness
- return new Object[][] {
- // no throttling data
- {List.of(), Temperature.THROTTLING_LIGHT, false, PowerManager.BRIGHTNESS_MAX},
- // throttlingStatus < min throttling data
- {List.of(
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
- Temperature.THROTTLING_LIGHT, false, PowerManager.BRIGHTNESS_MAX},
- // throttlingStatus = min throttling data
- {List.of(
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
- Temperature.THROTTLING_MODERATE, true, 0.5f},
- // throttlingStatus between min and max throttling data
- {List.of(
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
- Temperature.THROTTLING_SEVERE, true, 0.5f},
- // throttlingStatus = max throttling data
- {List.of(
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
- Temperature.THROTTLING_CRITICAL, true, 0.1f},
- // throttlingStatus > max throttling data
- {List.of(
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
- new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
- Temperature.THROTTLING_EMERGENCY, true, 0.1f},
- };
- }
- @Test
- @Parameters(method = "testThrottlingData")
- public void testNotifyThrottlingAfterOnDisplayChange(List<ThrottlingLevel> throttlingLevels,
- @Temperature.ThrottlingStatus int throttlingStatus,
- boolean expectedActive, float expectedBrightness) throws RemoteException {
- IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
- mClamper.onDisplayChanged(new TestThermalData(throttlingLevels));
- mTestHandler.flush();
- assertFalse(mClamper.isActive());
- assertEquals(PowerManager.BRIGHTNESS_MAX, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
-
- thermalEventListener.notifyThrottling(createSkinTemperature(throttlingStatus));
- mTestHandler.flush();
- assertEquals(expectedActive, mClamper.isActive());
- assertEquals(expectedBrightness, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
- }
-
- @Test
- @Parameters(method = "testThrottlingData")
- public void testOnDisplayChangeAfterNotifyThrottling(List<ThrottlingLevel> throttlingLevels,
- @Temperature.ThrottlingStatus int throttlingStatus,
- boolean expectedActive, float expectedBrightness) throws RemoteException {
- IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
- thermalEventListener.notifyThrottling(createSkinTemperature(throttlingStatus));
- mTestHandler.flush();
- assertFalse(mClamper.isActive());
- assertEquals(PowerManager.BRIGHTNESS_MAX, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
-
- mClamper.onDisplayChanged(new TestThermalData(throttlingLevels));
- mTestHandler.flush();
- assertEquals(expectedActive, mClamper.isActive());
- assertEquals(expectedBrightness, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
- }
-
- @Test
- public void testOverrideData() throws RemoteException {
- IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
- thermalEventListener.notifyThrottling(createSkinTemperature(Temperature.THROTTLING_SEVERE));
- mTestHandler.flush();
- assertFalse(mClamper.isActive());
- assertEquals(PowerManager.BRIGHTNESS_MAX, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
-
- mClamper.onDisplayChanged(new TestThermalData(
- List.of(new ThrottlingLevel(PowerManager.THERMAL_STATUS_SEVERE, 0.5f))));
- mTestHandler.flush();
- assertTrue(mClamper.isActive());
- assertEquals(0.5f, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
-
- overrideThrottlingData("displayId,1,emergency,0.4");
- mClamper.onDeviceConfigChanged();
- mTestHandler.flush();
-
- assertFalse(mClamper.isActive());
- assertEquals(PowerManager.BRIGHTNESS_MAX, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
-
- overrideThrottlingData("displayId,1,moderate,0.4");
- mClamper.onDeviceConfigChanged();
- mTestHandler.flush();
-
- assertTrue(mClamper.isActive());
- assertEquals(0.4f, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
- }
-
- @Test
- public void testDisplaySensorBasedThrottling() throws RemoteException {
- final int severity = PowerManager.THERMAL_STATUS_SEVERE;
- IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
- // Update config to listen to display type sensor.
- final SensorData tempSensor = createSensorData("DISPLAY", "VIRTUAL-SKIN-DISPLAY");
- final TestThermalData thermalData =
- new TestThermalData(
- DISPLAY_ID,
- DisplayDeviceConfig.DEFAULT_ID,
- List.of(new ThrottlingLevel(severity, 0.5f)),
- tempSensor);
- mClamper.onDisplayChanged(thermalData);
- mTestHandler.flush();
- verify(mMockThermalService).unregisterThermalEventListener(thermalEventListener);
- thermalEventListener = captureThermalEventListener(Temperature.TYPE_DISPLAY);
- assertFalse(mClamper.isActive());
-
- // Verify no throttling triggered when any other sensor notification received.
- thermalEventListener.notifyThrottling(createSkinTemperature(severity));
- mTestHandler.flush();
- assertFalse(mClamper.isActive());
-
- thermalEventListener.notifyThrottling(createDisplayTemperature("OTHER-SENSOR", severity));
- mTestHandler.flush();
- assertFalse(mClamper.isActive());
-
- assertEquals(PowerManager.BRIGHTNESS_MAX, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
-
- // Verify throttling triggered when display sensor of given name throttled.
- thermalEventListener.notifyThrottling(createDisplayTemperature(tempSensor.name, severity));
- mTestHandler.flush();
- assertTrue(mClamper.isActive());
- assertEquals(0.5f, mClamper.getBrightnessCap(), FLOAT_TOLERANCE);
- }
-
- private IThermalEventListener captureSkinThermalEventListener() throws RemoteException {
- return captureThermalEventListener(Temperature.TYPE_SKIN);
- }
-
- private IThermalEventListener captureThermalEventListener(int type) throws RemoteException {
- ArgumentCaptor<IThermalEventListener> captor = ArgumentCaptor.forClass(
- IThermalEventListener.class);
- verify(mMockThermalService).registerThermalEventListenerWithType(captor.capture(), eq(
- type));
- return captor.getValue();
- }
-
- private Temperature createDisplayTemperature(
- @NonNull String sensorName, @Temperature.ThrottlingStatus int status) {
- return new Temperature(100, Temperature.TYPE_DISPLAY, sensorName, status);
- }
-
- private Temperature createSkinTemperature(@Temperature.ThrottlingStatus int status) {
- return new Temperature(100, Temperature.TYPE_SKIN, "test_temperature", status);
- }
-
- private void overrideThrottlingData(String data) {
- mFakeDeviceConfigInterface.putProperty(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
- DisplayManager.DeviceConfig.KEY_BRIGHTNESS_THROTTLING_DATA, data);
- }
-
- private class TestInjector extends BrightnessThermalClamper.Injector {
- @Override
- IThermalService getThermalService() {
- return mMockThermalService;
- }
-
- @Override
- DeviceConfigParameterProvider getDeviceConfigParameterProvider() {
- return new DeviceConfigParameterProvider(mFakeDeviceConfigInterface);
- }
- }
-
- private static class TestThermalData implements BrightnessThermalClamper.ThermalData {
-
- private final String mUniqueDisplayId;
- private final String mDataId;
- private final ThermalBrightnessThrottlingData mData;
- private final SensorData mTempSensor;
-
- private TestThermalData() {
- this(DISPLAY_ID, DisplayDeviceConfig.DEFAULT_ID, null,
- SensorData.loadTempSensorUnspecifiedConfig());
- }
-
- private TestThermalData(List<ThrottlingLevel> data) {
- this(DISPLAY_ID, DisplayDeviceConfig.DEFAULT_ID, data,
- SensorData.loadTempSensorUnspecifiedConfig());
- }
-
- private TestThermalData(String uniqueDisplayId, String dataId, List<ThrottlingLevel> data,
- SensorData tempSensor) {
- mUniqueDisplayId = uniqueDisplayId;
- mDataId = dataId;
- mData = ThermalBrightnessThrottlingData.create(data);
- mTempSensor = tempSensor;
- }
-
- @NonNull
- @Override
- public String getUniqueDisplayId() {
- return mUniqueDisplayId;
- }
-
- @NonNull
- @Override
- public String getThermalThrottlingDataId() {
- return mDataId;
- }
-
- @Nullable
- @Override
- public ThermalBrightnessThrottlingData getThermalBrightnessThrottlingData() {
- return mData;
- }
-
- @NonNull
- @Override
- public SensorData getTempSensor() {
- return mTempSensor;
- }
- }
-}
diff --git a/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessThermalModifierTest.java b/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessThermalModifierTest.java
new file mode 100644
index 0000000..35d384b
--- /dev/null
+++ b/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/BrightnessThermalModifierTest.java
@@ -0,0 +1,378 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.display.brightness.clamper;
+
+import static com.android.server.display.config.DisplayDeviceConfigTestUtilsKt.createSensorData;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.hardware.display.BrightnessInfo;
+import android.hardware.display.DisplayManager;
+import android.hardware.display.DisplayManagerInternal;
+import android.os.IBinder;
+import android.os.IThermalEventListener;
+import android.os.IThermalService;
+import android.os.PowerManager;
+import android.os.RemoteException;
+import android.os.Temperature;
+import android.provider.DeviceConfig;
+
+import androidx.annotation.NonNull;
+
+import com.android.internal.annotations.Keep;
+import com.android.server.display.DisplayBrightnessState;
+import com.android.server.display.DisplayDeviceConfig;
+import com.android.server.display.DisplayDeviceConfig.ThermalBrightnessThrottlingData;
+import com.android.server.display.DisplayDeviceConfig.ThermalBrightnessThrottlingData.ThrottlingLevel;
+import com.android.server.display.brightness.BrightnessReason;
+import com.android.server.display.brightness.clamper.BrightnessClamperController.ModifiersAggregatedState;
+import com.android.server.display.config.SensorData;
+import com.android.server.display.feature.DeviceConfigParameterProvider;
+import com.android.server.testutils.FakeDeviceConfigInterface;
+import com.android.server.testutils.TestHandler;
+
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RunWith(JUnitParamsRunner.class)
+public class BrightnessThermalModifierTest {
+ private static final int NO_MODIFIER = 0;
+
+ private static final float FLOAT_TOLERANCE = 0.001f;
+
+ private static final String DISPLAY_ID = "displayId";
+ @Mock
+ private IThermalService mMockThermalService;
+ @Mock
+ private BrightnessClamperController.ClamperChangeListener mMockClamperChangeListener;
+ @Mock
+ private DisplayManagerInternal.DisplayPowerRequest mMockRequest;
+ @Mock
+ private DisplayDeviceConfig mMockDisplayDeviceConfig;
+ @Mock
+ private IBinder mMockBinder;
+
+ private final FakeDeviceConfigInterface mFakeDeviceConfigInterface =
+ new FakeDeviceConfigInterface();
+ private final TestHandler mTestHandler = new TestHandler(null);
+ private BrightnessThermalModifier mModifier;
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ when(mMockDisplayDeviceConfig.getTempSensor())
+ .thenReturn(SensorData.loadTempSensorUnspecifiedConfig());
+ mModifier = new BrightnessThermalModifier(new TestInjector(), mTestHandler,
+ mMockClamperChangeListener,
+ ClamperTestUtilsKt.createDisplayDeviceData(mMockDisplayDeviceConfig, mMockBinder));
+ mTestHandler.flush();
+ }
+
+
+ @Test
+ public void testNoThrottlingData() {
+ assertModifierState(
+ 0.3f, true,
+ PowerManager.BRIGHTNESS_MAX, 0.3f,
+ false, true);
+ }
+
+ @Keep
+ private static Object[][] testThrottlingData() {
+ // throttlingLevels, throttlingStatus, expectedActive, expectedBrightness
+ return new Object[][] {
+ // no throttling data
+ {List.of(), Temperature.THROTTLING_LIGHT, false, PowerManager.BRIGHTNESS_MAX},
+ // throttlingStatus < min throttling data
+ {List.of(
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
+ Temperature.THROTTLING_LIGHT, false, PowerManager.BRIGHTNESS_MAX},
+ // throttlingStatus = min throttling data
+ {List.of(
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
+ Temperature.THROTTLING_MODERATE, true, 0.5f},
+ // throttlingStatus between min and max throttling data
+ {List.of(
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
+ Temperature.THROTTLING_SEVERE, true, 0.5f},
+ // throttlingStatus = max throttling data
+ {List.of(
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
+ Temperature.THROTTLING_CRITICAL, true, 0.1f},
+ // throttlingStatus > max throttling data
+ {List.of(
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.5f),
+ new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.1f)),
+ Temperature.THROTTLING_EMERGENCY, true, 0.1f},
+ };
+ }
+ @Test
+ @Parameters(method = "testThrottlingData")
+ public void testNotifyThrottlingAfterOnDisplayChange(List<ThrottlingLevel> throttlingLevels,
+ @Temperature.ThrottlingStatus int throttlingStatus,
+ boolean expectedActive, float expectedBrightness) throws RemoteException {
+ IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
+ onDisplayChange(throttlingLevels);
+ mTestHandler.flush();
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ PowerManager.BRIGHTNESS_MAX, PowerManager.BRIGHTNESS_MAX,
+ false, true);
+
+ thermalEventListener.notifyThrottling(createSkinTemperature(throttlingStatus));
+ mTestHandler.flush();
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ expectedBrightness, expectedBrightness,
+ expectedActive, !expectedActive);
+ }
+
+ @Test
+ @Parameters(method = "testThrottlingData")
+ public void testOnDisplayChangeAfterNotifyThrottling(List<ThrottlingLevel> throttlingLevels,
+ @Temperature.ThrottlingStatus int throttlingStatus,
+ boolean expectedActive, float expectedBrightness) throws RemoteException {
+ IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
+ thermalEventListener.notifyThrottling(createSkinTemperature(throttlingStatus));
+ mTestHandler.flush();
+
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ PowerManager.BRIGHTNESS_MAX, PowerManager.BRIGHTNESS_MAX,
+ false, true);
+
+ onDisplayChange(throttlingLevels);
+ mTestHandler.flush();
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ expectedBrightness, expectedBrightness,
+ expectedActive, !expectedActive);
+ }
+
+ @Test
+ public void testAppliesFastChangeOnlyOnActivation() throws RemoteException {
+ IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
+ onDisplayChange(List.of(new ThrottlingLevel(PowerManager.THERMAL_STATUS_SEVERE, 0.5f)));
+ mTestHandler.flush();
+
+ thermalEventListener.notifyThrottling(createSkinTemperature(Temperature.THROTTLING_SEVERE));
+ mTestHandler.flush();
+
+ // expectedSlowChange = false
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ 0.5f, 0.5f,
+ true, false);
+
+ // slowChange is unchanged
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ 0.5f, 0.5f,
+ true, true);
+ }
+
+ @Test
+ public void testCapsMaxBrightnessOnly_currentBrightnessIsLowAndFastChange()
+ throws RemoteException {
+ IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
+ onDisplayChange(List.of(new ThrottlingLevel(PowerManager.THERMAL_STATUS_SEVERE, 0.5f)));
+ mTestHandler.flush();
+
+ thermalEventListener.notifyThrottling(createSkinTemperature(Temperature.THROTTLING_SEVERE));
+ mTestHandler.flush();
+
+ assertModifierState(
+ 0.1f, false,
+ 0.5f, 0.1f,
+ true, false);
+ }
+
+ @Test
+ public void testOverrideData() throws RemoteException {
+ IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
+ thermalEventListener.notifyThrottling(createSkinTemperature(Temperature.THROTTLING_SEVERE));
+ mTestHandler.flush();
+
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ PowerManager.BRIGHTNESS_MAX, PowerManager.BRIGHTNESS_MAX,
+ false, true);
+
+ onDisplayChange(List.of(new ThrottlingLevel(PowerManager.THERMAL_STATUS_SEVERE, 0.5f)));
+ mTestHandler.flush();
+
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ 0.5f, 0.5f,
+ true, false);
+
+ overrideThrottlingData("displayId,1,emergency,0.4");
+ mModifier.onDeviceConfigChanged();
+ mTestHandler.flush();
+
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ PowerManager.BRIGHTNESS_MAX, PowerManager.BRIGHTNESS_MAX,
+ false, true);
+
+ overrideThrottlingData("displayId,1,moderate,0.4");
+ mModifier.onDeviceConfigChanged();
+ mTestHandler.flush();
+
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ 0.4f, 0.4f,
+ true, false);
+ }
+
+ @Test
+ public void testDisplaySensorBasedThrottling() throws RemoteException {
+ final int severity = PowerManager.THERMAL_STATUS_SEVERE;
+ IThermalEventListener thermalEventListener = captureSkinThermalEventListener();
+ // Update config to listen to display type sensor.
+ SensorData tempSensor = createSensorData("DISPLAY", "VIRTUAL-SKIN-DISPLAY");
+
+ when(mMockDisplayDeviceConfig.getTempSensor()).thenReturn(tempSensor);
+ onDisplayChange(List.of(new ThrottlingLevel(severity, 0.5f)));
+ mTestHandler.flush();
+
+ verify(mMockThermalService).unregisterThermalEventListener(thermalEventListener);
+ thermalEventListener = captureThermalEventListener(Temperature.TYPE_DISPLAY);
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ PowerManager.BRIGHTNESS_MAX, PowerManager.BRIGHTNESS_MAX,
+ false, true);
+
+ // Verify no throttling triggered when any other sensor notification received.
+ thermalEventListener.notifyThrottling(createSkinTemperature(severity));
+ mTestHandler.flush();
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ PowerManager.BRIGHTNESS_MAX, PowerManager.BRIGHTNESS_MAX,
+ false, true);
+
+ thermalEventListener.notifyThrottling(createDisplayTemperature("OTHER-SENSOR", severity));
+ mTestHandler.flush();
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ PowerManager.BRIGHTNESS_MAX, PowerManager.BRIGHTNESS_MAX,
+ false, true);
+
+ // Verify throttling triggered when display sensor of given name throttled.
+ thermalEventListener.notifyThrottling(createDisplayTemperature(tempSensor.name, severity));
+ mTestHandler.flush();
+ assertModifierState(
+ PowerManager.BRIGHTNESS_MAX, true,
+ 0.5f, 0.5f,
+ true, false);
+ }
+
+ private IThermalEventListener captureSkinThermalEventListener() throws RemoteException {
+ return captureThermalEventListener(Temperature.TYPE_SKIN);
+ }
+
+ private IThermalEventListener captureThermalEventListener(int type) throws RemoteException {
+ ArgumentCaptor<IThermalEventListener> captor = ArgumentCaptor.forClass(
+ IThermalEventListener.class);
+ verify(mMockThermalService).registerThermalEventListenerWithType(captor.capture(), eq(
+ type));
+ return captor.getValue();
+ }
+
+ private Temperature createDisplayTemperature(
+ @NonNull String sensorName, @Temperature.ThrottlingStatus int status) {
+ return new Temperature(100, Temperature.TYPE_DISPLAY, sensorName, status);
+ }
+
+ private Temperature createSkinTemperature(@Temperature.ThrottlingStatus int status) {
+ return new Temperature(100, Temperature.TYPE_SKIN, "test_temperature", status);
+ }
+
+ private void overrideThrottlingData(String data) {
+ mFakeDeviceConfigInterface.putProperty(DeviceConfig.NAMESPACE_DISPLAY_MANAGER,
+ DisplayManager.DeviceConfig.KEY_BRIGHTNESS_THROTTLING_DATA, data);
+ }
+
+ private void onDisplayChange(List<ThrottlingLevel> throttlingLevels) {
+ Map<String, ThermalBrightnessThrottlingData> throttlingLevelsMap = new HashMap<>();
+ throttlingLevelsMap.put(DisplayDeviceConfig.DEFAULT_ID,
+ ThermalBrightnessThrottlingData.create(throttlingLevels));
+ when(mMockDisplayDeviceConfig.getThermalBrightnessThrottlingDataMapByThrottlingId())
+ .thenReturn(throttlingLevelsMap);
+ mModifier.onDisplayChanged(ClamperTestUtilsKt.createDisplayDeviceData(
+ mMockDisplayDeviceConfig, mMockBinder, DISPLAY_ID, DisplayDeviceConfig.DEFAULT_ID));
+ }
+
+ private void assertModifierState(
+ float currentBrightness,
+ boolean currentSlowChange,
+ float maxBrightness, float brightness,
+ boolean isActive,
+ boolean isSlowChange) {
+ ModifiersAggregatedState modifierState = new ModifiersAggregatedState();
+ DisplayBrightnessState.Builder stateBuilder = DisplayBrightnessState.builder();
+ stateBuilder.setBrightness(currentBrightness);
+ stateBuilder.setIsSlowChange(currentSlowChange);
+
+ int maxBrightnessReason = isActive ? BrightnessInfo.BRIGHTNESS_MAX_REASON_THERMAL
+ : BrightnessInfo.BRIGHTNESS_MAX_REASON_NONE;
+ int modifier = isActive ? BrightnessReason.MODIFIER_THROTTLED : NO_MODIFIER;
+
+ mModifier.applyStateChange(modifierState);
+ assertThat(modifierState.mMaxBrightness).isEqualTo(maxBrightness);
+ assertThat(modifierState.mMaxBrightnessReason).isEqualTo(maxBrightnessReason);
+
+ mModifier.apply(mMockRequest, stateBuilder);
+
+ assertThat(stateBuilder.getMaxBrightness()).isWithin(FLOAT_TOLERANCE).of(maxBrightness);
+ assertThat(stateBuilder.getBrightness()).isWithin(FLOAT_TOLERANCE).of(brightness);
+ assertThat(stateBuilder.getBrightnessMaxReason()).isEqualTo(maxBrightnessReason);
+ assertThat(stateBuilder.getBrightnessReason().getModifier()).isEqualTo(modifier);
+ assertThat(stateBuilder.isSlowChange()).isEqualTo(isSlowChange);
+ }
+
+
+ private class TestInjector extends BrightnessThermalModifier.Injector {
+ @Override
+ IThermalService getThermalService() {
+ return mMockThermalService;
+ }
+
+ @Override
+ DeviceConfigParameterProvider getDeviceConfigParameterProvider() {
+ return new DeviceConfigParameterProvider(mFakeDeviceConfigInterface);
+ }
+ }
+}
diff --git a/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/ClamperTestUtils.kt b/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/ClamperTestUtils.kt
index 5fd848f..f21749e 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/ClamperTestUtils.kt
+++ b/services/tests/displayservicetests/src/com/android/server/display/brightness/clamper/ClamperTestUtils.kt
@@ -21,6 +21,7 @@
import com.android.server.display.DisplayDeviceConfig
import com.android.server.display.brightness.clamper.BrightnessClamperController.DisplayDeviceData
+@JvmOverloads
fun createDisplayDeviceData(
displayDeviceConfig: DisplayDeviceConfig,
displayToken: IBinder,
diff --git a/services/tests/mockingservicestests/Android.bp b/services/tests/mockingservicestests/Android.bp
index 5a76931..c81d6be 100644
--- a/services/tests/mockingservicestests/Android.bp
+++ b/services/tests/mockingservicestests/Android.bp
@@ -80,9 +80,9 @@
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
"servicestests-core-utils",
],
@@ -118,14 +118,14 @@
"mockito-target-extended-minus-junit4",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
}
android_ravenwood_test {
name: "FrameworksMockingServicesTestsRavenwood",
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.annotation_annotation",
@@ -138,8 +138,6 @@
auto_gen_config: true,
}
-FLAKY = ["androidx.test.filters.FlakyTest"]
-
test_module_config {
name: "FrameworksMockingServicesTests_blob",
base: "FrameworksMockingServicesTests",
@@ -152,7 +150,6 @@
base: "FrameworksMockingServicesTests",
test_suites: ["device-tests"],
include_filters: ["com.android.server.DeviceIdleControllerTest"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -161,7 +158,6 @@
test_suites: ["device-tests"],
include_filters: ["com.android.server.AppStateTrackerTest"],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -177,7 +173,6 @@
test_suites: ["device-tests"],
include_filters: ["com.android.server.alarm"],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -185,7 +180,7 @@
base: "FrameworksMockingServicesTests",
test_suites: ["device-tests"],
include_filters: ["com.android.server.job"],
- exclude_annotations: FLAKY + ["androidx.test.filters.LargeTest"],
+ exclude_annotations: ["androidx.test.filters.LargeTest"],
}
test_module_config {
@@ -200,7 +195,6 @@
base: "FrameworksMockingServicesTests",
test_suites: ["device-tests"],
include_filters: ["com.android.server.tare"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -215,7 +209,6 @@
base: "FrameworksMockingServicesTests",
test_suites: ["device-tests"],
include_filters: ["android.service.games"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -245,7 +238,6 @@
test_suites: ["device-tests"],
include_filters: ["com.android.server.am."],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -265,7 +257,6 @@
test_suites: ["device-tests"],
// Matches appop too
include_filters: ["com.android.server.app"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -301,7 +292,6 @@
base: "FrameworksMockingServicesTests",
test_suites: ["device-tests"],
include_filters: ["com.android.server.pm"],
- exclude_annotations: FLAKY + ["org.junit.Ignore"],
}
test_module_config {
@@ -309,7 +299,6 @@
base: "FrameworksMockingServicesTests",
test_suites: ["device-tests"],
include_filters: ["com.android.server.power"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -324,7 +313,6 @@
base: "FrameworksMockingServicesTests",
test_suites: ["device-tests"],
include_filters: ["com.android.server.trust"],
- exclude_annotations: FLAKY,
}
test_module_config {
@@ -403,3 +391,13 @@
],
include_filters: ["com.android.server.trust"],
}
+
+test_module_config {
+ name: "FrameworksMockingServicesTests_server_storagemanagerservicetest",
+ base: "FrameworksMockingServicesTests",
+ test_suites: [
+ "automotive-tests",
+ "device-tests",
+ ],
+ include_filters: ["com.android.server.StorageManagerServiceTest"],
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
index d957355..5ec5302 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
@@ -438,6 +438,28 @@
@SuppressWarnings("GuardedBy")
@Test
+ public void testUpdateOomAdj_DoOne_TopSleepingReceivingBroadcast() {
+ ProcessRecord app = spy(makeDefaultProcessRecord(MOCKAPP_PID, MOCKAPP_UID,
+ MOCKAPP_PROCESSNAME, MOCKAPP_PACKAGENAME, true));
+ doReturn(PROCESS_STATE_TOP_SLEEPING).when(mService.mAtmInternal).getTopProcessState();
+ doReturn(app).when(mService).getTopApp();
+ updateOomAdj(app);
+
+ assertProcStates(app, PROCESS_STATE_TOP_SLEEPING, FOREGROUND_APP_ADJ,
+ SCHED_GROUP_BACKGROUND);
+ assertTrue(app.mState.hasForegroundActivities());
+
+ doReturn(true).when(mService).isReceivingBroadcastLocked(any(ProcessRecord.class),
+ any(int[].class));
+ updateOomAdj(app);
+
+ assertProcStates(app, PROCESS_STATE_RECEIVER, FOREGROUND_APP_ADJ, SCHED_GROUP_BACKGROUND);
+ assertTrue(app.mState.hasForegroundActivities());
+
+ }
+
+ @SuppressWarnings("GuardedBy")
+ @Test
public void testUpdateOomAdj_DoOne_ExecutingService() {
ProcessRecord app = spy(makeDefaultProcessRecord(MOCKAPP_PID, MOCKAPP_UID,
MOCKAPP_PROCESSNAME, MOCKAPP_PACKAGENAME, true));
@@ -1182,6 +1204,25 @@
@SuppressWarnings("GuardedBy")
@Test
+ public void testUpdateOomAdj_DoOne_BoundFgService_Sleeping() {
+ ProcessRecord app = spy(makeDefaultProcessRecord(MOCKAPP_PID, MOCKAPP_UID,
+ MOCKAPP_PROCESSNAME, MOCKAPP_PACKAGENAME, false));
+ ProcessRecord client = spy(makeDefaultProcessRecord(MOCKAPP2_PID, MOCKAPP2_UID,
+ MOCKAPP2_PROCESSNAME, MOCKAPP2_PACKAGENAME, false));
+ bindService(app, client, null, null, Context.BIND_FOREGROUND_SERVICE, mock(IBinder.class));
+ client.mState.setMaxAdj(PERSISTENT_PROC_ADJ);
+ mService.mWakefulness.set(PowerManagerInternal.WAKEFULNESS_ASLEEP);
+ updateOomAdj(client, app);
+ mService.mWakefulness.set(PowerManagerInternal.WAKEFULNESS_AWAKE);
+
+ assertProcStates(app, PROCESS_STATE_BOUND_FOREGROUND_SERVICE, VISIBLE_APP_ADJ,
+ SCHED_GROUP_RESTRICTED);
+ assertProcStates(client, PROCESS_STATE_PERSISTENT, PERSISTENT_PROC_ADJ,
+ SCHED_GROUP_DEFAULT);
+ }
+
+ @SuppressWarnings("GuardedBy")
+ @Test
public void testUpdateOomAdj_DoOne_Service_BoundNotForeground() {
ProcessRecord app = spy(makeDefaultProcessRecord(MOCKAPP_PID, MOCKAPP_UID,
MOCKAPP_PROCESSNAME, MOCKAPP_PACKAGENAME, false));
@@ -2766,6 +2807,30 @@
@SuppressWarnings("GuardedBy")
@Test
+ public void testUpdateOomAdj_DoOne_AboveClient() {
+ ProcessRecord app = spy(makeDefaultProcessRecord(MOCKAPP_PID, MOCKAPP_UID,
+ MOCKAPP_PROCESSNAME, MOCKAPP_PACKAGENAME, true));
+ ProcessRecord service = spy(makeDefaultProcessRecord(MOCKAPP2_PID, MOCKAPP2_UID,
+ MOCKAPP2_PROCESSNAME, MOCKAPP2_PACKAGENAME, true));
+ doReturn(PROCESS_STATE_TOP).when(mService.mAtmInternal).getTopProcessState();
+ doReturn(app).when(mService).getTopApp();
+ mService.mWakefulness.set(PowerManagerInternal.WAKEFULNESS_AWAKE);
+ updateOomAdj(app);
+
+ assertEquals(FOREGROUND_APP_ADJ, app.mState.getSetAdj());
+
+ // Simulate binding to a service in the same process using BIND_ABOVE_CLIENT and
+ // verify that its OOM adjustment level is unaffected.
+ bindService(service, app, null, null, Context.BIND_ABOVE_CLIENT, mock(IBinder.class));
+ app.mServices.updateHasAboveClientLocked();
+ assertTrue(app.mServices.hasAboveClient());
+
+ updateOomAdj(app);
+ assertEquals(VISIBLE_APP_ADJ, app.mState.getSetAdj());
+ }
+
+ @SuppressWarnings("GuardedBy")
+ @Test
public void testUpdateOomAdj_DoOne_AboveClient_SameProcess() {
ProcessRecord app = spy(makeDefaultProcessRecord(MOCKAPP_PID, MOCKAPP_UID,
MOCKAPP_PROCESSNAME, MOCKAPP_PACKAGENAME, true));
diff --git a/services/tests/mockingservicestests/src/com/android/server/job/JobParametersTest.java b/services/tests/mockingservicestests/src/com/android/server/job/JobParametersTest.java
new file mode 100644
index 0000000..c8e4f89
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/job/JobParametersTest.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.job;
+
+import static android.app.job.Flags.FLAG_CLEANUP_EMPTY_JOBS;
+
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.when;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+
+import android.app.job.IJobCallback;
+import android.app.job.JobParameters;
+import android.net.Uri;
+import android.os.Parcel;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+import android.platform.test.flag.junit.SetFlagsRule;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoSession;
+import org.mockito.quality.Strictness;
+
+public class JobParametersTest {
+ private static final String TAG = JobParametersTest.class.getSimpleName();
+ private static final int TEST_JOB_ID_1 = 123;
+ private static final String TEST_NAMESPACE = "TEST_NAMESPACE";
+ private static final String TEST_DEBUG_STOP_REASON = "TEST_DEBUG_STOP_REASON";
+ @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+
+ private MockitoSession mMockingSession;
+ @Mock private Parcel mMockParcel;
+ @Mock private IJobCallback.Stub mMockJobCallbackStub;
+
+ @Before
+ public void setUp() throws Exception {
+ mMockingSession =
+ mockitoSession().initMocks(this).strictness(Strictness.LENIENT).startMocking();
+ }
+
+ @After
+ public void tearDown() {
+ if (mMockingSession != null) {
+ mMockingSession.finishMocking();
+ }
+
+ when(mMockParcel.readInt())
+ .thenReturn(TEST_JOB_ID_1) // Job ID
+ .thenReturn(0) // No clip data
+ .thenReturn(0) // No deadline expired
+ .thenReturn(0) // No network
+ .thenReturn(0) // No stop reason
+ .thenReturn(0); // Internal stop reason
+ when(mMockParcel.readString())
+ .thenReturn(TEST_NAMESPACE) // Job namespace
+ .thenReturn(TEST_DEBUG_STOP_REASON); // Debug stop reason
+ when(mMockParcel.readPersistableBundle()).thenReturn(null);
+ when(mMockParcel.readBundle()).thenReturn(null);
+ when(mMockParcel.readStrongBinder()).thenReturn(mMockJobCallbackStub);
+ when(mMockParcel.readBoolean())
+ .thenReturn(false) // expedited
+ .thenReturn(false); // user initiated
+ when(mMockParcel.createTypedArray(any())).thenReturn(new Uri[0]);
+ when(mMockParcel.createStringArray()).thenReturn(new String[0]);
+ }
+
+ /**
+ * Test to verify that the JobParameters created using Non-Parcelable constructor has not
+ * cleaner attached
+ */
+ @Test
+ public void testJobParametersNonParcelableConstructor_noCleaner() {
+ JobParameters jobParameters =
+ new JobParameters(
+ null,
+ TEST_NAMESPACE,
+ TEST_JOB_ID_1,
+ null,
+ null,
+ null,
+ 0,
+ false,
+ false,
+ false,
+ null,
+ null,
+ null);
+
+ // Verify that cleaner is not registered
+ assertThat(jobParameters.getCleanable()).isNull();
+ assertThat(jobParameters.getJobCleanupCallback()).isNull();
+ }
+
+ /**
+ * Test to verify that the JobParameters created using Parcelable constructor has not cleaner
+ * attached
+ */
+ @Test
+ public void testJobParametersParcelableConstructor_noCleaner() {
+ JobParameters jobParameters = JobParameters.CREATOR.createFromParcel(mMockParcel);
+
+ // Verify that cleaner is not registered
+ assertThat(jobParameters.getCleanable()).isNull();
+ assertThat(jobParameters.getJobCleanupCallback()).isNull();
+ }
+
+ /** Test to verify that the JobParameters Cleaner is disabled */
+ @RequiresFlagsEnabled(FLAG_CLEANUP_EMPTY_JOBS)
+ @Test
+ public void testCleanerWithLeakedJobCleanerDisabled_flagCleanupEmptyJobsEnabled() {
+ // Inject real JobCallbackCleanup
+ JobParameters jobParameters = JobParameters.CREATOR.createFromParcel(mMockParcel);
+
+ // Enable the cleaner
+ jobParameters.enableCleaner();
+
+ // Verify the cleaner is enabled
+ assertThat(jobParameters.getCleanable()).isNotNull();
+ assertThat(jobParameters.getJobCleanupCallback()).isNotNull();
+ assertThat(jobParameters.getJobCleanupCallback().isCleanerEnabled()).isTrue();
+
+ // Disable the cleaner
+ jobParameters.disableCleaner();
+
+ // Verify the cleaner is disabled
+ assertThat(jobParameters.getCleanable()).isNull();
+ assertThat(jobParameters.getJobCleanupCallback()).isNull();
+ }
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp b/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp
index 6a16d1e..677ecf4 100644
--- a/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp
+++ b/services/tests/mockingservicestests/src/com/android/server/rollback/Android.bp
@@ -37,9 +37,9 @@
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
jni_libs: [
diff --git a/services/tests/performancehinttests/src/com/android/server/power/hint/HintManagerServiceTest.java b/services/tests/performancehinttests/src/com/android/server/power/hint/HintManagerServiceTest.java
index b2ca991..639ae30 100644
--- a/services/tests/performancehinttests/src/com/android/server/power/hint/HintManagerServiceTest.java
+++ b/services/tests/performancehinttests/src/com/android/server/power/hint/HintManagerServiceTest.java
@@ -48,7 +48,9 @@
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
+import android.hardware.common.fmq.MQDescriptor;
import android.hardware.power.ChannelConfig;
+import android.hardware.power.ChannelMessage;
import android.hardware.power.IPower;
import android.hardware.power.SessionConfig;
import android.hardware.power.SessionTag;
@@ -167,6 +169,8 @@
mConfig = new ChannelConfig();
mConfig.readFlagBitmask = 1;
mConfig.writeFlagBitmask = 2;
+ mConfig.channelDescriptor = new MQDescriptor<ChannelMessage, Byte>();
+ mConfig.eventFlagDescriptor = new MQDescriptor<Byte, Byte>();
ApplicationInfo applicationInfo = new ApplicationInfo();
applicationInfo.category = ApplicationInfo.CATEGORY_GAME;
when(mContext.getPackageManager()).thenReturn(mMockPackageManager);
diff --git a/services/tests/powerservicetests/Android.bp b/services/tests/powerservicetests/Android.bp
index f8cc6d0..f03043e 100644
--- a/services/tests/powerservicetests/Android.bp
+++ b/services/tests/powerservicetests/Android.bp
@@ -23,7 +23,7 @@
],
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
defaults: [
diff --git a/services/tests/powerstatstests/Android.bp b/services/tests/powerstatstests/Android.bp
index 0e922ce..d6ca10a 100644
--- a/services/tests/powerstatstests/Android.bp
+++ b/services/tests/powerstatstests/Android.bp
@@ -30,7 +30,7 @@
],
libs: [
- "android.test.base",
+ "android.test.base.stubs.system",
],
resource_dirs: ["res/"],
diff --git a/services/tests/servicestests/Android.bp b/services/tests/servicestests/Android.bp
index a862c43..e55e0f2 100644
--- a/services/tests/servicestests/Android.bp
+++ b/services/tests/servicestests/Android.bp
@@ -36,6 +36,7 @@
"-Werror",
],
static_libs: [
+ "a11ychecker",
"aatf",
"accessibility_protos_lite",
"cts-input-lib",
@@ -96,9 +97,9 @@
"android.hardware.tv.cec-V1.0-java",
"android.hardware.vibrator-V3-java",
"android.hidl.manager-V1.0-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
platform_apis: true,
@@ -152,7 +153,7 @@
android_ravenwood_test {
name: "FrameworksServicesTestsRavenwood",
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.annotation_annotation",
@@ -192,8 +193,8 @@
"src/com/android/server/devicepolicy/MockUtils.java",
],
libs: [
- "android.test.mock",
- "android.test.base",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
"mockito-target-minus-junit4",
],
static_libs: [
@@ -218,7 +219,7 @@
"mockito-target-minus-junit4",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
}
@@ -244,7 +245,7 @@
"mockito-target-extended-minus-junit4",
],
libs: [
- "android.test.runner",
+ "android.test.runner.stubs.system",
],
}
@@ -273,108 +274,135 @@
"$(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res",
}
-FLAKY = [
- "androidx.test.filters.FlakyTest",
-]
-
-FLAKY_AND_IGNORED = [
- "androidx.test.filters.FlakyTest",
- "org.junit.Ignore",
-]
// Used by content protection TEST_MAPPING
test_module_config {
name: "FrameworksServicesTests_contentprotection",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.contentprotection"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_om",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.om."],
- exclude_annotations: FLAKY_AND_IGNORED,
}
// Used by contexthub TEST_MAPPING
test_module_config {
name: "FrameworksServicesTests_contexthub_presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.location.contexthub."],
// TODO(ron): are these right, does it run anything?
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_contexthub_postsubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.location.contexthub."],
// TODO(ron): are these right, does it run anything?
include_annotations: ["android.platform.test.annotations.Postsubmit"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
// Used by contentcapture
test_module_config {
name: "FrameworksServicesTests_contentcapture",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.contentcapture"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_recoverysystem",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.recoverysystem."],
- exclude_annotations: FLAKY,
}
// server pm TEST_MAPPING
test_module_config {
name: "FrameworksServicesTests_pm_presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_annotations: ["android.platform.test.annotations.Presubmit"],
include_filters: ["com.android.server.pm."],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_pm_postsubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_annotations: ["android.platform.test.annotations.Postsubmit"],
include_filters: ["com.android.server.pm."],
- exclude_annotations: FLAKY_AND_IGNORED,
}
// server os TEST_MAPPING
test_module_config {
name: "FrameworksServicesTests_os",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.os."],
}
test_module_config {
name: "FrameworksServicesTests_presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_com_android_server_job_Presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.job"],
exclude_annotations: [
"androidx.test.filters.LargeTest",
@@ -385,73 +413,77 @@
test_module_config {
name: "FrameworksServicesTests_com_android_server_job",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.job"],
-}
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
-test_module_config {
- name: "FrameworksServicesTests_com_android_server_tare_Presubmit",
- base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.tare"],
- exclude_annotations: FLAKY,
+ include_filters: ["com.android.server.job"],
}
test_module_config {
name: "FrameworksServicesTests_com_android_server_tare",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.tare"],
-}
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
-test_module_config {
- name: "FrameworksServicesTests_com_android_server_usage_Presubmit",
- base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.usage"],
- exclude_annotations: FLAKY,
+ include_filters: ["com.android.server.tare"],
}
test_module_config {
name: "FrameworksServicesTests_com_android_server_usage",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.usage"],
}
test_module_config {
name: "FrameworksServicesTests_battery_stats",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.am.BatteryStatsServiceTest"],
-}
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
-test_module_config {
- name: "FrameworksServicesTests_accessibility_Presubmit",
- base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.accessibility"],
- exclude_annotations: FLAKY,
+ include_filters: ["com.android.server.am.BatteryStatsServiceTest"],
}
test_module_config {
name: "FrameworksServicesTests_accessibility",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.accessibility"],
}
test_module_config {
name: "FrameworksServicesTests_binary_transparency",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.BinaryTransparencyServiceTest"],
}
test_module_config {
name: "FrameworksServicesTests_pinner_service",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.PinnerServiceTest"],
exclude_annotations: ["org.junit.Ignore"],
}
@@ -459,208 +491,293 @@
test_module_config {
name: "FrameworksServicesTests_android_server_am_Presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.am."],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY,
}
test_module_config {
name: "FrameworksServicesTests_android_server_am",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.am."],
}
test_module_config {
name: "FrameworksServicesTests_android_server_appop",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.appop"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_audio",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.audio"],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_android_server_compat",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.compat"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_hdmi_Presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.hdmi"],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_android_server_hdmi",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.hdmi"],
- exclude_annotations: ["org.junit.Ignore"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_integrity",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.integrity."],
}
test_module_config {
name: "FrameworksServicesTests_android_server_lights",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.lights"],
- exclude_annotations: FLAKY,
}
test_module_config {
name: "FrameworksServicesTests_android_server_locales",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.locales."],
}
test_module_config {
name: "FrameworksServicesTests_android_server_location_contexthub_Presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.location.contexthub."],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_android_server_locksettings",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.locksettings."],
- exclude_annotations: FLAKY,
-}
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
-test_module_config {
- name: "FrameworksServicesTests_android_server_logcat_Presubmit",
- base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
- include_filters: ["com.android.server.logcat"],
- exclude_annotations: FLAKY,
+ include_filters: ["com.android.server.locksettings."],
}
test_module_config {
name: "FrameworksServicesTests_android_server_logcat",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.logcat"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_net_Presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.net."],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY,
}
test_module_config {
name: "FrameworksServicesTests_android_server_om",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.om."],
}
test_module_config {
name: "FrameworksServicesTests_android_server_pdb",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.pdb.PersistentDataBlockServiceTest"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_pm_dex",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.pm.dex"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_policy_Presubmit",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.policy."],
include_annotations: ["android.platform.test.annotations.Presubmit"],
- exclude_annotations: FLAKY,
}
test_module_config {
name: "FrameworksServicesTests_android_server_policy",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.policy."],
}
test_module_config {
name: "FrameworksServicesTests_android_server_power",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.power"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_power_hint",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.power.hint"],
- exclude_annotations: FLAKY,
}
test_module_config {
name: "FrameworksServicesTests_android_server_powerstats",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.powerstats"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_rollback",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.rollback"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_uri",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.uri."],
}
test_module_config {
name: "FrameworksServicesTests_com_android_server_location_contexthub",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.location.contexthub."],
include_annotations: ["android.platform.test.annotations.Postsubmit"],
- exclude_annotations: FLAKY_AND_IGNORED,
}
test_module_config {
name: "FrameworksServicesTests_android_server_usage",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.usage"],
exclude_filters: ["com.android.server.usage.StorageStatsServiceTest"],
}
@@ -668,14 +785,22 @@
test_module_config {
name: "FrameworksServicesTests_android_server_soundtrigger_middleware",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.soundtrigger_middleware"],
}
test_module_config {
name: "FrameworksServicesTests_android_server_input",
base: "FrameworksServicesTests",
- test_suites: ["device-tests"],
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
include_filters: ["com.android.server.input"],
}
@@ -851,3 +976,23 @@
],
include_filters: ["com.android.server.input"],
}
+
+test_module_config {
+ name: "FrameworksServicesTests_people_data",
+ base: "FrameworksServicesTests",
+ test_suites: [
+ "automotive-tests",
+ "device-tests",
+ ],
+ include_filters: ["com.android.server.people.data"],
+}
+
+test_module_config {
+ name: "FrameworksServicesTests_Presubmit",
+ base: "FrameworksServicesTests",
+ test_suites: [
+ "automotive-tests",
+ "device-tests",
+ ],
+ include_annotations: ["android.platform.test.annotations.Presubmit"],
+}
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java
index 2e6c93c..566feb7 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java
@@ -35,6 +35,7 @@
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.HARDWARE;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.QUICK_SETTINGS;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.SOFTWARE;
+import static com.android.internal.accessibility.dialog.AccessibilityButtonChooserActivity.EXTRA_TYPE_TO_CHOOSE;
import static com.android.server.accessibility.AccessibilityManagerService.ACTION_LAUNCH_HEARING_DEVICES_DIALOG;
import static com.android.window.flags.Flags.FLAG_ALWAYS_DRAW_MAGNIFICATION_FULLSCREEN_BORDER;
@@ -2046,6 +2047,53 @@
}
@Test
+ public void showAccessibilityTargetSelection_navBarNavigationMode_softwareExtra() {
+ mFakePermissionEnforcer.grant(Manifest.permission.STATUS_BAR_SERVICE);
+ final AccessibilityUserState userState = new AccessibilityUserState(
+ UserHandle.USER_SYSTEM, mTestableContext, mA11yms);
+ mA11yms.mUserStates.put(UserHandle.USER_SYSTEM, userState);
+ Settings.Secure.putIntForUser(mTestableContext.getContentResolver(),
+ NAVIGATION_MODE, NAV_BAR_MODE_3BUTTON, userState.mUserId);
+
+ mA11yms.notifyAccessibilityButtonLongClicked(Display.DEFAULT_DISPLAY);
+ mTestableLooper.processAllMessages();
+
+ assertStartActivityWithExpectedShortcutType(mTestableContext.getMockContext(), SOFTWARE);
+ }
+
+ @Test
+ @DisableFlags(android.provider.Flags.FLAG_A11Y_STANDALONE_GESTURE_ENABLED)
+ public void showAccessibilityTargetSelection_gestureNavigationMode_softwareExtra() {
+ mFakePermissionEnforcer.grant(Manifest.permission.STATUS_BAR_SERVICE);
+ final AccessibilityUserState userState = new AccessibilityUserState(
+ UserHandle.USER_SYSTEM, mTestableContext, mA11yms);
+ mA11yms.mUserStates.put(UserHandle.USER_SYSTEM, userState);
+ Settings.Secure.putIntForUser(mTestableContext.getContentResolver(),
+ NAVIGATION_MODE, NAV_BAR_MODE_GESTURAL, userState.mUserId);
+
+ mA11yms.notifyAccessibilityButtonLongClicked(Display.DEFAULT_DISPLAY);
+ mTestableLooper.processAllMessages();
+
+ assertStartActivityWithExpectedShortcutType(mTestableContext.getMockContext(), SOFTWARE);
+ }
+
+ @Test
+ @EnableFlags(android.provider.Flags.FLAG_A11Y_STANDALONE_GESTURE_ENABLED)
+ public void showAccessibilityTargetSelection_gestureNavigationMode_gestureExtra() {
+ mFakePermissionEnforcer.grant(Manifest.permission.STATUS_BAR_SERVICE);
+ final AccessibilityUserState userState = new AccessibilityUserState(
+ UserHandle.USER_SYSTEM, mTestableContext, mA11yms);
+ mA11yms.mUserStates.put(UserHandle.USER_SYSTEM, userState);
+ Settings.Secure.putIntForUser(mTestableContext.getContentResolver(),
+ NAVIGATION_MODE, NAV_BAR_MODE_GESTURAL, userState.mUserId);
+
+ mA11yms.notifyAccessibilityButtonLongClicked(Display.DEFAULT_DISPLAY);
+ mTestableLooper.processAllMessages();
+
+ assertStartActivityWithExpectedShortcutType(mTestableContext.getMockContext(), GESTURE);
+ }
+
+ @Test
public void registerUserInitializationCompleteCallback_isRegistered() {
mA11yms.mUserInitializationCompleteCallbacks.clear();
@@ -2075,6 +2123,43 @@
UserHandle.MIN_SECONDARY_USER_ID);
}
+ @Test
+ @DisableFlags(android.provider.Flags.FLAG_A11Y_STANDALONE_GESTURE_ENABLED)
+ public void getShortcutTypeForGenericShortcutCalls_softwareType() {
+ final AccessibilityUserState userState = new AccessibilityUserState(
+ UserHandle.USER_SYSTEM, mTestableContext, mA11yms);
+ mA11yms.mUserStates.put(UserHandle.USER_SYSTEM, userState);
+
+ assertThat(mA11yms.getShortcutTypeForGenericShortcutCalls(userState.mUserId))
+ .isEqualTo(SOFTWARE);
+ }
+
+ @Test
+ @EnableFlags(android.provider.Flags.FLAG_A11Y_STANDALONE_GESTURE_ENABLED)
+ public void getShortcutTypeForGenericShortcutCalls_gestureNavigationMode_gestureType() {
+ final AccessibilityUserState userState = new AccessibilityUserState(
+ UserHandle.USER_SYSTEM, mTestableContext, mA11yms);
+ mA11yms.mUserStates.put(UserHandle.USER_SYSTEM, userState);
+ Settings.Secure.putIntForUser(mTestableContext.getContentResolver(),
+ NAVIGATION_MODE, NAV_BAR_MODE_GESTURAL, userState.mUserId);
+
+ assertThat(mA11yms.getShortcutTypeForGenericShortcutCalls(userState.mUserId))
+ .isEqualTo(GESTURE);
+ }
+
+ @Test
+ @EnableFlags(android.provider.Flags.FLAG_A11Y_STANDALONE_GESTURE_ENABLED)
+ public void getShortcutTypeForGenericShortcutCalls_buttonNavigationMode_softwareType() {
+ final AccessibilityUserState userState = new AccessibilityUserState(
+ UserHandle.USER_SYSTEM, mTestableContext, mA11yms);
+ mA11yms.mUserStates.put(UserHandle.USER_SYSTEM, userState);
+ Settings.Secure.putIntForUser(mTestableContext.getContentResolver(),
+ NAVIGATION_MODE, NAV_BAR_MODE_3BUTTON, userState.mUserId);
+
+ assertThat(mA11yms.getShortcutTypeForGenericShortcutCalls(userState.mUserId))
+ .isEqualTo(SOFTWARE);
+ }
+
private Set<String> readStringsFromSetting(String setting) {
final Set<String> result = new ArraySet<>();
mA11yms.readColonDelimitedSettingToSet(
@@ -2148,6 +2233,14 @@
Intent.EXTRA_COMPONENT_NAME)).isEqualTo(componentName);
}
+ private void assertStartActivityWithExpectedShortcutType(Context mockContext,
+ @UserShortcutType int shortcutType) {
+ verify(mockContext).startActivityAsUser(mIntentArgumentCaptor.capture(),
+ any(Bundle.class), any(UserHandle.class));
+ assertThat(mIntentArgumentCaptor.getValue().getIntExtra(
+ EXTRA_TYPE_TO_CHOOSE, -1)).isEqualTo(shortcutType);
+ }
+
private void setupShortcutTargetServices() {
setupShortcutTargetServices(mA11yms.getCurrentUserState());
}
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java
index 62fa951..627b5e3 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java
@@ -28,10 +28,13 @@
import static android.view.accessibility.AccessibilityManager.STATE_FLAG_HIGH_TEXT_CONTRAST_ENABLED;
import static android.view.accessibility.AccessibilityManager.STATE_FLAG_TOUCH_EXPLORATION_ENABLED;
+import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_CONTROLLER_NAME;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.GESTURE;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.HARDWARE;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.QUICK_SETTINGS;
import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.SOFTWARE;
+import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.TRIPLETAP;
+import static com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType.TWOFINGER_DOUBLETAP;
import static com.android.server.accessibility.AccessibilityUserState.doesShortcutTargetsStringContain;
import static com.google.common.truth.Truth.assertThat;
@@ -67,6 +70,8 @@
import com.android.internal.R;
import com.android.internal.accessibility.AccessibilityShortcutController;
+import com.android.internal.accessibility.common.ShortcutConstants;
+import com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType;
import com.android.internal.util.test.FakeSettingsProvider;
import org.junit.After;
@@ -504,6 +509,36 @@
assertThat(actual).containsExactly(tileComponent, mMockServiceInfo);
}
+ @Test
+ public void isShortcutMagnificationEnabledLocked_anyShortcutType_returnsTrue() {
+ // Clear every shortcut
+ for (int shortcutType : ShortcutConstants.USER_SHORTCUT_TYPES) {
+ setMagnificationForShortcutType(shortcutType, false);
+ }
+ // Check each shortcut individually
+ for (int shortcutType : ShortcutConstants.USER_SHORTCUT_TYPES) {
+ // Setup
+ setMagnificationForShortcutType(shortcutType, true);
+
+ // Checking
+ assertThat(mUserState.getShortcutTargetsLocked(shortcutType))
+ .containsExactly(MAGNIFICATION_CONTROLLER_NAME);
+ assertThat(mUserState.isShortcutMagnificationEnabledLocked()).isTrue();
+
+ // Cleanup
+ setMagnificationForShortcutType(shortcutType, false);
+ }
+ }
+
+ @Test
+ public void isShortcutMagnificationEnabledLocked_noShortcutTypes_returnsFalse() {
+ // Clear every shortcut
+ for (int shortcutType : ShortcutConstants.USER_SHORTCUT_TYPES) {
+ setMagnificationForShortcutType(shortcutType, false);
+ }
+ assertThat(mUserState.isShortcutMagnificationEnabledLocked()).isFalse();
+ }
+
private int getSecureIntForUser(String key, int userId) {
return Settings.Secure.getIntForUser(mMockResolver, key, -1, userId);
}
@@ -511,4 +546,16 @@
private void putSecureIntForUser(String key, int value, int userId) {
Settings.Secure.putIntForUser(mMockResolver, key, value, userId);
}
+
+ private void setMagnificationForShortcutType(
+ @UserShortcutType int shortcutType, boolean enabled) {
+ if (shortcutType == TRIPLETAP) {
+ mUserState.setMagnificationSingleFingerTripleTapEnabledLocked(enabled);
+ } else if (shortcutType == TWOFINGER_DOUBLETAP) {
+ mUserState.setMagnificationTwoFingerTripleTapEnabledLocked(enabled);
+ } else {
+ mUserState.updateShortcutTargetsLocked(
+ enabled ? Set.of(MAGNIFICATION_CONTROLLER_NAME) : Set.of(), shortcutType);
+ }
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java b/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java
index 6b8e414..b4b3612 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java
@@ -558,7 +558,9 @@
waitForIdle();
verify(mReceiver1).onError(
eq(BiometricAuthenticator.TYPE_NONE),
- eq(BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE),
+ eq(Flags.mandatoryBiometrics()
+ ? BiometricConstants.BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS
+ : BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE),
eq(0 /* vendorCode */));
// Enrolled, not disabled in settings, user requires confirmation in settings
@@ -1450,7 +1452,9 @@
}
@Test
- public void testCanAuthenticate_whenBiometricsNotEnabledForApps() throws Exception {
+ @RequiresFlagsDisabled(Flags.FLAG_MANDATORY_BIOMETRICS)
+ public void testCanAuthenticate_whenBiometricsNotEnabledForApps_returnsHardwareUnavailable()
+ throws Exception {
setupAuthForOnly(TYPE_FACE, Authenticators.BIOMETRIC_STRONG);
when(mBiometricService.mSettingObserver.getEnabledForApps(anyInt())).thenReturn(false);
when(mTrustManager.isDeviceSecure(anyInt(), anyInt()))
@@ -1468,6 +1472,25 @@
}
@Test
+ @RequiresFlagsEnabled(Flags.FLAG_MANDATORY_BIOMETRICS)
+ public void testCanAuthenticate_whenBiometricsNotEnabledForApps() throws Exception {
+ setupAuthForOnly(TYPE_FACE, Authenticators.BIOMETRIC_STRONG);
+ when(mBiometricService.mSettingObserver.getEnabledForApps(anyInt())).thenReturn(false);
+ when(mTrustManager.isDeviceSecure(anyInt(), anyInt()))
+ .thenReturn(true);
+
+ // When only biometric is requested
+ int authenticators = Authenticators.BIOMETRIC_STRONG;
+ assertEquals(BiometricManager.BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS,
+ invokeCanAuthenticate(mBiometricService, authenticators));
+
+ // When credential and biometric are requested
+ authenticators = Authenticators.BIOMETRIC_STRONG | Authenticators.DEVICE_CREDENTIAL;
+ assertEquals(BiometricManager.BIOMETRIC_SUCCESS,
+ invokeCanAuthenticate(mBiometricService, authenticators));
+ }
+
+ @Test
public void testCanAuthenticate_whenNoBiometricSensor() throws Exception {
mBiometricService = new BiometricService(mContext, mInjector, mBiometricHandlerProvider);
mBiometricService.onStart();
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/PreAuthInfoTest.java b/services/tests/servicestests/src/com/android/server/biometrics/PreAuthInfoTest.java
index 760d38e..b758f57 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/PreAuthInfoTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/PreAuthInfoTest.java
@@ -20,6 +20,7 @@
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE;
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
import static android.hardware.biometrics.BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE;
+import static android.hardware.biometrics.BiometricManager.BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS;
import static com.android.server.biometrics.sensors.LockoutTracker.LOCKOUT_NONE;
@@ -266,6 +267,29 @@
@Test
@RequiresFlagsEnabled(Flags.FLAG_MANDATORY_BIOMETRICS)
+ public void testCalculateByPriority()
+ throws Exception {
+ when(mFaceAuthenticator.hasEnrolledTemplates(anyInt(), any())).thenReturn(false);
+ when(mSettingObserver.getEnabledForApps(anyInt())).thenReturn(false);
+
+ BiometricSensor faceSensor = getFaceSensor();
+ BiometricSensor fingerprintSensor = getFingerprintSensor();
+ PromptInfo promptInfo = new PromptInfo();
+ promptInfo.setConfirmationRequested(false /* requireConfirmation */);
+ promptInfo.setAuthenticators(BiometricManager.Authenticators.BIOMETRIC_STRONG);
+ promptInfo.setDisallowBiometricsIfPolicyExists(false /* checkDevicePolicy */);
+ PreAuthInfo preAuthInfo = PreAuthInfo.create(mTrustManager, mDevicePolicyManager,
+ mSettingObserver, List.of(faceSensor, fingerprintSensor),
+ 0 /* userId */, promptInfo, TEST_PACKAGE_NAME,
+ false /* checkDevicePolicyManager */, mContext, mBiometricCameraManager);
+
+ assertThat(preAuthInfo.eligibleSensors).hasSize(0);
+ assertThat(preAuthInfo.getCanAuthenticateResult()).isEqualTo(
+ BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS);
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_MANDATORY_BIOMETRICS)
public void testMandatoryBiometricsNegativeButtonText_whenSet()
throws Exception {
when(mTrustManager.isInSignificantPlace()).thenReturn(false);
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
index 004c6c6..21129a7 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
@@ -19,6 +19,7 @@
import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY;
import static com.android.server.hdmi.Constants.ADDR_AUDIO_SYSTEM;
+import static com.android.server.hdmi.Constants.ADDR_BROADCAST;
import static com.android.server.hdmi.Constants.ADDR_PLAYBACK_1;
import static com.android.server.hdmi.Constants.ADDR_TV;
import static com.android.server.hdmi.Constants.MESSAGE_DEVICE_VENDOR_ID;
@@ -529,21 +530,32 @@
public void handleVendorCommand_notHandled() {
HdmiCecMessage vendorCommand = HdmiCecMessageBuilder.buildVendorCommand(ADDR_TV,
ADDR_PLAYBACK_1, new byte[]{0});
- mNativeWrapper.onCecMessage(vendorCommand);
+ @Constants.HandleMessageResult int result =
+ mHdmiLocalDevice.handleVendorCommand(vendorCommand);
mTestLooper.dispatchAll();
- HdmiCecMessageBuilder.buildFeatureAbortCommand(ADDR_PLAYBACK_1, ADDR_TV,
- vendorCommand.getOpcode(), Constants.ABORT_REFUSED);
+ assertEquals(Constants.ABORT_REFUSED, result);
}
@Test
public void handleVendorCommandWithId_notHandled_Cec14() {
HdmiCecMessage vendorCommand = HdmiCecMessageBuilder.buildVendorCommandWithId(ADDR_TV,
ADDR_PLAYBACK_1, 0x1234, new byte[]{0});
- mNativeWrapper.onCecMessage(vendorCommand);
+ @Constants.HandleMessageResult int result =
+ mHdmiLocalDevice.handleVendorCommandWithId(vendorCommand);
mTestLooper.dispatchAll();
- HdmiCecMessageBuilder.buildFeatureAbortCommand(ADDR_PLAYBACK_1, ADDR_TV,
- vendorCommand.getOpcode(), Constants.ABORT_REFUSED);
+ assertEquals(Constants.ABORT_REFUSED, result);
+ }
+
+ @Test
+ public void handleVendorCommandWithId_broadcasted_handled() {
+ HdmiCecMessage vendorCommand = HdmiCecMessageBuilder.buildVendorCommandWithId(ADDR_TV,
+ ADDR_BROADCAST, 0x1234, new byte[]{0});
+ @Constants.HandleMessageResult int result =
+ mHdmiLocalDevice.handleVendorCommandWithId(vendorCommand);
+ mTestLooper.dispatchAll();
+
+ assertEquals(Constants.HANDLED, result);
}
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
index a5f1fcd..2d95740 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
@@ -30,6 +30,7 @@
import static com.android.server.hdmi.HdmiControlService.WAKE_UP_SCREEN_ON;
import static com.android.server.hdmi.RequestActiveSourceAction.TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS;
import static com.android.server.hdmi.RoutingControlAction.TIMEOUT_ROUTING_INFORMATION_MS;
+import static com.android.server.hdmi.RequestSadAction.RETRY_COUNTER_MAX;
import static com.google.common.truth.Truth.assertThat;
@@ -273,13 +274,12 @@
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportArcInitiated);
// Finish querying SADs
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mNativeWrapper.clearResultMessages();
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
assertThat(mNativeWrapper.getResultMessages()).contains(reportArcInitiated);
mNativeWrapper.clearResultMessages();
@@ -685,18 +685,46 @@
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportArcInitiated);
// Finish querying SADs
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mNativeWrapper.clearResultMessages();
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
assertThat(mNativeWrapper.getResultMessages()).contains(reportArcInitiated);
}
@Test
+ public void handleInitiateArc_arcAlreadyEstablished_noRequestSad() {
+ // Emulate Audio device on port 0x2000 (supports ARC)
+ mNativeWrapper.setPortConnectionStatus(2, true);
+ HdmiCecMessage reportPhysicalAddress =
+ HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
+ ADDR_AUDIO_SYSTEM, 0x2000, HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM);
+ mNativeWrapper.onCecMessage(reportPhysicalAddress);
+ mTestLooper.dispatchAll();
+
+ assertThat(mHdmiCecLocalDeviceTv.isArcEstablished()).isFalse();
+
+ HdmiCecMessage requestArcInitiation = HdmiCecMessageBuilder.buildInitiateArc(
+ ADDR_AUDIO_SYSTEM,
+ ADDR_TV);
+ mNativeWrapper.onCecMessage(requestArcInitiation);
+ mTestLooper.dispatchAll();
+
+ // Finish querying SADs
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
+
+ assertThat(mHdmiCecLocalDeviceTv.isArcEstablished()).isTrue();
+ }
+
+ @Test
public void handleTerminateArc_noAudioDevice() {
HdmiCecMessage terminateArc = HdmiCecMessageBuilder.buildTerminateArc(
ADDR_AUDIO_SYSTEM,
@@ -970,13 +998,12 @@
// <Report ARC Initiated> should only be sent after SAD querying is done
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportArcInitiated);
// Finish querying SADs
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mNativeWrapper.clearResultMessages();
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
assertThat(mNativeWrapper.getResultMessages()).contains(reportArcInitiated);
mNativeWrapper.clearResultMessages();
@@ -1171,13 +1198,12 @@
mTestLooper.dispatchAll();
// Finish querying SADs
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mNativeWrapper.clearResultMessages();
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
// ARC should be established after RequestSadAction is finished
assertThat(mNativeWrapper.getResultMessages()).contains(reportArcInitiated);
@@ -1327,13 +1353,12 @@
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportArcInitiated);
// Finish querying SADs
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mNativeWrapper.clearResultMessages();
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
- assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
- mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
- mTestLooper.dispatchAll();
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(SAD_QUERY);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
assertThat(mNativeWrapper.getResultMessages()).contains(reportArcInitiated);
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/RequestSadActionTest.java b/services/tests/servicestests/src/com/android/server/hdmi/RequestSadActionTest.java
index f8e465c..4cf2937 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/RequestSadActionTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/RequestSadActionTest.java
@@ -18,6 +18,7 @@
import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY;
import static com.android.server.hdmi.Constants.ADDR_AUDIO_SYSTEM;
+import static com.android.server.hdmi.RequestSadAction.RETRY_COUNTER_MAX;
import static com.google.common.truth.Truth.assertThat;
@@ -144,7 +145,7 @@
}
@Test
- public void noResponse_queryAgainOnce_emptyResult() {
+ public void noResponse_queryAgain_emptyResult() {
RequestSadAction action = new RequestSadAction(mHdmiCecLocalDeviceTv, ADDR_AUDIO_SYSTEM,
mCallback);
action.start();
@@ -154,13 +155,13 @@
HdmiCecMessage expected1 = HdmiCecMessageBuilder.buildRequestShortAudioDescriptor(
mTvLogicalAddress, Constants.ADDR_AUDIO_SYSTEM,
CODECS_TO_QUERY_1.stream().mapToInt(i -> i).toArray());
- assertThat(mNativeWrapper.getResultMessages()).contains(expected1);
- mNativeWrapper.clearResultMessages();
- mTestLooper.moveTimeForward(TIMEOUT_MS);
- mTestLooper.dispatchAll();
- assertThat(mNativeWrapper.getResultMessages()).contains(expected1);
- mTestLooper.moveTimeForward(TIMEOUT_MS);
- mTestLooper.dispatchAll();
+
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(expected1);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
assertThat(mSupportedSads).isNotNull();
assertThat(mSupportedSads.size()).isEqualTo(0);
@@ -507,7 +508,7 @@
}
@Test
- public void invalidMessageLength_queryAgainOnce() {
+ public void invalidMessageLength_queryAgain() {
RequestSadAction action = new RequestSadAction(mHdmiCecLocalDeviceTv, ADDR_AUDIO_SYSTEM,
mCallback);
action.start();
@@ -524,16 +525,13 @@
0x27, 0x20, 0x0A};
HdmiCecMessage response1 = HdmiCecMessageBuilder.buildReportShortAudioDescriptor(
Constants.ADDR_AUDIO_SYSTEM, mTvLogicalAddress, sadsToRespond_1);
- assertThat(mNativeWrapper.getResultMessages()).contains(expected1);
- mNativeWrapper.clearResultMessages();
- action.processCommand(response1);
- mTestLooper.dispatchAll();
- mTestLooper.moveTimeForward(TIMEOUT_MS);
- mTestLooper.dispatchAll();
- assertThat(mNativeWrapper.getResultMessages()).contains(expected1);
- mNativeWrapper.clearResultMessages();
- mTestLooper.moveTimeForward(TIMEOUT_MS);
- mTestLooper.dispatchAll();
+
+ for (int i = 0; i <= RETRY_COUNTER_MAX; ++i) {
+ assertThat(mNativeWrapper.getResultMessages()).contains(expected1);
+ mNativeWrapper.clearResultMessages();
+ mTestLooper.moveTimeForward(TIMEOUT_MS);
+ mTestLooper.dispatchAll();
+ }
assertThat(mSupportedSads).isNotNull();
assertThat(mSupportedSads.size()).isEqualTo(0);
diff --git a/services/tests/servicestests/src/com/android/server/webkit/TestSystemImpl.java b/services/tests/servicestests/src/com/android/server/webkit/TestSystemImpl.java
index cbf7935..def3355 100644
--- a/services/tests/servicestests/src/com/android/server/webkit/TestSystemImpl.java
+++ b/services/tests/servicestests/src/com/android/server/webkit/TestSystemImpl.java
@@ -19,7 +19,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.UserInfo;
+import android.os.UserHandle;
import android.webkit.UserPackage;
import android.webkit.WebViewProviderInfo;
@@ -137,16 +137,12 @@
List<UserPackage> ret = new ArrayList();
// Loop over defined users, and find the corresponding package for each user.
for (int userId : mUsers) {
- ret.add(new UserPackage(createUserInfo(userId),
+ ret.add(new UserPackage(UserHandle.of(userId),
userPackages == null ? null : userPackages.get(userId)));
}
return ret;
}
- private static UserInfo createUserInfo(int userId) {
- return new UserInfo(userId, "User nr. " + userId, 0 /* flags */);
- }
-
/**
* Set package for primary user.
*/
diff --git a/services/tests/timetests/Android.bp b/services/tests/timetests/Android.bp
index 05a1433..aae6acc 100644
--- a/services/tests/timetests/Android.bp
+++ b/services/tests/timetests/Android.bp
@@ -20,7 +20,7 @@
"services.core",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/services/tests/uiservicestests/Android.bp b/services/tests/uiservicestests/Android.bp
index e6cf0c38..a63a38d 100644
--- a/services/tests/uiservicestests/Android.bp
+++ b/services/tests/uiservicestests/Android.bp
@@ -54,9 +54,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
dxflags: ["--multi-dex"],
@@ -92,3 +92,13 @@
// Required for TestParameterInjector
javacflags: ["-parameters"],
}
+
+test_module_config {
+ name: "FrameworksUiServicesTests_notification",
+ base: "FrameworksUiServicesTests",
+ test_suites: [
+ "automotive-tests",
+ "device-tests",
+ ],
+ exclude_annotations: ["androidx.test.filters.LargeTest"],
+}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/BubbleExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/BubbleExtractorTest.java
index b5bc610..2effc69 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/BubbleExtractorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/BubbleExtractorTest.java
@@ -30,9 +30,9 @@
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -44,6 +44,8 @@
import android.app.Person;
import android.content.Intent;
import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.content.pm.ShortcutInfo;
import android.os.SystemClock;
import android.os.UserHandle;
@@ -89,6 +91,8 @@
@Mock
ShortcutHelper mShortcutHelper;
@Mock
+ PackageManager mPackageManager;
+ @Mock
ActivityManager mActivityManager;
@Before
@@ -98,6 +102,7 @@
mBubbleExtractor.initialize(mContext, mock(NotificationUsageStats.class));
mBubbleExtractor.setConfig(mConfig);
mBubbleExtractor.setShortcutHelper(mShortcutHelper);
+ mBubbleExtractor.setPackageManager(mPackageManager);
mBubbleExtractor.setActivityManager(mActivityManager);
mChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_ID, IMPORTANCE_DEFAULT);
@@ -106,7 +111,7 @@
}
/* NotificationRecord that fulfills conversation requirements (message style + shortcut) */
- private NotificationRecord getNotificationRecord(boolean addBubble) {
+ private NotificationRecord getNotificationRecord(boolean addBubble, UserHandle user) {
final Builder builder = new Builder(getContext())
.setContentTitle("foo")
.setSmallIcon(android.R.drawable.sym_def_app_icon)
@@ -127,13 +132,13 @@
n.setBubbleMetadata(mBubbleMetadata);
}
StatusBarNotification sbn = new StatusBarNotification(PKG, PKG, ID, TAG, UID,
- PID, n, mUser, null, System.currentTimeMillis());
+ PID, n, user, null, System.currentTimeMillis());
NotificationRecord r = new NotificationRecord(getContext(), sbn, mChannel);
r.setShortcutInfo(mShortcutInfo);
return r;
}
- void setUpIntentBubble(boolean isValid) {
+ void setUpIntentBubble(boolean isValid, UserHandle user) {
when(mPendingIntent.getIntent()).thenReturn(mIntent);
when(mBubbleMetadata.getIntent()).thenReturn(mPendingIntent);
when(mBubbleMetadata.getShortcutId()).thenReturn(null);
@@ -143,18 +148,21 @@
info.resizeMode = isValid
? RESIZE_MODE_RESIZEABLE
: RESIZE_MODE_UNRESIZEABLE;
- when(mIntent.resolveActivityInfo(any(), anyInt())).thenReturn(info);
+ ResolveInfo resolveInfo = new ResolveInfo();
+ resolveInfo.activityInfo = info;
+ when(mPackageManager.resolveActivityAsUser(eq(mIntent), eq(0), eq(user.getIdentifier())))
+ .thenReturn(resolveInfo);
}
- void setUpShortcutBubble(boolean isValid) {
+ void setUpShortcutBubble(boolean isValid, UserHandle user) {
when(mBubbleMetadata.getShortcutId()).thenReturn(SHORTCUT_ID);
when(mBubbleMetadata.getIntent()).thenReturn(null);
ShortcutInfo answer = isValid ? mShortcutInfo : null;
- when(mShortcutHelper.getValidShortcutInfo(SHORTCUT_ID, PKG, mUser)).thenReturn(answer);
+ when(mShortcutHelper.getValidShortcutInfo(SHORTCUT_ID, PKG, user)).thenReturn(answer);
}
- void setUpBubblesEnabled(boolean feature, int app, int channel) {
- when(mConfig.bubblesEnabled(mUser)).thenReturn(feature);
+ void setUpBubblesEnabled(boolean feature, int app, int channel, UserHandle user) {
+ when(mConfig.bubblesEnabled(user)).thenReturn(feature);
when(mConfig.getBubblePreference(anyString(), anyInt())).thenReturn(app);
mChannel.setAllowBubbles(channel);
}
@@ -167,10 +175,11 @@
public void testAppYesChannelNo() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- ALLOW_BUBBLE_OFF /* channel */);
+ ALLOW_BUBBLE_OFF /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
assertFalse(r.canBubble());
@@ -181,10 +190,11 @@
public void testAppYesChannelDefault() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -195,10 +205,11 @@
public void testAppYesChannelYes() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- ALLOW_BUBBLE_ON /* channel */);
+ ALLOW_BUBBLE_ON /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -209,10 +220,11 @@
public void testAppYesChannelYesFeatureNo() {
setUpBubblesEnabled(false /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- ALLOW_BUBBLE_ON /* channel */);
+ ALLOW_BUBBLE_ON /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -224,10 +236,11 @@
public void testAppNoChannelYes() throws Exception {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_NONE /* app */,
- ALLOW_BUBBLE_ON /* channel */);
+ ALLOW_BUBBLE_ON /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -239,10 +252,11 @@
public void testAppNoChannelDefault() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_NONE /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -254,10 +268,11 @@
public void testAppSelectedChannelDefault() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_SELECTED /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -269,10 +284,11 @@
public void testAppSelectedChannelNo() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_SELECTED /* app */,
- ALLOW_BUBBLE_OFF /* channel */);
+ ALLOW_BUBBLE_OFF /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ setUpShortcutBubble(true /* isValid */, mUser);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -284,11 +300,12 @@
public void testAppSeletedChannelYes() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_SELECTED /* app */,
- ALLOW_BUBBLE_ON /* channel */);
+ ALLOW_BUBBLE_ON /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
+ setUpShortcutBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -299,11 +316,12 @@
public void testAppSeletedChannelYesFeatureNo() {
setUpBubblesEnabled(false /* feature */,
BUBBLE_PREFERENCE_SELECTED /* app */,
- ALLOW_BUBBLE_ON /* channel */);
+ ALLOW_BUBBLE_ON /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
+ setUpShortcutBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
@@ -319,11 +337,12 @@
public void testFlagBubble_false_previouslyRemoved() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
+ setUpShortcutBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
r.setFlagBubbleRemoved(true);
mBubbleExtractor.process(r);
@@ -337,11 +356,12 @@
public void testFlagBubble_true_shortcutBubble() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(true /* isValid */);
+ setUpShortcutBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
assertTrue(r.canBubble());
@@ -353,11 +373,12 @@
public void testFlagBubble_true_intentBubble() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpIntentBubble(true /* isValid */);
+ setUpIntentBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
assertTrue(r.canBubble());
@@ -369,11 +390,12 @@
public void testFlagBubble_false_noIntentInvalidShortcut() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpShortcutBubble(false /* isValid */);
+ setUpShortcutBubble(false /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
r.setShortcutInfo(null);
mBubbleExtractor.process(r);
@@ -386,11 +408,12 @@
public void testFlagBubble_false_invalidIntentNoShortcut() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpIntentBubble(false /* isValid */);
+ setUpIntentBubble(false /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
r.setShortcutInfo(null);
mBubbleExtractor.process(r);
@@ -403,11 +426,12 @@
public void testFlagBubble_false_noIntentNoShortcut() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
// Shortcut here is for the notification not the bubble
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
assertFalse(r.canBubble());
@@ -419,10 +443,11 @@
public void testFlagBubble_false_noMetadata() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- NotificationRecord r = getNotificationRecord(false /* bubble */);
+ NotificationRecord r = getNotificationRecord(false /* bubble */, mUser);
mBubbleExtractor.process(r);
assertFalse(r.canBubble());
@@ -434,11 +459,12 @@
public void testFlagBubble_false_noShortcut() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpIntentBubble(true /* isValid */);
+ setUpIntentBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
r.setShortcutInfo(null);
r.getNotification().extras.putString(Notification.EXTRA_TEMPLATE, null);
@@ -453,11 +479,12 @@
public void testFlagBubble_false_notConversation() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(false);
- setUpIntentBubble(true /* isValid */);
+ setUpIntentBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
r.userDemotedAppFromConvoSpace(true);
r.getNotification().extras.putString(Notification.EXTRA_TEMPLATE, null);
@@ -472,11 +499,12 @@
public void testFlagBubble_false_lowRamDevice() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(true);
- setUpIntentBubble(true /* isValid */);
+ setUpIntentBubble(true /* isValid */, mUser);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
assertFalse(r.canBubble());
@@ -488,12 +516,13 @@
public void testFlagBubble_false_noIntent() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(true);
- setUpIntentBubble(true /* isValid */);
+ setUpIntentBubble(true /* isValid */, mUser);
when(mPendingIntent.getIntent()).thenReturn(null);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
assertFalse(r.canBubble());
@@ -505,13 +534,15 @@
public void testFlagBubble_false_noActivityInfo() {
setUpBubblesEnabled(true /* feature */,
BUBBLE_PREFERENCE_ALL /* app */,
- DEFAULT_ALLOW_BUBBLE /* channel */);
+ DEFAULT_ALLOW_BUBBLE /* channel */,
+ mUser);
when(mActivityManager.isLowRamDevice()).thenReturn(true);
- setUpIntentBubble(true /* isValid */);
+ setUpIntentBubble(true /* isValid */, mUser);
when(mPendingIntent.getIntent()).thenReturn(mIntent);
- when(mIntent.resolveActivityInfo(any(), anyInt())).thenReturn(null);
+ when(mPackageManager.resolveActivityAsUser(eq(mIntent), eq(0), eq(mUser.getIdentifier())))
+ .thenReturn(null);
- NotificationRecord r = getNotificationRecord(true /* bubble */);
+ NotificationRecord r = getNotificationRecord(true /* bubble */, mUser);
mBubbleExtractor.process(r);
assertFalse(r.canBubble());
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/DefaultDeviceEffectsApplierTest.java b/services/tests/uiservicestests/src/com/android/server/notification/DefaultDeviceEffectsApplierTest.java
index 4a19973..1890879 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/DefaultDeviceEffectsApplierTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/DefaultDeviceEffectsApplierTest.java
@@ -39,6 +39,7 @@
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
+import android.app.KeyguardManager;
import android.app.UiModeManager;
import android.app.WallpaperManager;
import android.content.BroadcastReceiver;
@@ -78,6 +79,7 @@
private DefaultDeviceEffectsApplier mApplier;
@Mock PowerManager mPowerManager;
@Mock ColorDisplayManager mColorDisplayManager;
+ @Mock KeyguardManager mKeyguardManager;
@Mock UiModeManager mUiModeManager;
@Mock WallpaperManager mWallpaperManager;
@@ -87,6 +89,7 @@
mContext = spy(new TestableContext(InstrumentationRegistry.getContext(), null));
mContext.addMockSystemService(PowerManager.class, mPowerManager);
mContext.addMockSystemService(ColorDisplayManager.class, mColorDisplayManager);
+ mContext.addMockSystemService(KeyguardManager.class, mKeyguardManager);
mContext.addMockSystemService(UiModeManager.class, mUiModeManager);
mContext.addMockSystemService(WallpaperManager.class, mWallpaperManager);
when(mWallpaperManager.isWallpaperSupported()).thenReturn(true);
@@ -311,6 +314,22 @@
}
@Test
+ @EnableFlags({android.app.Flags.FLAG_MODES_API, android.app.Flags.FLAG_MODES_UI})
+ public void apply_nightModeWithScreenOnAndKeyguardShowing_appliedImmediately(
+ @TestParameter ZenChangeOrigin origin) {
+
+ when(mPowerManager.isInteractive()).thenReturn(true);
+ when(mKeyguardManager.isKeyguardLocked()).thenReturn(true);
+
+ mApplier.apply(new ZenDeviceEffects.Builder().setShouldUseNightMode(true).build(),
+ origin.value());
+
+ // Effect was applied, and no broadcast receiver was registered.
+ verify(mUiModeManager).setAttentionModeThemeOverlay(eq(MODE_ATTENTION_THEME_OVERLAY_NIGHT));
+ verify(mContext, never()).registerReceiver(any(), any(), anyInt());
+ }
+
+ @Test
@TestParameters({"{origin: ORIGIN_USER_IN_SYSTEMUI}", "{origin: ORIGIN_USER_IN_APP}",
"{origin: ORIGIN_INIT}", "{origin: ORIGIN_INIT_USER}"})
public void apply_nightModeWithScreenOn_appliedImmediatelyBasedOnOrigin(
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 6a1140c..196bc47 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -1255,7 +1255,7 @@
info.resizeMode = RESIZE_MODE_RESIZEABLE;
ResolveInfo ri = new ResolveInfo();
ri.activityInfo = info;
- when(mPackageManagerClient.resolveActivity(any(), anyInt())).thenReturn(ri);
+ when(mPackageManagerClient.resolveActivityAsUser(any(), anyInt(), anyInt())).thenReturn(ri);
return new Notification.BubbleMetadata.Builder(
mActivityIntent,
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
index f572e7a..50a5f65 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
@@ -62,6 +62,8 @@
import android.graphics.Color;
import android.graphics.drawable.Icon;
import android.media.AudioAttributes;
+import android.media.RingtoneManager;
+import android.media.Utils;
import android.metrics.LogMaker;
import android.net.Uri;
import android.os.Build;
@@ -69,6 +71,7 @@
import android.os.UserHandle;
import android.os.VibrationEffect;
import android.os.Vibrator;
+import android.os.VibratorInfo;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
import android.provider.Settings;
@@ -93,6 +96,9 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
import java.util.ArrayList;
@SmallTest
@@ -141,6 +147,7 @@
when(mMockContext.getSystemService(eq(Vibrator.class))).thenReturn(mVibrator);
when(mVibrator.areVibrationFeaturesSupported(any())).thenReturn(true);
+ when(mVibrator.getInfo()).thenReturn(VibratorInfo.EMPTY_VIBRATOR_INFO);
final Resources res = mContext.getResources();
when(mMockContext.getResources()).thenReturn(res);
when(mMockContext.getPackageManager()).thenReturn(mPm);
@@ -511,6 +518,51 @@
}
@Test
+ @EnableFlags(com.android.server.notification.Flags.FLAG_NOTIFICATION_VIBRATION_IN_SOUND_URI)
+ public void testVibration_customVibrationForSound_withoutVibrationUri() {
+ // prepare testing data
+ Uri backupDefaultUri = RingtoneManager.getActualDefaultRingtoneUri(mMockContext,
+ RingtoneManager.TYPE_NOTIFICATION);
+ RingtoneManager.setActualDefaultRingtoneUri(mMockContext, RingtoneManager.TYPE_NOTIFICATION,
+ Settings.System.DEFAULT_NOTIFICATION_URI);
+ defaultChannel.enableVibration(true);
+ defaultChannel.setSound(Settings.System.DEFAULT_NOTIFICATION_URI, CUSTOM_ATTRIBUTES);
+ StatusBarNotification sbn = getNotification(
+ /* channelVibrationPattern= */ null,
+ /* channelVibrationEffect= */ null,
+ /* insistent= */ false);
+ NotificationRecord record = new NotificationRecord(mMockContext, sbn, defaultChannel);
+
+ try {
+ assertEquals(
+ new VibratorHelper(mMockContext).createDefaultVibration(false),
+ record.getVibration());
+ } finally {
+ // restore the data
+ RingtoneManager.setActualDefaultRingtoneUri(mMockContext,
+ RingtoneManager.TYPE_NOTIFICATION,
+ backupDefaultUri);
+ }
+ }
+
+ @Test
+ @EnableFlags(com.android.server.notification.Flags.FLAG_NOTIFICATION_VIBRATION_IN_SOUND_URI)
+ public void testVibration_customVibrationForSound_withVibrationUri() throws IOException {
+ defaultChannel.enableVibration(true);
+ VibrationInfo vibration = getTestingVibration(mVibrator);
+ Uri uriWithVibration = getVibrationUriAppended(
+ Settings.System.DEFAULT_NOTIFICATION_URI, vibration.mUri);
+ defaultChannel.setSound(uriWithVibration, CUSTOM_ATTRIBUTES);
+ StatusBarNotification sbn = getNotification(
+ /* channelVibrationPattern= */ null,
+ /* channelVibrationEffect= */ null,
+ /* insistent= */ false);
+ NotificationRecord record = new NotificationRecord(mMockContext, sbn, defaultChannel);
+
+ assertEquals(vibration.mVibrationEffect, record.getVibration());
+ }
+
+ @Test
public void testImportance_preUpgrade() {
StatusBarNotification sbn = getNotification(PKG_N_MR1, true /* noisy */,
true /* defaultSound */, false /* buzzy */, false /* defaultBuzz */,
@@ -1594,4 +1646,39 @@
assertThat(record.getAudioAttributes().getUsage()).isEqualTo(USAGE_ALARM);
}
+
+ static class VibrationInfo {
+ public VibrationEffect mVibrationEffect;
+ public Uri mUri;
+ VibrationInfo(VibrationEffect vibrationEffect, Uri uri) {
+ mVibrationEffect = vibrationEffect;
+ mUri = uri;
+ }
+ }
+
+ private static VibrationInfo getTestingVibration(Vibrator vibrator) throws IOException {
+ File tempVibrationFile = File.createTempFile("test_vibration_file", ".xml");
+ FileWriter writer = new FileWriter(tempVibrationFile);
+ writer.write("<vibration-effect>\n"
+ + " <waveform-effect>\n"
+ + " <!-- PRIMING -->\n"
+ + " <waveform-entry durationMs=\"0\" amplitude=\"0\"/>\n"
+ + " <waveform-entry durationMs=\"12\" amplitude=\"255\"/>\n"
+ + " <waveform-entry durationMs=\"250\" amplitude=\"0\"/>\n"
+ + " <waveform-entry durationMs=\"12\" amplitude=\"255\"/>\n"
+ + " <waveform-entry durationMs=\"500\" amplitude=\"0\"/>\n"
+ + " </waveform-effect>\n"
+ + "</vibration-effect>"); // Your test XML content
+ writer.close();
+ Uri vibrationUri = Uri.parse(tempVibrationFile.toURI().toString());
+
+ VibrationEffect vibrationEffect = Utils.parseVibrationEffect(vibrator, vibrationUri);
+ return new VibrationInfo(vibrationEffect, vibrationUri);
+ }
+
+ private static Uri getVibrationUriAppended(Uri audioUri, Uri vibrationUri) {
+ Uri.Builder builder = audioUri.buildUpon();
+ builder.appendQueryParameter(Utils.VIBRATION_URI_PARAM, vibrationUri.toString());
+ return builder.build();
+ }
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/VibratorHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/VibratorHelperTest.java
index 0993bec..4d2396c 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/VibratorHelperTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/VibratorHelperTest.java
@@ -22,8 +22,12 @@
import static org.mockito.Mockito.when;
+import android.media.Utils;
+import android.net.Uri;
import android.os.VibrationEffect;
import android.os.Vibrator;
+import android.os.VibratorInfo;
+import android.provider.Settings;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
@@ -36,6 +40,10 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
public class VibratorHelperTest extends UiServiceTestCase {
@@ -86,7 +94,34 @@
}
@Test
+ public void createVibrationEffectFromSoundUri_nullInput() {
+ assertNull(mVibratorHelper.createVibrationEffectFromSoundUri(null));
+ }
+
+ @Test
+ public void createVibrationEffectFromSoundUri_emptyUri() {
+ assertNull(mVibratorHelper.createVibrationEffectFromSoundUri(Uri.EMPTY));
+ }
+
+ @Test
+ public void createVibrationEffectFromSoundUri_uriWithoutRequiredQueryParameter() {
+ Uri uri = Settings.System.DEFAULT_NOTIFICATION_URI;
+ assertNull(mVibratorHelper.createVibrationEffectFromSoundUri(uri));
+ }
+
+ @Test
+ public void createVibrationEffectFromSoundUri_uriWithVibrationUri() throws IOException {
+ // prepare the uri with vibration
+ when(mVibrator.getInfo()).thenReturn(VibratorInfo.EMPTY_VIBRATOR_INFO);
+ Uri validUri = getVibrationUriAppended(Settings.System.DEFAULT_NOTIFICATION_URI);
+
+ assertSingleVibration(mVibratorHelper.createVibrationEffectFromSoundUri(validUri));
+ }
+
+ @Test
public void createVibration_insistent_createsRepeatingVibration() {
+ when(mVibrator.getInfo()).thenReturn(VibratorInfo.EMPTY_VIBRATOR_INFO);
+
when(mVibrator.hasFrequencyControl()).thenReturn(false);
assertRepeatingVibration(mVibratorHelper.createDefaultVibration(/* insistent= */ true));
assertRepeatingVibration(mVibratorHelper.createFallbackVibration(/* insistent= */ true));
@@ -98,6 +133,8 @@
@Test
public void createVibration_nonInsistent_createsSingleShotVibration() {
+ when(mVibrator.getInfo()).thenReturn(VibratorInfo.EMPTY_VIBRATOR_INFO);
+
when(mVibrator.hasFrequencyControl()).thenReturn(false);
assertSingleVibration(mVibratorHelper.createDefaultVibration(/* insistent= */ false));
assertSingleVibration(mVibratorHelper.createFallbackVibration(/* insistent= */ false));
@@ -120,4 +157,26 @@
effect instanceof VibrationEffect.Composed);
return ((VibrationEffect.Composed) effect).getRepeatIndex();
}
+
+ private static Uri getVibrationUriAppended(Uri baseUri) throws IOException {
+ File tempVibrationFile = File.createTempFile("test_vibration_file", ".xml");
+ FileWriter writer = new FileWriter(tempVibrationFile);
+ writer.write("<vibration-effect>\n"
+ + " <waveform-effect>\n"
+ + " <!-- PRIMING -->\n"
+ + " <waveform-entry durationMs=\"0\" amplitude=\"0\"/>\n"
+ + " <waveform-entry durationMs=\"12\" amplitude=\"255\"/>\n"
+ + " <waveform-entry durationMs=\"250\" amplitude=\"0\"/>\n"
+ + " <waveform-entry durationMs=\"12\" amplitude=\"255\"/>\n"
+ + " <waveform-entry durationMs=\"500\" amplitude=\"0\"/>\n"
+ + " </waveform-effect>\n"
+ + "</vibration-effect>"); // Your test XML content
+ writer.close();
+
+ Uri.Builder builder = baseUri.buildUpon();
+ builder.appendQueryParameter(
+ Utils.VIBRATION_URI_PARAM,
+ tempVibrationFile.toURI().toString());
+ return builder.build();
+ }
}
diff --git a/services/tests/vibrator/Android.bp b/services/tests/vibrator/Android.bp
index 2549ff5..ed18c8b 100644
--- a/services/tests/vibrator/Android.bp
+++ b/services/tests/vibrator/Android.bp
@@ -17,9 +17,9 @@
libs: [
"android.hardware.vibrator-V3-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
diff --git a/services/tests/vibrator/utils/com/android/server/vibrator/FakeVibratorControllerProvider.java b/services/tests/vibrator/utils/com/android/server/vibrator/FakeVibratorControllerProvider.java
index 031d1c2..946e1ea 100644
--- a/services/tests/vibrator/utils/com/android/server/vibrator/FakeVibratorControllerProvider.java
+++ b/services/tests/vibrator/utils/com/android/server/vibrator/FakeVibratorControllerProvider.java
@@ -68,6 +68,9 @@
private int[] mSupportedPrimitives;
private int mCompositionSizeMax;
private int mPwleSizeMax;
+ private int mMaxEnvelopeEffectSize;
+ private int mMinEnvelopeEffectControlPointDurationMillis;
+ private int mMaxEnvelopeEffectControlPointDurationMillis;
private float mMinFrequency = Float.NaN;
private float mResonantFrequency = Float.NaN;
private float mFrequencyResolution = Float.NaN;
@@ -217,6 +220,11 @@
infoBuilder.setQFactor(mQFactor);
infoBuilder.setFrequencyProfile(new VibratorInfo.FrequencyProfile(
mResonantFrequency, mMinFrequency, mFrequencyResolution, mMaxAmplitudes));
+ infoBuilder.setMaxEnvelopeEffectSize(mMaxEnvelopeEffectSize);
+ infoBuilder.setMinEnvelopeEffectControlPointDurationMillis(
+ mMinEnvelopeEffectControlPointDurationMillis);
+ infoBuilder.setMaxEnvelopeEffectControlPointDurationMillis(
+ mMaxEnvelopeEffectControlPointDurationMillis);
return mIsInfoLoadSuccessful;
}
@@ -358,6 +366,26 @@
}
/**
+ * Set the maximum number of envelope effects control points supported in fake vibrator
+ * hardware.
+ */
+ public void setMaxEnvelopeEffectSize(int envelopeEffectControlPointsMax) {
+ mMaxEnvelopeEffectSize = envelopeEffectControlPointsMax;
+ }
+
+ /** Set the envelope effect minimum segment duration in fake vibrator hardware. */
+ public void setMinEnvelopeEffectControlPointDurationMillis(
+ int minEnvelopeEffectControlPointDurationMillis) {
+ mMinEnvelopeEffectControlPointDurationMillis = minEnvelopeEffectControlPointDurationMillis;
+ }
+
+ /** Set the envelope effect maximum segment duration in fake vibrator hardware. */
+ public void setMaxEnvelopeEffectControlPointDurationMillis(
+ int maxEnvelopeEffectControlPointDurationMillis) {
+ mMaxEnvelopeEffectControlPointDurationMillis = maxEnvelopeEffectControlPointDurationMillis;
+ }
+
+ /**
* Return the amplitudes set by this controller, including zeroes for each time the vibrator was
* turned off.
*/
diff --git a/services/tests/voiceinteractiontests/Android.bp b/services/tests/voiceinteractiontests/Android.bp
index 8c70851..5fbf02c 100644
--- a/services/tests/voiceinteractiontests/Android.bp
+++ b/services/tests/voiceinteractiontests/Android.bp
@@ -49,9 +49,9 @@
],
libs: [
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
certificate: "platform",
diff --git a/services/tests/wmtests/Android.bp b/services/tests/wmtests/Android.bp
index 289f8a9..4e59fe5 100644
--- a/services/tests/wmtests/Android.bp
+++ b/services/tests/wmtests/Android.bp
@@ -76,9 +76,9 @@
libs: [
"android.hardware.power-V1-java",
- "android.test.mock",
- "android.test.base",
- "android.test.runner",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
defaults: [
diff --git a/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTests.java b/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTests.java
index e694c0b..536dcfb 100644
--- a/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTests.java
+++ b/services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerTests.java
@@ -42,7 +42,6 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.clearInvocations;
import android.app.ActivityManager;
import android.app.AppOpsManager;
@@ -135,15 +134,13 @@
doNothing().when(mPhoneWindowManager).initializeHdmiState();
final boolean[] isScreenTurnedOff = { false };
final DisplayPolicy displayPolicy = mock(DisplayPolicy.class);
- doAnswer(invocation -> isScreenTurnedOff[0] = true).when(displayPolicy).screenTurnedOff();
+ doAnswer(invocation -> isScreenTurnedOff[0] = true).when(displayPolicy).screenTurnedOff(
+ anyBoolean());
doAnswer(invocation -> !isScreenTurnedOff[0]).when(displayPolicy).isScreenOnEarly();
doAnswer(invocation -> !isScreenTurnedOff[0]).when(displayPolicy).isScreenOnFully();
mPhoneWindowManager.mDefaultDisplayPolicy = displayPolicy;
mPhoneWindowManager.mDefaultDisplayRotation = mock(DisplayRotation.class);
- final ActivityTaskManagerInternal.SleepTokenAcquirer tokenAcquirer =
- mock(ActivityTaskManagerInternal.SleepTokenAcquirer.class);
- doReturn(tokenAcquirer).when(mAtmInternal).createSleepTokenAcquirer(anyString());
final PowerManager pm = mock(PowerManager.class);
doReturn(true).when(pm).isInteractive();
doReturn(pm).when(mContext).getSystemService(eq(Context.POWER_SERVICE));
@@ -155,9 +152,8 @@
assertThat(mPhoneWindowManager.mIsGoingToSleepDefaultDisplay).isFalse();
// Skip sleep-token for non-sleep-screen-off.
- clearInvocations(tokenAcquirer);
mPhoneWindowManager.screenTurnedOff(DEFAULT_DISPLAY, true /* isSwappingDisplay */);
- verify(tokenAcquirer, never()).acquire(anyInt());
+ verify(displayPolicy).screenTurnedOff(false /* acquireSleepToken */);
assertThat(isScreenTurnedOff[0]).isTrue();
// Apply sleep-token for sleep-screen-off.
@@ -165,21 +161,10 @@
mPhoneWindowManager.startedGoingToSleep(DEFAULT_DISPLAY, 0 /* reason */);
assertThat(mPhoneWindowManager.mIsGoingToSleepDefaultDisplay).isTrue();
mPhoneWindowManager.screenTurnedOff(DEFAULT_DISPLAY, true /* isSwappingDisplay */);
- verify(tokenAcquirer).acquire(eq(DEFAULT_DISPLAY));
+ verify(displayPolicy).screenTurnedOff(true /* acquireSleepToken */);
mPhoneWindowManager.finishedGoingToSleep(DEFAULT_DISPLAY, 0 /* reason */);
assertThat(mPhoneWindowManager.mIsGoingToSleepDefaultDisplay).isFalse();
-
- // Simulate unexpected reversed order: screenTurnedOff -> startedGoingToSleep. The sleep
- // token can still be acquired.
- isScreenTurnedOff[0] = false;
- clearInvocations(tokenAcquirer);
- mPhoneWindowManager.screenTurnedOff(DEFAULT_DISPLAY, true /* isSwappingDisplay */);
- verify(tokenAcquirer, never()).acquire(anyInt());
- assertThat(displayPolicy.isScreenOnEarly()).isFalse();
- assertThat(displayPolicy.isScreenOnFully()).isFalse();
- mPhoneWindowManager.startedGoingToSleep(DEFAULT_DISPLAY, 0 /* reason */);
- verify(tokenAcquirer).acquire(eq(DEFAULT_DISPLAY));
}
@Test
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index 1e035da..e2e76d6 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -3231,7 +3231,7 @@
mDisplayContent.mOpeningApps.remove(activity);
mDisplayContent.mClosingApps.remove(activity);
activity.commitVisibility(false /* visible */, false /* performLayout */);
- mDisplayContent.getDisplayPolicy().screenTurnedOff();
+ mDisplayContent.getDisplayPolicy().screenTurnedOff(false /* acquireSleepToken */);
final KeyguardController controller = mSupervisor.getKeyguardController();
doReturn(true).when(controller).isKeyguardGoingAway(anyInt());
activity.setVisibility(true);
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppCompatActivityRobot.java b/services/tests/wmtests/src/com/android/server/wm/AppCompatActivityRobot.java
index a7a08b2..8227ed9 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppCompatActivityRobot.java
+++ b/services/tests/wmtests/src/com/android/server/wm/AppCompatActivityRobot.java
@@ -139,11 +139,6 @@
/* isUnresizable */ true);
}
- void activateCameraInPolicy(boolean isCameraActive) {
- doReturn(isCameraActive).when(mDisplayContent.mAppCompatCameraPolicy)
- .isCameraActive(any(ActivityRecord.class), anyBoolean());
- }
-
void setDisplayNaturalOrientation(@Configuration.Orientation int naturalOrientation) {
doReturn(naturalOrientation).when(mDisplayContent).getNaturalOrientation();
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraOverridesTest.java b/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraOverridesTest.java
index ba2a733..d66c21a 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraOverridesTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraOverridesTest.java
@@ -267,7 +267,6 @@
robot.conf().enableCameraCompatSplitScreenAspectRatio(true);
robot.applyOnActivity((a) -> {
a.createActivityWithComponentInNewTask();
- a.activateCameraInPolicy(true);
a.setShouldCreateCompatDisplayInsets(false);
});
@@ -276,27 +275,12 @@
}
@Test
- public void testIsCameraActive() {
- runTestScenario((robot) -> {
- robot.applyOnActivity((a) -> {
- a.createActivityWithComponent();
- a.activateCameraInPolicy(/* isCameraActive */ false);
- robot.checkIsCameraActive(/* active */ false);
- a.activateCameraInPolicy(/* isCameraActive */ true);
- robot.checkIsCameraActive(/* active */ true);
- });
- });
- }
-
-
- @Test
@EnableCompatChanges({OVERRIDE_MIN_ASPECT_RATIO_ONLY_FOR_CAMERA})
public void shouldOverrideMinAspectRatioForCamera_overrideEnabled_returnsTrue() {
runTestScenario((robot) -> {
robot.activity().createActivityWithComponent();
- robot.activity().activateCameraInPolicy(/* isCameraActive */ true);
- robot.checkShouldOverrideMinAspectRatioForCamera(/* expected */ true);
+ robot.checkIsOverrideMinAspectRatioForCameraEnabled(/* expected */ true);
});
}
@@ -306,21 +290,8 @@
runTestScenario((robot) -> {
robot.prop().enable(PROPERTY_COMPAT_ALLOW_MIN_ASPECT_RATIO_OVERRIDE);
robot.activity().createActivityWithComponent();
- robot.activity().activateCameraInPolicy(/* isCameraActive */ true);
- robot.checkShouldOverrideMinAspectRatioForCamera(/* expected */ true);
- });
- }
-
- @Test
- @EnableCompatChanges({OVERRIDE_MIN_ASPECT_RATIO_ONLY_FOR_CAMERA})
- public void shouldOverrideMinAspectRatioForCamera_propertyTrue_overrideEnabled_returnsFalse() {
- runTestScenario((robot) -> {
- robot.prop().enable(PROPERTY_COMPAT_ALLOW_MIN_ASPECT_RATIO_OVERRIDE);
- robot.activity().createActivityWithComponent();
- robot.activity().activateCameraInPolicy(/* isCameraActive */ false);
-
- robot.checkShouldOverrideMinAspectRatioForCamera(/* expected */ false);
+ robot.checkIsOverrideMinAspectRatioForCameraEnabled(/* expected */ true);
});
}
@@ -330,9 +301,8 @@
runTestScenario((robot) -> {
robot.prop().enable(PROPERTY_COMPAT_ALLOW_MIN_ASPECT_RATIO_OVERRIDE);
robot.activity().createActivityWithComponent();
- robot.activity().activateCameraInPolicy(/* isCameraActive */ true);
- robot.checkShouldOverrideMinAspectRatioForCamera(/* expected */ false);
+ robot.checkIsOverrideMinAspectRatioForCameraEnabled(/* expected */ false);
});
}
@@ -341,9 +311,8 @@
public void shouldOverrideMinAspectRatioForCamera_overrideDisabled_returnsFalse() {
runTestScenario((robot) -> {
robot.activity().createActivityWithComponent();
- robot.activity().activateCameraInPolicy(/* isCameraActive */ true);
- robot.checkShouldOverrideMinAspectRatioForCamera(/* expected */ false);
+ robot.checkIsOverrideMinAspectRatioForCameraEnabled(/* expected */ false);
});
}
@@ -354,7 +323,7 @@
robot.prop().disable(PROPERTY_COMPAT_ALLOW_MIN_ASPECT_RATIO_OVERRIDE);
robot.activity().createActivityWithComponent();
- robot.checkShouldOverrideMinAspectRatioForCamera(/* expected */ false);
+ robot.checkIsOverrideMinAspectRatioForCameraEnabled(/* expected */ false);
});
}
@@ -364,9 +333,8 @@
runTestScenario((robot) -> {
robot.prop().disable(PROPERTY_COMPAT_ALLOW_MIN_ASPECT_RATIO_OVERRIDE);
robot.activity().createActivityWithComponent();
- robot.activity().activateCameraInPolicy(/* isCameraActive */ true);
- robot.checkShouldOverrideMinAspectRatioForCamera(/* expected */ false);
+ robot.checkIsOverrideMinAspectRatioForCameraEnabled(/* expected */ false);
});
}
@@ -412,13 +380,9 @@
.shouldApplyFreeformTreatmentForCameraCompat(), expected);
}
- void checkShouldOverrideMinAspectRatioForCamera(boolean expected) {
+ void checkIsOverrideMinAspectRatioForCameraEnabled(boolean expected) {
Assert.assertEquals(getAppCompatCameraOverrides()
- .shouldOverrideMinAspectRatioForCamera(), expected);
- }
-
- void checkIsCameraActive(boolean active) {
- Assert.assertEquals(getAppCompatCameraOverrides().isCameraActive(), active);
+ .isOverrideMinAspectRatioForCameraEnabled(), expected);
}
private AppCompatCameraOverrides getAppCompatCameraOverrides() {
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraPolicyTest.java b/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraPolicyTest.java
index 2ae23f8..d91b38e 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraPolicyTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/AppCompatCameraPolicyTest.java
@@ -16,6 +16,8 @@
package com.android.server.wm;
+import static android.content.pm.ActivityInfo.OVERRIDE_MIN_ASPECT_RATIO_ONLY_FOR_CAMERA;
+
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.window.flags.Flags.FLAG_CAMERA_COMPAT_FOR_FREEFORM;
@@ -31,6 +33,9 @@
import androidx.annotation.NonNull;
+import libcore.junit.util.compat.CoreCompatChangeRule.DisableCompatChanges;
+import libcore.junit.util.compat.CoreCompatChangeRule.EnableCompatChanges;
+
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
@@ -186,16 +191,6 @@
});
}
- /**
- * Runs a test scenario providing a Robot.
- */
- void runTestScenario(@NonNull Consumer<AppCompatCameraPolicyRobotTest> consumer) {
- spyOn(mWm.mAppCompatConfiguration);
- final AppCompatCameraPolicyRobotTest robot =
- new AppCompatCameraPolicyRobotTest(mWm, mAtm, mSupervisor);
- consumer.accept(robot);
- }
-
@Test
public void testIsCameraCompatTreatmentActive_whenTreatmentForTopActivityIsEnabled() {
runTestScenario((robot) -> {
@@ -220,6 +215,58 @@
});
}
+ @Test
+ @EnableCompatChanges(OVERRIDE_MIN_ASPECT_RATIO_ONLY_FOR_CAMERA)
+ public void testShouldOverrideMinAspectRatioForCamera_whenCameraIsNotRunning() {
+ runTestScenario((robot) -> {
+ robot.applyOnActivity((a)-> {
+ robot.conf().enableCameraCompatTreatmentAtBuildTime(/* enabled= */ true);
+ a.createActivityWithComponentInNewTaskAndDisplay();
+ a.setTopActivityCameraActive(/* active */ false);
+ });
+
+ robot.checkShouldOverrideMinAspectRatioForCamera(/* active */ false);
+ });
+ }
+
+ @Test
+ @DisableCompatChanges(OVERRIDE_MIN_ASPECT_RATIO_ONLY_FOR_CAMERA)
+ public void testShouldOverrideMinAspectRatioForCamera_whenCameraIsRunning_overrideDisabled() {
+ runTestScenario((robot) -> {
+ robot.applyOnActivity((a)-> {
+ robot.conf().enableCameraCompatTreatmentAtBuildTime(/* enabled= */ true);
+ a.createActivityWithComponentInNewTaskAndDisplay();
+ a.setTopActivityCameraActive(/* active */ true);
+ });
+
+ robot.checkShouldOverrideMinAspectRatioForCamera(/* active */ false);
+ });
+ }
+
+ @Test
+ @EnableCompatChanges(OVERRIDE_MIN_ASPECT_RATIO_ONLY_FOR_CAMERA)
+ public void testShouldOverrideMinAspectRatioForCamera_whenCameraIsRunning_overrideEnabled() {
+ runTestScenario((robot) -> {
+ robot.applyOnActivity((a)-> {
+ robot.conf().enableCameraCompatTreatmentAtBuildTime(/* enabled= */ true);
+ a.createActivityWithComponentInNewTaskAndDisplay();
+ a.setTopActivityCameraActive(/* active */ true);
+ });
+
+ robot.checkShouldOverrideMinAspectRatioForCamera(/* active */ true);
+ });
+ }
+
+ /**
+ * Runs a test scenario providing a Robot.
+ */
+ void runTestScenario(@NonNull Consumer<AppCompatCameraPolicyRobotTest> consumer) {
+ final AppCompatCameraPolicyRobotTest robot =
+ new AppCompatCameraPolicyRobotTest(mWm, mAtm, mSupervisor);
+ consumer.accept(robot);
+ }
+
+
private static class AppCompatCameraPolicyRobotTest extends AppCompatRobotBase {
AppCompatCameraPolicyRobotTest(@NonNull WindowManagerService wm,
@NonNull ActivityTaskManagerService atm,
@@ -230,7 +277,14 @@
@Override
void onPostDisplayContentCreation(@NonNull DisplayContent displayContent) {
super.onPostDisplayContentCreation(displayContent);
+
spyOn(displayContent.mAppCompatCameraPolicy);
+ if (displayContent.mAppCompatCameraPolicy.mDisplayRotationCompatPolicy != null) {
+ spyOn(displayContent.mAppCompatCameraPolicy.mDisplayRotationCompatPolicy);
+ }
+ if (displayContent.mAppCompatCameraPolicy.mCameraCompatFreeformPolicy != null) {
+ spyOn(displayContent.mAppCompatCameraPolicy.mCameraCompatFreeformPolicy);
+ }
}
void checkTopActivityHasDisplayRotationCompatPolicy(boolean exists) {
@@ -268,6 +322,11 @@
.isTreatmentEnabledForActivity(activity().top()), active);
}
+ void checkShouldOverrideMinAspectRatioForCamera(boolean expected) {
+ assertEquals(getTopAppCompatCameraPolicy()
+ .shouldOverrideMinAspectRatioForCamera(activity().top()), expected);
+ }
+
// TODO(b/350460645): Create Desktop Windowing Robot to reuse common functionalities.
void allowEnterDesktopMode(boolean isAllowed) {
doReturn(isAllowed).when(() ->
diff --git a/services/tests/wmtests/src/com/android/server/wm/DimmerTests.java b/services/tests/wmtests/src/com/android/server/wm/DimmerTests.java
index e57e36d..1f3aa35 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DimmerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DimmerTests.java
@@ -52,39 +52,14 @@
@RunWith(WindowTestRunner.class)
public class DimmerTests extends WindowTestsBase {
- private static class TestWindowContainer extends WindowContainer<TestWindowContainer> {
- final SurfaceControl mControl = mock(SurfaceControl.class);
- final SurfaceControl.Transaction mPendingTransaction = spy(StubTransaction.class);
- final SurfaceControl.Transaction mSyncTransaction = spy(StubTransaction.class);
-
- TestWindowContainer(WindowManagerService wm) {
- super(wm);
- setVisibleRequested(true);
- }
-
- @Override
- public SurfaceControl getSurfaceControl() {
- return mControl;
- }
-
- @Override
- public SurfaceControl.Transaction getSyncTransaction() {
- return mSyncTransaction;
- }
-
- @Override
- public SurfaceControl.Transaction getPendingTransaction() {
- return mPendingTransaction;
- }
- }
-
- private static class MockSurfaceBuildingContainer extends WindowContainer<TestWindowContainer> {
+ private static class MockSurfaceBuildingContainer extends WindowContainer<WindowState> {
final SurfaceSession mSession = new SurfaceSession();
final SurfaceControl mHostControl = mock(SurfaceControl.class);
final SurfaceControl.Transaction mHostTransaction = spy(StubTransaction.class);
MockSurfaceBuildingContainer(WindowManagerService wm) {
super(wm);
+ mVisibleRequested = true;
}
class MockSurfaceBuilder extends SurfaceControl.Builder {
@@ -129,28 +104,41 @@
}
}
- private MockSurfaceBuildingContainer mHost;
private Dimmer mDimmer;
private SurfaceControl.Transaction mTransaction;
- private TestWindowContainer mChild;
+ private WindowState mChild1;
+ private WindowState mChild2;
private static AnimationAdapter sTestAnimation;
@Before
public void setUp() throws Exception {
- mHost = new MockSurfaceBuildingContainer(mWm);
- mTransaction = spy(StubTransaction.class);
- mChild = new TestWindowContainer(mWm);
+ MockSurfaceBuildingContainer host = new MockSurfaceBuildingContainer(mWm);
+ mTransaction = host.getSyncTransaction();
+
+ final SurfaceControl mControl1 = mock(SurfaceControl.class);
+ final SurfaceControl mControl2 = mock(SurfaceControl.class);
+
+ SurfaceAnimator animator = mock(SurfaceAnimator.class);
+ when(animator.getAnimation()).thenReturn(null);
+
+ mChild1 = mock(WindowState.class);
+ when(mChild1.getSurfaceControl()).thenReturn(mControl1);
+
+ mChild2 = mock(WindowState.class);
+ when(mChild2.getSurfaceControl()).thenReturn(mControl2);
+
+ host.addChild(mChild1, 0);
+ host.addChild(mChild2, 1);
+
sTestAnimation = spy(new MockAnimationAdapter());
- mDimmer = new Dimmer(mHost, new MockAnimationAdapterFactory());
+ mDimmer = new Dimmer(host, new MockAnimationAdapterFactory());
}
@Test
@RequiresFlagsDisabled(Flags.FLAG_USE_TASKS_DIM_ONLY)
public void testUpdateDimsAppliesCrop() {
- mHost.addChild(mChild, 0);
-
- mDimmer.adjustAppearance(mChild, 1, 1);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 1, 1);
+ mDimmer.adjustPosition(mChild1, mChild1);
int width = 100;
int height = 300;
@@ -165,9 +153,8 @@
public void testDimBelowWithChildSurfaceCreatesSurfaceBelowChild() {
final float alpha = 0.7f;
final int blur = 50;
- mHost.addChild(mChild, 0);
- mDimmer.adjustAppearance(mChild, alpha, blur);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, alpha, blur);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
assertNotNull("Dimmer should have created a surface", dimLayer);
@@ -175,25 +162,23 @@
mDimmer.updateDims(mTransaction);
verify(sTestAnimation).startAnimation(eq(dimLayer), eq(mTransaction),
anyInt(), any(SurfaceAnimator.OnAnimationFinishedCallback.class));
- verify(mTransaction).setRelativeLayer(dimLayer, mChild.mControl, -1);
+ verify(mTransaction).setRelativeLayer(dimLayer, mChild1.getSurfaceControl(), -1);
verify(mTransaction, lastCall()).setAlpha(dimLayer, alpha);
verify(mTransaction).setBackgroundBlurRadius(dimLayer, blur);
}
@Test
public void testDimBelowWithChildSurfaceDestroyedWhenReset() {
- mHost.addChild(mChild, 0);
-
final float alpha = 0.8f;
final int blur = 50;
// Dim once
- mDimmer.adjustAppearance(mChild, alpha, blur);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, alpha, blur);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
mDimmer.updateDims(mTransaction);
// Reset, and don't dim
mDimmer.resetDimStates();
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustPosition(mChild1, mChild1);
mDimmer.updateDims(mTransaction);
verify(mTransaction).show(dimLayer);
verify(mTransaction).remove(dimLayer);
@@ -201,19 +186,17 @@
@Test
public void testDimBelowWithChildSurfaceNotDestroyedWhenPersisted() {
- mHost.addChild(mChild, 0);
-
final float alpha = 0.8f;
final int blur = 20;
// Dim once
- mDimmer.adjustAppearance(mChild, alpha, blur);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, alpha, blur);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
mDimmer.updateDims(mTransaction);
// Reset and dim again
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(mChild, alpha, blur);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, alpha, blur);
+ mDimmer.adjustPosition(mChild1, mChild1);
mDimmer.updateDims(mTransaction);
verify(mTransaction).show(dimLayer);
verify(mTransaction, never()).remove(dimLayer);
@@ -222,10 +205,9 @@
@Test
@RequiresFlagsDisabled(Flags.FLAG_USE_TASKS_DIM_ONLY)
public void testDimUpdateWhileDimming() {
- mHost.addChild(mChild, 0);
final float alpha = 0.8f;
- mDimmer.adjustAppearance(mChild, alpha, 20);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, alpha, 20);
+ mDimmer.adjustPosition(mChild1, mChild1);
final Rect bounds = mDimmer.getDimBounds();
SurfaceControl dimLayer = mDimmer.getDimLayer();
@@ -243,9 +225,8 @@
@Test
public void testRemoveDimImmediately() {
- mHost.addChild(mChild, 0);
- mDimmer.adjustAppearance(mChild, 1, 2);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 1, 2);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
mDimmer.updateDims(mTransaction);
verify(mTransaction, times(1)).show(dimLayer);
@@ -266,22 +247,20 @@
*/
@Test
public void testContainerDimsOpeningAnimationByItself() {
- mHost.addChild(mChild, 0);
-
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(mChild, 0.1f, 0);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 0.1f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
mDimmer.updateDims(mTransaction);
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(mChild, 0.2f, 0);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 0.2f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
mDimmer.updateDims(mTransaction);
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(mChild, 0.3f, 0);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 0.3f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
mDimmer.updateDims(mTransaction);
verify(mTransaction).setAlpha(dimLayer, 0.2f);
@@ -297,22 +276,20 @@
*/
@Test
public void testContainerDimsClosingAnimationByItself() {
- mHost.addChild(mChild, 0);
-
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(mChild, 0.2f, 0);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 0.2f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
mDimmer.updateDims(mTransaction);
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(mChild, 0.1f, 0);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 0.1f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
mDimmer.updateDims(mTransaction);
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(mChild, 0f, 0);
- mDimmer.adjustPosition(mChild, mChild, -1);
+ mDimmer.adjustAppearance(mChild1, 0f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
mDimmer.updateDims(mTransaction);
mDimmer.resetDimStates();
@@ -325,19 +302,14 @@
*/
@Test
public void testMultipleContainersDimmingConsecutively() {
- TestWindowContainer first = mChild;
- TestWindowContainer second = new TestWindowContainer(mWm);
- mHost.addChild(first, 0);
- mHost.addChild(second, 1);
-
- mDimmer.adjustAppearance(first, 0.5f, 0);
- mDimmer.adjustPosition(mChild, first, -1);
+ mDimmer.adjustAppearance(mChild1, 0.5f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
mDimmer.updateDims(mTransaction);
mDimmer.resetDimStates();
- mDimmer.adjustAppearance(second, 0.9f, 0);
- mDimmer.adjustPosition(mChild, second, -1);
+ mDimmer.adjustAppearance(mChild2, 0.9f, 0);
+ mDimmer.adjustPosition(mChild1, mChild2);
mDimmer.updateDims(mTransaction);
verify(sTestAnimation, times(2)).startAnimation(
@@ -353,16 +325,11 @@
*/
@Test
public void testMultipleContainersDimmingAtTheSameTime() {
- TestWindowContainer first = mChild;
- TestWindowContainer second = new TestWindowContainer(mWm);
- mHost.addChild(first, 0);
- mHost.addChild(second, 1);
-
- mDimmer.adjustAppearance(first, 0.5f, 0);
- mDimmer.adjustPosition(mChild, first, -1);
+ mDimmer.adjustAppearance(mChild1, 0.5f, 0);
+ mDimmer.adjustPosition(mChild1, mChild1);
SurfaceControl dimLayer = mDimmer.getDimLayer();
- mDimmer.adjustAppearance(second, 0.9f, 0);
- mDimmer.adjustPosition(mChild, second, -1);
+ mDimmer.adjustAppearance(mChild2, 0.9f, 0);
+ mDimmer.adjustPosition(mChild1, mChild2);
mDimmer.updateDims(mTransaction);
verify(sTestAnimation, times(1)).startAnimation(
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java
index caeb41c..f32a234 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java
@@ -284,11 +284,11 @@
final DisplayPolicy policy = mDisplayContent.getDisplayPolicy();
policy.addWindowLw(mNotificationShadeWindow, mNotificationShadeWindow.mAttrs);
- policy.screenTurnedOff();
+ policy.screenTurnedOff(false /* acquireSleepToken */);
policy.setAwake(false);
policy.screenTurningOn(null /* screenOnListener */);
assertTrue(wpc.isShowingUiWhileDozing());
- policy.screenTurnedOff();
+ policy.screenTurnedOff(false /* acquireSleepToken */);
assertFalse(wpc.isShowingUiWhileDozing());
policy.screenTurningOn(null /* screenOnListener */);
@@ -393,7 +393,7 @@
info.logicalWidth, info.logicalHeight).mConfigFrame);
// If screen is not fully turned on, then the cache should be preserved.
- displayPolicy.screenTurnedOff();
+ displayPolicy.screenTurnedOff(false /* acquireSleepToken */);
final TransitionController transitionController = mDisplayContent.mTransitionController;
spyOn(transitionController);
doReturn(true).when(transitionController).isCollecting();
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java
index 2e488d8..09fe75d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java
@@ -22,6 +22,7 @@
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.DisplayCutout.NO_CUTOUT;
import static android.view.IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT;
import static android.view.IWindowManager.FIXED_TO_USER_ROTATION_DISABLED;
@@ -78,7 +79,6 @@
import com.android.internal.R;
import com.android.internal.util.test.FakeSettingsProvider;
-import com.android.server.LocalServices;
import com.android.server.UiThread;
import com.android.server.policy.WindowManagerPolicy;
import com.android.server.statusbar.StatusBarManagerInternal;
@@ -86,7 +86,6 @@
import com.android.server.testutils.TestHandler;
import com.android.server.wm.DisplayContent.FixedRotationTransitionListener;
-import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -168,25 +167,10 @@
public void setUp() {
FakeSettingsProvider.clearSettingsProvider();
- mPreviousStatusBarManagerInternal = LocalServices.getService(
- StatusBarManagerInternal.class);
- LocalServices.removeServiceForTest(StatusBarManagerInternal.class);
- mMockStatusBarManagerInternal = mock(StatusBarManagerInternal.class);
- LocalServices.addService(StatusBarManagerInternal.class, mMockStatusBarManagerInternal);
mDisplayRotationImmersiveAppCompatPolicyMock = null;
mBuilder = new DisplayRotationBuilder();
}
- @After
- public void tearDown() {
- LocalServices.removeServiceForTest(StatusBarManagerInternal.class);
- if (mPreviousStatusBarManagerInternal != null) {
- LocalServices.addService(StatusBarManagerInternal.class,
- mPreviousStatusBarManagerInternal);
- mPreviousStatusBarManagerInternal = null;
- }
- }
-
// ================================
// Display Settings Related Tests
// ================================
@@ -677,7 +661,8 @@
mOrientationSensorListener.onSensorChanged(createSensorEvent(Surface.ROTATION_90));
assertTrue(waitForUiHandler());
- verify(mMockStatusBarManagerInternal).onProposedRotationChanged(Surface.ROTATION_90, true);
+ verify(mMockStatusBarManagerInternal).onProposedRotationChanged(DEFAULT_DISPLAY,
+ Surface.ROTATION_90, true);
}
@Test
@@ -697,7 +682,8 @@
mOrientationSensorListener.onSensorChanged(createSensorEvent(Surface.ROTATION_90));
assertTrue(waitForUiHandler());
- verify(mMockStatusBarManagerInternal).onProposedRotationChanged(Surface.ROTATION_90, true);
+ verify(mMockStatusBarManagerInternal).onProposedRotationChanged(DEFAULT_DISPLAY,
+ Surface.ROTATION_90, true);
// An imaginary ActivityRecord.setRequestedOrientation call disables immersive mode:
when(mDisplayRotationImmersiveAppCompatPolicyMock.isRotationLockEnforced(
@@ -728,7 +714,7 @@
assertTrue(waitForUiHandler());
verify(mMockStatusBarManagerInternal)
- .onProposedRotationChanged(Surface.ROTATION_180, true);
+ .onProposedRotationChanged(DEFAULT_DISPLAY, Surface.ROTATION_180, true);
}
@Test
@@ -746,7 +732,7 @@
assertTrue(waitForUiHandler());
verify(mMockStatusBarManagerInternal)
- .onProposedRotationChanged(Surface.ROTATION_180, false);
+ .onProposedRotationChanged(DEFAULT_DISPLAY, Surface.ROTATION_180, false);
}
@Test
@@ -773,7 +759,7 @@
assertTrue(waitForUiHandler());
verify(mMockStatusBarManagerInternal)
- .onProposedRotationChanged(Surface.ROTATION_180, false);
+ .onProposedRotationChanged(DEFAULT_DISPLAY, Surface.ROTATION_180, false);
}
@Test
@@ -1526,6 +1512,7 @@
mMockDisplayContent = mock(DisplayContent.class);
when(mMockDisplayContent.getDisplay()).thenReturn(mock(Display.class));
+ when(mMockDisplayContent.getDisplayId()).thenReturn(DEFAULT_DISPLAY);
mMockDisplayContent.isDefaultDisplay = mIsDefaultDisplay;
when(mMockDisplayContent.calculateDisplayCutoutForRotation(anyInt()))
.thenReturn(NO_CUTOUT);
@@ -1541,6 +1528,9 @@
field.set(mMockDisplayContent, mock(FixedRotationTransitionListener.class));
mMockDisplayPolicy = mock(DisplayPolicy.class);
+ mMockStatusBarManagerInternal = mock(StatusBarManagerInternal.class);
+ when(mMockDisplayPolicy.getStatusBarManagerInternal()).thenReturn(
+ mMockStatusBarManagerInternal);
mMockRes = mock(Resources.class);
when(mMockContext.getResources()).thenReturn((mMockRes));
diff --git a/services/tests/wmtests/src/com/android/server/wm/LockTaskControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/LockTaskControllerTest.java
index 1d14dc3..bef4531 100644
--- a/services/tests/wmtests/src/com/android/server/wm/LockTaskControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/LockTaskControllerTest.java
@@ -219,7 +219,7 @@
mLockTaskController.startLockTaskMode(tr, false, TEST_UID);
// THEN a pinning request should be shown
- verify(mStatusBarManagerInternal).showScreenPinningRequest(anyInt());
+ verify(mStatusBarManagerInternal).showScreenPinningRequest(anyInt(), anyInt());
}
@Test
@@ -769,9 +769,11 @@
private Task getTask(Intent intent, int lockTaskAuth) {
Task tr = mock(Task.class);
+ DisplayContent dc = mock(DisplayContent.class);
tr.mLockTaskAuth = lockTaskAuth;
tr.intent = intent;
tr.mUserId = TEST_USER_ID;
+ tr.mDisplayContent = dc;
return tr;
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
index cc1805a..fd959b9 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
@@ -242,7 +242,7 @@
final Rect relStartBounds = new Rect(mTaskFragment.getRelativeEmbeddedBounds());
final DisplayPolicy displayPolicy = mDisplayContent.getDisplayPolicy();
- displayPolicy.screenTurnedOff();
+ displayPolicy.screenTurnedOff(false /* acquireSleepToken */);
assertFalse(mTaskFragment.okToAnimate());
diff --git a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
index 52a80b0..064b434 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
@@ -51,6 +51,7 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.server.wm.WindowContainer.POSITION_TOP;
+import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
import static com.android.window.flags.Flags.explicitRefreshRateHints;
import static org.junit.Assert.assertEquals;
@@ -140,8 +141,7 @@
}
private Transition createTestTransition(int transitType) {
- final TransitionController controller = new TestTransitionController(
- mock(ActivityTaskManagerService.class));
+ final TransitionController controller = new TestTransitionController(mAtm);
mSyncEngine = createTestBLASTSyncEngine();
controller.setSyncEngine(mSyncEngine);
@@ -1590,10 +1590,10 @@
});
assertTrue(activity1.isVisible());
doReturn(false).when(task1).isTranslucent(null);
- doReturn(false).when(task1).isTranslucentForTransition();
+ doReturn(false).when(task1).isTranslucentAndVisible();
assertTrue(controller.canApplyDim(task1));
doReturn(true).when(task1).isTranslucent(null);
- doReturn(true).when(task1).isTranslucentForTransition();
+ doReturn(true).when(task1).isTranslucentAndVisible();
assertFalse(controller.canApplyDim(task1));
controller.finishTransition(ActionChain.testFinish(closeTransition));
@@ -2005,10 +2005,10 @@
@DisableFlags(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE)
@Test
public void testOverrideAnimationOptionsToInfoIfNecessary_disableAnimOptionsPerChange() {
- initializeOverrideAnimationOptionsTest();
+ ActivityRecord r = initializeOverrideAnimationOptionsTest();
TransitionInfo.AnimationOptions options = TransitionInfo.AnimationOptions
.makeCommonAnimOptions("testPackage");
- mTransition.setOverrideAnimation(options, null /* startCallback */,
+ mTransition.setOverrideAnimation(options, r, null /* startCallback */,
null /* finishCallback */);
mTransition.overrideAnimationOptionsToInfoIfNecessary(mInfo);
@@ -2019,10 +2019,10 @@
@EnableFlags(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE)
@Test
public void testOverrideAnimationOptionsToInfoIfNecessary_fromStyleAnimOptions() {
- initializeOverrideAnimationOptionsTest();
+ ActivityRecord r = initializeOverrideAnimationOptionsTest();
TransitionInfo.AnimationOptions options = TransitionInfo.AnimationOptions
.makeCommonAnimOptions("testPackage");
- mTransition.setOverrideAnimation(options, null /* startCallback */,
+ mTransition.setOverrideAnimation(options, r, null /* startCallback */,
null /* finishCallback */);
mTransition.overrideAnimationOptionsToInfoIfNecessary(mInfo);
@@ -2045,10 +2045,10 @@
@EnableFlags(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE)
@Test
public void testOverrideAnimationOptionsToInfoIfNecessary_sceneAnimOptions() {
- initializeOverrideAnimationOptionsTest();
+ ActivityRecord r = initializeOverrideAnimationOptionsTest();
TransitionInfo.AnimationOptions options = TransitionInfo.AnimationOptions
.makeSceneTransitionAnimOptions();
- mTransition.setOverrideAnimation(options, null /* startCallback */,
+ mTransition.setOverrideAnimation(options, r, null /* startCallback */,
null /* finishCallback */);
mTransition.overrideAnimationOptionsToInfoIfNecessary(mInfo);
@@ -2071,10 +2071,10 @@
@EnableFlags(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE)
@Test
public void testOverrideAnimationOptionsToInfoIfNecessary_crossProfileAnimOptions() {
- initializeOverrideAnimationOptionsTest();
+ ActivityRecord r = initializeOverrideAnimationOptionsTest();
TransitionInfo.AnimationOptions options = TransitionInfo.AnimationOptions
.makeCrossProfileAnimOptions();
- mTransition.setOverrideAnimation(options, null /* startCallback */,
+ mTransition.setOverrideAnimation(options, r, null /* startCallback */,
null /* finishCallback */);
final TransitionInfo.Change displayChange = mInfo.getChanges().get(0);
@@ -2099,13 +2099,13 @@
@EnableFlags(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE)
@Test
public void testOverrideAnimationOptionsToInfoIfNecessary_customAnimOptions() {
- initializeOverrideAnimationOptionsTest();
+ ActivityRecord r = initializeOverrideAnimationOptionsTest();
TransitionInfo.AnimationOptions options = TransitionInfo.AnimationOptions
.makeCustomAnimOptions("testPackage", Resources.ID_NULL,
TransitionInfo.AnimationOptions.DEFAULT_ANIMATION_RESOURCES_ID,
TransitionInfo.AnimationOptions.DEFAULT_ANIMATION_RESOURCES_ID,
Color.GREEN, false /* overrideTaskTransition */);
- mTransition.setOverrideAnimation(options, null /* startCallback */,
+ mTransition.setOverrideAnimation(options, r, null /* startCallback */,
null /* finishCallback */);
mTransition.overrideAnimationOptionsToInfoIfNecessary(mInfo);
@@ -2132,7 +2132,7 @@
@EnableFlags(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE)
@Test
public void testOverrideAnimationOptionsToInfoIfNecessary_haveTaskFragmentAnimParams() {
- initializeOverrideAnimationOptionsTest();
+ ActivityRecord r = initializeOverrideAnimationOptionsTest();
final TaskFragment embeddedTf = mTransition.mTargets.get(2).mContainer.asTaskFragment();
embeddedTf.setAnimationParams(new TaskFragmentAnimationParams.Builder()
@@ -2145,7 +2145,7 @@
TransitionInfo.AnimationOptions.DEFAULT_ANIMATION_RESOURCES_ID,
TransitionInfo.AnimationOptions.DEFAULT_ANIMATION_RESOURCES_ID,
Color.GREEN, false /* overrideTaskTransition */);
- mTransition.setOverrideAnimation(options, null /* startCallback */,
+ mTransition.setOverrideAnimation(options, r, null /* startCallback */,
null /* finishCallback */);
final TransitionInfo.Change displayChange = mInfo.getChanges().get(0);
@@ -2181,13 +2181,13 @@
@EnableFlags(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE)
@Test
public void testOverrideAnimationOptionsToInfoIfNecessary_customAnimOptionsWithTaskOverride() {
- initializeOverrideAnimationOptionsTest();
+ ActivityRecord r = initializeOverrideAnimationOptionsTest();
TransitionInfo.AnimationOptions options = TransitionInfo.AnimationOptions
.makeCustomAnimOptions("testPackage", Resources.ID_NULL,
TransitionInfo.AnimationOptions.DEFAULT_ANIMATION_RESOURCES_ID,
TransitionInfo.AnimationOptions.DEFAULT_ANIMATION_RESOURCES_ID,
Color.GREEN, true /* overrideTaskTransition */);
- mTransition.setOverrideAnimation(options, null /* startCallback */,
+ mTransition.setOverrideAnimation(options, r, null /* startCallback */,
null /* finishCallback */);
mTransition.overrideAnimationOptionsToInfoIfNecessary(mInfo);
@@ -2213,7 +2213,7 @@
options.getBackgroundColor(), activityChange.getBackgroundColor());
}
- private void initializeOverrideAnimationOptionsTest() {
+ private ActivityRecord initializeOverrideAnimationOptionsTest() {
mTransition = createTestTransition(TRANSIT_OPEN);
// Test set AnimationOptions for Activity and Task.
@@ -2241,6 +2241,7 @@
embeddedTf.getAnimationLeash()));
mInfo.addChange(new TransitionInfo.Change(null /* container */,
nonEmbeddedActivity.getAnimationLeash()));
+ return nonEmbeddedActivity;
}
@Test
@@ -2357,7 +2358,7 @@
}
@Test
- public void testMoveToTopWhileVisible() {
+ public void testMoveTaskToTopWhileVisible() {
final Transition transition = createTestTransition(TRANSIT_OPEN);
final ArrayMap<WindowContainer, Transition.ChangeInfo> changes = transition.mChanges;
final ArraySet<WindowContainer> participants = transition.mParticipants;
@@ -2392,6 +2393,55 @@
assertEquals(TRANSIT_CHANGE, info.getChanges().get(0).getMode());
}
+ @Test
+ @EnableFlags(Flags.FLAG_ENABLE_DISPLAY_FOCUS_IN_SHELL_TRANSITIONS)
+ public void testMoveDisplayToTop() {
+ // Set up two displays, each of which has a task.
+ DisplayContent otherDisplay = createNewDisplay();
+ final Consumer<DisplayContent> setUpTask = (DisplayContent dc) -> {
+ final Task task = createTask(dc);
+ final ActivityRecord act = createActivityRecord(task);
+ final TestWindowState win = createWindowState(
+ new WindowManager.LayoutParams(TYPE_BASE_APPLICATION), act);
+ act.addWindow(win);
+ act.setVisibleRequested(true);
+ };
+ setUpTask.accept(mDisplayContent);
+ setUpTask.accept(otherDisplay);
+ mWm.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /* updateImWindows */);
+
+ final Transition transition = createTestTransition(TRANSIT_OPEN);
+ final ArrayMap<WindowContainer, Transition.ChangeInfo> changes = transition.mChanges;
+ final ArraySet<WindowContainer> participants = transition.mParticipants;
+
+ // Emulate WindowManagerService#moveDisplayToTopInternal().
+ transition.recordTaskOrder(mDefaultDisplay);
+ mDefaultDisplay.getParent().positionChildAt(WindowContainer.POSITION_TOP,
+ mDefaultDisplay, true /* includingParents */);
+ mWm.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /* updateImWindows */);
+ transition.setReady(mDefaultDisplay, true /* ready */);
+
+ // Test has order changes, a shallow check of order changes.
+ assertTrue(transition.hasOrderChanges());
+
+ // We just moved a display to top, so there shouldn't be any changes.
+ ArrayList<Transition.ChangeInfo> targets = Transition.calculateTargets(
+ participants, changes);
+ assertTrue(targets.isEmpty());
+
+ // After collecting order changes, the task on the newly focused display should be
+ // considered to get moved to top.
+ transition.collectOrderChanges(true);
+ targets = Transition.calculateTargets(participants, changes);
+ assertEquals(1, targets.size());
+
+ // Make sure the flag is set
+ final TransitionInfo info = Transition.calculateTransitionInfo(
+ transition.mType, 0 /* flags */, targets, mMockT);
+ assertTrue((info.getChanges().get(0).getFlags() & TransitionInfo.FLAG_MOVED_TO_TOP) != 0);
+ assertEquals(TRANSIT_CHANGE, info.getChanges().get(0).getMode());
+ }
+
private class OrderChangeTestSetup {
final TransitionController mController;
final TestTransitionPlayer mPlayer;
diff --git a/services/tests/wmtests/src/com/android/server/wm/TransparentPolicyTest.java b/services/tests/wmtests/src/com/android/server/wm/TransparentPolicyTest.java
index 7a440e6..5187f87 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TransparentPolicyTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TransparentPolicyTest.java
@@ -16,6 +16,7 @@
package com.android.server.wm;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
@@ -236,6 +237,21 @@
}
@Test
+ public void testNotRunStrategyToTranslucentActivitiesIfTaskIsFreeform() {
+ runTestScenario((robot) -> {
+ robot.transparentActivity((ta) -> {
+ ta.applyOnActivity((a) -> {
+ a.setIgnoreOrientationRequest(true);
+ ta.launchTransparentActivityInTask();
+ a.setTaskWindowingMode(WINDOWING_MODE_FREEFORM);
+
+ ta.checkTopActivityTransparentPolicyStateIsRunning(/* running */ false);
+ });
+ });
+ }, /* displayWidth */ 2800, /* displayHeight */ 1400);
+ }
+
+ @Test
public void testTranslucentActivitiesDontGoInSizeCompatMode() {
runTestScenario((robot) -> {
robot.transparentActivity((ta) -> {
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceTests.java
index 916c237..6111a65 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowManagerServiceTests.java
@@ -554,6 +554,14 @@
verify(mWm.mWindowContextListenerController, never()).registerWindowContainerListener(any(),
any(), any(), anyInt(), any(), anyBoolean());
+ // Even if the given display id is INVALID_DISPLAY, the specified params.token should be
+ // able to map the corresponding display.
+ final int result = mWm.addWindow(
+ session, new TestIWindow(), params, View.VISIBLE, INVALID_DISPLAY,
+ UserHandle.USER_SYSTEM, WindowInsets.Type.defaultVisible(), null, new InsetsState(),
+ new InsetsSourceControl.Array(), new Rect(), new float[1]);
+ assertThat(result).isAtLeast(WindowManagerGlobal.ADD_OKAY);
+
assertTrue(parentWin.hasChild());
assertTrue(parentWin.isAttached());
session.binderDied();
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index 112471b..c85374e 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -376,7 +376,8 @@
*/
void requestLogMark(in String message);
- void setTestPhoneAcctSuggestionComponent(String flattenedComponentName);
+ void setTestPhoneAcctSuggestionComponent(String flattenedComponentName,
+ in UserHandle userHandle);
void setTestDefaultCallScreeningApp(String packageName);
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index aca0941..41223db 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -5030,6 +5030,18 @@
public static final String KEY_ES_SUPL_DATA_PLANE_ONLY_ROAMING_PLMN_STRING_ARRAY =
KEY_PREFIX + "es_supl_data_plane_only_roaming_plmn_string_array";
+ /**
+ * Determine whether to enable Net Initiated SUPL (NI SUPL) message injection.
+ * If enabled, the GnssLocationProvider will monitor for WAP PUSH or MT SMS NI SUPL intents
+ * and subsequently inject the NI SUPL packet into the GNSS HAL.
+ * {@code false} - Disable NI SUPL message injection. This is default.
+ * {@code true} - Enable NI SUPL message injection.
+ */
+ @FlaggedApi(android.location.flags.Flags
+ .FLAG_ENABLE_NI_SUPL_MESSAGE_INJECTION_BY_CARRIER_CONFIG)
+ public static final String KEY_ENABLE_NI_SUPL_MESSAGE_INJECTION_BOOL =
+ KEY_PREFIX + "enable_ni_supl_message_injection_bool";
+
private static PersistableBundle getDefaults() {
PersistableBundle defaults = new PersistableBundle();
defaults.putBoolean(KEY_PERSIST_LPP_MODE_BOOL, true);
@@ -5047,6 +5059,9 @@
defaults.putInt(KEY_ES_SUPL_CONTROL_PLANE_SUPPORT_INT,
SUPL_EMERGENCY_MODE_TYPE_CP_ONLY);
defaults.putStringArray(KEY_ES_SUPL_DATA_PLANE_ONLY_ROAMING_PLMN_STRING_ARRAY, null);
+ if (android.location.flags.Flags.enableNiSuplMessageInjectionByCarrierConfig()) {
+ defaults.putBoolean(KEY_ENABLE_NI_SUPL_MESSAGE_INJECTION_BOOL, false);
+ }
return defaults;
}
}
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index f0850af..51e0c33 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -1456,21 +1456,21 @@
public static final int SERVICE_CAPABILITY_MAX = SERVICE_CAPABILITY_DATA;
/**
- * Bitmask for {@code SERVICE_CAPABILITY_VOICE}.
+ * Bitmask for {@link #SERVICE_CAPABILITY_VOICE}.
* @hide
*/
public static final int SERVICE_CAPABILITY_VOICE_BITMASK =
serviceCapabilityToBitmask(SERVICE_CAPABILITY_VOICE);
/**
- * Bitmask for {@code SERVICE_CAPABILITY_SMS}.
+ * Bitmask for {@link #SERVICE_CAPABILITY_SMS}.
* @hide
*/
public static final int SERVICE_CAPABILITY_SMS_BITMASK =
serviceCapabilityToBitmask(SERVICE_CAPABILITY_SMS);
/**
- * Bitmask for {@code SERVICE_CAPABILITY_DATA}.
+ * Bitmask for {@link #SERVICE_CAPABILITY_DATA}.
* @hide
*/
public static final int SERVICE_CAPABILITY_DATA_BITMASK =
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 3ff1e2c..3e226cc 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -6907,7 +6907,6 @@
return false;
}
- // TODO(b/316183370): replace all @code with @link in javadoc after feature is released
/**
* @return true if the current device is "voice capable".
* <p>
@@ -6921,10 +6920,10 @@
* PackageManager.FEATURE_TELEPHONY system feature, which is available
* on any device with a telephony radio, even if the device is
* data-only.
- * @deprecated Replaced by {@code #isDeviceVoiceCapable()}. Starting from Android 15, voice
+ * @deprecated Replaced by {@link #isDeviceVoiceCapable()}. Starting from Android 15, voice
* capability may also be overridden by carriers for a given subscription. For voice capable
- * device (when {@code #isDeviceVoiceCapable} return {@code true}), caller should check for
- * subscription-level voice capability as well. See {@code #isDeviceVoiceCapable} for details.
+ * device (when {@link #isDeviceVoiceCapable} return {@code true}), caller should check for
+ * subscription-level voice capability as well. See {@link #isDeviceVoiceCapable} for details.
*/
@Deprecated
public boolean isVoiceCapable() {
@@ -6946,8 +6945,8 @@
* <p>
* Starting from Android 15, voice capability may also be overridden by carrier for a given
* subscription on a voice capable device. To check if a subscription is "voice capable",
- * call method {@code SubscriptionInfo#getServiceCapabilities()} and check if
- * {@code SubscriptionManager#SERVICE_CAPABILITY_VOICE} is included.
+ * call method {@link SubscriptionInfo#getServiceCapabilities()} and check if
+ * {@link SubscriptionManager#SERVICE_CAPABILITY_VOICE} is included.
*
* @see SubscriptionInfo#getServiceCapabilities()
*/
@@ -6964,10 +6963,10 @@
* <p>
* Note: Voicemail waiting sms, cell broadcasting sms, and MMS are
* disabled when device doesn't support sms.
- * @deprecated Replaced by {@code #isDeviceSmsCapable()}. Starting from Android 15, SMS
+ * @deprecated Replaced by {@link #isDeviceSmsCapable()}. Starting from Android 15, SMS
* capability may also be overridden by carriers for a given subscription. For SMS capable
- * device (when {@code #isDeviceSmsCapable} return {@code true}), caller should check for
- * subscription-level SMS capability as well. See {@code #isDeviceSmsCapable} for details.
+ * device (when {@link #isDeviceSmsCapable} return {@code true}), caller should check for
+ * subscription-level SMS capability as well. See {@link #isDeviceSmsCapable} for details.
*/
@Deprecated
public boolean isSmsCapable() {
@@ -6986,8 +6985,8 @@
* <p>
* Starting from Android 15, SMS capability may also be overridden by carriers for a given
* subscription on an SMS capable device. To check if a subscription is "SMS capable",
- * call method {@code SubscriptionInfo#getServiceCapabilities()} and check if
- * {@code SubscriptionManager#SERVICE_CAPABILITY_SMS} is included.
+ * call method {@link SubscriptionInfo#getServiceCapabilities()} and check if
+ * {@link SubscriptionManager#SERVICE_CAPABILITY_SMS} is included.
*
* @see SubscriptionInfo#getServiceCapabilities()
*/
diff --git a/telephony/java/android/telephony/satellite/SatelliteManager.java b/telephony/java/android/telephony/satellite/SatelliteManager.java
index 3944b8e..284e2bd 100644
--- a/telephony/java/android/telephony/satellite/SatelliteManager.java
+++ b/telephony/java/android/telephony/satellite/SatelliteManager.java
@@ -420,6 +420,14 @@
@FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
public static final int SATELLITE_RESULT_DISABLE_IN_PROGRESS = 28;
+ /**
+ * Enabling satellite is in progress.
+ *
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
+ public static final int SATELLITE_RESULT_ENABLE_IN_PROGRESS = 29;
+
/** @hide */
@IntDef(prefix = {"SATELLITE_RESULT_"}, value = {
SATELLITE_RESULT_SUCCESS,
@@ -450,7 +458,8 @@
SATELLITE_RESULT_LOCATION_DISABLED,
SATELLITE_RESULT_LOCATION_NOT_AVAILABLE,
SATELLITE_RESULT_EMERGENCY_CALL_IN_PROGRESS,
- SATELLITE_RESULT_DISABLE_IN_PROGRESS
+ SATELLITE_RESULT_DISABLE_IN_PROGRESS,
+ SATELLITE_RESULT_ENABLE_IN_PROGRESS
})
@Retention(RetentionPolicy.SOURCE)
public @interface SatelliteResult {}
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index e852e6b..e57c207 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -3394,4 +3394,19 @@
@JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void provisionSatellite(in List<SatelliteSubscriberInfo> list, in ResultReceiver result);
+
+ /**
+ * This API can be used by only CTS to override the cached value for the device overlay config
+ * value :
+ * config_satellite_gateway_service_package and
+ * config_satellite_carrier_roaming_esos_provisioned_class.
+ * These values are set before sending an intent to broadcast there are any change to list of
+ * subscriber informations.
+ *
+ * @param name the name is one of the following that constitute an intent.
+ * Component package name, or component class name.
+ * @return {@code true} if the setting is successful, {@code false} otherwise.
+ * @hide
+ */
+ boolean setSatelliteSubscriberIdListChangedIntentComponent(in String name);
}
diff --git a/test-runner/Android.bp b/test-runner/Android.bp
index 6b5be3cb..bb2c4d9 100644
--- a/test-runner/Android.bp
+++ b/test-runner/Android.bp
@@ -32,14 +32,28 @@
javacflags: ["-Xep:DepAnn:ERROR"],
},
- libs: [
- "android.test.base",
- "android.test.mock",
+ impl_only_libs: [
+ "android.test.base.impl",
+ "android.test.mock.impl",
],
- stub_only_libs: [
- "android.test.base",
- "android.test.mock",
- ],
+ public: {
+ libs: [
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
+ ],
+ },
+ system: {
+ libs: [
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
+ ],
+ },
+ test: {
+ libs: [
+ "android.test.base.stubs.test",
+ "android.test.mock.stubs.test",
+ ],
+ },
api_packages: [
"android.test",
"android.test.suitebuilder",
@@ -64,7 +78,7 @@
sdk_version: "current",
libs: [
"android.test.base_static",
- "android.test.mock",
+ "android.test.mock.stubs",
"junit",
],
}
diff --git a/test-runner/tests/Android.bp b/test-runner/tests/Android.bp
index 0c0c080..39f41ed 100644
--- a/test-runner/tests/Android.bp
+++ b/test-runner/tests/Android.bp
@@ -30,8 +30,8 @@
libs: [
"android.test.runner.impl",
- "android.test.base",
- "android.test.mock",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"junit",
diff --git a/tests/AppLaunch/Android.bp b/tests/AppLaunch/Android.bp
index f838c5a..90a00fe 100644
--- a/tests/AppLaunch/Android.bp
+++ b/tests/AppLaunch/Android.bp
@@ -14,11 +14,12 @@
platform_apis: true,
certificate: "platform",
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
static_libs: [
"androidx.test.rules",
- "ub-uiautomator"],
+ "ub-uiautomator",
+ ],
test_suites: ["device-tests"],
}
diff --git a/tests/AttestationVerificationTest/Android.bp b/tests/AttestationVerificationTest/Android.bp
index b98f8cb..5f09089 100644
--- a/tests/AttestationVerificationTest/Android.bp
+++ b/tests/AttestationVerificationTest/Android.bp
@@ -32,8 +32,8 @@
},
test_suites: ["device-tests"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"compatibility-device-util-axt",
diff --git a/tests/BrowserPowerTest/Android.bp b/tests/BrowserPowerTest/Android.bp
index a8a9897..100e975 100644
--- a/tests/BrowserPowerTest/Android.bp
+++ b/tests/BrowserPowerTest/Android.bp
@@ -24,8 +24,8 @@
android_test {
name: "BrowserPowerTests",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
// Include all test java files.
diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp b/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp
index 5edb1de..4aeca5b 100644
--- a/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp
+++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.bp
@@ -24,7 +24,7 @@
name: "SmartCamera-tests",
platform_apis: true,
srcs: ["src/**/*.java"],
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
static_libs: [
"guava",
"junit",
diff --git a/tests/ChoreographerTests/Android.bp b/tests/ChoreographerTests/Android.bp
index 3f48d70..69a9d18 100644
--- a/tests/ChoreographerTests/Android.bp
+++ b/tests/ChoreographerTests/Android.bp
@@ -26,8 +26,8 @@
name: "ChoreographerTests",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/tests/CompanionDeviceMultiDeviceTests/client/Android.bp b/tests/CompanionDeviceMultiDeviceTests/client/Android.bp
index 9994826..ce63fe8 100644
--- a/tests/CompanionDeviceMultiDeviceTests/client/Android.bp
+++ b/tests/CompanionDeviceMultiDeviceTests/client/Android.bp
@@ -40,8 +40,8 @@
"mobly-snippet-lib",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
optimize: {
diff --git a/tests/CoreTests/android/Android.bp b/tests/CoreTests/android/Android.bp
index 97a6e5f..85e951e 100644
--- a/tests/CoreTests/android/Android.bp
+++ b/tests/CoreTests/android/Android.bp
@@ -12,7 +12,7 @@
srcs: ["**/*.java"],
libs: [
"android.test.runner.stubs",
- "org.apache.http.legacy",
+ "org.apache.http.legacy.stubs",
"android.test.base.stubs",
],
sdk_version: "current",
diff --git a/tests/CtsSurfaceControlTestsStaging/Android.bp b/tests/CtsSurfaceControlTestsStaging/Android.bp
index 1038c9e..8d93b28 100644
--- a/tests/CtsSurfaceControlTestsStaging/Android.bp
+++ b/tests/CtsSurfaceControlTestsStaging/Android.bp
@@ -28,8 +28,8 @@
name: "CtsSurfaceControlTestsStaging",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/tests/DataIdleTest/Android.bp b/tests/DataIdleTest/Android.bp
index f9509cc..8839df6 100644
--- a/tests/DataIdleTest/Android.bp
+++ b/tests/DataIdleTest/Android.bp
@@ -27,8 +27,8 @@
name: "DataIdleTest",
platform_apis: true,
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
srcs: ["src/**/*.java"],
diff --git a/tests/EnforcePermission/perf-app/Android.bp b/tests/EnforcePermission/perf-app/Android.bp
index 6d04fdc..dbafd73 100644
--- a/tests/EnforcePermission/perf-app/Android.bp
+++ b/tests/EnforcePermission/perf-app/Android.bp
@@ -32,8 +32,8 @@
"androidx.test.rules",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
":EnforcePermissionTestHelper",
diff --git a/tests/EnforcePermission/test-app/Android.bp b/tests/EnforcePermission/test-app/Android.bp
index 065ab33..64f850b 100644
--- a/tests/EnforcePermission/test-app/Android.bp
+++ b/tests/EnforcePermission/test-app/Android.bp
@@ -27,8 +27,8 @@
"androidx.test.rules",
],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
data: [
":EnforcePermissionTestHelper",
diff --git a/tests/FlickerTests/ActivityEmbedding/src/com/android/server/wm/flicker/activityembedding/open/OpenTrampolineActivityTest.kt b/tests/FlickerTests/ActivityEmbedding/src/com/android/server/wm/flicker/activityembedding/open/OpenTrampolineActivityTest.kt
index 67825d2..095c819 100644
--- a/tests/FlickerTests/ActivityEmbedding/src/com/android/server/wm/flicker/activityembedding/open/OpenTrampolineActivityTest.kt
+++ b/tests/FlickerTests/ActivityEmbedding/src/com/android/server/wm/flicker/activityembedding/open/OpenTrampolineActivityTest.kt
@@ -41,7 +41,7 @@
* Transitions: From A launch a trampoline Activity T, T launches secondary Activity B and finishes
* itself, end up in split A|B.
*
- * To run this test: `atest FlickerTestsOther:OpenTrampolineActivityTest`
+ * To run this test: `atest FlickerTestsActivityEmbedding:OpenTrampolineActivityTest`
*/
@FlakyTest(bugId = 341209752)
@RequiresDevice
diff --git a/tests/FlickerTests/Android.bp b/tests/FlickerTests/Android.bp
index d658d59..27e9ffa 100644
--- a/tests/FlickerTests/Android.bp
+++ b/tests/FlickerTests/Android.bp
@@ -31,7 +31,7 @@
enabled: false,
},
test_suites: ["device-tests"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"androidx.test.ext.junit",
"flickertestapplib",
diff --git a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt
index 4a675be..0bcd2f3 100644
--- a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt
+++ b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt
@@ -17,6 +17,7 @@
package com.android.server.wm.flicker.helpers
import android.app.Instrumentation
+import android.os.SystemClock
import android.tools.PlatformConsts
import android.tools.device.apphelpers.StandardAppHelper
import android.tools.helpers.FIND_TIMEOUT
@@ -25,6 +26,7 @@
import android.tools.traces.parsers.toFlickerComponent
import android.util.Log
import androidx.test.uiautomator.By
+import androidx.test.uiautomator.Direction
import androidx.test.uiautomator.Until
import androidx.window.extensions.WindowExtensions
import androidx.window.extensions.WindowExtensionsProvider
@@ -83,6 +85,7 @@
* activity and finish itself.
*/
fun launchTrampolineActivity(wmHelper: WindowManagerStateHelper) {
+ scrollToBottom()
val launchButton =
uiDevice.wait(
Until.findObject(By.res(packageName, "launch_trampoline_button")),
@@ -210,6 +213,7 @@
* placeholder secondary activity based on the placeholder rule.
*/
fun launchPlaceholderSplitRTL(wmHelper: WindowManagerStateHelper) {
+ scrollToBottom()
val launchButton =
uiDevice.wait(
Until.findObject(By.res(packageName, "launch_placeholder_split_rtl_button")),
@@ -224,6 +228,21 @@
.waitForAndVerify()
}
+ /**
+ * Scrolls to the bottom of the launch options. This is needed if the launch button is at the
+ * bottom. Otherwise the click may trigger touch on navBar.
+ */
+ private fun scrollToBottom() {
+ val launchOptionsList = uiDevice.wait(
+ Until.findObject(By.res(packageName, "launch_options_list")),
+ FIND_TIMEOUT
+ )
+ requireNotNull(launchOptionsList) { "Unable to find the list of launch options" }
+ launchOptionsList.scrollUntil(Direction.DOWN, Until.scrollFinished(Direction.DOWN))
+ // Wait a bit after scrolling, otherwise the immediate click may not be treated as "click".
+ SystemClock.sleep(1000L)
+ }
+
companion object {
private const val TAG = "ActivityEmbeddingAppHelper"
diff --git a/tests/FlickerTests/test-apps/flickerapp/res/layout/activity_embedding_main_layout.xml b/tests/FlickerTests/test-apps/flickerapp/res/layout/activity_embedding_main_layout.xml
index 917aec1..939ba81 100644
--- a/tests/FlickerTests/test-apps/flickerapp/res/layout/activity_embedding_main_layout.xml
+++ b/tests/FlickerTests/test-apps/flickerapp/res/layout/activity_embedding_main_layout.xml
@@ -21,8 +21,10 @@
android:background="@android:color/holo_orange_light">
<LinearLayout
+ android:id="@+id/launch_options_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:paddingBottom="48dp"
android:orientation="vertical">
<Button
diff --git a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/GameActivity.java b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/GameActivity.java
index ef75d4d..93254f7 100644
--- a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/GameActivity.java
+++ b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/GameActivity.java
@@ -71,7 +71,7 @@
windowInsetsController.setSystemBarsBehavior(
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
);
- // Hide both the status bar and the navigation bar.
- windowInsetsController.hide(WindowInsetsCompat.Type.systemBars());
+ // Hide status bar only to avoid flakiness on gesture quick switch cases.
+ windowInsetsController.hide(WindowInsetsCompat.Type.statusBars());
}
}
diff --git a/tests/FrameworkPerf/Android.bp b/tests/FrameworkPerf/Android.bp
index 9be3ab7..4e39fe1 100644
--- a/tests/FrameworkPerf/Android.bp
+++ b/tests/FrameworkPerf/Android.bp
@@ -12,8 +12,8 @@
srcs: ["**/*.java"],
platform_apis: true,
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
aaptflags: [
diff --git a/tests/GamePerformance/Android.bp b/tests/GamePerformance/Android.bp
index f250a1b..964f0b9 100644
--- a/tests/GamePerformance/Android.bp
+++ b/tests/GamePerformance/Android.bp
@@ -33,8 +33,8 @@
srcs: ["src/**/*.java"],
static_libs: ["androidx.test.rules"],
libs: [
- "android.test.base",
- "android.test.runner",
+ "android.test.base.stubs.system",
+ "android.test.runner.stubs.system",
],
platform_apis: true,
certificate: "platform",
diff --git a/tests/Input/Android.bp b/tests/Input/Android.bp
index 65398a2..f3e040a 100644
--- a/tests/Input/Android.bp
+++ b/tests/Input/Android.bp
@@ -51,8 +51,8 @@
"ui-trace-collector",
],
libs: [
- "android.test.mock",
- "android.test.base",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
],
test_suites: ["device-tests"],
}
diff --git a/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewControllerTests.java b/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewControllerTests.java
index c7ebd3a..5875520 100644
--- a/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewControllerTests.java
+++ b/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewControllerTests.java
@@ -38,6 +38,7 @@
import androidx.test.platform.app.InstrumentationRegistry;
import com.android.server.input.InputManagerService;
+import com.android.server.input.TouchpadHardwareProperties;
import org.junit.Before;
import org.junit.Rule;
@@ -87,6 +88,9 @@
mTestableLooper = TestableLooper.get(this);
mTestableContext.addMockSystemService(InputManager.class, mInputManagerMock);
+ when(mInputManagerServiceMock.getTouchpadHardwareProperties(DEVICE_ID)).thenReturn(
+ new TouchpadHardwareProperties.Builder(-100f, 100f, -100f, 100f, 45f, 45f, -5f, 5f,
+ (short) 10, true, false).build());
mTouchpadDebugViewController = new TouchpadDebugViewController(mTestableContext,
mTestableLooper.getLooper(), mInputManagerServiceMock);
diff --git a/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewTest.java b/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewTest.java
index ad0ef1b..99e04cc 100644
--- a/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewTest.java
+++ b/tests/Input/src/com/android/server/input/debug/TouchpadDebugViewTest.java
@@ -26,7 +26,9 @@
import static org.mockito.Mockito.when;
import android.content.Context;
+import android.graphics.Color;
import android.graphics.Rect;
+import android.graphics.drawable.ColorDrawable;
import android.testing.TestableContext;
import android.view.MotionEvent;
import android.view.View;
@@ -40,6 +42,9 @@
import com.android.cts.input.MotionEventBuilder;
import com.android.cts.input.PointerBuilder;
+import com.android.server.input.TouchpadFingerState;
+import com.android.server.input.TouchpadHardwareProperties;
+import com.android.server.input.TouchpadHardwareState;
import org.junit.Before;
import org.junit.Test;
@@ -79,7 +84,10 @@
when(mWindowManager.getCurrentWindowMetrics()).thenReturn(mWindowMetrics);
- mTouchpadDebugView = new TouchpadDebugView(mTestableContext, TOUCHPAD_DEVICE_ID);
+ mTouchpadDebugView = new TouchpadDebugView(mTestableContext, TOUCHPAD_DEVICE_ID,
+ new TouchpadHardwareProperties.Builder(500f, 500f, 500f,
+ 500f, 0f, 0f, -5f, 5f, (short) 10, true,
+ true).build());
mTouchpadDebugView.measure(
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
@@ -289,4 +297,34 @@
assertEquals(initialX, mWindowLayoutParamsCaptor.getValue().x);
assertEquals(initialY, mWindowLayoutParamsCaptor.getValue().y);
}
+
+ @Test
+ public void testTouchpadClick() {
+ View child = mTouchpadDebugView.getChildAt(0);
+
+ mTouchpadDebugView.updateHardwareState(
+ new TouchpadHardwareState(0, 1 /* buttonsDown */, 0, 0,
+ new TouchpadFingerState[0]), TOUCHPAD_DEVICE_ID);
+
+ assertEquals(((ColorDrawable) child.getBackground()).getColor(), Color.BLUE);
+
+ mTouchpadDebugView.updateHardwareState(
+ new TouchpadHardwareState(0, 0 /* buttonsDown */, 0, 0,
+ new TouchpadFingerState[0]), TOUCHPAD_DEVICE_ID);
+
+ assertEquals(((ColorDrawable) child.getBackground()).getColor(), Color.RED);
+
+ mTouchpadDebugView.updateHardwareState(
+ new TouchpadHardwareState(0, 1 /* buttonsDown */, 0, 0,
+ new TouchpadFingerState[0]), TOUCHPAD_DEVICE_ID);
+
+ assertEquals(((ColorDrawable) child.getBackground()).getColor(), Color.BLUE);
+
+ // Color should not change because hardware state of a different touchpad
+ mTouchpadDebugView.updateHardwareState(
+ new TouchpadHardwareState(0, 0 /* buttonsDown */, 0, 0,
+ new TouchpadFingerState[0]), TOUCHPAD_DEVICE_ID + 1);
+
+ assertEquals(((ColorDrawable) child.getBackground()).getColor(), Color.BLUE);
+ }
}
diff --git a/tests/InputMethodStressTest/Android.bp b/tests/InputMethodStressTest/Android.bp
index 5ed8d8d..2697d32 100644
--- a/tests/InputMethodStressTest/Android.bp
+++ b/tests/InputMethodStressTest/Android.bp
@@ -20,7 +20,7 @@
android_test {
name: "InputMethodStressTest",
srcs: ["src/**/*.java"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs"],
static_libs: [
"androidx.test.ext.junit",
"androidx.test.uiautomator_uiautomator",
diff --git a/tests/InputScreenshotTest/Android.bp b/tests/InputScreenshotTest/Android.bp
index 927b101..12ab550 100644
--- a/tests/InputScreenshotTest/Android.bp
+++ b/tests/InputScreenshotTest/Android.bp
@@ -67,8 +67,8 @@
"truth",
],
libs: [
- "android.test.mock",
- "android.test.base",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
],
test_suites: ["device-tests"],
compile_multilib: "both",
diff --git a/tests/InputScreenshotTest/robotests/Android.bp b/tests/InputScreenshotTest/robotests/Android.bp
index d63fd69..b2414a8 100644
--- a/tests/InputScreenshotTest/robotests/Android.bp
+++ b/tests/InputScreenshotTest/robotests/Android.bp
@@ -61,9 +61,9 @@
"uiautomator-helpers",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"truth",
],
upstream: true,
diff --git a/tests/Internal/Android.bp b/tests/Internal/Android.bp
index ad98e47..3e58517 100644
--- a/tests/Internal/Android.bp
+++ b/tests/Internal/Android.bp
@@ -14,7 +14,7 @@
},
// Include some source files directly to be able to access package members
srcs: ["src/**/*.java"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"junit",
"androidx.test.rules",
diff --git a/tests/Internal/src/com/android/internal/protolog/PerfettoProtoLogImplTest.java b/tests/Internal/src/com/android/internal/protolog/PerfettoProtoLogImplTest.java
index 27cc923..e841d9e 100644
--- a/tests/Internal/src/com/android/internal/protolog/PerfettoProtoLogImplTest.java
+++ b/tests/Internal/src/com/android/internal/protolog/PerfettoProtoLogImplTest.java
@@ -16,8 +16,6 @@
package com.android.internal.protolog;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
@@ -30,7 +28,6 @@
import static java.io.File.createTempFile;
-import android.content.Context;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
import android.tools.ScenarioBuilder;
@@ -45,6 +42,7 @@
import androidx.test.platform.app.InstrumentationRegistry;
+import com.android.internal.protolog.ProtoLogConfigurationService.ViewerConfigFileTracer;
import com.android.internal.protolog.common.IProtoLogGroup;
import com.android.internal.protolog.common.LogDataType;
import com.android.internal.protolog.common.LogLevel;
@@ -53,11 +51,11 @@
import org.junit.After;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
import perfetto.protos.Protolog;
import perfetto.protos.ProtologCommon;
@@ -76,6 +74,7 @@
@RunWith(JUnit4.class)
public class PerfettoProtoLogImplTest {
private static final String TEST_PROTOLOG_DATASOURCE_NAME = "test.android.protolog";
+ private static final String MOCK_VIEWER_CONFIG_FILE = "my/mock/viewer/config/file.pb";
private final File mTracingDirectory = InstrumentationRegistry.getInstrumentation()
.getTargetContext().getFilesDir();
@@ -92,29 +91,19 @@
new TraceConfig(false, true, false)
);
- private ProtoLogConfigurationService mProtoLogConfigurationService;
- private PerfettoProtoLogImpl mProtoLog;
- private Protolog.ProtoLogViewerConfig.Builder mViewerConfigBuilder;
- private File mFile;
- private Runnable mCacheUpdater;
+ private static ProtoLogConfigurationService sProtoLogConfigurationService;
+ private static PerfettoProtoLogImpl sProtoLog;
+ private static Protolog.ProtoLogViewerConfig.Builder sViewerConfigBuilder;
+ private static Runnable sCacheUpdater;
- private ProtoLogViewerConfigReader mReader;
+ private static ProtoLogViewerConfigReader sReader;
public PerfettoProtoLogImplTest() throws IOException {
}
- @Before
- public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
- final Context testContext = getInstrumentation().getContext();
- mFile = testContext.getFileStreamPath("tracing_test.dat");
- //noinspection ResultOfMethodCallIgnored
- mFile.delete();
-
- TestProtoLogGroup.TEST_GROUP.setLogToLogcat(false);
- TestProtoLogGroup.TEST_GROUP.setLogToProto(false);
-
- mViewerConfigBuilder = Protolog.ProtoLogViewerConfig.newBuilder()
+ @BeforeClass
+ public static void setUp() throws Exception {
+ sViewerConfigBuilder = Protolog.ProtoLogViewerConfig.newBuilder()
.addGroups(
Protolog.ProtoLogViewerConfig.Group.newBuilder()
.setId(1)
@@ -160,33 +149,52 @@
ViewerConfigInputStreamProvider viewerConfigInputStreamProvider = Mockito.mock(
ViewerConfigInputStreamProvider.class);
Mockito.when(viewerConfigInputStreamProvider.getInputStream())
- .thenAnswer(it -> new ProtoInputStream(mViewerConfigBuilder.build().toByteArray()));
+ .thenAnswer(it -> new ProtoInputStream(sViewerConfigBuilder.build().toByteArray()));
- mCacheUpdater = () -> {};
- mReader = Mockito.spy(new ProtoLogViewerConfigReader(viewerConfigInputStreamProvider));
+ sCacheUpdater = () -> {};
+ sReader = Mockito.spy(new ProtoLogViewerConfigReader(viewerConfigInputStreamProvider));
final ProtoLogDataSourceBuilder dataSourceBuilder =
(onStart, onFlush, onStop) -> new ProtoLogDataSource(
onStart, onFlush, onStop, TEST_PROTOLOG_DATASOURCE_NAME);
- mProtoLogConfigurationService =
- new ProtoLogConfigurationService(dataSourceBuilder);
- mProtoLog = new PerfettoProtoLogImpl(
- viewerConfigInputStreamProvider, mReader, () -> mCacheUpdater.run(),
- TestProtoLogGroup.values(), dataSourceBuilder, mProtoLogConfigurationService);
+ final ViewerConfigFileTracer tracer = (dataSource, viewerConfigFilePath) -> {
+ Utils.dumpViewerConfig(dataSource, () -> {
+ if (!viewerConfigFilePath.equals(MOCK_VIEWER_CONFIG_FILE)) {
+ throw new RuntimeException(
+ "Unexpected viewer config file path provided");
+ }
+ return new ProtoInputStream(sViewerConfigBuilder.build().toByteArray());
+ });
+ };
+ sProtoLogConfigurationService = new ProtoLogConfigurationService(dataSourceBuilder, tracer);
+
+ if (android.tracing.Flags.clientSideProtoLogging()) {
+ sProtoLog = new PerfettoProtoLogImpl(
+ MOCK_VIEWER_CONFIG_FILE, sReader, () -> sCacheUpdater.run(),
+ TestProtoLogGroup.values(), dataSourceBuilder, sProtoLogConfigurationService);
+ } else {
+ sProtoLog = new PerfettoProtoLogImpl(
+ viewerConfigInputStreamProvider, sReader, () -> sCacheUpdater.run(),
+ TestProtoLogGroup.values(), dataSourceBuilder, sProtoLogConfigurationService);
+ }
+ }
+
+ @Before
+ public void before() {
+ Mockito.reset(sReader);
+
+ TestProtoLogGroup.TEST_GROUP.setLogToLogcat(false);
+ TestProtoLogGroup.TEST_GROUP.setLogToProto(false);
}
@After
public void tearDown() {
- if (mFile != null) {
- //noinspection ResultOfMethodCallIgnored
- mFile.delete();
- }
ProtoLogImpl.setSingleInstance(null);
}
@Test
public void isEnabled_returnsFalseByDefault() {
- assertFalse(mProtoLog.isProtoEnabled());
+ assertFalse(sProtoLog.isProtoEnabled());
}
@Test
@@ -196,7 +204,7 @@
.build();
try {
traceMonitor.start();
- assertTrue(mProtoLog.isProtoEnabled());
+ assertTrue(sProtoLog.isProtoEnabled());
} finally {
traceMonitor.stop(mWriter);
}
@@ -209,12 +217,12 @@
.build();
try {
traceMonitor.start();
- assertTrue(mProtoLog.isProtoEnabled());
+ assertTrue(sProtoLog.isProtoEnabled());
} finally {
traceMonitor.stop(mWriter);
}
- assertFalse(mProtoLog.isProtoEnabled());
+ assertFalse(sProtoLog.isProtoEnabled());
}
@Test
@@ -226,15 +234,15 @@
traceMonitor.start();
// Shouldn't be logging anything except WTF unless explicitly requested in the group
// override.
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
+ sProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
+ sProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
+ sProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
+ sProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
LogDataType.BOOLEAN, new Object[]{true});
} finally {
traceMonitor.stop(mWriter);
@@ -258,15 +266,15 @@
).build();
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
+ sProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
+ sProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
+ sProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
+ sProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
LogDataType.BOOLEAN, new Object[]{true});
} finally {
traceMonitor.stop(mWriter);
@@ -294,15 +302,15 @@
).build();
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
+ sProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
+ sProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
+ sProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
+ sProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
LogDataType.BOOLEAN, new Object[]{true});
} finally {
traceMonitor.stop(mWriter);
@@ -324,15 +332,15 @@
.build();
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
+ sProtoLog.log(LogLevel.VERBOSE, TestProtoLogGroup.TEST_GROUP, 2,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
+ sProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP, 3,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
+ sProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP, 4,
LogDataType.BOOLEAN, new Object[]{true});
- mProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
+ sProtoLog.log(LogLevel.WTF, TestProtoLogGroup.TEST_GROUP, 5,
LogDataType.BOOLEAN, new Object[]{true});
} finally {
traceMonitor.stop(mWriter);
@@ -351,8 +359,8 @@
@Test
public void log_logcatEnabled() {
- when(mReader.getViewerString(anyLong())).thenReturn("test %b %d %% 0x%x %s %f");
- PerfettoProtoLogImpl implSpy = Mockito.spy(mProtoLog);
+ when(sReader.getViewerString(anyLong())).thenReturn("test %b %d %% 0x%x %s %f");
+ PerfettoProtoLogImpl implSpy = Mockito.spy(sProtoLog);
TestProtoLogGroup.TEST_GROUP.setLogToLogcat(true);
TestProtoLogGroup.TEST_GROUP.setLogToProto(false);
@@ -363,13 +371,13 @@
verify(implSpy).passToLogcat(eq(TestProtoLogGroup.TEST_GROUP.getTag()), eq(
LogLevel.INFO),
eq("test true 10000 % 0x7530 test 3.0E-6"));
- verify(mReader).getViewerString(eq(1234L));
+ verify(sReader).getViewerString(eq(1234L));
}
@Test
public void log_logcatEnabledInvalidMessage() {
- when(mReader.getViewerString(anyLong())).thenReturn("test %b %d %% %x %s %f");
- PerfettoProtoLogImpl implSpy = Mockito.spy(mProtoLog);
+ when(sReader.getViewerString(anyLong())).thenReturn("test %b %d %% %x %s %f");
+ PerfettoProtoLogImpl implSpy = Mockito.spy(sProtoLog);
TestProtoLogGroup.TEST_GROUP.setLogToLogcat(true);
TestProtoLogGroup.TEST_GROUP.setLogToProto(false);
@@ -381,29 +389,28 @@
LogLevel.INFO),
eq("FORMAT_ERROR \"test %b %d %% %x %s %f\", "
+ "args=(true, 10000, 1.0E-4, 2.0E-5, test)"));
- verify(mReader).getViewerString(eq(1234L));
+ verify(sReader).getViewerString(eq(1234L));
}
@Test
public void log_logcatEnabledNoMessage() {
- when(mReader.getViewerString(anyLong())).thenReturn(null);
- PerfettoProtoLogImpl implSpy = Mockito.spy(mProtoLog);
+ when(sReader.getViewerString(anyLong())).thenReturn(null);
+ PerfettoProtoLogImpl implSpy = Mockito.spy(sProtoLog);
TestProtoLogGroup.TEST_GROUP.setLogToLogcat(true);
TestProtoLogGroup.TEST_GROUP.setLogToProto(false);
- implSpy.log(
- LogLevel.INFO, TestProtoLogGroup.TEST_GROUP, 1234, 4321,
+ implSpy.log(LogLevel.INFO, TestProtoLogGroup.TEST_GROUP, 1234, 4321,
new Object[]{5});
verify(implSpy).passToLogcat(eq(TestProtoLogGroup.TEST_GROUP.getTag()), eq(
LogLevel.INFO), eq("UNKNOWN MESSAGE args = (5)"));
- verify(mReader).getViewerString(eq(1234L));
+ verify(sReader).getViewerString(eq(1234L));
}
@Test
public void log_logcatDisabled() {
- when(mReader.getViewerString(anyLong())).thenReturn("test %d");
- PerfettoProtoLogImpl implSpy = Mockito.spy(mProtoLog);
+ when(sReader.getViewerString(anyLong())).thenReturn("test %d");
+ PerfettoProtoLogImpl implSpy = Mockito.spy(sProtoLog);
TestProtoLogGroup.TEST_GROUP.setLogToLogcat(false);
implSpy.log(
@@ -411,7 +418,7 @@
new Object[]{5});
verify(implSpy, never()).passToLogcat(any(), any(), any());
- verify(mReader, never()).getViewerString(anyLong());
+ verify(sReader, never()).getViewerString(anyLong());
}
@Test
@@ -426,11 +433,12 @@
long before;
long after;
try {
+ assertFalse(sProtoLog.isProtoEnabled());
traceMonitor.start();
- assertTrue(mProtoLog.isProtoEnabled());
+ assertTrue(sProtoLog.isProtoEnabled());
before = SystemClock.elapsedRealtimeNanos();
- mProtoLog.log(
+ sProtoLog.log(
LogLevel.INFO, TestProtoLogGroup.TEST_GROUP, messageHash,
0b1110101001010100,
new Object[]{"test", 1, 2, 3, 0.4, 0.5, 0.6, true});
@@ -448,7 +456,8 @@
Truth.assertThat(protolog.messages.getFirst().getTimestamp().getElapsedNanos())
.isAtMost(after);
Truth.assertThat(protolog.messages.getFirst().getMessage())
- .isEqualTo("My test message :: test, 2, 4, 6, 0.400000, 5.000000e-01, 0.6, true");
+ .isEqualTo(
+ "My test message :: test, 1, 2, 3, 0.400000, 5.000000e-01, 0.6, true");
}
@Test
@@ -460,10 +469,10 @@
long after;
try {
traceMonitor.start();
- assertTrue(mProtoLog.isProtoEnabled());
+ assertTrue(sProtoLog.isProtoEnabled());
before = SystemClock.elapsedRealtimeNanos();
- mProtoLog.log(
+ sProtoLog.log(
LogLevel.INFO, TestProtoLogGroup.TEST_GROUP,
"My test message :: %s, %d, %x, %f, %b",
"test", 1, 3, 0.4, true);
@@ -481,7 +490,7 @@
Truth.assertThat(protolog.messages.getFirst().getTimestamp().getElapsedNanos())
.isAtMost(after);
Truth.assertThat(protolog.messages.getFirst().getMessage())
- .isEqualTo("My test message :: test, 2, 6, 0.400000, true");
+ .isEqualTo("My test message :: test, 1, 3, 0.400000, true");
}
@Test
@@ -491,7 +500,7 @@
.build();
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
LogDataType.BOOLEAN, new Object[]{true});
} finally {
traceMonitor.stop(mWriter);
@@ -507,7 +516,7 @@
private long addMessageToConfig(ProtologCommon.ProtoLogLevel logLevel, String message) {
final long messageId = new Random().nextLong();
- mViewerConfigBuilder.addMessages(Protolog.ProtoLogViewerConfig.MessageData.newBuilder()
+ sViewerConfigBuilder.addMessages(Protolog.ProtoLogViewerConfig.MessageData.newBuilder()
.setMessageId(messageId)
.setMessage(message)
.setLevel(logLevel)
@@ -530,7 +539,7 @@
try {
traceMonitor.start();
before = SystemClock.elapsedRealtimeNanos();
- mProtoLog.log(
+ sProtoLog.log(
LogLevel.INFO, TestProtoLogGroup.TEST_GROUP, messageHash,
0b01100100,
new Object[]{"test", 1, 0.1, true});
@@ -550,7 +559,7 @@
.build();
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
0b11, new Object[]{true});
} finally {
traceMonitor.stop(mWriter);
@@ -575,7 +584,7 @@
try {
traceMonitor.start();
- ProtoLogImpl.setSingleInstance(mProtoLog);
+ ProtoLogImpl.setSingleInstance(sProtoLog);
ProtoLogImpl.d(TestProtoLogGroup.TEST_GROUP, 1,
0b11, true);
} finally {
@@ -599,7 +608,7 @@
@Test
public void cacheIsUpdatedWhenTracesStartAndStop() {
final AtomicInteger cacheUpdateCallCount = new AtomicInteger(0);
- mCacheUpdater = cacheUpdateCallCount::incrementAndGet;
+ sCacheUpdater = cacheUpdateCallCount::incrementAndGet;
PerfettoTraceMonitor traceMonitor1 = PerfettoTraceMonitor.newBuilder()
.enableProtoLog(true,
@@ -641,17 +650,17 @@
@Test
public void isEnabledUpdatesBasedOnRunningTraces() {
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF)).isFalse();
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF)).isFalse();
PerfettoTraceMonitor traceMonitor1 =
PerfettoTraceMonitor.newBuilder().enableProtoLog(true,
@@ -670,65 +679,65 @@
try {
traceMonitor1.start();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
.isTrue();
try {
traceMonitor2.start();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP,
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP,
LogLevel.VERBOSE)).isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
.isTrue();
} finally {
traceMonitor2.stop(mWriter);
}
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
.isTrue();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
.isTrue();
} finally {
traceMonitor1.stop(mWriter);
}
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.DEBUG))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.VERBOSE))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.INFO))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WARN))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.ERROR))
.isFalse();
- Truth.assertThat(mProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
+ Truth.assertThat(sProtoLog.isEnabled(TestProtoLogGroup.TEST_GROUP, LogLevel.WTF))
.isFalse();
}
@@ -741,7 +750,7 @@
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP,
"My test null string: %s", (Object) null);
} finally {
traceMonitor.stop(mWriter);
@@ -764,7 +773,7 @@
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP,
"My null args: %d, %f, %b", null, null, null);
} finally {
traceMonitor.stop(mWriter);
@@ -775,7 +784,7 @@
Truth.assertThat(protolog.messages).hasSize(1);
Truth.assertThat(protolog.messages.get(0).getMessage())
- .isEqualTo("My null args: 0, 0, false");
+ .isEqualTo("My null args: 0, 0.000000, false");
}
@Test
@@ -798,7 +807,7 @@
traceMonitor1.start();
traceMonitor2.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP, 1,
LogDataType.BOOLEAN, new Object[]{true});
} finally {
traceMonitor1.stop(mWriter);
@@ -827,12 +836,12 @@
.build();
try {
traceMonitor.start();
- mProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP,
- "This message should not be logged");
- mProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP,
- "This message should logged %d", 123);
- mProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP,
- "This message should also be logged %d", 567);
+ sProtoLog.log(LogLevel.DEBUG, TestProtoLogGroup.TEST_GROUP,
+ "This message should not be logged");
+ sProtoLog.log(LogLevel.WARN, TestProtoLogGroup.TEST_GROUP,
+ "This message should be logged %d", 123);
+ sProtoLog.log(LogLevel.ERROR, TestProtoLogGroup.TEST_GROUP,
+ "This message should also be logged %d", 567);
} finally {
traceMonitor.stop(mWriter);
}
@@ -845,7 +854,7 @@
Truth.assertThat(protolog.messages.get(0).getLevel())
.isEqualTo(LogLevel.WARN);
Truth.assertThat(protolog.messages.get(0).getMessage())
- .isEqualTo("This message should logged 123");
+ .isEqualTo("This message should be logged 123");
Truth.assertThat(protolog.messages.get(1).getLevel())
.isEqualTo(LogLevel.ERROR);
diff --git a/tests/LocalizationTest/Android.bp b/tests/LocalizationTest/Android.bp
index 909ca59..5d9901b 100644
--- a/tests/LocalizationTest/Android.bp
+++ b/tests/LocalizationTest/Android.bp
@@ -25,9 +25,9 @@
name: "LocalizationTest",
srcs: ["java/**/*.kt"],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
static_libs: [
"androidx.test.core",
diff --git a/tests/MemoryUsage/Android.bp b/tests/MemoryUsage/Android.bp
index e30a0a7..deb4663 100644
--- a/tests/MemoryUsage/Android.bp
+++ b/tests/MemoryUsage/Android.bp
@@ -14,8 +14,8 @@
platform_apis: true,
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
}
diff --git a/tests/MultiUser/Android.bp b/tests/MultiUser/Android.bp
index bde309f..e4d9f02 100644
--- a/tests/MultiUser/Android.bp
+++ b/tests/MultiUser/Android.bp
@@ -18,9 +18,9 @@
"services.core",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
certificate: "platform",
test_suites: ["device-tests"],
diff --git a/tests/NetworkSecurityConfigTest/Android.bp b/tests/NetworkSecurityConfigTest/Android.bp
index 473eadb..4c48eaa 100644
--- a/tests/NetworkSecurityConfigTest/Android.bp
+++ b/tests/NetworkSecurityConfigTest/Android.bp
@@ -11,8 +11,8 @@
name: "NetworkSecurityConfigTests",
certificate: "platform",
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
static_libs: ["junit"],
// Include all test java files.
diff --git a/tests/OneMedia/Android.bp b/tests/OneMedia/Android.bp
index a43cd39..a1817cc 100644
--- a/tests/OneMedia/Android.bp
+++ b/tests/OneMedia/Android.bp
@@ -15,7 +15,7 @@
],
platform_apis: true,
certificate: "platform",
- libs: ["org.apache.http.legacy"],
+ libs: ["org.apache.http.legacy.stubs.system"],
optional_uses_libs: ["org.apache.http.legacy"],
optimize: {
enabled: false,
diff --git a/tests/PackageWatchdog/Android.bp b/tests/PackageWatchdog/Android.bp
index 2c5fdd3..096555e 100644
--- a/tests/PackageWatchdog/Android.bp
+++ b/tests/PackageWatchdog/Android.bp
@@ -36,7 +36,7 @@
"services.net",
"truth",
],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
jni_libs: [
// mockito-target-extended dependencies
"libdexmakerjvmtiagent",
diff --git a/tests/ProtoInputStreamTests/Android.bp b/tests/ProtoInputStreamTests/Android.bp
index 0029080..40ab257 100644
--- a/tests/ProtoInputStreamTests/Android.bp
+++ b/tests/ProtoInputStreamTests/Android.bp
@@ -33,7 +33,7 @@
platform_apis: true,
certificate: "platform",
test_suites: ["device-tests"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.system"],
static_libs: [
"androidx.test.rules",
"frameworks-base-testutils",
diff --git a/tests/RemoteDisplayProvider/Android.bp b/tests/RemoteDisplayProvider/Android.bp
index 55732d1..468bdda 100644
--- a/tests/RemoteDisplayProvider/Android.bp
+++ b/tests/RemoteDisplayProvider/Android.bp
@@ -27,6 +27,6 @@
sdk_version: "system_current",
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
- libs: ["com.android.media.remotedisplay"],
+ libs: ["com.android.media.remotedisplay.stubs.system"],
certificate: "platform",
}
diff --git a/tests/RollbackTest/lib/src/com/android/tests/rollback/host/WatchdogEventLogger.java b/tests/RollbackTest/lib/src/com/android/tests/rollback/host/WatchdogEventLogger.java
index 8c16079..01f8bc1 100644
--- a/tests/RollbackTest/lib/src/com/android/tests/rollback/host/WatchdogEventLogger.java
+++ b/tests/RollbackTest/lib/src/com/android/tests/rollback/host/WatchdogEventLogger.java
@@ -16,33 +16,26 @@
package com.android.tests.rollback.host;
+import static com.google.common.truth.Truth.assertThat;
+
import com.android.tradefed.device.ITestDevice;
+import com.android.tradefed.log.LogUtil.CLog;
+
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.Truth;
-import static com.google.common.truth.Truth.assertThat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
public class WatchdogEventLogger {
- private static final String[] ROLLBACK_EVENT_TYPES = {
- "ROLLBACK_INITIATE", "ROLLBACK_BOOT_TRIGGERED", "ROLLBACK_SUCCESS"};
- private static final String[] ROLLBACK_EVENT_ATTRS = {
- "logPackage", "rollbackReason", "failedPackageName"};
- private static final String PROP_PREFIX = "persist.sys.rollbacktest.";
private ITestDevice mDevice;
- private void resetProperties(boolean enabled) throws Exception {
+ private void updateTestSysProp(boolean enabled) throws Exception {
try {
mDevice.enableAdbRoot();
assertThat(mDevice.setProperty(
- PROP_PREFIX + "enabled", String.valueOf(enabled))).isTrue();
- for (String type : ROLLBACK_EVENT_TYPES) {
- String key = PROP_PREFIX + type;
- assertThat(mDevice.setProperty(key, "")).isTrue();
- for (String attr : ROLLBACK_EVENT_ATTRS) {
- assertThat(mDevice.setProperty(key + "." + attr, "")).isTrue();
- }
- }
+ "persist.sys.rollbacktest.enabled", String.valueOf(enabled))).isTrue();
} finally {
mDevice.disableAdbRoot();
}
@@ -50,19 +43,17 @@
public void start(ITestDevice device) throws Exception {
mDevice = device;
- resetProperties(true);
+ updateTestSysProp(true);
}
public void stop() throws Exception {
if (mDevice != null) {
- resetProperties(false);
+ updateTestSysProp(false);
}
}
- private boolean matchProperty(String type, String attr, String expectedVal) throws Exception {
- String key = PROP_PREFIX + type + "." + attr;
- String val = mDevice.getProperty(key);
- return expectedVal == null || expectedVal.equals(val);
+ private boolean verifyEventContainsVal(String watchdogEvent, String expectedVal) {
+ return expectedVal == null || watchdogEvent.contains(expectedVal);
}
/**
@@ -72,11 +63,33 @@
* occurred, and return {@code true} if an event exists which matches all criteria.
*/
public boolean watchdogEventOccurred(String type, String logPackage,
- String rollbackReason, String failedPackageName) throws Exception {
- return mDevice.getBooleanProperty(PROP_PREFIX + type, false)
- && matchProperty(type, "logPackage", logPackage)
- && matchProperty(type, "rollbackReason", rollbackReason)
- && matchProperty(type, "failedPackageName", failedPackageName);
+ String rollbackReason, String failedPackageName) {
+ String watchdogEvent = getEventForRollbackType(type);
+ return (watchdogEvent != null)
+ && verifyEventContainsVal(watchdogEvent, logPackage)
+ && verifyEventContainsVal(watchdogEvent, rollbackReason)
+ && verifyEventContainsVal(watchdogEvent, failedPackageName);
+ }
+
+ /** Returns last matched event for rollbackType **/
+ private String getEventForRollbackType(String rollbackType) {
+ String lastMatchedEvent = null;
+ try {
+ String rollbackDump = mDevice.executeShellCommand("dumpsys rollback");
+ String eventRegex = ".*%s%s(.*)\\n";
+ String eventPrefix = "Watchdog event occurred with type: ";
+
+ final Pattern pattern = Pattern.compile(
+ String.format(eventRegex, eventPrefix, rollbackType));
+ final Matcher matcher = pattern.matcher(rollbackDump);
+ while (matcher.find()) {
+ lastMatchedEvent = matcher.group(1);
+ }
+ CLog.d("Found watchdogEvent: " + lastMatchedEvent + " for type: " + rollbackType);
+ } catch (Exception e) {
+ CLog.e("Unable to find event for type: " + rollbackType, e);
+ }
+ return lastMatchedEvent;
}
static class Subject extends com.google.common.truth.Subject {
@@ -97,7 +110,7 @@
}
void eventOccurred(String type, String logPackage, String rollbackReason,
- String failedPackageName) throws Exception {
+ String failedPackageName) {
check("watchdogEventOccurred(type=%s, logPackage=%s, rollbackReason=%s, "
+ "failedPackageName=%s)", type, logPackage, rollbackReason, failedPackageName)
.that(mActual.watchdogEventOccurred(type, logPackage, rollbackReason,
diff --git a/tests/ServiceCrashTest/Android.bp b/tests/ServiceCrashTest/Android.bp
index fb98b763..82f397f 100644
--- a/tests/ServiceCrashTest/Android.bp
+++ b/tests/ServiceCrashTest/Android.bp
@@ -13,7 +13,7 @@
srcs: ["src/**/*.java"],
platform_apis: true,
certificate: "platform",
- libs: ["android.test.base"],
+ libs: ["android.test.base.stubs.system"],
static_libs: [
"compatibility-device-util-axt",
"androidx.test.rules",
diff --git a/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp b/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp
index 0d20497..c0ac50c 100644
--- a/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp
+++ b/tests/SharedLibraryLoadingTest/test-apps/SharedLibraryClientTests/Android.bp
@@ -23,7 +23,7 @@
libs: [
"SharedLibraryLoadingTests_StandardSharedLibrary",
"SharedLibraryLoadingTests_SharedLibraryLoadedAfter",
- "android.test.base",
+ "android.test.base.stubs.system",
],
static_libs: [
"androidx.test.ext.junit",
diff --git a/tests/TelephonyCommonTests/Android.bp b/tests/TelephonyCommonTests/Android.bp
index b968e5d..b1af6ae 100644
--- a/tests/TelephonyCommonTests/Android.bp
+++ b/tests/TelephonyCommonTests/Android.bp
@@ -50,9 +50,9 @@
platform_apis: true,
libs: [
- "android.test.runner",
- "android.test.mock",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.mock.stubs.system",
+ "android.test.base.stubs.system",
"unsupportedappusage",
],
}
diff --git a/tests/TrustTests/Android.bp b/tests/TrustTests/Android.bp
index 8888b32..f22feb3 100644
--- a/tests/TrustTests/Android.bp
+++ b/tests/TrustTests/Android.bp
@@ -31,8 +31,8 @@
"truth",
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
test_suites: [
"device-tests",
diff --git a/tests/TtsTests/Android.bp b/tests/TtsTests/Android.bp
index b7aa5d4..e28f69b 100644
--- a/tests/TtsTests/Android.bp
+++ b/tests/TtsTests/Android.bp
@@ -28,8 +28,8 @@
srcs: ["**/*.java"],
static_libs: ["mockito-target"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
],
platform_apis: true,
}
diff --git a/tests/UpdatableSystemFontTest/Android.bp b/tests/UpdatableSystemFontTest/Android.bp
index 12d4338..34eff4f 100644
--- a/tests/UpdatableSystemFontTest/Android.bp
+++ b/tests/UpdatableSystemFontTest/Android.bp
@@ -25,7 +25,7 @@
android_test {
name: "UpdatableSystemFontTest",
srcs: ["src/**/*.java"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs.test"],
static_libs: [
"androidx.test.ext.junit",
"androidx.test.uiautomator_uiautomator",
diff --git a/tests/UsbManagerTests/lib/Android.bp b/tests/UsbManagerTests/lib/Android.bp
index 4e5a70fe..506de5c 100644
--- a/tests/UsbManagerTests/lib/Android.bp
+++ b/tests/UsbManagerTests/lib/Android.bp
@@ -38,6 +38,6 @@
"androidx.core_core",
],
libs: [
- "android.test.mock",
+ "android.test.mock.stubs.system",
],
}
diff --git a/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp b/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp
index a4085e5..44aa402 100644
--- a/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp
+++ b/tests/inputmethod/ConcurrentMultiSessionImeTest/Android.bp
@@ -21,7 +21,7 @@
name: "ConcurrentMultiSessionImeTest",
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
- libs: ["android.test.runner"],
+ libs: ["android.test.runner.stubs"],
static_libs: [
"androidx.core_core",
"androidx.test.ext.junit",
diff --git a/tests/permission/Android.bp b/tests/permission/Android.bp
index b02f410..1a08f99 100644
--- a/tests/permission/Android.bp
+++ b/tests/permission/Android.bp
@@ -12,8 +12,8 @@
// Include all test java files.
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
"telephony-common",
],
static_libs: [
@@ -25,3 +25,10 @@
platform_apis: true,
test_suites: ["device-tests"],
}
+
+test_module_config {
+ name: "FrameworkPermissionTests_Presubmit",
+ base: "FrameworkPermissionTests",
+ test_suites: ["device-tests"],
+ include_annotations: ["android.platform.test.annotations.Presubmit"],
+}
diff --git a/tests/testables/Android.bp b/tests/testables/Android.bp
index c0e3d63..7596ee7 100644
--- a/tests/testables/Android.bp
+++ b/tests/testables/Android.bp
@@ -27,8 +27,8 @@
name: "testables",
srcs: ["src/**/*.java"],
libs: [
- "android.test.runner",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.mock.stubs.system",
"androidx.test.rules",
"mockito-target-inline-minus-junit4",
],
diff --git a/tests/testables/tests/Android.bp b/tests/testables/tests/Android.bp
index d6a4754..1eb36fa 100644
--- a/tests/testables/tests/Android.bp
+++ b/tests/testables/tests/Android.bp
@@ -45,9 +45,9 @@
"libmultiplejvmtiagentsinterferenceagent",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
certificate: "platform",
test_suites: [
diff --git a/tests/utils/testutils/Android.bp b/tests/utils/testutils/Android.bp
index deff42a..35fd5b1 100644
--- a/tests/utils/testutils/Android.bp
+++ b/tests/utils/testutils/Android.bp
@@ -35,9 +35,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
"mockito-target-extended-minus-junit4",
],
}
diff --git a/tests/utils/testutils/tests/Android.bp b/tests/utils/testutils/tests/Android.bp
index 8104280..3bb02e4 100644
--- a/tests/utils/testutils/tests/Android.bp
+++ b/tests/utils/testutils/tests/Android.bp
@@ -35,9 +35,9 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs.system",
+ "android.test.base.stubs.system",
+ "android.test.mock.stubs.system",
],
certificate: "platform",
diff --git a/tests/vcn/Android.bp b/tests/vcn/Android.bp
index ee2e7cf..b16ba15 100644
--- a/tests/vcn/Android.bp
+++ b/tests/vcn/Android.bp
@@ -34,8 +34,8 @@
"flag-junit",
],
libs: [
- "android.test.runner",
- "android.test.base",
- "android.test.mock",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
+ "android.test.mock.stubs",
],
}
diff --git a/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java b/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java
index 0439d5f5..edad678 100644
--- a/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java
+++ b/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java
@@ -123,7 +123,6 @@
mSetFlagsRule.enableFlags(Flags.FLAG_VALIDATE_NETWORK_ON_IPSEC_LOSS);
mSetFlagsRule.enableFlags(Flags.FLAG_EVALUATE_IPSEC_LOSS_ON_LP_NC_CHANGE);
mSetFlagsRule.enableFlags(Flags.FLAG_HANDLE_SEQ_NUM_LEAP);
- mSetFlagsRule.enableFlags(Flags.FLAG_ALLOW_DISABLE_IPSEC_LOSS_DETECTOR);
when(mNetwork.getNetId()).thenReturn(-1);
diff --git a/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java b/tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestRedirect.java
similarity index 76%
copy from ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java
copy to tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestRedirect.java
index 4b9cf85..bc9471b 100644
--- a/ravenwood/annotations-src/android/ravenwood/annotation/RavenwoodNativeSubstitutionClass.java
+++ b/tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestRedirect.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package android.ravenwood.annotation;
+package android.hosttest.annotation;
-import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -24,13 +24,9 @@
/**
* THIS ANNOTATION IS EXPERIMENTAL. REACH OUT TO g/ravenwood BEFORE USING IT, OR YOU HAVE ANY
* QUESTIONS ABOUT IT.
- *
- * TODO: Javadoc
- *
* @hide
*/
-@Target({TYPE})
+@Target({METHOD})
@Retention(RetentionPolicy.CLASS)
-public @interface RavenwoodNativeSubstitutionClass {
- String value();
+public @interface HostSideTestRedirect {
}
diff --git a/tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestNativeSubstitutionClass.java b/tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestRedirectionClass.java
similarity index 95%
rename from tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestNativeSubstitutionClass.java
rename to tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestRedirectionClass.java
index 9c81383..28ad236 100644
--- a/tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestNativeSubstitutionClass.java
+++ b/tools/hoststubgen/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestRedirectionClass.java
@@ -30,6 +30,6 @@
*/
@Target({TYPE})
@Retention(RetentionPolicy.CLASS)
-public @interface HostSideTestNativeSubstitutionClass {
+public @interface HostSideTestRedirectionClass {
String value();
}
diff --git a/tools/hoststubgen/hoststubgen/hoststubgen-standard-options.txt b/tools/hoststubgen/hoststubgen/hoststubgen-standard-options.txt
index e72c9a4..eba8e62 100644
--- a/tools/hoststubgen/hoststubgen/hoststubgen-standard-options.txt
+++ b/tools/hoststubgen/hoststubgen/hoststubgen-standard-options.txt
@@ -27,8 +27,11 @@
--substitute-annotation
android.hosttest.annotation.HostSideTestSubstitute
---native-substitute-annotation
- android.hosttest.annotation.HostSideTestNativeSubstitutionClass
+--redirect-annotation
+ android.hosttest.annotation.HostSideTestRedirect
+
+--redirection-class-annotation
+ android.hosttest.annotation.HostSideTestRedirectionClass
--class-load-hook-annotation
android.hosttest.annotation.HostSideTestClassLoadHook
diff --git a/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh b/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh
index 5f0368a..084448d 100755
--- a/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh
+++ b/tools/hoststubgen/hoststubgen/invoketest/hoststubgen-invoke-test.sh
@@ -100,8 +100,10 @@
android.hosttest.annotation.HostSideTestRemove \
--substitute-annotation \
android.hosttest.annotation.HostSideTestSubstitute \
- --native-substitute-annotation \
- android.hosttest.annotation.HostSideTestNativeSubstitutionClass \
+ --redirect-annotation \
+ android.hosttest.annotation.HostSideTestRedirect \
+ --redirection-class-annotation \
+ android.hosttest.annotation.HostSideTestRedirectionClass \
--class-load-hook-annotation \
android.hosttest.annotation.HostSideTestClassLoadHook \
--keep-static-initializer-annotation \
@@ -223,4 +225,4 @@
echo "All tests passed"
-exit 0
\ No newline at end of file
+exit 0
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt
index 0f38fe7..34aaaa9 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt
@@ -24,8 +24,9 @@
import com.android.hoststubgen.filters.FilterPolicy
import com.android.hoststubgen.filters.FilterRemapper
import com.android.hoststubgen.filters.ImplicitOutputFilter
-import com.android.hoststubgen.filters.NativeFilter
+import com.android.hoststubgen.filters.KeepNativeFilter
import com.android.hoststubgen.filters.OutputFilter
+import com.android.hoststubgen.filters.SanitizationFilter
import com.android.hoststubgen.filters.createFilterFromTextPolicyFile
import com.android.hoststubgen.filters.printAsTextPolicy
import com.android.hoststubgen.utils.ClassFilter
@@ -134,7 +135,7 @@
var filter: OutputFilter = ConstantFilter(options.defaultPolicy.get, "default-by-options")
// Next, we build a filter that preserves all native methods by default
- filter = NativeFilter(allClasses, filter)
+ filter = KeepNativeFilter(allClasses, filter)
// Next, we need a filter that resolves "class-wide" policies.
// This is used when a member (methods, fields, nested classes) don't get any polices
@@ -166,11 +167,12 @@
options.throwAnnotations,
options.removeAnnotations,
options.substituteAnnotations,
- options.nativeSubstituteAnnotations,
+ options.redirectAnnotations,
+ options.redirectionClassAnnotations,
options.classLoadHookAnnotations,
options.keepStaticInitializerAnnotations,
annotationAllowedClassesFilter,
- filter,
+ filter
)
// Next, "text based" filter, which allows to override polices without touching
@@ -182,6 +184,9 @@
// Apply the implicit filter.
filter = ImplicitOutputFilter(errors, allClasses, filter)
+ // Add a final sanitization step.
+ filter = SanitizationFilter(errors, allClasses, filter)
+
return filter
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
index 1cedcc3..057a52c 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
@@ -85,9 +85,10 @@
var throwAnnotations: MutableSet<String> = mutableSetOf(),
var removeAnnotations: MutableSet<String> = mutableSetOf(),
var keepClassAnnotations: MutableSet<String> = mutableSetOf(),
+ var redirectAnnotations: MutableSet<String> = mutableSetOf(),
var substituteAnnotations: MutableSet<String> = mutableSetOf(),
- var nativeSubstituteAnnotations: MutableSet<String> = mutableSetOf(),
+ var redirectionClassAnnotations: MutableSet<String> = mutableSetOf(),
var classLoadHookAnnotations: MutableSet<String> = mutableSetOf(),
var keepStaticInitializerAnnotations: MutableSet<String> = mutableSetOf(),
@@ -186,8 +187,11 @@
"--substitute-annotation" ->
ret.substituteAnnotations.addUniqueAnnotationArg()
- "--native-substitute-annotation" ->
- ret.nativeSubstituteAnnotations.addUniqueAnnotationArg()
+ "--redirect-annotation" ->
+ ret.redirectAnnotations.addUniqueAnnotationArg()
+
+ "--redirection-class-annotation" ->
+ ret.redirectionClassAnnotations.addUniqueAnnotationArg()
"--class-load-hook-annotation" ->
ret.classLoadHookAnnotations.addUniqueAnnotationArg()
@@ -275,7 +279,7 @@
removeAnnotations=$removeAnnotations,
keepClassAnnotations=$keepClassAnnotations,
substituteAnnotations=$substituteAnnotations,
- nativeSubstituteAnnotations=$nativeSubstituteAnnotations,
+ nativeSubstituteAnnotations=$redirectionClassAnnotations,
classLoadHookAnnotations=$classLoadHookAnnotations,
keepStaticInitializerAnnotations=$keepStaticInitializerAnnotations,
packageRedirects=$packageRedirects,
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
index 7197e0e..a02082d 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
@@ -29,33 +29,24 @@
/** Name of the class initializer method. */
-val CLASS_INITIALIZER_NAME = "<clinit>"
+const val CLASS_INITIALIZER_NAME = "<clinit>"
/** Descriptor of the class initializer method. */
-val CLASS_INITIALIZER_DESC = "()V"
+const val CLASS_INITIALIZER_DESC = "()V"
/** Name of constructors. */
-val CTOR_NAME = "<init>"
+const val CTOR_NAME = "<init>"
/**
- * Find any of [anyAnnotations] from the list of visible / invisible annotations.
+ * Find any of [set] from the list of visible / invisible annotations.
*/
fun findAnyAnnotation(
- anyAnnotations: Set<String>,
- visibleAnnotations: List<AnnotationNode>?,
- invisibleAnnotations: List<AnnotationNode>?,
- ): AnnotationNode? {
- for (an in visibleAnnotations ?: emptyList()) {
- if (anyAnnotations.contains(an.desc)) {
- return an
- }
- }
- for (an in invisibleAnnotations ?: emptyList()) {
- if (anyAnnotations.contains(an.desc)) {
- return an
- }
- }
- return null
+ set: Set<String>,
+ visibleAnnotations: List<AnnotationNode>?,
+ invisibleAnnotations: List<AnnotationNode>?,
+): AnnotationNode? {
+ return visibleAnnotations?.find { it.desc in set }
+ ?: invisibleAnnotations?.find { it.desc in set }
}
fun ClassNode.findAnyAnnotation(set: Set<String>): AnnotationNode? {
@@ -70,6 +61,27 @@
return findAnyAnnotation(set, this.visibleAnnotations, this.invisibleAnnotations)
}
+fun findAllAnnotations(
+ set: Set<String>,
+ visibleAnnotations: List<AnnotationNode>?,
+ invisibleAnnotations: List<AnnotationNode>?
+): List<AnnotationNode> {
+ return (visibleAnnotations ?: emptyList()).filter { it.desc in set } +
+ (invisibleAnnotations ?: emptyList()).filter { it.desc in set }
+}
+
+fun ClassNode.findAllAnnotations(set: Set<String>): List<AnnotationNode> {
+ return findAllAnnotations(set, this.visibleAnnotations, this.invisibleAnnotations)
+}
+
+fun MethodNode.findAllAnnotations(set: Set<String>): List<AnnotationNode> {
+ return findAllAnnotations(set, this.visibleAnnotations, this.invisibleAnnotations)
+}
+
+fun FieldNode.findAllAnnotations(set: Set<String>): List<AnnotationNode> {
+ return findAllAnnotations(set, this.visibleAnnotations, this.invisibleAnnotations)
+}
+
fun <T> findAnnotationValueAsObject(
an: AnnotationNode,
propertyName: String,
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt
index 38a41b2..a6b8cdb 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt
@@ -18,12 +18,15 @@
import com.android.hoststubgen.ClassParseException
import com.android.hoststubgen.HostStubGenErrors
import com.android.hoststubgen.InvalidAnnotationException
-import com.android.hoststubgen.addNonNullElement
+import com.android.hoststubgen.addLists
import com.android.hoststubgen.asm.CLASS_INITIALIZER_DESC
import com.android.hoststubgen.asm.CLASS_INITIALIZER_NAME
import com.android.hoststubgen.asm.ClassNodes
+import com.android.hoststubgen.asm.findAllAnnotations
import com.android.hoststubgen.asm.findAnnotationValueAsString
import com.android.hoststubgen.asm.findAnyAnnotation
+import com.android.hoststubgen.asm.getPackageNameFromFullClassName
+import com.android.hoststubgen.asm.resolveClassNameWithDefaultPackage
import com.android.hoststubgen.asm.toHumanReadableClassName
import com.android.hoststubgen.asm.toHumanReadableMethodName
import com.android.hoststubgen.asm.toJvmClassName
@@ -46,7 +49,8 @@
throwAnnotations_: Set<String>,
removeAnnotations_: Set<String>,
substituteAnnotations_: Set<String>,
- nativeSubstituteAnnotations_: Set<String>,
+ redirectAnnotations_: Set<String>,
+ redirectionClassAnnotations_: Set<String>,
classLoadHookAnnotations_: Set<String>,
keepStaticInitializerAnnotations_: Set<String>,
private val annotationAllowedClassesFilter: ClassFilter,
@@ -56,8 +60,10 @@
private val keepClassAnnotations = convertToInternalNames(keepClassAnnotations_)
private val throwAnnotations = convertToInternalNames(throwAnnotations_)
private val removeAnnotations = convertToInternalNames(removeAnnotations_)
+ private val redirectAnnotations = convertToInternalNames(redirectAnnotations_)
private val substituteAnnotations = convertToInternalNames(substituteAnnotations_)
- private val nativeSubstituteAnnotations = convertToInternalNames(nativeSubstituteAnnotations_)
+ private val redirectionClassAnnotations =
+ convertToInternalNames(redirectionClassAnnotations_)
private val classLoadHookAnnotations = convertToInternalNames(classLoadHookAnnotations_)
private val keepStaticInitializerAnnotations =
convertToInternalNames(keepStaticInitializerAnnotations_)
@@ -67,11 +73,12 @@
keepClassAnnotations +
throwAnnotations +
removeAnnotations +
+ redirectAnnotations +
substituteAnnotations
/** All the annotations we use. */
private val allAnnotations = visibilityAnnotations +
- nativeSubstituteAnnotations +
+ redirectionClassAnnotations +
classLoadHookAnnotations +
keepStaticInitializerAnnotations
@@ -84,8 +91,9 @@
keepClassAnnotations_ +
throwAnnotations_ +
removeAnnotations_ +
+ redirectAnnotations_ +
substituteAnnotations_ +
- nativeSubstituteAnnotations_ +
+ redirectionClassAnnotations_ +
classLoadHookAnnotations_ +
keepStaticInitializerAnnotations_
)
@@ -99,6 +107,7 @@
in substituteAnnotations -> FilterPolicy.Substitute.withReason(REASON_ANNOTATION)
in throwAnnotations -> FilterPolicy.Throw.withReason(REASON_ANNOTATION)
in removeAnnotations -> FilterPolicy.Remove.withReason(REASON_ANNOTATION)
+ in redirectAnnotations -> FilterPolicy.Redirect.withReason(REASON_ANNOTATION)
else -> null
}
}
@@ -129,13 +138,6 @@
descriptor: String
): FilterPolicyWithReason {
val cn = classes.getClass(className)
-
- if (methodName == CLASS_INITIALIZER_NAME && descriptor == CLASS_INITIALIZER_DESC) {
- if (cn.findAnyAnnotation(keepStaticInitializerAnnotations) != null) {
- return FilterPolicy.Keep.withReason(REASON_ANNOTATION)
- }
- }
-
return getAnnotationPolicy(cn).methodPolicies[MethodKey(methodName, descriptor)]
?: super.getPolicyForMethod(className, methodName, descriptor)
}
@@ -150,22 +152,14 @@
?: super.getRenameTo(className, methodName, descriptor)
}
- override fun getNativeSubstitutionClass(className: String): String? {
- classes.getClass(className).let { cn ->
- cn.findAnyAnnotation(nativeSubstituteAnnotations)?.let { an ->
- return getAnnotationField(an, "value")?.toJvmClassName()
- }
- }
- return null
+ override fun getRedirectionClass(className: String): String? {
+ val cn = classes.getClass(className)
+ return getAnnotationPolicy(cn).redirectionClass
}
override fun getClassLoadHooks(className: String): List<String> {
- val e = classes.getClass(className).let { cn ->
- cn.findAnyAnnotation(classLoadHookAnnotations)?.let { an ->
- getAnnotationField(an, "value")?.toHumanReadableMethodName()
- }
- }
- return addNonNullElement(super.getClassLoadHooks(className), e)
+ val cn = classes.getClass(className)
+ return addLists(super.getClassLoadHooks(className), getAnnotationPolicy(cn).classLoadHooks)
}
private data class MethodKey(val name: String, val desc: String)
@@ -195,6 +189,8 @@
val fieldPolicies = mutableMapOf<String, FilterPolicyWithReason>()
val methodPolicies = mutableMapOf<MethodKey, FilterPolicyWithReason>()
val renamedMethods = mutableMapOf<MethodKey, String>()
+ val redirectionClass: String?
+ val classLoadHooks: List<String>
init {
val allowAnnotation = annotationAllowedClassesFilter.matches(cn.name)
@@ -204,6 +200,16 @@
"class", cn.name
)
classPolicy = cn.findAnyAnnotation(visibilityAnnotations)?.policy
+ redirectionClass = cn.findAnyAnnotation(redirectionClassAnnotations)?.let { an ->
+ getAnnotationField(an, "value")?.let { resolveRelativeClass(cn, it) }
+ }
+ classLoadHooks = cn.findAllAnnotations(classLoadHookAnnotations).mapNotNull { an ->
+ getAnnotationField(an, "value")?.toHumanReadableMethodName()
+ }
+ if (cn.findAnyAnnotation(keepStaticInitializerAnnotations) != null) {
+ methodPolicies[MethodKey(CLASS_INITIALIZER_NAME, CLASS_INITIALIZER_DESC)] =
+ FilterPolicy.Keep.withReason(REASON_ANNOTATION)
+ }
for (fn in cn.fields ?: emptyList()) {
detectInvalidAnnotations(
@@ -297,25 +303,36 @@
)
}
}
- }
- /**
- * Return the (String) value of 'value' parameter from an annotation.
- */
- private fun getAnnotationField(
- an: AnnotationNode,
- name: String,
- required: Boolean = true
- ): String? {
- try {
- val suffix = findAnnotationValueAsString(an, name)
- if (suffix == null && required) {
- errors.onErrorFound("Annotation \"${an.desc}\" must have field $name")
+ /**
+ * Return the (String) value of 'value' parameter from an annotation.
+ */
+ private fun getAnnotationField(
+ an: AnnotationNode,
+ name: String,
+ required: Boolean = true
+ ): String? {
+ try {
+ val suffix = findAnnotationValueAsString(an, name)
+ if (suffix == null && required) {
+ errors.onErrorFound("Annotation \"${an.desc}\" must have field $name")
+ }
+ return suffix
+ } catch (e: ClassParseException) {
+ errors.onErrorFound(e.message!!)
+ return null
}
- return suffix
- } catch (e: ClassParseException) {
- errors.onErrorFound(e.message!!)
- return null
+ }
+
+ /**
+ * Resolve the full class name if the class is relative
+ */
+ private fun resolveRelativeClass(
+ cn: ClassNode,
+ name: String
+ ): String {
+ val packageName = getPackageNameFromFullClassName(cn.name)
+ return resolveClassNameWithDefaultPackage(name, packageName).toJvmClassName()
}
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt
index 8ee3a94..f8bb526 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/ClassWidePolicyPropagatingFilter.kt
@@ -16,7 +16,6 @@
package com.android.hoststubgen.filters
import com.android.hoststubgen.asm.ClassNodes
-import com.android.hoststubgen.asm.isNative
/**
* This is used as the second last fallback filter. This filter propagates the class-wide policy
@@ -88,16 +87,7 @@
methodName: String,
descriptor: String
): FilterPolicyWithReason {
- return outermostFilter.getNativeSubstitutionClass(className)?.let {
- // First check native substitution
- classes.findMethod(className, methodName, descriptor)?.let { mn ->
- if (mn.isNative()) {
- FilterPolicy.NativeSubstitute.withReason("class-wide in $className")
- } else {
- null
- }
- }
- } ?: getClassWidePolicy(className, resolve = true)
- ?: super.getPolicyForMethod(className, methodName, descriptor)
+ return getClassWidePolicy(className, resolve = true)
+ ?: super.getPolicyForMethod(className, methodName, descriptor)
}
-}
\ No newline at end of file
+}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt
index 6fcffb8..b8b0d8a 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/DelegatingFilter.kt
@@ -72,8 +72,8 @@
return fallback.getRenameTo(className, methodName, descriptor)
}
- override fun getNativeSubstitutionClass(className: String): String? {
- return fallback.getNativeSubstitutionClass(className)
+ override fun getRedirectionClass(className: String): String? {
+ return fallback.getRedirectionClass(className)
}
override fun getClassLoadHooks(className: String): List<String> {
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt
index ab03874..2f2f81b 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt
@@ -33,9 +33,9 @@
Substitute,
/**
- * Only usable with methods. Replace a native method with a "substitution" method,
+ * Only usable with methods. Redirect a method to a method in the substitution class.
*/
- NativeSubstitute,
+ Redirect,
/**
* Only usable with methods. The item will be kept in the impl jar file, but when called,
@@ -102,8 +102,7 @@
val isSupported: Boolean
get() {
return when (this) {
- // TODO: handle native method with no substitution as being unsupported
- Keep, KeepClass, Substitute, NativeSubstitute -> true
+ Keep, KeepClass, Substitute, Redirect -> true
else -> false
}
}
@@ -111,7 +110,7 @@
val isMethodRewriteBody: Boolean
get() {
return when (this) {
- NativeSubstitute, Throw, Ignore -> true
+ Redirect, Throw, Ignore -> true
else -> false
}
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/InMemoryOutputFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/InMemoryOutputFilter.kt
index 2e144f5..59fa464 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/InMemoryOutputFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/InMemoryOutputFilter.kt
@@ -19,6 +19,7 @@
import com.android.hoststubgen.asm.ClassNodes
import com.android.hoststubgen.asm.toHumanReadableClassName
import com.android.hoststubgen.asm.toHumanReadableMethodName
+import com.android.hoststubgen.asm.toJvmClassName
import com.android.hoststubgen.log
// TODO: Validate all input names.
@@ -29,7 +30,7 @@
) : DelegatingFilter(fallback) {
private val mPolicies: MutableMap<String, FilterPolicyWithReason> = mutableMapOf()
private val mRenames: MutableMap<String, String> = mutableMapOf()
- private val mNativeSubstitutionClasses: MutableMap<String, String> = mutableMapOf()
+ private val mRedirectionClasses: MutableMap<String, String> = mutableMapOf()
private val mClassLoadHooks: MutableMap<String, String> = mutableMapOf()
private fun getClassKey(className: String): String {
@@ -115,17 +116,17 @@
mRenames[getMethodKey(className, methodName, descriptor)] = toName
}
- override fun getNativeSubstitutionClass(className: String): String? {
- return mNativeSubstitutionClasses[getClassKey(className)]
- ?: super.getNativeSubstitutionClass(className)
+ override fun getRedirectionClass(className: String): String? {
+ return mRedirectionClasses[getClassKey(className)]
+ ?: super.getRedirectionClass(className)
}
- fun setNativeSubstitutionClass(from: String, to: String) {
+ fun setRedirectionClass(from: String, to: String) {
checkClass(from)
- // Native substitute classes may be provided from other jars, so we can't do this check.
+ // Redirection classes may be provided from other jars, so we can't do this check.
// ensureClassExists(to)
- mNativeSubstitutionClasses[getClassKey(from)] = to.toHumanReadableClassName()
+ mRedirectionClasses[getClassKey(from)] = to.toJvmClassName()
}
override fun getClassLoadHooks(className: String): List<String> {
@@ -136,4 +137,4 @@
fun setClassLoadHook(className: String, methodName: String) {
mClassLoadHooks[getClassKey(className)] = methodName.toHumanReadableMethodName()
}
-}
\ No newline at end of file
+}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/NativeFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/KeepNativeFilter.kt
similarity index 82%
rename from tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/NativeFilter.kt
rename to tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/KeepNativeFilter.kt
index bd71931..00e7d77 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/NativeFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/KeepNativeFilter.kt
@@ -18,7 +18,12 @@
import com.android.hoststubgen.asm.ClassNodes
import com.android.hoststubgen.asm.isNative
-class NativeFilter(
+/**
+ * For native methods that weren't handled by outer filters, we keep it so that
+ * native method registration will not crash at runtime. Ideally we shouldn't need
+ * this, but in practice unsupported native method registrations do occur.
+ */
+class KeepNativeFilter(
private val classes: ClassNodes,
fallback: OutputFilter
) : DelegatingFilter(fallback) {
@@ -28,8 +33,6 @@
descriptor: String,
): FilterPolicyWithReason {
return classes.findMethod(className, methodName, descriptor)?.let { mn ->
- // For native methods that weren't handled by outer filters,
- // we keep it so that native method registration will not crash.
if (mn.isNative()) {
FilterPolicy.Keep.withReason("native-preserve")
} else {
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/OutputFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/OutputFilter.kt
index 1049e2b..f99ce90 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/OutputFilter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/OutputFilter.kt
@@ -35,10 +35,6 @@
* using it.
*/
open var outermostFilter: OutputFilter = this
- get() = field
- set(value) {
- field = value
- }
abstract fun getPolicyForClass(className: String): FilterPolicyWithReason
@@ -60,13 +56,13 @@
}
/**
- * Return a "native substitution class" name for a given class.
+ * Return a "redirection class" name for a given class.
*
- * The result will be in a "human readable" form. (e.g. uses '.'s instead of '/'s)
+ * The result will be in a JVM internal form. (e.g. uses '/'s instead of '.'s)
*
- * (which corresponds to @HostSideTestNativeSubstitutionClass of the standard annotations.)
+ * (which corresponds to @HostSideTestRedirectClass of the standard annotations.)
*/
- open fun getNativeSubstitutionClass(className: String): String? {
+ open fun getRedirectionClass(className: String): String? {
return null
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/SanitizationFilter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/SanitizationFilter.kt
new file mode 100644
index 0000000..18a1e16
--- /dev/null
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/SanitizationFilter.kt
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.hoststubgen.filters
+
+import com.android.hoststubgen.HostStubGenErrors
+import com.android.hoststubgen.asm.ClassNodes
+import com.android.hoststubgen.asm.toHumanReadableClassName
+import com.android.hoststubgen.log
+
+/**
+ * Check whether the policies in the inner layers make sense, and sanitize the results.
+ */
+class SanitizationFilter(
+ private val errors: HostStubGenErrors,
+ private val classes: ClassNodes,
+ fallback: OutputFilter
+) : DelegatingFilter(fallback) {
+ override fun getPolicyForMethod(
+ className: String,
+ methodName: String,
+ descriptor: String
+ ): FilterPolicyWithReason {
+ val policy = super.getPolicyForMethod(className, methodName, descriptor)
+ if (policy.policy == FilterPolicy.Redirect) {
+ // Check whether the hosting class has a redirection class
+ if (getRedirectionClass(className) == null) {
+ errors.onErrorFound("Method $methodName$descriptor requires a redirection " +
+ "class set on ${className.toHumanReadableClassName()}")
+ }
+ }
+ return policy
+ }
+
+ override fun getRedirectionClass(className: String): String? {
+ return super.getRedirectionClass(className)?.also { clazz ->
+ if (classes.findClass(clazz) == null) {
+ log.w("Redirection class $clazz not found. Class must be available at runtime.")
+ } else if (outermostFilter.getPolicyForClass(clazz).policy != FilterPolicy.KeepClass) {
+ // If the class exists, it must have a KeepClass policy.
+ errors.onErrorFound("Redirection class $clazz must have @KeepWholeClass.")
+ }
+ }
+ }
+}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt
index 14fd82b..073b503 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt
@@ -142,9 +142,9 @@
throw ParseException(
"Special class can't have a substitution")
}
- // It's a native-substitution.
+ // It's a redirection class.
val toClass = fields[2].substring(1)
- imf.setNativeSubstitutionClass(className, toClass)
+ imf.setRedirectionClass(className, toClass)
} else if (fields[2].startsWith("~")) {
if (classType != SpecialClass.NotSpecial) {
// We could support it, but not needed at least for now.
@@ -350,6 +350,7 @@
"r", "remove" -> FilterPolicy.Remove
"kc", "keepclass" -> FilterPolicy.KeepClass
"i", "ignore" -> FilterPolicy.Ignore
+ "rdr", "redirect" -> FilterPolicy.Redirect
else -> {
if (s.startsWith("@")) {
FilterPolicy.Substitute
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
index 41ba928..261ef59c 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
@@ -21,8 +21,6 @@
import com.android.hoststubgen.asm.ClassNodes
import com.android.hoststubgen.asm.UnifiedVisitor
import com.android.hoststubgen.asm.getPackageNameFromFullClassName
-import com.android.hoststubgen.asm.resolveClassNameWithDefaultPackage
-import com.android.hoststubgen.asm.toJvmClassName
import com.android.hoststubgen.filters.FilterPolicy
import com.android.hoststubgen.filters.FilterPolicyWithReason
import com.android.hoststubgen.filters.OutputFilter
@@ -57,7 +55,7 @@
protected lateinit var currentPackageName: String
protected lateinit var currentClassName: String
- protected var nativeSubstitutionClass: String? = null
+ protected var redirectionClass: String? = null
protected lateinit var classPolicy: FilterPolicyWithReason
override fun visit(
@@ -72,34 +70,13 @@
currentClassName = name
currentPackageName = getPackageNameFromFullClassName(name)
classPolicy = filter.getPolicyForClass(currentClassName)
+ redirectionClass = filter.getRedirectionClass(currentClassName)
log.d("[%s] visit: %s (package: %s)", this.javaClass.simpleName, name, currentPackageName)
log.indent()
log.v("Emitting class: %s", name)
log.indent()
- filter.getNativeSubstitutionClass(currentClassName)?.let { className ->
- val fullClassName = resolveClassNameWithDefaultPackage(className, currentPackageName)
- .toJvmClassName()
- log.d(" NativeSubstitutionClass: $fullClassName")
- if (classes.findClass(fullClassName) == null) {
- log.w(
- "Native substitution class $fullClassName not found. Class must be " +
- "available at runtime."
- )
- } else {
- // If the class exists, it must have a KeepClass policy.
- if (filter.getPolicyForClass(fullClassName).policy != FilterPolicy.KeepClass) {
- // TODO: Use real annotation name.
- options.errors.onErrorFound(
- "Native substitution class $fullClassName should have @Keep."
- )
- }
- }
-
- nativeSubstitutionClass = fullClassName
- }
-
// Inject annotations to generated classes.
UnifiedVisitor.on(this).visitAnnotation(HostStubGenProcessedAsKeep.CLASS_DESCRIPTOR, true)
}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt
index 057d653..567a69e 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/ImplGeneratingAdapter.kt
@@ -184,9 +184,12 @@
return IgnoreMethodAdapter(descriptor, forceCreateBody, innerVisitor)
.withAnnotation(HostStubGenProcessedAsIgnore.CLASS_DESCRIPTOR)
}
- FilterPolicy.NativeSubstitute -> {
- log.v("Rewriting native method...")
- return NativeSubstitutingMethodAdapter(access, name, descriptor, innerVisitor)
+ FilterPolicy.Redirect -> {
+ log.v("Redirecting method...")
+ return RedirectMethodAdapter(
+ access, name, descriptor,
+ forceCreateBody, innerVisitor
+ )
.withAnnotation(HostStubGenProcessedAsSubstitute.CLASS_DESCRIPTOR)
}
else -> {}
@@ -274,15 +277,16 @@
}
/**
- * A method adapter that rewrite a native method body with a
- * call to a method in the "native substitution" class.
+ * A method adapter that rewrite a method body with a
+ * call to a method in the redirection class.
*/
- private inner class NativeSubstitutingMethodAdapter(
+ private inner class RedirectMethodAdapter(
access: Int,
private val name: String,
private val descriptor: String,
+ createBody: Boolean,
next: MethodVisitor?
- ) : BodyReplacingMethodVisitor(true, next) {
+ ) : BodyReplacingMethodVisitor(createBody, next) {
private val isStatic = (access and Opcodes.ACC_STATIC) != 0
@@ -290,7 +294,7 @@
var targetDescriptor = descriptor
var argOffset = 0
- // For non-static native method, we need to tweak it a bit.
+ // For non-static method, we need to tweak it a bit.
if (!isStatic) {
// Push `this` as the first argument.
this.visitVarInsn(Opcodes.ALOAD, 0)
@@ -310,7 +314,7 @@
visitMethodInsn(
INVOKESTATIC,
- nativeSubstitutionClass,
+ redirectionClass,
name,
targetDescriptor,
false
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
index 5fde14f..82586bb 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
@@ -41,20 +41,40 @@
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
-## Class: android/hosttest/annotation/HostSideTestNativeSubstitutionClass.class
- Compiled from "HostSideTestNativeSubstitutionClass.java"
-public interface android.hosttest.annotation.HostSideTestNativeSubstitutionClass extends java.lang.annotation.Annotation
+## Class: android/hosttest/annotation/HostSideTestRedirect.class
+ Compiled from "HostSideTestRedirect.java"
+public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation
minor version: 0
major version: 61
flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION
- this_class: #x // android/hosttest/annotation/HostSideTestNativeSubstitutionClass
+ this_class: #x // android/hosttest/annotation/HostSideTestRedirect
+ super_class: #x // java/lang/Object
+ interfaces: 1, fields: 0, methods: 0, attributes: 2
+}
+SourceFile: "HostSideTestRedirect.java"
+RuntimeVisibleAnnotations:
+ x: #x(#x=[e#x.#x])
+ java.lang.annotation.Target(
+ value=[Ljava/lang/annotation/ElementType;.METHOD]
+ )
+ x: #x(#x=e#x.#x)
+ java.lang.annotation.Retention(
+ value=Ljava/lang/annotation/RetentionPolicy;.CLASS
+ )
+## Class: android/hosttest/annotation/HostSideTestRedirectionClass.class
+ Compiled from "HostSideTestRedirectionClass.java"
+public interface android.hosttest.annotation.HostSideTestRedirectionClass extends java.lang.annotation.Annotation
+ minor version: 0
+ major version: 61
+ flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION
+ this_class: #x // android/hosttest/annotation/HostSideTestRedirectionClass
super_class: #x // java/lang/Object
interfaces: 1, fields: 0, methods: 1, attributes: 2
public abstract java.lang.String value();
descriptor: ()Ljava/lang/String;
flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
}
-SourceFile: "HostSideTestNativeSubstitutionClass.java"
+SourceFile: "HostSideTestRedirectionClass.java"
RuntimeVisibleAnnotations:
x: #x(#x=[e#x.#x])
java.lang.annotation.Target(
@@ -1925,7 +1945,7 @@
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 1, methods: 12, attributes: 2
+ interfaces: 0, fields: 1, methods: 14, attributes: 2
int value;
descriptor: I
flags: (0x0000)
@@ -1946,6 +1966,9 @@
public static native int nativeAddTwo(int);
descriptor: (I)I
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
@@ -1963,6 +1986,9 @@
public static native long nativeLongPlus(long, long);
descriptor: (JJ)J
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
@@ -1997,6 +2023,9 @@
public native int nativeNonStaticAddToValue(int);
descriptor: (I)I
flags: (0x0101) ACC_PUBLIC, ACC_NATIVE
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public int nativeNonStaticAddToValue_should_be_like_this(int);
descriptor: (I)I
@@ -2023,9 +2052,6 @@
public static native void nativeStillKeep();
descriptor: ()V
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
- RuntimeInvisibleAnnotations:
- x: #x()
- android.hosttest.annotation.HostSideTestKeep
public static void nativeStillNotSupported_should_be_like_this();
descriptor: ()V
@@ -2041,13 +2067,47 @@
public static native byte nativeBytePlus(byte, byte);
descriptor: (BB)B
flags: (0x0109) ACC_PUBLIC, ACC_STATIC, ACC_NATIVE
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
+
+ public void notNativeRedirected();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=2, locals=1, args_size=1
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
+ x: athrow
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 8 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
+
+ public static void notNativeStaticRedirected();
+ descriptor: ()V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=2, locals=0, args_size=0
+ x: new #x // class java/lang/RuntimeException
+ x: dup
+ x: invokespecial #x // Method java/lang/RuntimeException."<init>":()V
+ x: athrow
+ LineNumberTable:
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
}
SourceFile: "TinyFrameworkNative.java"
RuntimeInvisibleAnnotations:
x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
x: #x(#x=s#x)
- android.hosttest.annotation.HostSideTestNativeSubstitutionClass(
+ android.hosttest.annotation.HostSideTestRedirectionClass(
value="TinyFrameworkNative_host"
)
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.class
@@ -2058,7 +2118,7 @@
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 5, attributes: 2
+ interfaces: 0, fields: 0, methods: 7, attributes: 2
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -2132,6 +2192,25 @@
Start Length Slot Name Signature
0 5 0 arg1 B
0 5 1 arg2 B
+
+ public static void notNativeRedirected(com.android.hoststubgen.test.tinyframework.TinyFrameworkNative);
+ descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;)V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=0, locals=1, args_size=1
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 1 0 source Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+
+ public static void notNativeStaticRedirected();
+ descriptor: ()V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=0, locals=0, args_size=0
+ x: return
+ LineNumberTable:
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeInvisibleAnnotations:
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt
index e41d46d..31bbcc5 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt
@@ -48,13 +48,35 @@
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
-## Class: android/hosttest/annotation/HostSideTestNativeSubstitutionClass.class
- Compiled from "HostSideTestNativeSubstitutionClass.java"
-public interface android.hosttest.annotation.HostSideTestNativeSubstitutionClass extends java.lang.annotation.Annotation
+## Class: android/hosttest/annotation/HostSideTestRedirect.class
+ Compiled from "HostSideTestRedirect.java"
+public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation
minor version: 0
major version: 61
flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION
- this_class: #x // android/hosttest/annotation/HostSideTestNativeSubstitutionClass
+ this_class: #x // android/hosttest/annotation/HostSideTestRedirect
+ super_class: #x // java/lang/Object
+ interfaces: 1, fields: 0, methods: 0, attributes: 2
+}
+SourceFile: "HostSideTestRedirect.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ x: #x(#x=[e#x.#x])
+ java.lang.annotation.Target(
+ value=[Ljava/lang/annotation/ElementType;.METHOD]
+ )
+ x: #x(#x=e#x.#x)
+ java.lang.annotation.Retention(
+ value=Ljava/lang/annotation/RetentionPolicy;.CLASS
+ )
+## Class: android/hosttest/annotation/HostSideTestRedirectionClass.class
+ Compiled from "HostSideTestRedirectionClass.java"
+public interface android.hosttest.annotation.HostSideTestRedirectionClass extends java.lang.annotation.Annotation
+ minor version: 0
+ major version: 61
+ flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION
+ this_class: #x // android/hosttest/annotation/HostSideTestRedirectionClass
super_class: #x // java/lang/Object
interfaces: 1, fields: 0, methods: 1, attributes: 2
public abstract java.lang.String value();
@@ -64,7 +86,7 @@
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
}
-SourceFile: "HostSideTestNativeSubstitutionClass.java"
+SourceFile: "HostSideTestRedirectionClass.java"
RuntimeVisibleAnnotations:
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
@@ -2076,7 +2098,7 @@
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 1, methods: 12, attributes: 3
+ interfaces: 0, fields: 1, methods: 14, attributes: 3
int value;
descriptor: I
flags: (0x0000)
@@ -2113,6 +2135,9 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
@@ -2144,6 +2169,9 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
@@ -2195,6 +2223,9 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public int nativeNonStaticAddToValue_should_be_like_this(int);
descriptor: (I)I
@@ -2240,9 +2271,6 @@
RuntimeVisibleAnnotations:
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
- RuntimeInvisibleAnnotations:
- x: #x()
- android.hosttest.annotation.HostSideTestKeep
public static void nativeStillNotSupported_should_be_like_this();
descriptor: ()V
@@ -2272,6 +2300,42 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
+
+ public void notNativeRedirected();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=1, locals=1, args_size=1
+ x: aload_0
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.notNativeRedirected:(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;)V
+ x: return
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
+
+ public static void notNativeStaticRedirected();
+ descriptor: ()V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=0, locals=0, args_size=0
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.notNativeStaticRedirected:()V
+ x: return
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
@@ -2281,7 +2345,7 @@
x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
x: #x(#x=s#x)
- android.hosttest.annotation.HostSideTestNativeSubstitutionClass(
+ android.hosttest.annotation.HostSideTestRedirectionClass(
value="TinyFrameworkNative_host"
)
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.class
@@ -2292,7 +2356,7 @@
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 5, attributes: 3
+ interfaces: 0, fields: 0, methods: 7, attributes: 3
public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
@@ -2381,6 +2445,31 @@
RuntimeVisibleAnnotations:
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+
+ public static void notNativeRedirected(com.android.hoststubgen.test.tinyframework.TinyFrameworkNative);
+ descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;)V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=0, locals=1, args_size=1
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 0 1 0 source Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+
+ public static void notNativeStaticRedirected();
+ descriptor: ()V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=0, locals=0, args_size=0
+ x: return
+ LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeVisibleAnnotations:
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt
index 2ca723b..41f459a 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt
@@ -67,13 +67,44 @@
java.lang.annotation.Retention(
value=Ljava/lang/annotation/RetentionPolicy;.CLASS
)
-## Class: android/hosttest/annotation/HostSideTestNativeSubstitutionClass.class
- Compiled from "HostSideTestNativeSubstitutionClass.java"
-public interface android.hosttest.annotation.HostSideTestNativeSubstitutionClass extends java.lang.annotation.Annotation
+## Class: android/hosttest/annotation/HostSideTestRedirect.class
+ Compiled from "HostSideTestRedirect.java"
+public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation
minor version: 0
major version: 61
flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION
- this_class: #x // android/hosttest/annotation/HostSideTestNativeSubstitutionClass
+ this_class: #x // android/hosttest/annotation/HostSideTestRedirect
+ super_class: #x // java/lang/Object
+ interfaces: 1, fields: 0, methods: 1, attributes: 2
+ private static {};
+ descriptor: ()V
+ flags: (0x000a) ACC_PRIVATE, ACC_STATIC
+ Code:
+ stack=2, locals=0, args_size=0
+ x: ldc #x // class android/hosttest/annotation/HostSideTestRedirect
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
+ x: return
+}
+SourceFile: "HostSideTestRedirect.java"
+RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ x: #x(#x=[e#x.#x])
+ java.lang.annotation.Target(
+ value=[Ljava/lang/annotation/ElementType;.METHOD]
+ )
+ x: #x(#x=e#x.#x)
+ java.lang.annotation.Retention(
+ value=Ljava/lang/annotation/RetentionPolicy;.CLASS
+ )
+## Class: android/hosttest/annotation/HostSideTestRedirectionClass.class
+ Compiled from "HostSideTestRedirectionClass.java"
+public interface android.hosttest.annotation.HostSideTestRedirectionClass extends java.lang.annotation.Annotation
+ minor version: 0
+ major version: 61
+ flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION
+ this_class: #x // android/hosttest/annotation/HostSideTestRedirectionClass
super_class: #x // java/lang/Object
interfaces: 1, fields: 0, methods: 2, attributes: 2
private static {};
@@ -81,7 +112,7 @@
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=0, args_size=0
- x: ldc #x // class android/hosttest/annotation/HostSideTestNativeSubstitutionClass
+ x: ldc #x // class android/hosttest/annotation/HostSideTestRedirectionClass
x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded
x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V
x: return
@@ -93,7 +124,7 @@
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
}
-SourceFile: "HostSideTestNativeSubstitutionClass.java"
+SourceFile: "HostSideTestRedirectionClass.java"
RuntimeVisibleAnnotations:
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
@@ -2612,7 +2643,7 @@
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
super_class: #x // java/lang/Object
- interfaces: 0, fields: 1, methods: 13, attributes: 3
+ interfaces: 0, fields: 1, methods: 15, attributes: 3
int value;
descriptor: I
flags: (0x0000)
@@ -2669,6 +2700,9 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public static int nativeAddTwo_should_be_like_this(int);
descriptor: (I)I
@@ -2710,6 +2744,9 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public static long nativeLongPlus_should_be_like_this(long, long);
descriptor: (JJ)J
@@ -2776,6 +2813,9 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
public int nativeNonStaticAddToValue_should_be_like_this(int);
descriptor: (I)I
@@ -2831,9 +2871,6 @@
RuntimeVisibleAnnotations:
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
- RuntimeInvisibleAnnotations:
- x: #x()
- android.hosttest.annotation.HostSideTestKeep
public static void nativeStillNotSupported_should_be_like_this();
descriptor: ()V
@@ -2873,6 +2910,52 @@
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
+
+ public void notNativeRedirected();
+ descriptor: ()V
+ flags: (0x0001) ACC_PUBLIC
+ Code:
+ stack=4, locals=1, args_size=1
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
+ x: ldc #x // String notNativeRedirected
+ x: ldc #x // String ()V
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: aload_0
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.notNativeRedirected:(Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;)V
+ x: return
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
+
+ public static void notNativeStaticRedirected();
+ descriptor: ()V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=4, locals=0, args_size=0
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNative
+ x: ldc #x // String notNativeStaticRedirected
+ x: ldc #x // String ()V
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: invokestatic #x // Method com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.notNativeStaticRedirected:()V
+ x: return
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsSubstitute
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+ RuntimeInvisibleAnnotations:
+ x: #x()
+ android.hosttest.annotation.HostSideTestRedirect
}
SourceFile: "TinyFrameworkNative.java"
RuntimeVisibleAnnotations:
@@ -2882,7 +2965,7 @@
x: #x()
android.hosttest.annotation.HostSideTestWholeClassKeep
x: #x(#x=s#x)
- android.hosttest.annotation.HostSideTestNativeSubstitutionClass(
+ android.hosttest.annotation.HostSideTestRedirectionClass(
value="TinyFrameworkNative_host"
)
## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.class
@@ -2893,7 +2976,7 @@
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
super_class: #x // java/lang/Object
- interfaces: 0, fields: 0, methods: 6, attributes: 3
+ interfaces: 0, fields: 0, methods: 8, attributes: 3
private static {};
descriptor: ()V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
@@ -3017,6 +3100,41 @@
RuntimeVisibleAnnotations:
x: #x()
com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+
+ public static void notNativeRedirected(com.android.hoststubgen.test.tinyframework.TinyFrameworkNative);
+ descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;)V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=4, locals=1, args_size=1
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String notNativeRedirected
+ x: ldc #x // String (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;)V
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: return
+ LineNumberTable:
+ LocalVariableTable:
+ Start Length Slot Name Signature
+ 11 1 0 source Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNative;
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
+
+ public static void notNativeStaticRedirected();
+ descriptor: ()V
+ flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ Code:
+ stack=4, locals=0, args_size=0
+ x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host
+ x: ldc #x // String notNativeStaticRedirected
+ x: ldc #x // String ()V
+ x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+ x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ x: return
+ LineNumberTable:
+ RuntimeVisibleAnnotations:
+ x: #x()
+ com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep
}
SourceFile: "TinyFrameworkNative_host.java"
RuntimeVisibleAnnotations:
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java
index 73b5e2f..04a551c 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative.java
@@ -15,20 +15,23 @@
*/
package com.android.hoststubgen.test.tinyframework;
-import android.hosttest.annotation.HostSideTestKeep;
-import android.hosttest.annotation.HostSideTestNativeSubstitutionClass;
+import android.hosttest.annotation.HostSideTestRedirect;
+import android.hosttest.annotation.HostSideTestRedirectionClass;
import android.hosttest.annotation.HostSideTestThrow;
import android.hosttest.annotation.HostSideTestWholeClassKeep;
@HostSideTestWholeClassKeep
-@HostSideTestNativeSubstitutionClass("TinyFrameworkNative_host")
+@HostSideTestRedirectionClass("TinyFrameworkNative_host")
public class TinyFrameworkNative {
+
+ @HostSideTestRedirect
public static native int nativeAddTwo(int arg);
public static int nativeAddTwo_should_be_like_this(int arg) {
return TinyFrameworkNative_host.nativeAddTwo(arg);
}
+ @HostSideTestRedirect
public static native long nativeLongPlus(long arg1, long arg2);
public static long nativeLongPlus_should_be_like_this(long arg1, long arg2) {
@@ -41,6 +44,7 @@
this.value = v;
}
+ @HostSideTestRedirect
public native int nativeNonStaticAddToValue(int arg);
public int nativeNonStaticAddToValue_should_be_like_this(int arg) {
@@ -50,12 +54,22 @@
@HostSideTestThrow
public static native void nativeStillNotSupported();
- @HostSideTestKeep
public static native void nativeStillKeep();
public static void nativeStillNotSupported_should_be_like_this() {
throw new RuntimeException();
}
+ @HostSideTestRedirect
public static native byte nativeBytePlus(byte arg1, byte arg2);
+
+ @HostSideTestRedirect
+ public void notNativeRedirected() {
+ throw new RuntimeException();
+ }
+
+ @HostSideTestRedirect
+ public static void notNativeStaticRedirected() {
+ throw new RuntimeException();
+ }
}
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java
index b23c216..c7a29a1 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host.java
@@ -17,8 +17,6 @@
import android.hosttest.annotation.HostSideTestWholeClassKeep;
-// TODO: This annotation shouldn't be needed.
-// We should infer it from HostSideTestNativeSubstitutionClass.
@HostSideTestWholeClassKeep
public class TinyFrameworkNative_host {
public static int nativeAddTwo(int arg) {
@@ -38,4 +36,10 @@
public static byte nativeBytePlus(byte arg1, byte arg2) {
return (byte) (arg1 + arg2);
}
+
+ public static void notNativeRedirected(TinyFrameworkNative source) {
+ }
+
+ public static void notNativeStaticRedirected() {
+ }
}
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java
index 14229a0..68673dc 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassTest.java
@@ -164,6 +164,12 @@
}
@Test
+ public void testNotNativeRedirect() {
+ TinyFrameworkNative.notNativeStaticRedirected();
+ new TinyFrameworkNative().notNativeRedirected();
+ }
+
+ @Test
public void testExitLog() {
thrown.expect(RuntimeException.class);
thrown.expectMessage("Outer exception");
diff --git a/tools/lint/common/src/main/java/com/google/android/lint/aidl/EnforcePermissionUtils.kt b/tools/lint/common/src/main/java/com/google/android/lint/aidl/EnforcePermissionUtils.kt
index 24d203f..f5af99e 100644
--- a/tools/lint/common/src/main/java/com/google/android/lint/aidl/EnforcePermissionUtils.kt
+++ b/tools/lint/common/src/main/java/com/google/android/lint/aidl/EnforcePermissionUtils.kt
@@ -24,20 +24,31 @@
import org.jetbrains.uast.UMethod
/**
- * Given a UMethod, determine if this method is the entrypoint to an interface
- * generated by AIDL, returning the interface name if so, otherwise returning
- * null
+ * Given a UMethod, determine if this method is the entrypoint to an interface generated by AIDL,
+ * returning the interface name if so, otherwise returning null.
*/
fun getContainingAidlInterface(context: JavaContext, node: UMethod): String? {
+ return containingAidlInterfacePsiClass(context, node)?.name
+}
+
+/**
+ * Given a UMethod, determine if this method is the entrypoint to an interface generated by AIDL,
+ * returning the fully qualified interface name if so, otherwise returning null.
+ */
+fun getContainingAidlInterfaceQualified(context: JavaContext, node: UMethod): String? {
+ return containingAidlInterfacePsiClass(context, node)?.qualifiedName
+}
+
+private fun containingAidlInterfacePsiClass(context: JavaContext, node: UMethod): PsiClass? {
val containingStub = containingStub(context, node) ?: return null
val superMethod = node.findSuperMethods(containingStub)
if (superMethod.isEmpty()) return null
- return containingStub.containingClass?.name
+ return containingStub.containingClass
}
-/* Returns the containing Stub class if any. This is not sufficient to infer
- * that the method itself extends an AIDL generated method. See
- * getContainingAidlInterface for that purpose.
+/**
+ * Returns the containing Stub class if any. This is not sufficient to infer that the method itself
+ * extends an AIDL generated method. See getContainingAidlInterface for that purpose.
*/
fun containingStub(context: JavaContext, node: UMethod?): PsiClass? {
var superClass = node?.containingClass?.superClass
@@ -48,7 +59,7 @@
return null
}
-private fun isStub(context: JavaContext, psiClass: PsiClass?): Boolean {
+fun isStub(context: JavaContext, psiClass: PsiClass?): Boolean {
if (psiClass == null) return false
if (psiClass.name != "Stub") return false
if (!context.evaluator.isStatic(psiClass)) return false
diff --git a/tools/lint/global/checks/src/main/java/com/google/android/lint/aidl/ExemptAidlInterfaces.kt b/tools/lint/global/checks/src/main/java/com/google/android/lint/aidl/ExemptAidlInterfaces.kt
new file mode 100644
index 0000000..8777712
--- /dev/null
+++ b/tools/lint/global/checks/src/main/java/com/google/android/lint/aidl/ExemptAidlInterfaces.kt
@@ -0,0 +1,774 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.android.lint.aidl
+
+/**
+ * The exemptAidlInterfaces set was generated by running ExemptAidlInterfacesGenerator on the
+ * entire source tree. To reproduce the results, run generate-exempt-aidl-interfaces.sh
+ * located in tools/lint/utils.
+ *
+ * TODO: b/363248121 - Use the exemptAidlInterfaces set inside PermissionAnnotationDetector when it
+ * gets migrated to a global lint check.
+ */
+val exemptAidlInterfaces = setOf(
+ "android.accessibilityservice.IAccessibilityServiceConnection",
+ "android.accessibilityservice.IBrailleDisplayConnection",
+ "android.accounts.IAccountAuthenticatorResponse",
+ "android.accounts.IAccountManager",
+ "android.accounts.IAccountManagerResponse",
+ "android.adservices.adid.IAdIdProviderService",
+ "android.adservices.adid.IAdIdService",
+ "android.adservices.adid.IGetAdIdCallback",
+ "android.adservices.adid.IGetAdIdProviderCallback",
+ "android.adservices.adselection.AdSelectionCallback",
+ "android.adservices.adselection.AdSelectionOverrideCallback",
+ "android.adservices.adselection.AdSelectionService",
+ "android.adservices.adselection.GetAdSelectionDataCallback",
+ "android.adservices.adselection.PersistAdSelectionResultCallback",
+ "android.adservices.adselection.ReportImpressionCallback",
+ "android.adservices.adselection.ReportInteractionCallback",
+ "android.adservices.adselection.SetAppInstallAdvertisersCallback",
+ "android.adservices.adselection.UpdateAdCounterHistogramCallback",
+ "android.adservices.appsetid.IAppSetIdProviderService",
+ "android.adservices.appsetid.IAppSetIdService",
+ "android.adservices.appsetid.IGetAppSetIdCallback",
+ "android.adservices.appsetid.IGetAppSetIdProviderCallback",
+ "android.adservices.cobalt.IAdServicesCobaltUploadService",
+ "android.adservices.common.IAdServicesCommonCallback",
+ "android.adservices.common.IAdServicesCommonService",
+ "android.adservices.common.IAdServicesCommonStatesCallback",
+ "android.adservices.common.IEnableAdServicesCallback",
+ "android.adservices.common.IUpdateAdIdCallback",
+ "android.adservices.customaudience.CustomAudienceOverrideCallback",
+ "android.adservices.customaudience.FetchAndJoinCustomAudienceCallback",
+ "android.adservices.customaudience.ICustomAudienceCallback",
+ "android.adservices.customaudience.ICustomAudienceService",
+ "android.adservices.customaudience.ScheduleCustomAudienceUpdateCallback",
+ "android.adservices.extdata.IAdServicesExtDataStorageService",
+ "android.adservices.extdata.IGetAdServicesExtDataCallback",
+ "android.adservices.measurement.IMeasurementApiStatusCallback",
+ "android.adservices.measurement.IMeasurementCallback",
+ "android.adservices.measurement.IMeasurementService",
+ "android.adservices.ondevicepersonalization.aidl.IDataAccessService",
+ "android.adservices.ondevicepersonalization.aidl.IDataAccessServiceCallback",
+ "android.adservices.ondevicepersonalization.aidl.IExecuteCallback",
+ "android.adservices.ondevicepersonalization.aidl.IFederatedComputeCallback",
+ "android.adservices.ondevicepersonalization.aidl.IFederatedComputeService",
+ "android.adservices.ondevicepersonalization.aidl.IIsolatedModelService",
+ "android.adservices.ondevicepersonalization.aidl.IIsolatedModelServiceCallback",
+ "android.adservices.ondevicepersonalization.aidl.IIsolatedService",
+ "android.adservices.ondevicepersonalization.aidl.IIsolatedServiceCallback",
+ "android.adservices.ondevicepersonalization.aidl.IOnDevicePersonalizationConfigService",
+ "android.adservices.ondevicepersonalization.aidl.IOnDevicePersonalizationConfigServiceCallback",
+ "android.adservices.ondevicepersonalization.aidl.IOnDevicePersonalizationDebugService",
+ "android.adservices.ondevicepersonalization.aidl.IOnDevicePersonalizationManagingService",
+ "android.adservices.ondevicepersonalization.aidl.IRegisterMeasurementEventCallback",
+ "android.adservices.ondevicepersonalization.aidl.IRequestSurfacePackageCallback",
+ "android.adservices.shell.IShellCommand",
+ "android.adservices.shell.IShellCommandCallback",
+ "android.adservices.signals.IProtectedSignalsService",
+ "android.adservices.signals.UpdateSignalsCallback",
+ "android.adservices.topics.IGetTopicsCallback",
+ "android.adservices.topics.ITopicsService",
+ "android.app.admin.IDevicePolicyManager",
+ "android.app.adservices.IAdServicesManager",
+ "android.app.ambientcontext.IAmbientContextManager",
+ "android.app.ambientcontext.IAmbientContextObserver",
+ "android.app.appsearch.aidl.IAppFunctionService",
+ "android.app.appsearch.aidl.IAppSearchBatchResultCallback",
+ "android.app.appsearch.aidl.IAppSearchManager",
+ "android.app.appsearch.aidl.IAppSearchObserverProxy",
+ "android.app.appsearch.aidl.IAppSearchResultCallback",
+ "android.app.backup.IBackupCallback",
+ "android.app.backup.IBackupManager",
+ "android.app.backup.IRestoreSession",
+ "android.app.blob.IBlobCommitCallback",
+ "android.app.blob.IBlobStoreManager",
+ "android.app.blob.IBlobStoreSession",
+ "android.app.contentsuggestions.IContentSuggestionsManager",
+ "android.app.contextualsearch.IContextualSearchManager",
+ "android.app.ecm.IEnhancedConfirmationManager",
+ "android.apphibernation.IAppHibernationService",
+ "android.app.IActivityClientController",
+ "android.app.IActivityController",
+ "android.app.IActivityTaskManager",
+ "android.app.IAlarmCompleteListener",
+ "android.app.IAlarmListener",
+ "android.app.IAlarmManager",
+ "android.app.IApplicationThread",
+ "android.app.IAppTask",
+ "android.app.IAppTraceRetriever",
+ "android.app.IAssistDataReceiver",
+ "android.app.IForegroundServiceObserver",
+ "android.app.IGameManagerService",
+ "android.app.IGrammaticalInflectionManager",
+ "android.app.ILocaleManager",
+ "android.app.INotificationManager",
+ "android.app.IParcelFileDescriptorRetriever",
+ "android.app.IProcessObserver",
+ "android.app.ISearchManager",
+ "android.app.IStopUserCallback",
+ "android.app.ITaskStackListener",
+ "android.app.IUiModeManager",
+ "android.app.IUriGrantsManager",
+ "android.app.IUserSwitchObserver",
+ "android.app.IWallpaperManager",
+ "android.app.job.IJobCallback",
+ "android.app.job.IJobScheduler",
+ "android.app.job.IJobService",
+ "android.app.ondeviceintelligence.IDownloadCallback",
+ "android.app.ondeviceintelligence.IFeatureCallback",
+ "android.app.ondeviceintelligence.IFeatureDetailsCallback",
+ "android.app.ondeviceintelligence.IListFeaturesCallback",
+ "android.app.ondeviceintelligence.IOnDeviceIntelligenceManager",
+ "android.app.ondeviceintelligence.IProcessingSignal",
+ "android.app.ondeviceintelligence.IResponseCallback",
+ "android.app.ondeviceintelligence.IStreamingResponseCallback",
+ "android.app.ondeviceintelligence.ITokenInfoCallback",
+ "android.app.people.IPeopleManager",
+ "android.app.pinner.IPinnerService",
+ "android.app.prediction.IPredictionManager",
+ "android.app.role.IOnRoleHoldersChangedListener",
+ "android.app.role.IRoleController",
+ "android.app.role.IRoleManager",
+ "android.app.sdksandbox.ILoadSdkCallback",
+ "android.app.sdksandbox.IRequestSurfacePackageCallback",
+ "android.app.sdksandbox.ISdkSandboxManager",
+ "android.app.sdksandbox.ISdkSandboxProcessDeathCallback",
+ "android.app.sdksandbox.ISdkToServiceCallback",
+ "android.app.sdksandbox.ISharedPreferencesSyncCallback",
+ "android.app.sdksandbox.IUnloadSdkCallback",
+ "android.app.sdksandbox.testutils.testscenario.ISdkSandboxTestExecutor",
+ "android.app.search.ISearchUiManager",
+ "android.app.slice.ISliceManager",
+ "android.app.smartspace.ISmartspaceManager",
+ "android.app.timedetector.ITimeDetectorService",
+ "android.app.timezonedetector.ITimeZoneDetectorService",
+ "android.app.trust.ITrustManager",
+ "android.app.usage.IStorageStatsManager",
+ "android.app.usage.IUsageStatsManager",
+ "android.app.wallpapereffectsgeneration.IWallpaperEffectsGenerationManager",
+ "android.app.wearable.IWearableSensingCallback",
+ "android.app.wearable.IWearableSensingManager",
+ "android.bluetooth.IBluetooth",
+ "android.bluetooth.IBluetoothA2dp",
+ "android.bluetooth.IBluetoothA2dpSink",
+ "android.bluetooth.IBluetoothActivityEnergyInfoListener",
+ "android.bluetooth.IBluetoothAvrcpController",
+ "android.bluetooth.IBluetoothCallback",
+ "android.bluetooth.IBluetoothConnectionCallback",
+ "android.bluetooth.IBluetoothCsipSetCoordinator",
+ "android.bluetooth.IBluetoothCsipSetCoordinatorLockCallback",
+ "android.bluetooth.IBluetoothGatt",
+ "android.bluetooth.IBluetoothGattCallback",
+ "android.bluetooth.IBluetoothGattServerCallback",
+ "android.bluetooth.IBluetoothHapClient",
+ "android.bluetooth.IBluetoothHapClientCallback",
+ "android.bluetooth.IBluetoothHeadset",
+ "android.bluetooth.IBluetoothHeadsetClient",
+ "android.bluetooth.IBluetoothHearingAid",
+ "android.bluetooth.IBluetoothHidDevice",
+ "android.bluetooth.IBluetoothHidDeviceCallback",
+ "android.bluetooth.IBluetoothHidHost",
+ "android.bluetooth.IBluetoothLeAudio",
+ "android.bluetooth.IBluetoothLeAudioCallback",
+ "android.bluetooth.IBluetoothLeBroadcastAssistant",
+ "android.bluetooth.IBluetoothLeBroadcastAssistantCallback",
+ "android.bluetooth.IBluetoothLeBroadcastCallback",
+ "android.bluetooth.IBluetoothLeCallControl",
+ "android.bluetooth.IBluetoothLeCallControlCallback",
+ "android.bluetooth.IBluetoothManager",
+ "android.bluetooth.IBluetoothManagerCallback",
+ "android.bluetooth.IBluetoothMap",
+ "android.bluetooth.IBluetoothMapClient",
+ "android.bluetooth.IBluetoothMcpServiceManager",
+ "android.bluetooth.IBluetoothMetadataListener",
+ "android.bluetooth.IBluetoothOobDataCallback",
+ "android.bluetooth.IBluetoothPan",
+ "android.bluetooth.IBluetoothPanCallback",
+ "android.bluetooth.IBluetoothPbap",
+ "android.bluetooth.IBluetoothPbapClient",
+ "android.bluetooth.IBluetoothPreferredAudioProfilesCallback",
+ "android.bluetooth.IBluetoothQualityReportReadyCallback",
+ "android.bluetooth.IBluetoothSap",
+ "android.bluetooth.IBluetoothScan",
+ "android.bluetooth.IBluetoothSocketManager",
+ "android.bluetooth.IBluetoothVolumeControl",
+ "android.bluetooth.IBluetoothVolumeControlCallback",
+ "android.bluetooth.le.IAdvertisingSetCallback",
+ "android.bluetooth.le.IDistanceMeasurementCallback",
+ "android.bluetooth.le.IPeriodicAdvertisingCallback",
+ "android.bluetooth.le.IScannerCallback",
+ "android.companion.ICompanionDeviceManager",
+ "android.companion.IOnMessageReceivedListener",
+ "android.companion.IOnTransportsChangedListener",
+ "android.companion.virtualcamera.IVirtualCameraCallback",
+ "android.companion.virtual.IVirtualDevice",
+ "android.companion.virtual.IVirtualDeviceManager",
+ "android.companion.virtualnative.IVirtualDeviceManagerNative",
+ "android.content.IClipboard",
+ "android.content.IContentService",
+ "android.content.IIntentReceiver",
+ "android.content.IIntentSender",
+ "android.content.integrity.IAppIntegrityManager",
+ "android.content.IRestrictionsManager",
+ "android.content.ISyncAdapterUnsyncableAccountCallback",
+ "android.content.ISyncContext",
+ "android.content.om.IOverlayManager",
+ "android.content.pm.dex.IArtManager",
+ "android.content.pm.dex.ISnapshotRuntimeProfileCallback",
+ "android.content.pm.IBackgroundInstallControlService",
+ "android.content.pm.ICrossProfileApps",
+ "android.content.pm.IDataLoaderManager",
+ "android.content.pm.IDataLoaderStatusListener",
+ "android.content.pm.ILauncherApps",
+ "android.content.pm.IOnChecksumsReadyListener",
+ "android.content.pm.IOtaDexopt",
+ "android.content.pm.IPackageDataObserver",
+ "android.content.pm.IPackageDeleteObserver",
+ "android.content.pm.IPackageInstaller",
+ "android.content.pm.IPackageInstallerSession",
+ "android.content.pm.IPackageInstallerSessionFileSystemConnector",
+ "android.content.pm.IPackageInstallObserver2",
+ "android.content.pm.IPackageLoadingProgressCallback",
+ "android.content.pm.IPackageManager",
+ "android.content.pm.IPackageManagerNative",
+ "android.content.pm.IPackageMoveObserver",
+ "android.content.pm.IPinItemRequest",
+ "android.content.pm.IShortcutService",
+ "android.content.pm.IStagedApexObserver",
+ "android.content.pm.verify.domain.IDomainVerificationManager",
+ "android.content.res.IResourcesManager",
+ "android.content.rollback.IRollbackManager",
+ "android.credentials.ICredentialManager",
+ "android.debug.IAdbTransport",
+ "android.devicelock.IDeviceLockService",
+ "android.devicelock.IGetDeviceIdCallback",
+ "android.devicelock.IGetKioskAppsCallback",
+ "android.devicelock.IIsDeviceLockedCallback",
+ "android.devicelock.IVoidResultCallback",
+ "android.federatedcompute.aidl.IExampleStoreCallback",
+ "android.federatedcompute.aidl.IExampleStoreIterator",
+ "android.federatedcompute.aidl.IExampleStoreIteratorCallback",
+ "android.federatedcompute.aidl.IExampleStoreService",
+ "android.federatedcompute.aidl.IFederatedComputeCallback",
+ "android.federatedcompute.aidl.IFederatedComputeService",
+ "android.federatedcompute.aidl.IResultHandlingService",
+ "android.flags.IFeatureFlags",
+ "android.frameworks.location.altitude.IAltitudeService",
+ "android.frameworks.vibrator.IVibratorController",
+ "android.frameworks.vibrator.IVibratorControlService",
+ "android.gsi.IGsiServiceCallback",
+ "android.hardware.biometrics.AuthenticationStateListener",
+ "android.hardware.biometrics.common.ICancellationSignal",
+ "android.hardware.biometrics.face.IFace",
+ "android.hardware.biometrics.face.ISession",
+ "android.hardware.biometrics.face.ISessionCallback",
+ "android.hardware.biometrics.fingerprint.IFingerprint",
+ "android.hardware.biometrics.fingerprint.ISession",
+ "android.hardware.biometrics.fingerprint.ISessionCallback",
+ "android.hardware.biometrics.IAuthService",
+ "android.hardware.biometrics.IBiometricAuthenticator",
+ "android.hardware.biometrics.IBiometricContextListener",
+ "android.hardware.biometrics.IBiometricSensorReceiver",
+ "android.hardware.biometrics.IBiometricService",
+ "android.hardware.biometrics.IBiometricStateListener",
+ "android.hardware.biometrics.IBiometricSysuiReceiver",
+ "android.hardware.biometrics.IInvalidationCallback",
+ "android.hardware.biometrics.ITestSession",
+ "android.hardware.broadcastradio.IAnnouncementListener",
+ "android.hardware.broadcastradio.ITunerCallback",
+ "android.hardware.contexthub.IContextHubCallback",
+ "android.hardware.devicestate.IDeviceStateManager",
+ "android.hardware.display.IColorDisplayManager",
+ "android.hardware.display.IDisplayManager",
+ "android.hardware.face.IFaceAuthenticatorsRegisteredCallback",
+ "android.hardware.face.IFaceService",
+ "android.hardware.face.IFaceServiceReceiver",
+ "android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback",
+ "android.hardware.fingerprint.IFingerprintClientActiveCallback",
+ "android.hardware.fingerprint.IFingerprintService",
+ "android.hardware.fingerprint.IFingerprintServiceReceiver",
+ "android.hardware.fingerprint.IUdfpsOverlayControllerCallback",
+ "android.hardware.fingerprint.IUdfpsRefreshRateRequestCallback",
+ "android.hardware.hdmi.IHdmiControlCallback",
+ "android.hardware.hdmi.IHdmiControlService",
+ "android.hardware.hdmi.IHdmiDeviceEventListener",
+ "android.hardware.hdmi.IHdmiHotplugEventListener",
+ "android.hardware.hdmi.IHdmiSystemAudioModeChangeListener",
+ "android.hardware.health.IHealthInfoCallback",
+ "android.hardware.ICameraServiceProxy",
+ "android.hardware.IConsumerIrService",
+ "android.hardware.input.IInputManager",
+ "android.hardware.iris.IIrisService",
+ "android.hardware.ISensorPrivacyManager",
+ "android.hardware.ISerialManager",
+ "android.hardware.lights.ILightsManager",
+ "android.hardware.location.IContextHubClient",
+ "android.hardware.location.IContextHubClientCallback",
+ "android.hardware.location.IContextHubService",
+ "android.hardware.location.IContextHubTransactionCallback",
+ "android.hardware.location.ISignificantPlaceProviderManager",
+ "android.hardware.radio.IAnnouncementListener",
+ "android.hardware.radio.ICloseHandle",
+ "android.hardware.radio.ims.media.IImsMedia",
+ "android.hardware.radio.ims.media.IImsMediaListener",
+ "android.hardware.radio.ims.media.IImsMediaSession",
+ "android.hardware.radio.ims.media.IImsMediaSessionListener",
+ "android.hardware.radio.IRadioService",
+ "android.hardware.radio.ITuner",
+ "android.hardware.radio.sap.ISapCallback",
+ "android.hardware.soundtrigger3.ISoundTriggerHw",
+ "android.hardware.soundtrigger3.ISoundTriggerHwCallback",
+ "android.hardware.soundtrigger3.ISoundTriggerHwGlobalCallback",
+ "android.hardware.soundtrigger.IRecognitionStatusCallback",
+ "android.hardware.tetheroffload.ITetheringOffloadCallback",
+ "android.hardware.thermal.IThermalChangedCallback",
+ "android.hardware.tv.hdmi.cec.IHdmiCecCallback",
+ "android.hardware.tv.hdmi.connection.IHdmiConnectionCallback",
+ "android.hardware.tv.hdmi.earc.IEArcCallback",
+ "android.hardware.usb.gadget.IUsbGadgetCallback",
+ "android.hardware.usb.IUsbCallback",
+ "android.hardware.usb.IUsbManager",
+ "android.hardware.usb.IUsbSerialReader",
+ "android.hardware.wifi.hostapd.IHostapdCallback",
+ "android.hardware.wifi.IWifiChipEventCallback",
+ "android.hardware.wifi.IWifiEventCallback",
+ "android.hardware.wifi.IWifiNanIfaceEventCallback",
+ "android.hardware.wifi.IWifiRttControllerEventCallback",
+ "android.hardware.wifi.IWifiStaIfaceEventCallback",
+ "android.hardware.wifi.supplicant.INonStandardCertCallback",
+ "android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback",
+ "android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback",
+ "android.hardware.wifi.supplicant.ISupplicantStaNetworkCallback",
+ "android.health.connect.aidl.IAccessLogsResponseCallback",
+ "android.health.connect.aidl.IActivityDatesResponseCallback",
+ "android.health.connect.aidl.IAggregateRecordsResponseCallback",
+ "android.health.connect.aidl.IApplicationInfoResponseCallback",
+ "android.health.connect.aidl.IChangeLogsResponseCallback",
+ "android.health.connect.aidl.IDataStagingFinishedCallback",
+ "android.health.connect.aidl.IEmptyResponseCallback",
+ "android.health.connect.aidl.IGetChangeLogTokenCallback",
+ "android.health.connect.aidl.IGetHealthConnectDataStateCallback",
+ "android.health.connect.aidl.IGetHealthConnectMigrationUiStateCallback",
+ "android.health.connect.aidl.IGetPriorityResponseCallback",
+ "android.health.connect.aidl.IHealthConnectService",
+ "android.health.connect.aidl.IInsertRecordsResponseCallback",
+ "android.health.connect.aidl.IMedicalDataSourceResponseCallback",
+ "android.health.connect.aidl.IMedicalResourcesResponseCallback",
+ "android.health.connect.aidl.IMigrationCallback",
+ "android.health.connect.aidl.IReadMedicalResourcesResponseCallback",
+ "android.health.connect.aidl.IReadRecordsResponseCallback",
+ "android.health.connect.aidl.IRecordTypeInfoResponseCallback",
+ "android.health.connect.exportimport.IImportStatusCallback",
+ "android.health.connect.exportimport.IQueryDocumentProvidersCallback",
+ "android.health.connect.exportimport.IScheduledExportStatusCallback",
+ "android.location.ICountryDetector",
+ "android.location.IGpsGeofenceHardware",
+ "android.location.ILocationManager",
+ "android.location.provider.ILocationProviderManager",
+ "android.media.IAudioRoutesObserver",
+ "android.media.IMediaCommunicationService",
+ "android.media.IMediaCommunicationServiceCallback",
+ "android.media.IMediaController2",
+ "android.media.IMediaRoute2ProviderServiceCallback",
+ "android.media.IMediaRouterService",
+ "android.media.IMediaSession2",
+ "android.media.IMediaSession2Service",
+ "android.media.INativeSpatializerCallback",
+ "android.media.IPlaybackConfigDispatcher",
+ "android.media.IRecordingConfigDispatcher",
+ "android.media.IRemoteDisplayCallback",
+ "android.media.ISoundDoseCallback",
+ "android.media.ISpatializerHeadTrackingCallback",
+ "android.media.ITranscodingClientCallback",
+ "android.media.metrics.IMediaMetricsManager",
+ "android.media.midi.IMidiManager",
+ "android.media.musicrecognition.IMusicRecognitionAttributionTagCallback",
+ "android.media.musicrecognition.IMusicRecognitionManager",
+ "android.media.musicrecognition.IMusicRecognitionServiceCallback",
+ "android.media.projection.IMediaProjection",
+ "android.media.projection.IMediaProjectionCallback",
+ "android.media.projection.IMediaProjectionManager",
+ "android.media.projection.IMediaProjectionWatcherCallback",
+ "android.media.session.ISession",
+ "android.media.session.ISessionController",
+ "android.media.session.ISessionManager",
+ "android.media.soundtrigger.ISoundTriggerDetectionServiceClient",
+ "android.media.soundtrigger_middleware.IInjectGlobalEvent",
+ "android.media.soundtrigger_middleware.IInjectModelEvent",
+ "android.media.soundtrigger_middleware.IInjectRecognitionEvent",
+ "android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService",
+ "android.media.soundtrigger_middleware.ISoundTriggerModule",
+ "android.media.tv.ad.ITvAdManager",
+ "android.media.tv.ad.ITvAdSessionCallback",
+ "android.media.tv.interactive.ITvInteractiveAppManager",
+ "android.media.tv.interactive.ITvInteractiveAppServiceCallback",
+ "android.media.tv.interactive.ITvInteractiveAppSessionCallback",
+ "android.media.tv.ITvInputHardware",
+ "android.media.tv.ITvInputManager",
+ "android.media.tv.ITvInputServiceCallback",
+ "android.media.tv.ITvInputSessionCallback",
+ "android.media.tv.ITvRemoteServiceInput",
+ "android.nearby.aidl.IOffloadCallback",
+ "android.nearby.IBroadcastListener",
+ "android.nearby.INearbyManager",
+ "android.nearby.IScanListener",
+ "android.net.connectivity.aidl.ConnectivityNative",
+ "android.net.dhcp.IDhcpEventCallbacks",
+ "android.net.dhcp.IDhcpServer",
+ "android.net.dhcp.IDhcpServerCallbacks",
+ "android.net.ICaptivePortal",
+ "android.net.IConnectivityDiagnosticsCallback",
+ "android.net.IConnectivityManager",
+ "android.net.IEthernetManager",
+ "android.net.IEthernetServiceListener",
+ "android.net.IIntResultListener",
+ "android.net.IIpConnectivityMetrics",
+ "android.net.IIpMemoryStore",
+ "android.net.IIpMemoryStoreCallbacks",
+ "android.net.IIpSecService",
+ "android.net.INetdEventCallback",
+ "android.net.INetdUnsolicitedEventListener",
+ "android.net.INetworkActivityListener",
+ "android.net.INetworkAgent",
+ "android.net.INetworkAgentRegistry",
+ "android.net.INetworkInterfaceOutcomeReceiver",
+ "android.net.INetworkManagementEventObserver",
+ "android.net.INetworkMonitor",
+ "android.net.INetworkMonitorCallbacks",
+ "android.net.INetworkOfferCallback",
+ "android.net.INetworkPolicyListener",
+ "android.net.INetworkPolicyManager",
+ "android.net.INetworkScoreService",
+ "android.net.INetworkStackConnector",
+ "android.net.INetworkStackStatusCallback",
+ "android.net.INetworkStatsService",
+ "android.net.INetworkStatsSession",
+ "android.net.IOnCompleteListener",
+ "android.net.IPacProxyManager",
+ "android.net.ip.IIpClient",
+ "android.net.ip.IIpClientCallbacks",
+ "android.net.ipmemorystore.IOnBlobRetrievedListener",
+ "android.net.ipmemorystore.IOnL2KeyResponseListener",
+ "android.net.ipmemorystore.IOnNetworkAttributesRetrievedListener",
+ "android.net.ipmemorystore.IOnSameL3NetworkResponseListener",
+ "android.net.ipmemorystore.IOnStatusAndCountListener",
+ "android.net.ipmemorystore.IOnStatusListener",
+ "android.net.IQosCallback",
+ "android.net.ISocketKeepaliveCallback",
+ "android.net.ITestNetworkManager",
+ "android.net.ITetheredInterfaceCallback",
+ "android.net.ITetheringConnector",
+ "android.net.ITetheringEventCallback",
+ "android.net.IVpnManager",
+ "android.net.mdns.aidl.IMDnsEventListener",
+ "android.net.metrics.INetdEventListener",
+ "android.net.netstats.IUsageCallback",
+ "android.net.netstats.provider.INetworkStatsProvider",
+ "android.net.netstats.provider.INetworkStatsProviderCallback",
+ "android.net.nsd.INsdManager",
+ "android.net.nsd.INsdManagerCallback",
+ "android.net.nsd.INsdServiceConnector",
+ "android.net.nsd.IOffloadEngine",
+ "android.net.resolv.aidl.IDnsResolverUnsolicitedEventListener",
+ "android.net.thread.IActiveOperationalDatasetReceiver",
+ "android.net.thread.IConfigurationReceiver",
+ "android.net.thread.IOperationalDatasetCallback",
+ "android.net.thread.IOperationReceiver",
+ "android.net.thread.IStateCallback",
+ "android.net.thread.IThreadNetworkController",
+ "android.net.thread.IThreadNetworkManager",
+ "android.net.vcn.IVcnManagementService",
+ "android.net.wear.ICompanionDeviceManagerProxy",
+ "android.net.wifi.aware.IWifiAwareDiscoverySessionCallback",
+ "android.net.wifi.aware.IWifiAwareEventCallback",
+ "android.net.wifi.aware.IWifiAwareMacAddressProvider",
+ "android.net.wifi.aware.IWifiAwareManager",
+ "android.net.wifi.hotspot2.IProvisioningCallback",
+ "android.net.wifi.IActionListener",
+ "android.net.wifi.IBooleanListener",
+ "android.net.wifi.IByteArrayListener",
+ "android.net.wifi.ICoexCallback",
+ "android.net.wifi.IDppCallback",
+ "android.net.wifi.IIntegerListener",
+ "android.net.wifi.IInterfaceCreationInfoCallback",
+ "android.net.wifi.ILastCallerListener",
+ "android.net.wifi.IListListener",
+ "android.net.wifi.ILocalOnlyConnectionStatusListener",
+ "android.net.wifi.ILocalOnlyHotspotCallback",
+ "android.net.wifi.IMacAddressListListener",
+ "android.net.wifi.IMapListener",
+ "android.net.wifi.INetworkRequestMatchCallback",
+ "android.net.wifi.INetworkRequestUserSelectionCallback",
+ "android.net.wifi.IOnWifiActivityEnergyInfoListener",
+ "android.net.wifi.IOnWifiDriverCountryCodeChangedListener",
+ "android.net.wifi.IOnWifiUsabilityStatsListener",
+ "android.net.wifi.IPnoScanResultsCallback",
+ "android.net.wifi.IScanDataListener",
+ "android.net.wifi.IScanResultsCallback",
+ "android.net.wifi.IScoreUpdateObserver",
+ "android.net.wifi.ISoftApCallback",
+ "android.net.wifi.IStringListener",
+ "android.net.wifi.ISubsystemRestartCallback",
+ "android.net.wifi.ISuggestionConnectionStatusListener",
+ "android.net.wifi.ISuggestionUserApprovalStatusListener",
+ "android.net.wifi.ITrafficStateCallback",
+ "android.net.wifi.ITwtCallback",
+ "android.net.wifi.ITwtCapabilitiesListener",
+ "android.net.wifi.ITwtStatsListener",
+ "android.net.wifi.IWifiBandsListener",
+ "android.net.wifi.IWifiConnectedNetworkScorer",
+ "android.net.wifi.IWifiLowLatencyLockListener",
+ "android.net.wifi.IWifiManager",
+ "android.net.wifi.IWifiNetworkSelectionConfigListener",
+ "android.net.wifi.IWifiNetworkStateChangedListener",
+ "android.net.wifi.IWifiScanner",
+ "android.net.wifi.IWifiScannerListener",
+ "android.net.wifi.IWifiVerboseLoggingStatusChangedListener",
+ "android.net.wifi.p2p.IWifiP2pListener",
+ "android.net.wifi.p2p.IWifiP2pManager",
+ "android.net.wifi.rtt.IRttCallback",
+ "android.net.wifi.rtt.IWifiRttManager",
+ "android.ondevicepersonalization.IOnDevicePersonalizationSystemService",
+ "android.ondevicepersonalization.IOnDevicePersonalizationSystemServiceCallback",
+ "android.os.IBatteryPropertiesRegistrar",
+ "android.os.ICancellationSignal",
+ "android.os.IDeviceIdentifiersPolicyService",
+ "android.os.IDeviceIdleController",
+ "android.os.IDumpstate",
+ "android.os.IDumpstateListener",
+ "android.os.IExternalVibratorService",
+ "android.os.IHardwarePropertiesManager",
+ "android.os.IHintManager",
+ "android.os.IHintSession",
+ "android.os.IIncidentCompanion",
+ "android.os.image.IDynamicSystemService",
+ "android.os.incremental.IStorageHealthListener",
+ "android.os.INetworkManagementService",
+ "android.os.IPendingIntentRef",
+ "android.os.IPowerStatsService",
+ "android.os.IProfilingResultCallback",
+ "android.os.IProfilingService",
+ "android.os.IProgressListener",
+ "android.os.IPullAtomCallback",
+ "android.os.IRecoverySystem",
+ "android.os.IRemoteCallback",
+ "android.os.ISecurityStateManager",
+ "android.os.IServiceCallback",
+ "android.os.IStatsCompanionService",
+ "android.os.IStatsManagerService",
+ "android.os.IStatsQueryCallback",
+ "android.os.ISystemConfig",
+ "android.os.ISystemUpdateManager",
+ "android.os.IThermalEventListener",
+ "android.os.IUpdateLock",
+ "android.os.IUserManager",
+ "android.os.IUserRestrictionsListener",
+ "android.os.IVibratorManagerService",
+ "android.os.IVoldListener",
+ "android.os.IVoldMountCallback",
+ "android.os.IVoldTaskListener",
+ "android.os.logcat.ILogcatManagerService",
+ "android.permission.ILegacyPermissionManager",
+ "android.permission.IPermissionChecker",
+ "android.permission.IPermissionManager",
+ "android.print.IPrintManager",
+ "android.print.IPrintSpoolerCallbacks",
+ "android.print.IPrintSpoolerClient",
+ "android.printservice.IPrintServiceClient",
+ "android.printservice.recommendation.IRecommendationServiceCallbacks",
+ "android.provider.aidl.IDeviceConfigManager",
+ "android.remoteauth.IDeviceDiscoveryListener",
+ "android.safetycenter.IOnSafetyCenterDataChangedListener",
+ "android.safetycenter.ISafetyCenterManager",
+ "android.scheduling.IRebootReadinessManager",
+ "android.scheduling.IRequestRebootReadinessStatusListener",
+ "android.security.attestationverification.IAttestationVerificationManagerService",
+ "android.security.IFileIntegrityService",
+ "android.security.keystore.IKeyAttestationApplicationIdProvider",
+ "android.security.rkp.IRegistration",
+ "android.security.rkp.IRemoteProvisioning",
+ "android.service.appprediction.IPredictionService",
+ "android.service.assist.classification.IFieldClassificationCallback",
+ "android.service.attention.IAttentionCallback",
+ "android.service.attention.IProximityUpdateCallback",
+ "android.service.autofill.augmented.IFillCallback",
+ "android.service.autofill.IConvertCredentialCallback",
+ "android.service.autofill.IFillCallback",
+ "android.service.autofill.IInlineSuggestionUiCallback",
+ "android.service.autofill.ISaveCallback",
+ "android.service.autofill.ISurfacePackageResultCallback",
+ "android.service.contentcapture.IContentCaptureServiceCallback",
+ "android.service.contentcapture.IContentProtectionAllowlistCallback",
+ "android.service.contentcapture.IDataShareCallback",
+ "android.service.credentials.IBeginCreateCredentialCallback",
+ "android.service.credentials.IBeginGetCredentialCallback",
+ "android.service.credentials.IClearCredentialStateCallback",
+ "android.service.dreams.IDreamManager",
+ "android.service.games.IGameServiceController",
+ "android.service.games.IGameSessionController",
+ "android.service.notification.IStatusBarNotificationHolder",
+ "android.service.oemlock.IOemLockService",
+ "android.service.ondeviceintelligence.IProcessingUpdateStatusCallback",
+ "android.service.ondeviceintelligence.IRemoteProcessingService",
+ "android.service.ondeviceintelligence.IRemoteStorageService",
+ "android.service.persistentdata.IPersistentDataBlockService",
+ "android.service.resolver.IResolverRankerResult",
+ "android.service.rotationresolver.IRotationResolverCallback",
+ "android.service.textclassifier.ITextClassifierCallback",
+ "android.service.textclassifier.ITextClassifierService",
+ "android.service.timezone.ITimeZoneProviderManager",
+ "android.service.trust.ITrustAgentServiceCallback",
+ "android.service.voice.IDetectorSessionStorageService",
+ "android.service.voice.IDetectorSessionVisualQueryDetectionCallback",
+ "android.service.voice.IDspHotwordDetectionCallback",
+ "android.service.wallpaper.IWallpaperConnection",
+ "android.speech.IRecognitionListener",
+ "android.speech.IRecognitionService",
+ "android.speech.IRecognitionServiceManager",
+ "android.speech.tts.ITextToSpeechManager",
+ "android.speech.tts.ITextToSpeechSession",
+ "android.system.composd.ICompilationTaskCallback",
+ "android.system.virtualizationmaintenance.IVirtualizationReconciliationCallback",
+ "android.system.virtualizationservice.IVirtualMachineCallback",
+ "android.system.vmtethering.IVmTethering",
+ "android.telephony.imsmedia.IImsAudioSession",
+ "android.telephony.imsmedia.IImsAudioSessionCallback",
+ "android.telephony.imsmedia.IImsMedia",
+ "android.telephony.imsmedia.IImsMediaCallback",
+ "android.telephony.imsmedia.IImsTextSession",
+ "android.telephony.imsmedia.IImsTextSessionCallback",
+ "android.telephony.imsmedia.IImsVideoSession",
+ "android.telephony.imsmedia.IImsVideoSessionCallback",
+ "android.tracing.ITracingServiceProxy",
+ "android.uwb.IOnUwbActivityEnergyInfoListener",
+ "android.uwb.IUwbAdapter",
+ "android.uwb.IUwbAdapterStateCallbacks",
+ "android.uwb.IUwbAdfProvisionStateCallbacks",
+ "android.uwb.IUwbOemExtensionCallback",
+ "android.uwb.IUwbRangingCallbacks",
+ "android.uwb.IUwbVendorUciCallback",
+ "android.view.accessibility.IAccessibilityInteractionConnectionCallback",
+ "android.view.accessibility.IAccessibilityManager",
+ "android.view.accessibility.IMagnificationConnectionCallback",
+ "android.view.accessibility.IRemoteMagnificationAnimationCallback",
+ "android.view.autofill.IAutoFillManager",
+ "android.view.autofill.IAutofillWindowPresenter",
+ "android.view.contentcapture.IContentCaptureManager",
+ "android.view.IDisplayChangeWindowCallback",
+ "android.view.IDisplayWindowListener",
+ "android.view.IInputFilter",
+ "android.view.IInputFilterHost",
+ "android.view.IInputMonitorHost",
+ "android.view.IRecentsAnimationController",
+ "android.view.IRemoteAnimationFinishedCallback",
+ "android.view.ISensitiveContentProtectionManager",
+ "android.view.IWindowId",
+ "android.view.IWindowManager",
+ "android.view.IWindowSession",
+ "android.view.translation.ITranslationManager",
+ "android.view.translation.ITranslationServiceCallback",
+ "android.webkit.IWebViewUpdateService",
+ "android.window.IBackAnimationFinishedCallback",
+ "android.window.IDisplayAreaOrganizerController",
+ "android.window.ITaskFragmentOrganizerController",
+ "android.window.ITaskOrganizerController",
+ "android.window.ITransitionMetricsReporter",
+ "android.window.IUnhandledDragCallback",
+ "android.window.IWindowContainerToken",
+ "android.window.IWindowlessStartingSurfaceCallback",
+ "android.window.IWindowOrganizerController",
+ "androidx.core.uwb.backend.IUwb",
+ "androidx.core.uwb.backend.IUwbClient",
+ "com.android.clockwork.modes.IModeManager",
+ "com.android.clockwork.modes.IStateChangeListener",
+ "com.android.clockwork.power.IWearPowerService",
+ "com.android.devicelockcontroller.IDeviceLockControllerService",
+ "com.android.devicelockcontroller.storage.IGlobalParametersService",
+ "com.android.devicelockcontroller.storage.ISetupParametersService",
+ "com.android.federatedcompute.services.training.aidl.IIsolatedTrainingService",
+ "com.android.federatedcompute.services.training.aidl.ITrainingResultCallback",
+ "com.android.internal.app.IAppOpsActiveCallback",
+ "com.android.internal.app.ILogAccessDialogCallback",
+ "com.android.internal.app.ISoundTriggerService",
+ "com.android.internal.app.ISoundTriggerSession",
+ "com.android.internal.app.IVoiceInteractionAccessibilitySettingsListener",
+ "com.android.internal.app.IVoiceInteractionManagerService",
+ "com.android.internal.app.IVoiceInteractionSessionListener",
+ "com.android.internal.app.IVoiceInteractionSessionShowCallback",
+ "com.android.internal.app.IVoiceInteractionSoundTriggerSession",
+ "com.android.internal.app.procstats.IProcessStats",
+ "com.android.internal.appwidget.IAppWidgetService",
+ "com.android.internal.backup.ITransportStatusCallback",
+ "com.android.internal.compat.IOverrideValidator",
+ "com.android.internal.compat.IPlatformCompat",
+ "com.android.internal.compat.IPlatformCompatNative",
+ "com.android.internal.graphics.fonts.IFontManager",
+ "com.android.internal.inputmethod.IAccessibilityInputMethodSessionCallback",
+ "com.android.internal.inputmethod.IConnectionlessHandwritingCallback",
+ "com.android.internal.inputmethod.IImeTracker",
+ "com.android.internal.inputmethod.IInlineSuggestionsRequestCallback",
+ "com.android.internal.inputmethod.IInputContentUriToken",
+ "com.android.internal.inputmethod.IInputMethodPrivilegedOperations",
+ "com.android.internal.inputmethod.IInputMethodSessionCallback",
+ "com.android.internal.net.INetworkWatchlistManager",
+ "com.android.internal.os.IBinaryTransparencyService",
+ "com.android.internal.os.IDropBoxManagerService",
+ "com.android.internal.policy.IKeyguardDismissCallback",
+ "com.android.internal.policy.IKeyguardDrawnCallback",
+ "com.android.internal.policy.IKeyguardExitCallback",
+ "com.android.internal.policy.IKeyguardStateCallback",
+ "com.android.internal.statusbar.IAddTileResultCallback",
+ "com.android.internal.statusbar.ISessionListener",
+ "com.android.internal.statusbar.IStatusBarService",
+ "com.android.internal.telecom.IDeviceIdleControllerAdapter",
+ "com.android.internal.telecom.IInternalServiceRetriever",
+ "com.android.internal.telephony.IMms",
+ "com.android.internal.telephony.ITelephonyRegistry",
+ "com.android.internal.textservice.ISpellCheckerServiceCallback",
+ "com.android.internal.textservice.ITextServicesManager",
+ "com.android.internal.view.IDragAndDropPermissions",
+ "com.android.internal.view.IInputMethodManager",
+ "com.android.internal.view.inline.IInlineContentProvider",
+ "com.android.internal.widget.ILockSettings",
+ "com.android.net.IProxyPortListener",
+ "com.android.net.module.util.IRoutingCoordinator",
+ "com.android.ondevicepersonalization.libraries.plugin.internal.IPluginCallback",
+ "com.android.ondevicepersonalization.libraries.plugin.internal.IPluginExecutorService",
+ "com.android.ondevicepersonalization.libraries.plugin.internal.IPluginStateCallback",
+ "com.android.rkpdapp.IGetKeyCallback",
+ "com.android.rkpdapp.IGetRegistrationCallback",
+ "com.android.rkpdapp.IRegistration",
+ "com.android.rkpdapp.IRemoteProvisioning",
+ "com.android.rkpdapp.IStoreUpgradedKeyCallback",
+ "com.android.sdksandbox.IComputeSdkStorageCallback",
+ "com.android.sdksandbox.ILoadSdkInSandboxCallback",
+ "com.android.sdksandbox.IRequestSurfacePackageFromSdkCallback",
+ "com.android.sdksandbox.ISdkSandboxManagerToSdkSandboxCallback",
+ "com.android.sdksandbox.ISdkSandboxService",
+ "com.android.sdksandbox.IUnloadSdkInSandboxCallback",
+ "com.android.server.profcollect.IProviderStatusCallback",
+ "com.android.server.thread.openthread.IChannelMasksReceiver",
+ "com.android.server.thread.openthread.INsdPublisher",
+ "com.android.server.thread.openthread.IOtDaemonCallback",
+ "com.android.server.thread.openthread.IOtStatusReceiver",
+ "com.google.android.clockwork.ambient.offload.IDisplayOffloadService",
+ "com.google.android.clockwork.ambient.offload.IDisplayOffloadTransitionFinishedCallbacks",
+ "com.google.android.clockwork.healthservices.IHealthService",
+ "vendor.google_clockwork.healthservices.IHealthServicesCallback",
+)
diff --git a/tools/lint/utils/README.md b/tools/lint/utils/README.md
new file mode 100644
index 0000000..b5583c5
--- /dev/null
+++ b/tools/lint/utils/README.md
@@ -0,0 +1,11 @@
+# Utility Android Lint Checks for AOSP
+
+This directory contains scripts that execute utility Android Lint Checks for AOSP, specifically:
+* `enforce_permission_counter.py`: Provides statistics regarding the percentage of annotated/not
+ annotated `AIDL` methods with `@EnforcePermission` annotations.
+* `generate-exempt-aidl-interfaces.sh`: Provides a list of all `AIDL` interfaces in the entire
+ source tree.
+
+When adding a new utility Android Lint check to this directory, consider adding any utility or
+data processing tool you might require. Make sure that your contribution is documented in this
+README file.
diff --git a/tools/lint/utils/checks/src/main/java/com/google/android/lint/AndroidUtilsIssueRegistry.kt b/tools/lint/utils/checks/src/main/java/com/google/android/lint/AndroidUtilsIssueRegistry.kt
index fa61c42..9842881 100644
--- a/tools/lint/utils/checks/src/main/java/com/google/android/lint/AndroidUtilsIssueRegistry.kt
+++ b/tools/lint/utils/checks/src/main/java/com/google/android/lint/AndroidUtilsIssueRegistry.kt
@@ -19,6 +19,7 @@
import com.android.tools.lint.client.api.IssueRegistry
import com.android.tools.lint.client.api.Vendor
import com.android.tools.lint.detector.api.CURRENT_API
+import com.google.android.lint.aidl.ExemptAidlInterfacesGenerator
import com.google.android.lint.aidl.AnnotatedAidlCounter
import com.google.auto.service.AutoService
@@ -27,6 +28,7 @@
class AndroidUtilsIssueRegistry : IssueRegistry() {
override val issues = listOf(
AnnotatedAidlCounter.ISSUE_ANNOTATED_AIDL_COUNTER,
+ ExemptAidlInterfacesGenerator.ISSUE_PERMISSION_ANNOTATION_EXEMPT_AIDL_INTERFACES,
)
override val api: Int
@@ -38,6 +40,6 @@
override val vendor: Vendor = Vendor(
vendorName = "Android",
feedbackUrl = "http://b/issues/new?component=315013",
- contact = "tweek@google.com"
+ contact = "android-platform-abuse-prevention-withfriends@google.com"
)
}
diff --git a/tools/lint/utils/checks/src/main/java/com/google/android/lint/aidl/ExemptAidlInterfacesGenerator.kt b/tools/lint/utils/checks/src/main/java/com/google/android/lint/aidl/ExemptAidlInterfacesGenerator.kt
new file mode 100644
index 0000000..6ad223c
--- /dev/null
+++ b/tools/lint/utils/checks/src/main/java/com/google/android/lint/aidl/ExemptAidlInterfacesGenerator.kt
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.android.lint.aidl
+
+import com.android.tools.lint.detector.api.Category
+import com.android.tools.lint.detector.api.Context
+import com.android.tools.lint.detector.api.Implementation
+import com.android.tools.lint.detector.api.Issue
+import com.android.tools.lint.detector.api.JavaContext
+import com.android.tools.lint.detector.api.Scope
+import com.android.tools.lint.detector.api.Severity
+import org.jetbrains.uast.UBlockExpression
+import org.jetbrains.uast.UMethod
+
+/**
+ * Generates a set of fully qualified AIDL Interface names present in the entire source tree with
+ * the following requirement: their implementations have to be inside directories whose path
+ * prefixes match `systemServicePathPrefixes`.
+ */
+class ExemptAidlInterfacesGenerator : AidlImplementationDetector() {
+ private val targetExemptAidlInterfaceNames = mutableSetOf<String>()
+ private val systemServicePathPrefixes = setOf(
+ "frameworks/base/services",
+ "frameworks/base/apex",
+ "frameworks/opt/wear",
+ "packages/modules"
+ )
+
+ // We could've improved performance by visiting classes rather than methods, however, this lint
+ // check won't be run regularly, hence we've decided not to add extra overrides to
+ // AidlImplementationDetector.
+ override fun visitAidlMethod(
+ context: JavaContext,
+ node: UMethod,
+ interfaceName: String,
+ body: UBlockExpression
+ ) {
+ val filePath = context.file.path
+
+ // We perform `filePath.contains` instead of `filePath.startsWith` since getting the
+ // relative path of a source file is non-trivial. That is because `context.file.path`
+ // returns the path to where soong builds the file (i.e. /out/soong/...). Moreover, the
+ // logic to extract the relative path would need to consider several /out/soong/...
+ // locations patterns.
+ if (systemServicePathPrefixes.none { filePath.contains(it) }) return
+
+ val fullyQualifiedInterfaceName =
+ getContainingAidlInterfaceQualified(context, node) ?: return
+
+ targetExemptAidlInterfaceNames.add("\"$fullyQualifiedInterfaceName\",")
+ }
+
+ override fun afterCheckEachProject(context: Context) {
+ if (targetExemptAidlInterfaceNames.isEmpty()) return
+
+ val message = targetExemptAidlInterfaceNames.joinToString("\n")
+
+ context.report(
+ ISSUE_PERMISSION_ANNOTATION_EXEMPT_AIDL_INTERFACES,
+ context.getLocation(context.project.dir),
+ "\n" + message + "\n",
+ )
+ }
+
+ companion object {
+ @JvmField
+ val ISSUE_PERMISSION_ANNOTATION_EXEMPT_AIDL_INTERFACES = Issue.create(
+ id = "PermissionAnnotationExemptAidlInterfaces",
+ briefDescription = "Returns a set of all AIDL interfaces",
+ explanation = """
+ Produces the exemptAidlInterfaces set used by PermissionAnnotationDetector
+ """.trimIndent(),
+ category = Category.SECURITY,
+ priority = 5,
+ severity = Severity.INFORMATIONAL,
+ implementation = Implementation(
+ ExemptAidlInterfacesGenerator::class.java,
+ Scope.JAVA_FILE_SCOPE
+ )
+ )
+ }
+}
diff --git a/tools/lint/utils/checks/src/test/java/com/google/android/lint/aidl/ExemptAidlInterfacesGeneratorTest.kt b/tools/lint/utils/checks/src/test/java/com/google/android/lint/aidl/ExemptAidlInterfacesGeneratorTest.kt
new file mode 100644
index 0000000..9a17bb4
--- /dev/null
+++ b/tools/lint/utils/checks/src/test/java/com/google/android/lint/aidl/ExemptAidlInterfacesGeneratorTest.kt
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.android.lint.aidl
+
+import com.android.tools.lint.checks.infrastructure.LintDetectorTest
+import com.android.tools.lint.checks.infrastructure.TestFile
+import com.android.tools.lint.checks.infrastructure.TestLintTask
+import com.android.tools.lint.detector.api.Detector
+import com.android.tools.lint.detector.api.Issue
+
+class ExemptAidlInterfacesGeneratorTest : LintDetectorTest() {
+ override fun getDetector(): Detector = ExemptAidlInterfacesGenerator()
+
+ override fun getIssues(): List<Issue> = listOf(
+ ExemptAidlInterfacesGenerator.ISSUE_PERMISSION_ANNOTATION_EXEMPT_AIDL_INTERFACES,
+ )
+
+ override fun lint(): TestLintTask = super.lint().allowMissingSdk(true)
+
+ fun testMultipleAidlInterfacesImplemented() {
+ lint()
+ .files(
+ java(
+ createVisitedPath("TestClass1.java"),
+ """
+ package com.android.server;
+ public class TestClass1 extends IFoo.Stub {
+ public void testMethod() {}
+ }
+ """
+ )
+ .indented(),
+ java(
+ createVisitedPath("TestClass2.java"),
+ """
+ package com.android.server;
+ public class TestClass2 extends IBar.Stub {
+ public void testMethod() {}
+ }
+ """
+ )
+ .indented(),
+ *stubs,
+ )
+ .run()
+ .expect(
+ """
+ app: Information: "IFoo",
+ "IBar", [PermissionAnnotationExemptAidlInterfaces]
+ 0 errors, 0 warnings
+ """
+ )
+ }
+
+ fun testSingleAidlInterfaceRepeated() {
+ lint()
+ .files(
+ java(
+ createVisitedPath("TestClass1.java"),
+ """
+ package com.android.server;
+ public class TestClass1 extends IFoo.Stub {
+ public void testMethod() {}
+ }
+ """
+ )
+ .indented(),
+ java(
+ createVisitedPath("TestClass2.java"),
+ """
+ package com.android.server;
+ public class TestClass2 extends IFoo.Stub {
+ public void testMethod() {}
+ }
+ """
+ )
+ .indented(),
+ *stubs,
+ )
+ .run()
+ .expect(
+ """
+ app: Information: "IFoo", [PermissionAnnotationExemptAidlInterfaces]
+ 0 errors, 0 warnings
+ """
+ )
+ }
+
+ fun testAnonymousClassExtendsAidlStub() {
+ lint()
+ .files(
+ java(
+ createVisitedPath("TestClass.java"),
+ """
+ package com.android.server;
+ public class TestClass {
+ private IBinder aidlImpl = new IFoo.Stub() {
+ public void testMethod() {}
+ };
+ }
+ """
+ )
+ .indented(),
+ *stubs,
+ )
+ .run()
+ .expect(
+ """
+ app: Information: "IFoo", [PermissionAnnotationExemptAidlInterfaces]
+ 0 errors, 0 warnings
+ """
+ )
+ }
+
+ fun testNoAidlInterfacesImplemented() {
+ lint()
+ .files(
+ java(
+ createVisitedPath("TestClass.java"),
+ """
+ package com.android.server;
+ public class TestClass {
+ public void testMethod() {}
+ }
+ """
+ )
+ .indented(),
+ *stubs
+ )
+ .run()
+ .expectClean()
+ }
+
+ fun testAidlInterfaceImplementedInIgnoredDirectory() {
+ lint()
+ .files(
+ java(
+ ignoredPath,
+ """
+ package com.android.server;
+ public class TestClass1 extends IFoo.Stub {
+ public void testMethod() {}
+ }
+ """
+ )
+ .indented(),
+ *stubs,
+ )
+ .run()
+ .expectClean()
+ }
+
+ private val interfaceIFoo: TestFile = java(
+ """
+ public interface IFoo extends android.os.IInterface {
+ public static abstract class Stub extends android.os.Binder implements IFoo {}
+ public void testMethod();
+ }
+ """
+ ).indented()
+
+ private val interfaceIBar: TestFile = java(
+ """
+ public interface IBar extends android.os.IInterface {
+ public static abstract class Stub extends android.os.Binder implements IBar {}
+ public void testMethod();
+ }
+ """
+ ).indented()
+
+ private val stubs = arrayOf(interfaceIFoo, interfaceIBar)
+
+ private fun createVisitedPath(filename: String) =
+ "src/frameworks/base/services/java/com/android/server/$filename"
+
+ private val ignoredPath = "src/test/pkg/TestClass.java"
+}
diff --git a/tools/lint/utils/generate-exempt-aidl-interfaces.sh b/tools/lint/utils/generate-exempt-aidl-interfaces.sh
new file mode 100755
index 0000000..44dcdd7
--- /dev/null
+++ b/tools/lint/utils/generate-exempt-aidl-interfaces.sh
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2024 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Create a directory for the results and a nested temporary directory.
+mkdir -p $ANDROID_BUILD_TOP/out/soong/exempt_aidl_interfaces_generator_output/tmp
+
+# Create a copy of `AndroidGlobalLintChecker.jar` to restore it afterwards.
+cp $ANDROID_BUILD_TOP/prebuilts/cmdline-tools/AndroidGlobalLintChecker.jar \
+ $ANDROID_BUILD_TOP/out/soong/exempt_aidl_interfaces_generator_output/AndroidGlobalLintChecker.jar
+
+# Configure the environment variable required for running the lint check on the entire source tree.
+export ANDROID_LINT_CHECK=PermissionAnnotationExemptAidlInterfaces
+
+# Build the target corresponding to the lint checks present in the `utils` directory.
+m AndroidUtilsLintChecker
+
+# Replace `AndroidGlobalLintChecker.jar` with the newly built `jar` file.
+cp $ANDROID_BUILD_TOP/out/host/linux-x86/framework/AndroidUtilsLintChecker.jar \
+ $ANDROID_BUILD_TOP/prebuilts/cmdline-tools/AndroidGlobalLintChecker.jar;
+
+# Run the lint check on the entire source tree.
+m lint-check
+
+# Copy the archive containing the results of `lint-check` into the temporary directory.
+cp $ANDROID_BUILD_TOP/out/soong/lint-report-text.zip \
+ $ANDROID_BUILD_TOP/out/soong/exempt_aidl_interfaces_generator_output/tmp
+
+cd $ANDROID_BUILD_TOP/out/soong/exempt_aidl_interfaces_generator_output/tmp
+
+# Unzip the archive containing the results of `lint-check`.
+unzip lint-report-text.zip
+
+# Concatenate the results of `lint-check` into a single string.
+concatenated_reports=$(find . -type f | xargs cat)
+
+# Extract the fully qualified names of the AIDL Interfaces from the concatenated results. Output
+# this list into `out/soong/exempt_aidl_interfaces_generator_output/exempt_aidl_interfaces`.
+echo $concatenated_reports | grep -Eo '\"([a-zA-Z0-9_]*\.)+[a-zA-Z0-9_]*\",' | sort | uniq > ../exempt_aidl_interfaces
+
+# Remove the temporary directory.
+rm -rf $ANDROID_BUILD_TOP/out/soong/exempt_aidl_interfaces_generator_output/tmp
+
+# Restore the original copy of `AndroidGlobalLintChecker.jar` and delete the copy.
+cp $ANDROID_BUILD_TOP/out/soong/exempt_aidl_interfaces_generator_output/AndroidGlobalLintChecker.jar \
+ $ANDROID_BUILD_TOP/prebuilts/cmdline-tools/AndroidGlobalLintChecker.jar
+rm $ANDROID_BUILD_TOP/out/soong/exempt_aidl_interfaces_generator_output/AndroidGlobalLintChecker.jar
diff --git a/tools/protologtool/src/com/android/protolog/tool/ViewerConfigProtoBuilder.kt b/tools/protologtool/src/com/android/protolog/tool/ViewerConfigProtoBuilder.kt
index 0115339..245e802 100644
--- a/tools/protologtool/src/com/android/protolog/tool/ViewerConfigProtoBuilder.kt
+++ b/tools/protologtool/src/com/android/protolog/tool/ViewerConfigProtoBuilder.kt
@@ -53,7 +53,7 @@
.setMessageId(key)
.setMessage(log.messageString)
.setLevel(
- ProtoLogLevel.forNumber(log.logLevel.ordinal + 1))
+ ProtoLogLevel.forNumber(log.logLevel.id))
.setGroupId(groupId)
.setLocation(log.position)
)
diff --git a/wifi/tests/Android.bp b/wifi/tests/Android.bp
index 1d3e4bd..74a6be9 100644
--- a/wifi/tests/Android.bp
+++ b/wifi/tests/Android.bp
@@ -44,8 +44,8 @@
],
libs: [
- "android.test.runner",
- "android.test.base",
+ "android.test.runner.stubs",
+ "android.test.base.stubs",
],
// Required by Extended Mockito