Merge "Initialize StatusBar unfold animation with 1f progress" into tm-dev
diff --git a/TEST_MAPPING b/TEST_MAPPING
index b43eb7e..e178583 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -17,6 +17,14 @@
],
"presubmit": [
{
+ "name": "ManagedProvisioningTests",
+ "options": [
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ }
+ ]
+ },
+ {
"file_patterns": [
"ApexManager\\.java",
"SystemServer\\.java",
diff --git a/apct-tests/perftests/blobstore/src/com/android/perftests/blob/BlobStorePerfTests.java b/apct-tests/perftests/blobstore/src/com/android/perftests/blob/BlobStorePerfTests.java
index 665e986..3781b6d 100644
--- a/apct-tests/perftests/blobstore/src/com/android/perftests/blob/BlobStorePerfTests.java
+++ b/apct-tests/perftests/blobstore/src/com/android/perftests/blob/BlobStorePerfTests.java
@@ -95,9 +95,9 @@
}
@After
- public void tearDown() {
+ public void tearDown() throws Exception {
mContext.getFilesDir().delete();
- runShellCommand("cmd package clear " + mContext.getPackageName());
+ mBlobStoreManager.releaseAllLeases();
runShellCommand("cmd blob_store idle-maintenance");
}
diff --git a/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java
new file mode 100644
index 0000000..e0c12dd
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.math.BigInteger;
+
+/**
+ * Tries to measure important BigInteger operations across a variety of BigInteger sizes. Note that
+ * BigInteger implementations commonly need to use wildly different algorithms for different sizes,
+ * so relative performance may change substantially depending on the size of the integer. This is
+ * not structured as a proper benchmark; just run main(), e.g. with vogar
+ * libcore/benchmarks/src/benchmarks/BigIntegerBenchmark.java.
+ */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class BigIntegerPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ // A simple sum of products computation, mostly so we can check timing in the
+ // absence of any division. Computes the sum from 1 to n of ((10^prec) << 30) + 1)^2,
+ // repeating the multiplication, but not addition of 1, each time through the loop.
+ // Check the last few bits of the result as we go. Assumes n < 2^30.
+ // Note that we're actually squaring values in computing the product.
+ // That affects the algorithm used by some implementations.
+ private static void inner(int n, int prec) {
+ BigInteger big = BigInteger.TEN.pow(prec).shiftLeft(30).add(BigInteger.ONE);
+ BigInteger sum = BigInteger.ZERO;
+ for (int i = 0; i < n; ++i) {
+ sum = sum.add(big.multiply(big));
+ }
+ if (sum.and(BigInteger.valueOf(0x3fffffff)).intValue() != n) {
+ throw new AssertionError(
+ "inner() got " + sum.and(BigInteger.valueOf(0x3fffffff)) + " instead of " + n);
+ }
+ }
+
+ // Execute the above rep times, optionally timing it.
+ @Test
+ public void repeatInner() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 10; i <= 10_000; i *= 10) {
+ inner(100, i);
+ }
+ }
+ }
+
+ // Approximate the sum of the first 1000 terms of the harmonic series (sum of 1/m as m
+ // goes from 1 to n) to about prec digits. The result has an implicit decimal point
+ // prec digits from the right.
+ private static BigInteger harmonic1000(int prec) {
+ BigInteger scaledOne = BigInteger.TEN.pow(prec);
+ BigInteger sum = BigInteger.ZERO;
+ for (int i = 1; i <= 1000; ++i) {
+ sum = sum.add(scaledOne.divide(BigInteger.valueOf(i)));
+ }
+ return sum;
+ }
+
+ // Execute the above rep times, optionally timing it.
+ // Check results for equality, and print one, to compaare against reference.
+ @Test
+ public void repeatHarmonic1000() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 5; i <= 5_000; i *= 10) {
+ BigInteger refRes = harmonic1000(i);
+ BigInteger newRes = harmonic1000(i);
+ if (!newRes.equals(refRes)) {
+ throw new AssertionError(newRes + " != " + refRes);
+ }
+ if (i >= 50
+ && !refRes.toString()
+ .startsWith("748547086055034491265651820433390017652167916970")) {
+ throw new AssertionError("harmanic(" + i + ") incorrectly produced " + refRes);
+ }
+ }
+ }
+ }
+
+ // Repeatedly execute just the base conversion from the last test, allowing
+ // us to time and check it for consistency as well.
+ @Test
+ public void repeatToString() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 5; i <= 5_000; i *= 10) {
+ BigInteger refRes = harmonic1000(i);
+ String refString = refRes.toString();
+ // Disguise refRes to avoid compiler optimization issues.
+ BigInteger newRes = refRes.shiftLeft(30).add(BigInteger.valueOf(i)).shiftRight(30);
+ // The time-consuming part:
+ String newString = newRes.toString();
+ }
+ }
+ }
+
+ // Compute base^exp, where base and result are scaled/multiplied by scaleBy to make them
+ // integers. exp >= 0 .
+ private static BigInteger myPow(BigInteger base, int exp, BigInteger scaleBy) {
+ if (exp == 0) {
+ return scaleBy; // Return one.
+ } else if ((exp & 1) != 0) {
+ BigInteger tmp = myPow(base, exp - 1, scaleBy);
+ return tmp.multiply(base).divide(scaleBy);
+ } else {
+ BigInteger tmp = myPow(base, exp / 2, scaleBy);
+ return tmp.multiply(tmp).divide(scaleBy);
+ }
+ }
+
+ // Approximate e by computing (1 + 1/n)^n to prec decimal digits.
+ // This isn't necessarily a very good approximation to e.
+ // Return the result, scaled by 10^prec.
+ private static BigInteger eApprox(int n, int prec) {
+ BigInteger scaledOne = BigInteger.TEN.pow(prec);
+ BigInteger base = scaledOne.add(scaledOne.divide(BigInteger.valueOf(n)));
+ return myPow(base, n, scaledOne);
+ }
+
+ // Repeatedly execute and check the above, printing one of the results
+ // to compare to reference.
+ @Test
+ public void repeatEApprox() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 10; i <= 10_000; i *= 10) {
+ BigInteger refRes = eApprox(100_000, i);
+ BigInteger newRes = eApprox(100_000, i);
+ if (!newRes.equals(refRes)) {
+ throw new AssertionError(newRes + " != " + refRes);
+ }
+ if (i >= 10 && !refRes.toString().startsWith("271826")) {
+ throw new AssertionError(
+ "eApprox(" + 100_000 + "," + i + ") incorrectly produced " + refRes);
+ }
+ }
+ }
+ }
+
+ // Test / time modPow()
+ @Test
+ public void repeatModPow() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 5; i <= 500; i *= 10) {
+ BigInteger odd1 = BigInteger.TEN.pow(i / 2).add(BigInteger.ONE);
+ BigInteger odd2 = BigInteger.TEN.pow(i / 2).add(BigInteger.valueOf(17));
+ BigInteger product = odd1.multiply(odd2);
+ BigInteger exponent = BigInteger.TEN.pow(i / 2 - 1);
+ BigInteger base = BigInteger.TEN.pow(i / 4);
+ BigInteger newRes = base.modPow(exponent, product);
+ if (!newRes.mod(odd1).equals(base.modPow(exponent, odd1))) {
+ throw new AssertionError(
+ "ModPow() result incorrect mod odd1:"
+ + odd1
+ + "; lastRes.mod(odd1)="
+ + newRes.mod(odd1)
+ + " vs. "
+ + "base.modPow(exponent, odd1)="
+ + base.modPow(exponent, odd1)
+ + " base="
+ + base
+ + " exponent="
+ + exponent);
+ }
+ if (!newRes.mod(odd2).equals(base.modPow(exponent, odd2))) {
+ throw new AssertionError("ModPow() result incorrect mod odd2");
+ }
+ }
+ }
+ }
+
+ // Test / time modInverse()
+ @Test
+ public void repeatModInverse() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 10; i <= 10_000; i *= 10) {
+ BigInteger odd1 = BigInteger.TEN.pow(i / 2).add(BigInteger.ONE);
+ BigInteger odd2 = BigInteger.TEN.pow(i / 2).add(BigInteger.valueOf(17));
+ BigInteger product = odd1.multiply(odd2);
+ BigInteger arg = BigInteger.ONE.shiftLeft(i / 4);
+ BigInteger lastRes = null;
+ BigInteger newRes = arg.modInverse(product);
+ lastRes = newRes;
+ if (!lastRes.mod(odd1).equals(arg.modInverse(odd1))) {
+ throw new AssertionError("ModInverse() result incorrect mod odd1");
+ }
+ if (!lastRes.mod(odd2).equals(arg.modInverse(odd2))) {
+ throw new AssertionError("ModInverse() result incorrect mod odd2");
+ }
+ }
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java
new file mode 100644
index 0000000..04ef09e4
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.util.Random;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public final class BufferedZipFilePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ int[] mReadSize = new int[] {4, 32, 128};
+ int[] mCompressedSize = new int[] {128, 1024, 8192, 65536};
+ private File mFile;
+
+ @Before
+ public void setUp() throws Exception {
+ mFile = File.createTempFile("BufferedZipFilePerfTest", ".zip");
+ mFile.deleteOnExit();
+ Random random = new Random(0);
+ ZipOutputStream out = new ZipOutputStream(new FileOutputStream(mFile));
+ for (int i = 0; i < mCompressedSize.length; i++) {
+ byte[] data = new byte[8192];
+ out.putNextEntry(new ZipEntry("entry.data" + mCompressedSize[i]));
+ int written = 0;
+ while (written < mCompressedSize[i]) {
+ random.nextBytes(data);
+ int toWrite = Math.min(mCompressedSize[i] - written, data.length);
+ out.write(data, 0, toWrite);
+ written += toWrite;
+ }
+ }
+ out.close();
+ }
+
+ @Test
+ public void timeUnbufferedRead() throws Exception {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 0; i < mCompressedSize.length; i++) {
+ for (int j = 0; j < mReadSize.length; j++) {
+ ZipFile zipFile = new ZipFile(mFile);
+ ZipEntry entry = zipFile.getEntry("entry.data" + mCompressedSize[i]);
+ InputStream in = zipFile.getInputStream(entry);
+ byte[] buffer = new byte[mReadSize[j]];
+ while (in.read(buffer) != -1) {
+ // Keep reading
+ }
+ in.close();
+ zipFile.close();
+ }
+ }
+ }
+ }
+
+ @Test
+ public void timeBufferedRead() throws Exception {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ for (int i = 0; i < mCompressedSize.length; i++) {
+ for (int j = 0; j < mReadSize.length; j++) {
+ ZipFile zipFile = new ZipFile(mFile);
+ ZipEntry entry = zipFile.getEntry("entry.data" + mCompressedSize[i]);
+ InputStream in = new BufferedInputStream(zipFile.getInputStream(entry));
+ byte[] buffer = new byte[mReadSize[j]];
+ while (in.read(buffer) != -1) {
+ // Keep reading
+ }
+ in.close();
+ zipFile.close();
+ }
+ }
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java
new file mode 100644
index 0000000..4ae88b8
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class ClassLoaderResourcePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ private static final String EXISTENT_RESOURCE = "java/util/logging/logging.properties";
+ private static final String MISSING_RESOURCE = "missing_entry";
+
+ @Test
+ public void timeGetBootResource_hit() {
+ ClassLoader currentClassLoader = getClass().getClassLoader();
+ Assert.assertNotNull(currentClassLoader.getResource(EXISTENT_RESOURCE));
+
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ currentClassLoader.getResource(EXISTENT_RESOURCE);
+ }
+ }
+
+ @Test
+ public void timeGetBootResource_miss() {
+ ClassLoader currentClassLoader = getClass().getClassLoader();
+ Assert.assertNull(currentClassLoader.getResource(MISSING_RESOURCE));
+
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ currentClassLoader.getResource(MISSING_RESOURCE);
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java
new file mode 100644
index 0000000..5e73916
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java
@@ -0,0 +1,1197 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class ClonePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ static class CloneableObject implements Cloneable {
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+ }
+
+ static class CloneableManyFieldObject implements Cloneable {
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ Object mO1 = new Object();
+ Object mO2 = new Object();
+ Object mO3 = new Object();
+ Object mO4 = new Object();
+ Object mO5 = new Object();
+ Object mO6 = new Object();
+ Object mO7 = new Object();
+ Object mO8 = new Object();
+ Object mO9 = new Object();
+ Object mO10 = new Object();
+ Object mO11 = new Object();
+ Object mO12 = new Object();
+ Object mO13 = new Object();
+ Object mO14 = new Object();
+ Object mO15 = new Object();
+ Object mO16 = new Object();
+ Object mO17 = new Object();
+ Object mO18 = new Object();
+ Object mO19 = new Object();
+ Object mO20 = new Object();
+ Object mO21 = new Object();
+ Object mO22 = new Object();
+ Object mO23 = new Object();
+ Object mO24 = new Object();
+ Object mO25 = new Object();
+ Object mO26 = new Object();
+ Object mO27 = new Object();
+ Object mO28 = new Object();
+ Object mO29 = new Object();
+ Object mO30 = new Object();
+ Object mO31 = new Object();
+ Object mO32 = new Object();
+ Object mO33 = new Object();
+ Object mO34 = new Object();
+ Object mO35 = new Object();
+ Object mO36 = new Object();
+ Object mO37 = new Object();
+ Object mO38 = new Object();
+ Object mO39 = new Object();
+ Object mO40 = new Object();
+ Object mO41 = new Object();
+ Object mO42 = new Object();
+ Object mO43 = new Object();
+ Object mO44 = new Object();
+ Object mO45 = new Object();
+ Object mO46 = new Object();
+ Object mO47 = new Object();
+ Object mO48 = new Object();
+ Object mO49 = new Object();
+ Object mO50 = new Object();
+ Object mO51 = new Object();
+ Object mO52 = new Object();
+ Object mO53 = new Object();
+ Object mO54 = new Object();
+ Object mO55 = new Object();
+ Object mO56 = new Object();
+ Object mO57 = new Object();
+ Object mO58 = new Object();
+ Object mO59 = new Object();
+ Object mO60 = new Object();
+ Object mO61 = new Object();
+ Object mO62 = new Object();
+ Object mO63 = new Object();
+ Object mO64 = new Object();
+ Object mO65 = new Object();
+ Object mO66 = new Object();
+ Object mO67 = new Object();
+ Object mO68 = new Object();
+ Object mO69 = new Object();
+ Object mO70 = new Object();
+ Object mO71 = new Object();
+ Object mO72 = new Object();
+ Object mO73 = new Object();
+ Object mO74 = new Object();
+ Object mO75 = new Object();
+ Object mO76 = new Object();
+ Object mO77 = new Object();
+ Object mO78 = new Object();
+ Object mO79 = new Object();
+ Object mO80 = new Object();
+ Object mO81 = new Object();
+ Object mO82 = new Object();
+ Object mO83 = new Object();
+ Object mO84 = new Object();
+ Object mO85 = new Object();
+ Object mO86 = new Object();
+ Object mO87 = new Object();
+ Object mO88 = new Object();
+ Object mO89 = new Object();
+ Object mO90 = new Object();
+ Object mO91 = new Object();
+ Object mO92 = new Object();
+ Object mO93 = new Object();
+ Object mO94 = new Object();
+ Object mO95 = new Object();
+ Object mO96 = new Object();
+ Object mO97 = new Object();
+ Object mO98 = new Object();
+ Object mO99 = new Object();
+ Object mO100 = new Object();
+ Object mO101 = new Object();
+ Object mO102 = new Object();
+ Object mO103 = new Object();
+ Object mO104 = new Object();
+ Object mO105 = new Object();
+ Object mO106 = new Object();
+ Object mO107 = new Object();
+ Object mO108 = new Object();
+ Object mO109 = new Object();
+ Object mO110 = new Object();
+ Object mO111 = new Object();
+ Object mO112 = new Object();
+ Object mO113 = new Object();
+ Object mO114 = new Object();
+ Object mO115 = new Object();
+ Object mO116 = new Object();
+ Object mO117 = new Object();
+ Object mO118 = new Object();
+ Object mO119 = new Object();
+ Object mO120 = new Object();
+ Object mO121 = new Object();
+ Object mO122 = new Object();
+ Object mO123 = new Object();
+ Object mO124 = new Object();
+ Object mO125 = new Object();
+ Object mO126 = new Object();
+ Object mO127 = new Object();
+ Object mO128 = new Object();
+ Object mO129 = new Object();
+ Object mO130 = new Object();
+ Object mO131 = new Object();
+ Object mO132 = new Object();
+ Object mO133 = new Object();
+ Object mO134 = new Object();
+ Object mO135 = new Object();
+ Object mO136 = new Object();
+ Object mO137 = new Object();
+ Object mO138 = new Object();
+ Object mO139 = new Object();
+ Object mO140 = new Object();
+ Object mO141 = new Object();
+ Object mO142 = new Object();
+ Object mO143 = new Object();
+ Object mO144 = new Object();
+ Object mO145 = new Object();
+ Object mO146 = new Object();
+ Object mO147 = new Object();
+ Object mO148 = new Object();
+ Object mO149 = new Object();
+ Object mO150 = new Object();
+ Object mO151 = new Object();
+ Object mO152 = new Object();
+ Object mO153 = new Object();
+ Object mO154 = new Object();
+ Object mO155 = new Object();
+ Object mO156 = new Object();
+ Object mO157 = new Object();
+ Object mO158 = new Object();
+ Object mO159 = new Object();
+ Object mO160 = new Object();
+ Object mO161 = new Object();
+ Object mO162 = new Object();
+ Object mO163 = new Object();
+ Object mO164 = new Object();
+ Object mO165 = new Object();
+ Object mO166 = new Object();
+ Object mO167 = new Object();
+ Object mO168 = new Object();
+ Object mO169 = new Object();
+ Object mO170 = new Object();
+ Object mO171 = new Object();
+ Object mO172 = new Object();
+ Object mO173 = new Object();
+ Object mO174 = new Object();
+ Object mO175 = new Object();
+ Object mO176 = new Object();
+ Object mO177 = new Object();
+ Object mO178 = new Object();
+ Object mO179 = new Object();
+ Object mO180 = new Object();
+ Object mO181 = new Object();
+ Object mO182 = new Object();
+ Object mO183 = new Object();
+ Object mO184 = new Object();
+ Object mO185 = new Object();
+ Object mO186 = new Object();
+ Object mO187 = new Object();
+ Object mO188 = new Object();
+ Object mO189 = new Object();
+ Object mO190 = new Object();
+ Object mO191 = new Object();
+ Object mO192 = new Object();
+ Object mO193 = new Object();
+ Object mO194 = new Object();
+ Object mO195 = new Object();
+ Object mO196 = new Object();
+ Object mO197 = new Object();
+ Object mO198 = new Object();
+ Object mO199 = new Object();
+ Object mO200 = new Object();
+ Object mO201 = new Object();
+ Object mO202 = new Object();
+ Object mO203 = new Object();
+ Object mO204 = new Object();
+ Object mO205 = new Object();
+ Object mO206 = new Object();
+ Object mO207 = new Object();
+ Object mO208 = new Object();
+ Object mO209 = new Object();
+ Object mO210 = new Object();
+ Object mO211 = new Object();
+ Object mO212 = new Object();
+ Object mO213 = new Object();
+ Object mO214 = new Object();
+ Object mO215 = new Object();
+ Object mO216 = new Object();
+ Object mO217 = new Object();
+ Object mO218 = new Object();
+ Object mO219 = new Object();
+ Object mO220 = new Object();
+ Object mO221 = new Object();
+ Object mO222 = new Object();
+ Object mO223 = new Object();
+ Object mO224 = new Object();
+ Object mO225 = new Object();
+ Object mO226 = new Object();
+ Object mO227 = new Object();
+ Object mO228 = new Object();
+ Object mO229 = new Object();
+ Object mO230 = new Object();
+ Object mO231 = new Object();
+ Object mO232 = new Object();
+ Object mO233 = new Object();
+ Object mO234 = new Object();
+ Object mO235 = new Object();
+ Object mO236 = new Object();
+ Object mO237 = new Object();
+ Object mO238 = new Object();
+ Object mO239 = new Object();
+ Object mO240 = new Object();
+ Object mO241 = new Object();
+ Object mO242 = new Object();
+ Object mO243 = new Object();
+ Object mO244 = new Object();
+ Object mO245 = new Object();
+ Object mO246 = new Object();
+ Object mO247 = new Object();
+ Object mO248 = new Object();
+ Object mO249 = new Object();
+ Object mO250 = new Object();
+ Object mO251 = new Object();
+ Object mO252 = new Object();
+ Object mO253 = new Object();
+ Object mO254 = new Object();
+ Object mO255 = new Object();
+ Object mO256 = new Object();
+ Object mO257 = new Object();
+ Object mO258 = new Object();
+ Object mO259 = new Object();
+ Object mO260 = new Object();
+ Object mO261 = new Object();
+ Object mO262 = new Object();
+ Object mO263 = new Object();
+ Object mO264 = new Object();
+ Object mO265 = new Object();
+ Object mO266 = new Object();
+ Object mO267 = new Object();
+ Object mO268 = new Object();
+ Object mO269 = new Object();
+ Object mO270 = new Object();
+ Object mO271 = new Object();
+ Object mO272 = new Object();
+ Object mO273 = new Object();
+ Object mO274 = new Object();
+ Object mO275 = new Object();
+ Object mO276 = new Object();
+ Object mO277 = new Object();
+ Object mO278 = new Object();
+ Object mO279 = new Object();
+ Object mO280 = new Object();
+ Object mO281 = new Object();
+ Object mO282 = new Object();
+ Object mO283 = new Object();
+ Object mO284 = new Object();
+ Object mO285 = new Object();
+ Object mO286 = new Object();
+ Object mO287 = new Object();
+ Object mO288 = new Object();
+ Object mO289 = new Object();
+ Object mO290 = new Object();
+ Object mO291 = new Object();
+ Object mO292 = new Object();
+ Object mO293 = new Object();
+ Object mO294 = new Object();
+ Object mO295 = new Object();
+ Object mO296 = new Object();
+ Object mO297 = new Object();
+ Object mO298 = new Object();
+ Object mO299 = new Object();
+ Object mO300 = new Object();
+ Object mO301 = new Object();
+ Object mO302 = new Object();
+ Object mO303 = new Object();
+ Object mO304 = new Object();
+ Object mO305 = new Object();
+ Object mO306 = new Object();
+ Object mO307 = new Object();
+ Object mO308 = new Object();
+ Object mO309 = new Object();
+ Object mO310 = new Object();
+ Object mO311 = new Object();
+ Object mO312 = new Object();
+ Object mO313 = new Object();
+ Object mO314 = new Object();
+ Object mO315 = new Object();
+ Object mO316 = new Object();
+ Object mO317 = new Object();
+ Object mO318 = new Object();
+ Object mO319 = new Object();
+ Object mO320 = new Object();
+ Object mO321 = new Object();
+ Object mO322 = new Object();
+ Object mO323 = new Object();
+ Object mO324 = new Object();
+ Object mO325 = new Object();
+ Object mO326 = new Object();
+ Object mO327 = new Object();
+ Object mO328 = new Object();
+ Object mO329 = new Object();
+ Object mO330 = new Object();
+ Object mO331 = new Object();
+ Object mO332 = new Object();
+ Object mO333 = new Object();
+ Object mO334 = new Object();
+ Object mO335 = new Object();
+ Object mO336 = new Object();
+ Object mO337 = new Object();
+ Object mO338 = new Object();
+ Object mO339 = new Object();
+ Object mO340 = new Object();
+ Object mO341 = new Object();
+ Object mO342 = new Object();
+ Object mO343 = new Object();
+ Object mO344 = new Object();
+ Object mO345 = new Object();
+ Object mO346 = new Object();
+ Object mO347 = new Object();
+ Object mO348 = new Object();
+ Object mO349 = new Object();
+ Object mO350 = new Object();
+ Object mO351 = new Object();
+ Object mO352 = new Object();
+ Object mO353 = new Object();
+ Object mO354 = new Object();
+ Object mO355 = new Object();
+ Object mO356 = new Object();
+ Object mO357 = new Object();
+ Object mO358 = new Object();
+ Object mO359 = new Object();
+ Object mO360 = new Object();
+ Object mO361 = new Object();
+ Object mO362 = new Object();
+ Object mO363 = new Object();
+ Object mO364 = new Object();
+ Object mO365 = new Object();
+ Object mO366 = new Object();
+ Object mO367 = new Object();
+ Object mO368 = new Object();
+ Object mO369 = new Object();
+ Object mO370 = new Object();
+ Object mO371 = new Object();
+ Object mO372 = new Object();
+ Object mO373 = new Object();
+ Object mO374 = new Object();
+ Object mO375 = new Object();
+ Object mO376 = new Object();
+ Object mO377 = new Object();
+ Object mO378 = new Object();
+ Object mO379 = new Object();
+ Object mO380 = new Object();
+ Object mO381 = new Object();
+ Object mO382 = new Object();
+ Object mO383 = new Object();
+ Object mO384 = new Object();
+ Object mO385 = new Object();
+ Object mO386 = new Object();
+ Object mO387 = new Object();
+ Object mO388 = new Object();
+ Object mO389 = new Object();
+ Object mO390 = new Object();
+ Object mO391 = new Object();
+ Object mO392 = new Object();
+ Object mO393 = new Object();
+ Object mO394 = new Object();
+ Object mO395 = new Object();
+ Object mO396 = new Object();
+ Object mO397 = new Object();
+ Object mO398 = new Object();
+ Object mO399 = new Object();
+ Object mO400 = new Object();
+ Object mO401 = new Object();
+ Object mO402 = new Object();
+ Object mO403 = new Object();
+ Object mO404 = new Object();
+ Object mO405 = new Object();
+ Object mO406 = new Object();
+ Object mO407 = new Object();
+ Object mO408 = new Object();
+ Object mO409 = new Object();
+ Object mO410 = new Object();
+ Object mO411 = new Object();
+ Object mO412 = new Object();
+ Object mO413 = new Object();
+ Object mO414 = new Object();
+ Object mO415 = new Object();
+ Object mO416 = new Object();
+ Object mO417 = new Object();
+ Object mO418 = new Object();
+ Object mO419 = new Object();
+ Object mO420 = new Object();
+ Object mO421 = new Object();
+ Object mO422 = new Object();
+ Object mO423 = new Object();
+ Object mO424 = new Object();
+ Object mO425 = new Object();
+ Object mO426 = new Object();
+ Object mO427 = new Object();
+ Object mO428 = new Object();
+ Object mO429 = new Object();
+ Object mO430 = new Object();
+ Object mO431 = new Object();
+ Object mO432 = new Object();
+ Object mO433 = new Object();
+ Object mO434 = new Object();
+ Object mO435 = new Object();
+ Object mO436 = new Object();
+ Object mO437 = new Object();
+ Object mO438 = new Object();
+ Object mO439 = new Object();
+ Object mO440 = new Object();
+ Object mO441 = new Object();
+ Object mO442 = new Object();
+ Object mO460 = new Object();
+ Object mO461 = new Object();
+ Object mO462 = new Object();
+ Object mO463 = new Object();
+ Object mO464 = new Object();
+ Object mO465 = new Object();
+ Object mO466 = new Object();
+ Object mO467 = new Object();
+ Object mO468 = new Object();
+ Object mO469 = new Object();
+ Object mO470 = new Object();
+ Object mO471 = new Object();
+ Object mO472 = new Object();
+ Object mO473 = new Object();
+ Object mO474 = new Object();
+ Object mO475 = new Object();
+ Object mO476 = new Object();
+ Object mO477 = new Object();
+ Object mO478 = new Object();
+ Object mO479 = new Object();
+ Object mO480 = new Object();
+ Object mO481 = new Object();
+ Object mO482 = new Object();
+ Object mO483 = new Object();
+ Object mO484 = new Object();
+ Object mO485 = new Object();
+ Object mO486 = new Object();
+ Object mO487 = new Object();
+ Object mO488 = new Object();
+ Object mO489 = new Object();
+ Object mO490 = new Object();
+ Object mO491 = new Object();
+ Object mO492 = new Object();
+ Object mO493 = new Object();
+ Object mO494 = new Object();
+ Object mO495 = new Object();
+ Object mO496 = new Object();
+ Object mO497 = new Object();
+ Object mO498 = new Object();
+ Object mO499 = new Object();
+ Object mO500 = new Object();
+ Object mO501 = new Object();
+ Object mO502 = new Object();
+ Object mO503 = new Object();
+ Object mO504 = new Object();
+ Object mO505 = new Object();
+ Object mO506 = new Object();
+ Object mO507 = new Object();
+ Object mO508 = new Object();
+ Object mO509 = new Object();
+ Object mO510 = new Object();
+ Object mO511 = new Object();
+ Object mO512 = new Object();
+ Object mO513 = new Object();
+ Object mO514 = new Object();
+ Object mO515 = new Object();
+ Object mO516 = new Object();
+ Object mO517 = new Object();
+ Object mO518 = new Object();
+ Object mO519 = new Object();
+ Object mO520 = new Object();
+ Object mO521 = new Object();
+ Object mO522 = new Object();
+ Object mO523 = new Object();
+ Object mO556 = new Object();
+ Object mO557 = new Object();
+ Object mO558 = new Object();
+ Object mO559 = new Object();
+ Object mO560 = new Object();
+ Object mO561 = new Object();
+ Object mO562 = new Object();
+ Object mO563 = new Object();
+ Object mO564 = new Object();
+ Object mO565 = new Object();
+ Object mO566 = new Object();
+ Object mO567 = new Object();
+ Object mO568 = new Object();
+ Object mO569 = new Object();
+ Object mO570 = new Object();
+ Object mO571 = new Object();
+ Object mO572 = new Object();
+ Object mO573 = new Object();
+ Object mO574 = new Object();
+ Object mO575 = new Object();
+ Object mO576 = new Object();
+ Object mO577 = new Object();
+ Object mO578 = new Object();
+ Object mO579 = new Object();
+ Object mO580 = new Object();
+ Object mO581 = new Object();
+ Object mO582 = new Object();
+ Object mO583 = new Object();
+ Object mO584 = new Object();
+ Object mO585 = new Object();
+ Object mO586 = new Object();
+ Object mO587 = new Object();
+ Object mO588 = new Object();
+ Object mO589 = new Object();
+ Object mO590 = new Object();
+ Object mO591 = new Object();
+ Object mO592 = new Object();
+ Object mO593 = new Object();
+ Object mO594 = new Object();
+ Object mO595 = new Object();
+ Object mO596 = new Object();
+ Object mO597 = new Object();
+ Object mO598 = new Object();
+ Object mO599 = new Object();
+ Object mO600 = new Object();
+ Object mO601 = new Object();
+ Object mO602 = new Object();
+ Object mO603 = new Object();
+ Object mO604 = new Object();
+ Object mO605 = new Object();
+ Object mO606 = new Object();
+ Object mO607 = new Object();
+ Object mO608 = new Object();
+ Object mO609 = new Object();
+ Object mO610 = new Object();
+ Object mO611 = new Object();
+ Object mO612 = new Object();
+ Object mO613 = new Object();
+ Object mO614 = new Object();
+ Object mO615 = new Object();
+ Object mO616 = new Object();
+ Object mO617 = new Object();
+ Object mO618 = new Object();
+ Object mO619 = new Object();
+ Object mO620 = new Object();
+ Object mO621 = new Object();
+ Object mO622 = new Object();
+ Object mO623 = new Object();
+ Object mO624 = new Object();
+ Object mO625 = new Object();
+ Object mO626 = new Object();
+ Object mO627 = new Object();
+ Object mO628 = new Object();
+ Object mO629 = new Object();
+ Object mO630 = new Object();
+ Object mO631 = new Object();
+ Object mO632 = new Object();
+ Object mO633 = new Object();
+ Object mO634 = new Object();
+ Object mO635 = new Object();
+ Object mO636 = new Object();
+ Object mO637 = new Object();
+ Object mO638 = new Object();
+ Object mO639 = new Object();
+ Object mO640 = new Object();
+ Object mO641 = new Object();
+ Object mO642 = new Object();
+ Object mO643 = new Object();
+ Object mO644 = new Object();
+ Object mO645 = new Object();
+ Object mO646 = new Object();
+ Object mO647 = new Object();
+ Object mO648 = new Object();
+ Object mO649 = new Object();
+ Object mO650 = new Object();
+ Object mO651 = new Object();
+ Object mO652 = new Object();
+ Object mO653 = new Object();
+ Object mO654 = new Object();
+ Object mO655 = new Object();
+ Object mO656 = new Object();
+ Object mO657 = new Object();
+ Object mO658 = new Object();
+ Object mO659 = new Object();
+ Object mO660 = new Object();
+ Object mO661 = new Object();
+ Object mO662 = new Object();
+ Object mO663 = new Object();
+ Object mO664 = new Object();
+ Object mO665 = new Object();
+ Object mO666 = new Object();
+ Object mO667 = new Object();
+ Object mO668 = new Object();
+ Object mO669 = new Object();
+ Object mO670 = new Object();
+ Object mO671 = new Object();
+ Object mO672 = new Object();
+ Object mO673 = new Object();
+ Object mO674 = new Object();
+ Object mO675 = new Object();
+ Object mO676 = new Object();
+ Object mO677 = new Object();
+ Object mO678 = new Object();
+ Object mO679 = new Object();
+ Object mO680 = new Object();
+ Object mO681 = new Object();
+ Object mO682 = new Object();
+ Object mO683 = new Object();
+ Object mO684 = new Object();
+ Object mO685 = new Object();
+ Object mO686 = new Object();
+ Object mO687 = new Object();
+ Object mO688 = new Object();
+ Object mO734 = new Object();
+ Object mO735 = new Object();
+ Object mO736 = new Object();
+ Object mO737 = new Object();
+ Object mO738 = new Object();
+ Object mO739 = new Object();
+ Object mO740 = new Object();
+ Object mO741 = new Object();
+ Object mO742 = new Object();
+ Object mO743 = new Object();
+ Object mO744 = new Object();
+ Object mO745 = new Object();
+ Object mO746 = new Object();
+ Object mO747 = new Object();
+ Object mO748 = new Object();
+ Object mO749 = new Object();
+ Object mO750 = new Object();
+ Object mO751 = new Object();
+ Object mO752 = new Object();
+ Object mO753 = new Object();
+ Object mO754 = new Object();
+ Object mO755 = new Object();
+ Object mO756 = new Object();
+ Object mO757 = new Object();
+ Object mO758 = new Object();
+ Object mO759 = new Object();
+ Object mO760 = new Object();
+ Object mO761 = new Object();
+ Object mO762 = new Object();
+ Object mO763 = new Object();
+ Object mO764 = new Object();
+ Object mO765 = new Object();
+ Object mO766 = new Object();
+ Object mO767 = new Object();
+ Object mO768 = new Object();
+ Object mO769 = new Object();
+ Object mO770 = new Object();
+ Object mO771 = new Object();
+ Object mO772 = new Object();
+ Object mO773 = new Object();
+ Object mO774 = new Object();
+ Object mO775 = new Object();
+ Object mO776 = new Object();
+ Object mO777 = new Object();
+ Object mO778 = new Object();
+ Object mO779 = new Object();
+ Object mO780 = new Object();
+ Object mO781 = new Object();
+ Object mO782 = new Object();
+ Object mO783 = new Object();
+ Object mO784 = new Object();
+ Object mO785 = new Object();
+ Object mO786 = new Object();
+ Object mO787 = new Object();
+ Object mO788 = new Object();
+ Object mO789 = new Object();
+ Object mO790 = new Object();
+ Object mO791 = new Object();
+ Object mO792 = new Object();
+ Object mO793 = new Object();
+ Object mO794 = new Object();
+ Object mO795 = new Object();
+ Object mO796 = new Object();
+ Object mO797 = new Object();
+ Object mO798 = new Object();
+ Object mO799 = new Object();
+ Object mO800 = new Object();
+ Object mO801 = new Object();
+ Object mO802 = new Object();
+ Object mO803 = new Object();
+ Object mO804 = new Object();
+ Object mO805 = new Object();
+ Object mO806 = new Object();
+ Object mO807 = new Object();
+ Object mO808 = new Object();
+ Object mO809 = new Object();
+ Object mO810 = new Object();
+ Object mO811 = new Object();
+ Object mO812 = new Object();
+ Object mO813 = new Object();
+ Object mO848 = new Object();
+ Object mO849 = new Object();
+ Object mO850 = new Object();
+ Object mO851 = new Object();
+ Object mO852 = new Object();
+ Object mO853 = new Object();
+ Object mO854 = new Object();
+ Object mO855 = new Object();
+ Object mO856 = new Object();
+ Object mO857 = new Object();
+ Object mO858 = new Object();
+ Object mO859 = new Object();
+ Object mO860 = new Object();
+ Object mO861 = new Object();
+ Object mO862 = new Object();
+ Object mO863 = new Object();
+ Object mO864 = new Object();
+ Object mO865 = new Object();
+ Object mO866 = new Object();
+ Object mO867 = new Object();
+ Object mO868 = new Object();
+ Object mO869 = new Object();
+ Object mO870 = new Object();
+ Object mO871 = new Object();
+ Object mO872 = new Object();
+ Object mO873 = new Object();
+ Object mO874 = new Object();
+ Object mO875 = new Object();
+ Object mO876 = new Object();
+ Object mO877 = new Object();
+ Object mO878 = new Object();
+ Object mO879 = new Object();
+ Object mO880 = new Object();
+ Object mO881 = new Object();
+ Object mO882 = new Object();
+ Object mO883 = new Object();
+ Object mO884 = new Object();
+ Object mO885 = new Object();
+ Object mO886 = new Object();
+ Object mO887 = new Object();
+ Object mO888 = new Object();
+ Object mO889 = new Object();
+ Object mO890 = new Object();
+ Object mO891 = new Object();
+ Object mO892 = new Object();
+ Object mO893 = new Object();
+ Object mO894 = new Object();
+ Object mO895 = new Object();
+ Object mO896 = new Object();
+ Object mO897 = new Object();
+ Object mO898 = new Object();
+ Object mO899 = new Object();
+ Object mO900 = new Object();
+ Object mO901 = new Object();
+ Object mO902 = new Object();
+ Object mO903 = new Object();
+ Object mO904 = new Object();
+ Object mO905 = new Object();
+ Object mO906 = new Object();
+ Object mO907 = new Object();
+ Object mO908 = new Object();
+ Object mO909 = new Object();
+ Object mO910 = new Object();
+ Object mO911 = new Object();
+ Object mO912 = new Object();
+ Object mO913 = new Object();
+ Object mO914 = new Object();
+ Object mO915 = new Object();
+ Object mO916 = new Object();
+ Object mO917 = new Object();
+ Object mO918 = new Object();
+ Object mO919 = new Object();
+ Object mO920 = new Object();
+ Object mO921 = new Object();
+ Object mO922 = new Object();
+ Object mO923 = new Object();
+ Object mO924 = new Object();
+ Object mO925 = new Object();
+ Object mO926 = new Object();
+ Object mO927 = new Object();
+ Object mO928 = new Object();
+ Object mO929 = new Object();
+ Object mO930 = new Object();
+ Object mO931 = new Object();
+ Object mO932 = new Object();
+ Object mO933 = new Object();
+ Object mO934 = new Object();
+ Object mO935 = new Object();
+ Object mO936 = new Object();
+ Object mO937 = new Object();
+ Object mO938 = new Object();
+ Object mO939 = new Object();
+ Object mO940 = new Object();
+ Object mO941 = new Object();
+ Object mO942 = new Object();
+ Object mO943 = new Object();
+ Object mO944 = new Object();
+ Object mO945 = new Object();
+ Object mO946 = new Object();
+ Object mO947 = new Object();
+ Object mO948 = new Object();
+ Object mO949 = new Object();
+ Object mO950 = new Object();
+ Object mO951 = new Object();
+ Object mO952 = new Object();
+ Object mO953 = new Object();
+ Object mO954 = new Object();
+ Object mO955 = new Object();
+ Object mO956 = new Object();
+ Object mO957 = new Object();
+ Object mO958 = new Object();
+ Object mO959 = new Object();
+ Object mO960 = new Object();
+ Object mO961 = new Object();
+ Object mO962 = new Object();
+ Object mO963 = new Object();
+ Object mO964 = new Object();
+ Object mO965 = new Object();
+ Object mO966 = new Object();
+ Object mO967 = new Object();
+ Object mO968 = new Object();
+ Object mO969 = new Object();
+ Object mO970 = new Object();
+ Object mO971 = new Object();
+ Object mO972 = new Object();
+ Object mO973 = new Object();
+ Object mO974 = new Object();
+ Object mO975 = new Object();
+ Object mO976 = new Object();
+ Object mO977 = new Object();
+ Object mO978 = new Object();
+ Object mO979 = new Object();
+ Object mO980 = new Object();
+ Object mO981 = new Object();
+ Object mO982 = new Object();
+ Object mO983 = new Object();
+ Object mO984 = new Object();
+ Object mO985 = new Object();
+ Object mO986 = new Object();
+ Object mO987 = new Object();
+ Object mO988 = new Object();
+ Object mO989 = new Object();
+ Object mO990 = new Object();
+ Object mO991 = new Object();
+ Object mO992 = new Object();
+ Object mO993 = new Object();
+ Object mO994 = new Object();
+ Object mO995 = new Object();
+ Object mO996 = new Object();
+ Object mO997 = new Object();
+ Object mO998 = new Object();
+ Object mO999 = new Object();
+ }
+
+ static class Deep0 {}
+
+ static class Deep1 extends Deep0 {}
+
+ static class Deep2 extends Deep1 {}
+
+ static class Deep3 extends Deep2 {}
+
+ static class Deep4 extends Deep3 {}
+
+ static class Deep5 extends Deep4 {}
+
+ static class Deep6 extends Deep5 {}
+
+ static class Deep7 extends Deep6 {}
+
+ static class Deep8 extends Deep7 {}
+
+ static class Deep9 extends Deep8 {}
+
+ static class Deep10 extends Deep9 {}
+
+ static class Deep11 extends Deep10 {}
+
+ static class Deep12 extends Deep11 {}
+
+ static class Deep13 extends Deep12 {}
+
+ static class Deep14 extends Deep13 {}
+
+ static class Deep15 extends Deep14 {}
+
+ static class Deep16 extends Deep15 {}
+
+ static class Deep17 extends Deep16 {}
+
+ static class Deep18 extends Deep17 {}
+
+ static class Deep19 extends Deep18 {}
+
+ static class Deep20 extends Deep19 {}
+
+ static class Deep21 extends Deep20 {}
+
+ static class Deep22 extends Deep21 {}
+
+ static class Deep23 extends Deep22 {}
+
+ static class Deep24 extends Deep23 {}
+
+ static class Deep25 extends Deep24 {}
+
+ static class Deep26 extends Deep25 {}
+
+ static class Deep27 extends Deep26 {}
+
+ static class Deep28 extends Deep27 {}
+
+ static class Deep29 extends Deep28 {}
+
+ static class Deep30 extends Deep29 {}
+
+ static class Deep31 extends Deep30 {}
+
+ static class Deep32 extends Deep31 {}
+
+ static class Deep33 extends Deep32 {}
+
+ static class Deep34 extends Deep33 {}
+
+ static class Deep35 extends Deep34 {}
+
+ static class Deep36 extends Deep35 {}
+
+ static class Deep37 extends Deep36 {}
+
+ static class Deep38 extends Deep37 {}
+
+ static class Deep39 extends Deep38 {}
+
+ static class Deep40 extends Deep39 {}
+
+ static class Deep41 extends Deep40 {}
+
+ static class Deep42 extends Deep41 {}
+
+ static class Deep43 extends Deep42 {}
+
+ static class Deep44 extends Deep43 {}
+
+ static class Deep45 extends Deep44 {}
+
+ static class Deep46 extends Deep45 {}
+
+ static class Deep47 extends Deep46 {}
+
+ static class Deep48 extends Deep47 {}
+
+ static class Deep49 extends Deep48 {}
+
+ static class Deep50 extends Deep49 {}
+
+ static class Deep51 extends Deep50 {}
+
+ static class Deep52 extends Deep51 {}
+
+ static class Deep53 extends Deep52 {}
+
+ static class Deep54 extends Deep53 {}
+
+ static class Deep55 extends Deep54 {}
+
+ static class Deep56 extends Deep55 {}
+
+ static class Deep57 extends Deep56 {}
+
+ static class Deep58 extends Deep57 {}
+
+ static class Deep59 extends Deep58 {}
+
+ static class Deep60 extends Deep59 {}
+
+ static class Deep61 extends Deep60 {}
+
+ static class Deep62 extends Deep61 {}
+
+ static class Deep63 extends Deep62 {}
+
+ static class Deep64 extends Deep63 {}
+
+ static class Deep65 extends Deep64 {}
+
+ static class Deep66 extends Deep65 {}
+
+ static class Deep67 extends Deep66 {}
+
+ static class Deep68 extends Deep67 {}
+
+ static class Deep69 extends Deep68 {}
+
+ static class Deep70 extends Deep69 {}
+
+ static class Deep71 extends Deep70 {}
+
+ static class Deep72 extends Deep71 {}
+
+ static class Deep73 extends Deep72 {}
+
+ static class Deep74 extends Deep73 {}
+
+ static class Deep75 extends Deep74 {}
+
+ static class Deep76 extends Deep75 {}
+
+ static class Deep77 extends Deep76 {}
+
+ static class Deep78 extends Deep77 {}
+
+ static class Deep79 extends Deep78 {}
+
+ static class Deep80 extends Deep79 {}
+
+ static class Deep81 extends Deep80 {}
+
+ static class Deep82 extends Deep81 {}
+
+ static class Deep83 extends Deep82 {}
+
+ static class Deep84 extends Deep83 {}
+
+ static class Deep85 extends Deep84 {}
+
+ static class Deep86 extends Deep85 {}
+
+ static class Deep87 extends Deep86 {}
+
+ static class Deep88 extends Deep87 {}
+
+ static class Deep89 extends Deep88 {}
+
+ static class Deep90 extends Deep89 {}
+
+ static class Deep91 extends Deep90 {}
+
+ static class Deep92 extends Deep91 {}
+
+ static class Deep93 extends Deep92 {}
+
+ static class Deep94 extends Deep93 {}
+
+ static class Deep95 extends Deep94 {}
+
+ static class Deep96 extends Deep95 {}
+
+ static class Deep97 extends Deep96 {}
+
+ static class Deep98 extends Deep97 {}
+
+ static class Deep99 extends Deep98 {}
+
+ static class Deep100 extends Deep99 {}
+
+ static class DeepCloneable extends Deep100 implements Cloneable {
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+ }
+
+ @Test
+ public void time_Object_clone() {
+ try {
+ CloneableObject o = new CloneableObject();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ o.clone();
+ }
+ } catch (Exception e) {
+ throw new AssertionError(e.getMessage());
+ }
+ }
+
+ @Test
+ public void time_Object_manyFieldClone() {
+ try {
+ CloneableManyFieldObject o = new CloneableManyFieldObject();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ o.clone();
+ }
+ } catch (Exception e) {
+ throw new AssertionError(e.getMessage());
+ }
+ }
+
+ @Test
+ public void time_Object_deepClone() {
+ try {
+ DeepCloneable o = new DeepCloneable();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ o.clone();
+ }
+ } catch (Exception e) {
+ throw new AssertionError(e.getMessage());
+ }
+ }
+
+ @Test
+ public void time_Array_clone() {
+ int[] o = new int[32];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ o.clone();
+ }
+ }
+
+ @Test
+ public void time_ObjectArray_smallClone() {
+ Object[] o = new Object[32];
+ for (int i = 0; i < o.length / 2; ++i) {
+ o[i] = new Object();
+ }
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ o.clone();
+ }
+ }
+
+ @Test
+ public void time_ObjectArray_largeClone() {
+ Object[] o = new Object[2048];
+ for (int i = 0; i < o.length / 2; ++i) {
+ o[i] = new Object();
+ }
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ o.clone();
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java
new file mode 100644
index 0000000..3f4f6af
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.util.Arrays;
+import java.util.Collection;
+
+@RunWith(Parameterized.class)
+@LargeTest
+public class DeepArrayOpsPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ private Object[] mArray;
+ private Object[] mArray2;
+
+ @Parameterized.Parameter(0)
+ public int mArrayLength;
+
+ @Parameterized.Parameters(name = "mArrayLength({0})")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(new Object[][] {{1}, {4}, {16}, {32}, {2048}});
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ mArray = new Object[mArrayLength * 14];
+ mArray2 = new Object[mArrayLength * 14];
+ for (int i = 0; i < mArrayLength; i += 14) {
+ mArray[i] = new IntWrapper(i);
+ mArray2[i] = new IntWrapper(i);
+
+ mArray[i + 1] = new16ElementObjectmArray();
+ mArray2[i + 1] = new16ElementObjectmArray();
+
+ mArray[i + 2] = new boolean[16];
+ mArray2[i + 2] = new boolean[16];
+
+ mArray[i + 3] = new byte[16];
+ mArray2[i + 3] = new byte[16];
+
+ mArray[i + 4] = new char[16];
+ mArray2[i + 4] = new char[16];
+
+ mArray[i + 5] = new short[16];
+ mArray2[i + 5] = new short[16];
+
+ mArray[i + 6] = new float[16];
+ mArray2[i + 6] = new float[16];
+
+ mArray[i + 7] = new long[16];
+ mArray2[i + 7] = new long[16];
+
+ mArray[i + 8] = new int[16];
+ mArray2[i + 8] = new int[16];
+
+ mArray[i + 9] = new double[16];
+ mArray2[i + 9] = new double[16];
+
+ // SubmArray types are concrete objects.
+ mArray[i + 10] = new16ElementArray(String.class, String.class);
+ mArray2[i + 10] = new16ElementArray(String.class, String.class);
+
+ mArray[i + 11] = new16ElementArray(Integer.class, Integer.class);
+ mArray2[i + 11] = new16ElementArray(Integer.class, Integer.class);
+
+ // SubmArray types is an interface.
+ mArray[i + 12] = new16ElementArray(CharSequence.class, String.class);
+ mArray2[i + 12] = new16ElementArray(CharSequence.class, String.class);
+
+ mArray[i + 13] = null;
+ mArray2[i + 13] = null;
+ }
+ }
+
+ @Test
+ public void deepHashCode() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ Arrays.deepHashCode(mArray);
+ }
+ }
+
+ @Test
+ public void deepEquals() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ Arrays.deepEquals(mArray, mArray2);
+ }
+ }
+
+ private static Object[] new16ElementObjectmArray() {
+ Object[] array = new Object[16];
+ for (int i = 0; i < 16; ++i) {
+ array[i] = new IntWrapper(i);
+ }
+
+ return array;
+ }
+
+ @SuppressWarnings("unchecked")
+ private static <T, V> T[] new16ElementArray(Class<T> mArrayType, Class<V> type)
+ throws Exception {
+ T[] array = (T[]) Array.newInstance(type, 16);
+ if (!mArrayType.isAssignableFrom(type)) {
+ throw new IllegalArgumentException(mArrayType + " is not assignable from " + type);
+ }
+
+ Constructor<V> constructor = type.getDeclaredConstructor(String.class);
+ for (int i = 0; i < 16; ++i) {
+ array[i] = (T) constructor.newInstance(String.valueOf(i + 1000));
+ }
+
+ return array;
+ }
+
+ /**
+ * A class that provides very basic equals() and hashCode() operations and doesn't resort to
+ * memoization tricks like {@link java.lang.Integer}.
+ *
+ * <p>Useful for providing equal objects that aren't the same (a.equals(b) but a != b).
+ */
+ public static final class IntWrapper {
+ private final int mWrapped;
+
+ public IntWrapper(int wrap) {
+ mWrapped = wrap;
+ }
+
+ @Override
+ public int hashCode() {
+ return mWrapped;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof IntWrapper)) {
+ return false;
+ }
+
+ return ((IntWrapper) o).mWrapped == this.mWrapped;
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java b/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java
new file mode 100644
index 0000000..da94ae1
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/** What does field access cost? */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class FieldAccessPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ private static class Inner {
+ public int mPublicInnerIntVal;
+ protected int mProtectedInnerIntVal;
+ private int mPrivateInnerIntVal;
+ int mPackageInnerIntVal;
+ }
+
+ int mIntVal = 42;
+ final int mFinalIntVal = 42;
+ static int sStaticIntVal = 42;
+ static final int FINAL_INT_VAL = 42;
+
+ @Test
+ public void timeField() {
+ int result = 0;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = mIntVal;
+ }
+ }
+
+ @Test
+ public void timeFieldFinal() {
+ int result = 0;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = mFinalIntVal;
+ }
+ }
+
+ @Test
+ public void timeFieldStatic() {
+ int result = 0;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = sStaticIntVal;
+ }
+ }
+
+ @Test
+ public void timeFieldStaticFinal() {
+ int result = 0;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = FINAL_INT_VAL;
+ }
+ }
+
+ @Test
+ public void timeFieldCached() {
+ int result = 0;
+ int cachedIntVal = this.mIntVal;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = cachedIntVal;
+ }
+ }
+
+ @Test
+ public void timeFieldPrivateInnerClassPublicField() {
+ int result = 0;
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = inner.mPublicInnerIntVal;
+ }
+ }
+
+ @Test
+ public void timeFieldPrivateInnerClassProtectedField() {
+ int result = 0;
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = inner.mProtectedInnerIntVal;
+ }
+ }
+
+ @Test
+ public void timeFieldPrivateInnerClassPrivateField() {
+ int result = 0;
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = inner.mPrivateInnerIntVal;
+ }
+ }
+
+ @Test
+ public void timeFieldPrivateInnerClassPackageField() {
+ int result = 0;
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = inner.mPackageInnerIntVal;
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java
new file mode 100644
index 0000000..9446d99c
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.LinkedHashMap;
+import java.util.concurrent.ConcurrentHashMap;
+
+/** How do the various hash maps compare? */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class HashedCollectionsPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Test
+ public void timeHashMapGet() {
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("hello", "world");
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ map.get("hello");
+ }
+ }
+
+ @Test
+ public void timeHashMapGet_Synchronized() {
+ HashMap<String, String> map = new HashMap<String, String>();
+ synchronized (map) {
+ map.put("hello", "world");
+ }
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ synchronized (map) {
+ map.get("hello");
+ }
+ }
+ }
+
+ @Test
+ public void timeHashtableGet() {
+ Hashtable<String, String> map = new Hashtable<String, String>();
+ map.put("hello", "world");
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ map.get("hello");
+ }
+ }
+
+ @Test
+ public void timeLinkedHashMapGet() {
+ LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
+ map.put("hello", "world");
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ map.get("hello");
+ }
+ }
+
+ @Test
+ public void timeConcurrentHashMapGet() {
+ ConcurrentHashMap<String, String> map = new ConcurrentHashMap<String, String>();
+ map.put("hello", "world");
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ map.get("hello");
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java
new file mode 100644
index 0000000..be2a7e9
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java
@@ -0,0 +1,1818 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This file is script-generated by ImtConflictPerfTestGen.py. It measures the performance impact of
+ * conflicts in interface method tables. Run `python ImtConflictPerfTestGen.py >
+ * ImtConflictPerfTest.java` to regenerate.
+ *
+ * <p>Each interface has 64 methods, which is the current size of an IMT. C0 implements one
+ * interface, C1 implements two, C2 implements three, and so on. The intent is that C0 has no
+ * conflicts in its IMT, C1 has depth-2 conflicts in its IMT, C2 has depth-3 conflicts, etc. This is
+ * currently guaranteed by the fact that we hash interface methods by taking their method index
+ * modulo 64. (Note that a "conflict depth" of 1 means no conflict at all.)
+ */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class ImtConflictPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Before
+ public void setup() {
+ C0 c0 = new C0();
+ callF0(c0);
+ C1 c1 = new C1();
+ callF0(c1);
+ callF19(c1);
+ C2 c2 = new C2();
+ callF0(c2);
+ callF19(c2);
+ callF38(c2);
+ C3 c3 = new C3();
+ callF0(c3);
+ callF19(c3);
+ callF38(c3);
+ callF57(c3);
+ C4 c4 = new C4();
+ callF0(c4);
+ callF19(c4);
+ callF38(c4);
+ callF57(c4);
+ callF76(c4);
+ C5 c5 = new C5();
+ callF0(c5);
+ callF19(c5);
+ callF38(c5);
+ callF57(c5);
+ callF76(c5);
+ callF95(c5);
+ C6 c6 = new C6();
+ callF0(c6);
+ callF19(c6);
+ callF38(c6);
+ callF57(c6);
+ callF76(c6);
+ callF95(c6);
+ callF114(c6);
+ C7 c7 = new C7();
+ callF0(c7);
+ callF19(c7);
+ callF38(c7);
+ callF57(c7);
+ callF76(c7);
+ callF95(c7);
+ callF114(c7);
+ callF133(c7);
+ C8 c8 = new C8();
+ callF0(c8);
+ callF19(c8);
+ callF38(c8);
+ callF57(c8);
+ callF76(c8);
+ callF95(c8);
+ callF114(c8);
+ callF133(c8);
+ callF152(c8);
+ C9 c9 = new C9();
+ callF0(c9);
+ callF19(c9);
+ callF38(c9);
+ callF57(c9);
+ callF76(c9);
+ callF95(c9);
+ callF114(c9);
+ callF133(c9);
+ callF152(c9);
+ callF171(c9);
+ C10 c10 = new C10();
+ callF0(c10);
+ callF19(c10);
+ callF38(c10);
+ callF57(c10);
+ callF76(c10);
+ callF95(c10);
+ callF114(c10);
+ callF133(c10);
+ callF152(c10);
+ callF171(c10);
+ callF190(c10);
+ C11 c11 = new C11();
+ callF0(c11);
+ callF19(c11);
+ callF38(c11);
+ callF57(c11);
+ callF76(c11);
+ callF95(c11);
+ callF114(c11);
+ callF133(c11);
+ callF152(c11);
+ callF171(c11);
+ callF190(c11);
+ callF209(c11);
+ C12 c12 = new C12();
+ callF0(c12);
+ callF19(c12);
+ callF38(c12);
+ callF57(c12);
+ callF76(c12);
+ callF95(c12);
+ callF114(c12);
+ callF133(c12);
+ callF152(c12);
+ callF171(c12);
+ callF190(c12);
+ callF209(c12);
+ callF228(c12);
+ C13 c13 = new C13();
+ callF0(c13);
+ callF19(c13);
+ callF38(c13);
+ callF57(c13);
+ callF76(c13);
+ callF95(c13);
+ callF114(c13);
+ callF133(c13);
+ callF152(c13);
+ callF171(c13);
+ callF190(c13);
+ callF209(c13);
+ callF228(c13);
+ callF247(c13);
+ C14 c14 = new C14();
+ callF0(c14);
+ callF19(c14);
+ callF38(c14);
+ callF57(c14);
+ callF76(c14);
+ callF95(c14);
+ callF114(c14);
+ callF133(c14);
+ callF152(c14);
+ callF171(c14);
+ callF190(c14);
+ callF209(c14);
+ callF228(c14);
+ callF247(c14);
+ callF266(c14);
+ C15 c15 = new C15();
+ callF0(c15);
+ callF19(c15);
+ callF38(c15);
+ callF57(c15);
+ callF76(c15);
+ callF95(c15);
+ callF114(c15);
+ callF133(c15);
+ callF152(c15);
+ callF171(c15);
+ callF190(c15);
+ callF209(c15);
+ callF228(c15);
+ callF247(c15);
+ callF266(c15);
+ callF285(c15);
+ C16 c16 = new C16();
+ callF0(c16);
+ callF19(c16);
+ callF38(c16);
+ callF57(c16);
+ callF76(c16);
+ callF95(c16);
+ callF114(c16);
+ callF133(c16);
+ callF152(c16);
+ callF171(c16);
+ callF190(c16);
+ callF209(c16);
+ callF228(c16);
+ callF247(c16);
+ callF266(c16);
+ callF285(c16);
+ callF304(c16);
+ C17 c17 = new C17();
+ callF0(c17);
+ callF19(c17);
+ callF38(c17);
+ callF57(c17);
+ callF76(c17);
+ callF95(c17);
+ callF114(c17);
+ callF133(c17);
+ callF152(c17);
+ callF171(c17);
+ callF190(c17);
+ callF209(c17);
+ callF228(c17);
+ callF247(c17);
+ callF266(c17);
+ callF285(c17);
+ callF304(c17);
+ callF323(c17);
+ C18 c18 = new C18();
+ callF0(c18);
+ callF19(c18);
+ callF38(c18);
+ callF57(c18);
+ callF76(c18);
+ callF95(c18);
+ callF114(c18);
+ callF133(c18);
+ callF152(c18);
+ callF171(c18);
+ callF190(c18);
+ callF209(c18);
+ callF228(c18);
+ callF247(c18);
+ callF266(c18);
+ callF285(c18);
+ callF304(c18);
+ callF323(c18);
+ callF342(c18);
+ C19 c19 = new C19();
+ callF0(c19);
+ callF19(c19);
+ callF38(c19);
+ callF57(c19);
+ callF76(c19);
+ callF95(c19);
+ callF114(c19);
+ callF133(c19);
+ callF152(c19);
+ callF171(c19);
+ callF190(c19);
+ callF209(c19);
+ callF228(c19);
+ callF247(c19);
+ callF266(c19);
+ callF285(c19);
+ callF304(c19);
+ callF323(c19);
+ callF342(c19);
+ callF361(c19);
+ }
+
+ @Test
+ public void timeConflictDepth01() {
+ C0 c0 = new C0();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ callF0(c0);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth02() {
+ C1 c1 = new C1();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ callF0(c1);
+ callF19(c1);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth03() {
+ C2 c2 = new C2();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c2);
+ callF19(c2);
+ callF38(c2);
+ callF0(c2);
+ callF19(c2);
+ callF38(c2);
+ callF0(c2);
+ callF19(c2);
+ callF38(c2);
+ callF0(c2);
+ callF19(c2);
+ callF38(c2);
+ callF0(c2);
+ callF19(c2);
+ callF38(c2);
+ callF0(c2);
+ callF19(c2);
+ callF38(c2);
+ callF0(c2);
+ callF19(c2);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth04() {
+ C3 c3 = new C3();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c3);
+ callF19(c3);
+ callF38(c3);
+ callF57(c3);
+ callF0(c3);
+ callF19(c3);
+ callF38(c3);
+ callF57(c3);
+ callF0(c3);
+ callF19(c3);
+ callF38(c3);
+ callF57(c3);
+ callF0(c3);
+ callF19(c3);
+ callF38(c3);
+ callF57(c3);
+ callF0(c3);
+ callF19(c3);
+ callF38(c3);
+ callF57(c3);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth05() {
+ C4 c4 = new C4();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c4);
+ callF19(c4);
+ callF38(c4);
+ callF57(c4);
+ callF76(c4);
+ callF0(c4);
+ callF19(c4);
+ callF38(c4);
+ callF57(c4);
+ callF76(c4);
+ callF0(c4);
+ callF19(c4);
+ callF38(c4);
+ callF57(c4);
+ callF76(c4);
+ callF0(c4);
+ callF19(c4);
+ callF38(c4);
+ callF57(c4);
+ callF76(c4);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth06() {
+ C5 c5 = new C5();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c5);
+ callF19(c5);
+ callF38(c5);
+ callF57(c5);
+ callF76(c5);
+ callF95(c5);
+ callF0(c5);
+ callF19(c5);
+ callF38(c5);
+ callF57(c5);
+ callF76(c5);
+ callF95(c5);
+ callF0(c5);
+ callF19(c5);
+ callF38(c5);
+ callF57(c5);
+ callF76(c5);
+ callF95(c5);
+ callF0(c5);
+ callF19(c5);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth07() {
+ C6 c6 = new C6();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c6);
+ callF19(c6);
+ callF38(c6);
+ callF57(c6);
+ callF76(c6);
+ callF95(c6);
+ callF114(c6);
+ callF0(c6);
+ callF19(c6);
+ callF38(c6);
+ callF57(c6);
+ callF76(c6);
+ callF95(c6);
+ callF114(c6);
+ callF0(c6);
+ callF19(c6);
+ callF38(c6);
+ callF57(c6);
+ callF76(c6);
+ callF95(c6);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth08() {
+ C7 c7 = new C7();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c7);
+ callF19(c7);
+ callF38(c7);
+ callF57(c7);
+ callF76(c7);
+ callF95(c7);
+ callF114(c7);
+ callF133(c7);
+ callF0(c7);
+ callF19(c7);
+ callF38(c7);
+ callF57(c7);
+ callF76(c7);
+ callF95(c7);
+ callF114(c7);
+ callF133(c7);
+ callF0(c7);
+ callF19(c7);
+ callF38(c7);
+ callF57(c7);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth09() {
+ C8 c8 = new C8();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c8);
+ callF19(c8);
+ callF38(c8);
+ callF57(c8);
+ callF76(c8);
+ callF95(c8);
+ callF114(c8);
+ callF133(c8);
+ callF152(c8);
+ callF0(c8);
+ callF19(c8);
+ callF38(c8);
+ callF57(c8);
+ callF76(c8);
+ callF95(c8);
+ callF114(c8);
+ callF133(c8);
+ callF152(c8);
+ callF0(c8);
+ callF19(c8);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth10() {
+ C9 c9 = new C9();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c9);
+ callF19(c9);
+ callF38(c9);
+ callF57(c9);
+ callF76(c9);
+ callF95(c9);
+ callF114(c9);
+ callF133(c9);
+ callF152(c9);
+ callF171(c9);
+ callF0(c9);
+ callF19(c9);
+ callF38(c9);
+ callF57(c9);
+ callF76(c9);
+ callF95(c9);
+ callF114(c9);
+ callF133(c9);
+ callF152(c9);
+ callF171(c9);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth11() {
+ C10 c10 = new C10();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c10);
+ callF19(c10);
+ callF38(c10);
+ callF57(c10);
+ callF76(c10);
+ callF95(c10);
+ callF114(c10);
+ callF133(c10);
+ callF152(c10);
+ callF171(c10);
+ callF190(c10);
+ callF0(c10);
+ callF19(c10);
+ callF38(c10);
+ callF57(c10);
+ callF76(c10);
+ callF95(c10);
+ callF114(c10);
+ callF133(c10);
+ callF152(c10);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth12() {
+ C11 c11 = new C11();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c11);
+ callF19(c11);
+ callF38(c11);
+ callF57(c11);
+ callF76(c11);
+ callF95(c11);
+ callF114(c11);
+ callF133(c11);
+ callF152(c11);
+ callF171(c11);
+ callF190(c11);
+ callF209(c11);
+ callF0(c11);
+ callF19(c11);
+ callF38(c11);
+ callF57(c11);
+ callF76(c11);
+ callF95(c11);
+ callF114(c11);
+ callF133(c11);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth13() {
+ C12 c12 = new C12();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c12);
+ callF19(c12);
+ callF38(c12);
+ callF57(c12);
+ callF76(c12);
+ callF95(c12);
+ callF114(c12);
+ callF133(c12);
+ callF152(c12);
+ callF171(c12);
+ callF190(c12);
+ callF209(c12);
+ callF228(c12);
+ callF0(c12);
+ callF19(c12);
+ callF38(c12);
+ callF57(c12);
+ callF76(c12);
+ callF95(c12);
+ callF114(c12);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth14() {
+ C13 c13 = new C13();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c13);
+ callF19(c13);
+ callF38(c13);
+ callF57(c13);
+ callF76(c13);
+ callF95(c13);
+ callF114(c13);
+ callF133(c13);
+ callF152(c13);
+ callF171(c13);
+ callF190(c13);
+ callF209(c13);
+ callF228(c13);
+ callF247(c13);
+ callF0(c13);
+ callF19(c13);
+ callF38(c13);
+ callF57(c13);
+ callF76(c13);
+ callF95(c13);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth15() {
+ C14 c14 = new C14();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c14);
+ callF19(c14);
+ callF38(c14);
+ callF57(c14);
+ callF76(c14);
+ callF95(c14);
+ callF114(c14);
+ callF133(c14);
+ callF152(c14);
+ callF171(c14);
+ callF190(c14);
+ callF209(c14);
+ callF228(c14);
+ callF247(c14);
+ callF266(c14);
+ callF0(c14);
+ callF19(c14);
+ callF38(c14);
+ callF57(c14);
+ callF76(c14);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth16() {
+ C15 c15 = new C15();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c15);
+ callF19(c15);
+ callF38(c15);
+ callF57(c15);
+ callF76(c15);
+ callF95(c15);
+ callF114(c15);
+ callF133(c15);
+ callF152(c15);
+ callF171(c15);
+ callF190(c15);
+ callF209(c15);
+ callF228(c15);
+ callF247(c15);
+ callF266(c15);
+ callF285(c15);
+ callF0(c15);
+ callF19(c15);
+ callF38(c15);
+ callF57(c15);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth17() {
+ C16 c16 = new C16();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c16);
+ callF19(c16);
+ callF38(c16);
+ callF57(c16);
+ callF76(c16);
+ callF95(c16);
+ callF114(c16);
+ callF133(c16);
+ callF152(c16);
+ callF171(c16);
+ callF190(c16);
+ callF209(c16);
+ callF228(c16);
+ callF247(c16);
+ callF266(c16);
+ callF285(c16);
+ callF304(c16);
+ callF0(c16);
+ callF19(c16);
+ callF38(c16);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth18() {
+ C17 c17 = new C17();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c17);
+ callF19(c17);
+ callF38(c17);
+ callF57(c17);
+ callF76(c17);
+ callF95(c17);
+ callF114(c17);
+ callF133(c17);
+ callF152(c17);
+ callF171(c17);
+ callF190(c17);
+ callF209(c17);
+ callF228(c17);
+ callF247(c17);
+ callF266(c17);
+ callF285(c17);
+ callF304(c17);
+ callF323(c17);
+ callF0(c17);
+ callF19(c17);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth19() {
+ C18 c18 = new C18();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c18);
+ callF19(c18);
+ callF38(c18);
+ callF57(c18);
+ callF76(c18);
+ callF95(c18);
+ callF114(c18);
+ callF133(c18);
+ callF152(c18);
+ callF171(c18);
+ callF190(c18);
+ callF209(c18);
+ callF228(c18);
+ callF247(c18);
+ callF266(c18);
+ callF285(c18);
+ callF304(c18);
+ callF323(c18);
+ callF342(c18);
+ callF0(c18);
+ }
+ }
+
+ @Test
+ public void timeConflictDepth20() {
+ C19 c19 = new C19();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ callF0(c19);
+ callF19(c19);
+ callF38(c19);
+ callF57(c19);
+ callF76(c19);
+ callF95(c19);
+ callF114(c19);
+ callF133(c19);
+ callF152(c19);
+ callF171(c19);
+ callF190(c19);
+ callF209(c19);
+ callF228(c19);
+ callF247(c19);
+ callF266(c19);
+ callF285(c19);
+ callF304(c19);
+ callF323(c19);
+ callF342(c19);
+ callF361(c19);
+ }
+ }
+
+ public void callF0(I0 i) {
+ i.f0();
+ }
+
+ public void callF19(I1 i) {
+ i.f19();
+ }
+
+ public void callF38(I2 i) {
+ i.f38();
+ }
+
+ public void callF57(I3 i) {
+ i.f57();
+ }
+
+ public void callF76(I4 i) {
+ i.f76();
+ }
+
+ public void callF95(I5 i) {
+ i.f95();
+ }
+
+ public void callF114(I6 i) {
+ i.f114();
+ }
+
+ public void callF133(I7 i) {
+ i.f133();
+ }
+
+ public void callF152(I8 i) {
+ i.f152();
+ }
+
+ public void callF171(I9 i) {
+ i.f171();
+ }
+
+ public void callF190(I10 i) {
+ i.f190();
+ }
+
+ public void callF209(I11 i) {
+ i.f209();
+ }
+
+ public void callF228(I12 i) {
+ i.f228();
+ }
+
+ public void callF247(I13 i) {
+ i.f247();
+ }
+
+ public void callF266(I14 i) {
+ i.f266();
+ }
+
+ public void callF285(I15 i) {
+ i.f285();
+ }
+
+ public void callF304(I16 i) {
+ i.f304();
+ }
+
+ public void callF323(I17 i) {
+ i.f323();
+ }
+
+ public void callF342(I18 i) {
+ i.f342();
+ }
+
+ public void callF361(I19 i) {
+ i.f361();
+ }
+
+ static class C0 implements I0 {}
+
+ static class C1 implements I0, I1 {}
+
+ static class C2 implements I0, I1, I2 {}
+
+ static class C3 implements I0, I1, I2, I3 {}
+
+ static class C4 implements I0, I1, I2, I3, I4 {}
+
+ static class C5 implements I0, I1, I2, I3, I4, I5 {}
+
+ static class C6 implements I0, I1, I2, I3, I4, I5, I6 {}
+
+ static class C7 implements I0, I1, I2, I3, I4, I5, I6, I7 {}
+
+ static class C8 implements I0, I1, I2, I3, I4, I5, I6, I7, I8 {}
+
+ static class C9 implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9 {}
+
+ static class C10 implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10 {}
+
+ static class C11 implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11 {}
+
+ static class C12 implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12 {}
+
+ static class C13 implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13 {}
+
+ static class C14 implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14 {}
+
+ static class C15
+ implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15 {}
+
+ static class C16
+ implements I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16 {}
+
+ static class C17
+ implements I0,
+ I1,
+ I2,
+ I3,
+ I4,
+ I5,
+ I6,
+ I7,
+ I8,
+ I9,
+ I10,
+ I11,
+ I12,
+ I13,
+ I14,
+ I15,
+ I16,
+ I17 {}
+
+ static class C18
+ implements I0,
+ I1,
+ I2,
+ I3,
+ I4,
+ I5,
+ I6,
+ I7,
+ I8,
+ I9,
+ I10,
+ I11,
+ I12,
+ I13,
+ I14,
+ I15,
+ I16,
+ I17,
+ I18 {}
+
+ static class C19
+ implements I0,
+ I1,
+ I2,
+ I3,
+ I4,
+ I5,
+ I6,
+ I7,
+ I8,
+ I9,
+ I10,
+ I11,
+ I12,
+ I13,
+ I14,
+ I15,
+ I16,
+ I17,
+ I18,
+ I19 {}
+
+ interface I0 {
+ default void f0() {}
+
+ default void f1() {}
+
+ default void f2() {}
+
+ default void f3() {}
+
+ default void f4() {}
+
+ default void f5() {}
+
+ default void f6() {}
+
+ default void f7() {}
+
+ default void f8() {}
+
+ default void f9() {}
+
+ default void f10() {}
+
+ default void f11() {}
+
+ default void f12() {}
+
+ default void f13() {}
+
+ default void f14() {}
+
+ default void f15() {}
+
+ default void f16() {}
+
+ default void f17() {}
+
+ default void f18() {}
+ }
+
+ interface I1 {
+ default void f19() {}
+
+ default void f20() {}
+
+ default void f21() {}
+
+ default void f22() {}
+
+ default void f23() {}
+
+ default void f24() {}
+
+ default void f25() {}
+
+ default void f26() {}
+
+ default void f27() {}
+
+ default void f28() {}
+
+ default void f29() {}
+
+ default void f30() {}
+
+ default void f31() {}
+
+ default void f32() {}
+
+ default void f33() {}
+
+ default void f34() {}
+
+ default void f35() {}
+
+ default void f36() {}
+
+ default void f37() {}
+ }
+
+ interface I2 {
+ default void f38() {}
+
+ default void f39() {}
+
+ default void f40() {}
+
+ default void f41() {}
+
+ default void f42() {}
+
+ default void f43() {}
+
+ default void f44() {}
+
+ default void f45() {}
+
+ default void f46() {}
+
+ default void f47() {}
+
+ default void f48() {}
+
+ default void f49() {}
+
+ default void f50() {}
+
+ default void f51() {}
+
+ default void f52() {}
+
+ default void f53() {}
+
+ default void f54() {}
+
+ default void f55() {}
+
+ default void f56() {}
+ }
+
+ interface I3 {
+ default void f57() {}
+
+ default void f58() {}
+
+ default void f59() {}
+
+ default void f60() {}
+
+ default void f61() {}
+
+ default void f62() {}
+
+ default void f63() {}
+
+ default void f64() {}
+
+ default void f65() {}
+
+ default void f66() {}
+
+ default void f67() {}
+
+ default void f68() {}
+
+ default void f69() {}
+
+ default void f70() {}
+
+ default void f71() {}
+
+ default void f72() {}
+
+ default void f73() {}
+
+ default void f74() {}
+
+ default void f75() {}
+ }
+
+ interface I4 {
+ default void f76() {}
+
+ default void f77() {}
+
+ default void f78() {}
+
+ default void f79() {}
+
+ default void f80() {}
+
+ default void f81() {}
+
+ default void f82() {}
+
+ default void f83() {}
+
+ default void f84() {}
+
+ default void f85() {}
+
+ default void f86() {}
+
+ default void f87() {}
+
+ default void f88() {}
+
+ default void f89() {}
+
+ default void f90() {}
+
+ default void f91() {}
+
+ default void f92() {}
+
+ default void f93() {}
+
+ default void f94() {}
+ }
+
+ interface I5 {
+ default void f95() {}
+
+ default void f96() {}
+
+ default void f97() {}
+
+ default void f98() {}
+
+ default void f99() {}
+
+ default void f100() {}
+
+ default void f101() {}
+
+ default void f102() {}
+
+ default void f103() {}
+
+ default void f104() {}
+
+ default void f105() {}
+
+ default void f106() {}
+
+ default void f107() {}
+
+ default void f108() {}
+
+ default void f109() {}
+
+ default void f110() {}
+
+ default void f111() {}
+
+ default void f112() {}
+
+ default void f113() {}
+ }
+
+ interface I6 {
+ default void f114() {}
+
+ default void f115() {}
+
+ default void f116() {}
+
+ default void f117() {}
+
+ default void f118() {}
+
+ default void f119() {}
+
+ default void f120() {}
+
+ default void f121() {}
+
+ default void f122() {}
+
+ default void f123() {}
+
+ default void f124() {}
+
+ default void f125() {}
+
+ default void f126() {}
+
+ default void f127() {}
+
+ default void f128() {}
+
+ default void f129() {}
+
+ default void f130() {}
+
+ default void f131() {}
+
+ default void f132() {}
+ }
+
+ interface I7 {
+ default void f133() {}
+
+ default void f134() {}
+
+ default void f135() {}
+
+ default void f136() {}
+
+ default void f137() {}
+
+ default void f138() {}
+
+ default void f139() {}
+
+ default void f140() {}
+
+ default void f141() {}
+
+ default void f142() {}
+
+ default void f143() {}
+
+ default void f144() {}
+
+ default void f145() {}
+
+ default void f146() {}
+
+ default void f147() {}
+
+ default void f148() {}
+
+ default void f149() {}
+
+ default void f150() {}
+
+ default void f151() {}
+ }
+
+ interface I8 {
+ default void f152() {}
+
+ default void f153() {}
+
+ default void f154() {}
+
+ default void f155() {}
+
+ default void f156() {}
+
+ default void f157() {}
+
+ default void f158() {}
+
+ default void f159() {}
+
+ default void f160() {}
+
+ default void f161() {}
+
+ default void f162() {}
+
+ default void f163() {}
+
+ default void f164() {}
+
+ default void f165() {}
+
+ default void f166() {}
+
+ default void f167() {}
+
+ default void f168() {}
+
+ default void f169() {}
+
+ default void f170() {}
+ }
+
+ interface I9 {
+ default void f171() {}
+
+ default void f172() {}
+
+ default void f173() {}
+
+ default void f174() {}
+
+ default void f175() {}
+
+ default void f176() {}
+
+ default void f177() {}
+
+ default void f178() {}
+
+ default void f179() {}
+
+ default void f180() {}
+
+ default void f181() {}
+
+ default void f182() {}
+
+ default void f183() {}
+
+ default void f184() {}
+
+ default void f185() {}
+
+ default void f186() {}
+
+ default void f187() {}
+
+ default void f188() {}
+
+ default void f189() {}
+ }
+
+ interface I10 {
+ default void f190() {}
+
+ default void f191() {}
+
+ default void f192() {}
+
+ default void f193() {}
+
+ default void f194() {}
+
+ default void f195() {}
+
+ default void f196() {}
+
+ default void f197() {}
+
+ default void f198() {}
+
+ default void f199() {}
+
+ default void f200() {}
+
+ default void f201() {}
+
+ default void f202() {}
+
+ default void f203() {}
+
+ default void f204() {}
+
+ default void f205() {}
+
+ default void f206() {}
+
+ default void f207() {}
+
+ default void f208() {}
+ }
+
+ interface I11 {
+ default void f209() {}
+
+ default void f210() {}
+
+ default void f211() {}
+
+ default void f212() {}
+
+ default void f213() {}
+
+ default void f214() {}
+
+ default void f215() {}
+
+ default void f216() {}
+
+ default void f217() {}
+
+ default void f218() {}
+
+ default void f219() {}
+
+ default void f220() {}
+
+ default void f221() {}
+
+ default void f222() {}
+
+ default void f223() {}
+
+ default void f224() {}
+
+ default void f225() {}
+
+ default void f226() {}
+
+ default void f227() {}
+ }
+
+ interface I12 {
+ default void f228() {}
+
+ default void f229() {}
+
+ default void f230() {}
+
+ default void f231() {}
+
+ default void f232() {}
+
+ default void f233() {}
+
+ default void f234() {}
+
+ default void f235() {}
+
+ default void f236() {}
+
+ default void f237() {}
+
+ default void f238() {}
+
+ default void f239() {}
+
+ default void f240() {}
+
+ default void f241() {}
+
+ default void f242() {}
+
+ default void f243() {}
+
+ default void f244() {}
+
+ default void f245() {}
+
+ default void f246() {}
+ }
+
+ interface I13 {
+ default void f247() {}
+
+ default void f248() {}
+
+ default void f249() {}
+
+ default void f250() {}
+
+ default void f251() {}
+
+ default void f252() {}
+
+ default void f253() {}
+
+ default void f254() {}
+
+ default void f255() {}
+
+ default void f256() {}
+
+ default void f257() {}
+
+ default void f258() {}
+
+ default void f259() {}
+
+ default void f260() {}
+
+ default void f261() {}
+
+ default void f262() {}
+
+ default void f263() {}
+
+ default void f264() {}
+
+ default void f265() {}
+ }
+
+ interface I14 {
+ default void f266() {}
+
+ default void f267() {}
+
+ default void f268() {}
+
+ default void f269() {}
+
+ default void f270() {}
+
+ default void f271() {}
+
+ default void f272() {}
+
+ default void f273() {}
+
+ default void f274() {}
+
+ default void f275() {}
+
+ default void f276() {}
+
+ default void f277() {}
+
+ default void f278() {}
+
+ default void f279() {}
+
+ default void f280() {}
+
+ default void f281() {}
+
+ default void f282() {}
+
+ default void f283() {}
+
+ default void f284() {}
+ }
+
+ interface I15 {
+ default void f285() {}
+
+ default void f286() {}
+
+ default void f287() {}
+
+ default void f288() {}
+
+ default void f289() {}
+
+ default void f290() {}
+
+ default void f291() {}
+
+ default void f292() {}
+
+ default void f293() {}
+
+ default void f294() {}
+
+ default void f295() {}
+
+ default void f296() {}
+
+ default void f297() {}
+
+ default void f298() {}
+
+ default void f299() {}
+
+ default void f300() {}
+
+ default void f301() {}
+
+ default void f302() {}
+
+ default void f303() {}
+ }
+
+ interface I16 {
+ default void f304() {}
+
+ default void f305() {}
+
+ default void f306() {}
+
+ default void f307() {}
+
+ default void f308() {}
+
+ default void f309() {}
+
+ default void f310() {}
+
+ default void f311() {}
+
+ default void f312() {}
+
+ default void f313() {}
+
+ default void f314() {}
+
+ default void f315() {}
+
+ default void f316() {}
+
+ default void f317() {}
+
+ default void f318() {}
+
+ default void f319() {}
+
+ default void f320() {}
+
+ default void f321() {}
+
+ default void f322() {}
+ }
+
+ interface I17 {
+ default void f323() {}
+
+ default void f324() {}
+
+ default void f325() {}
+
+ default void f326() {}
+
+ default void f327() {}
+
+ default void f328() {}
+
+ default void f329() {}
+
+ default void f330() {}
+
+ default void f331() {}
+
+ default void f332() {}
+
+ default void f333() {}
+
+ default void f334() {}
+
+ default void f335() {}
+
+ default void f336() {}
+
+ default void f337() {}
+
+ default void f338() {}
+
+ default void f339() {}
+
+ default void f340() {}
+
+ default void f341() {}
+ }
+
+ interface I18 {
+ default void f342() {}
+
+ default void f343() {}
+
+ default void f344() {}
+
+ default void f345() {}
+
+ default void f346() {}
+
+ default void f347() {}
+
+ default void f348() {}
+
+ default void f349() {}
+
+ default void f350() {}
+
+ default void f351() {}
+
+ default void f352() {}
+
+ default void f353() {}
+
+ default void f354() {}
+
+ default void f355() {}
+
+ default void f356() {}
+
+ default void f357() {}
+
+ default void f358() {}
+
+ default void f359() {}
+
+ default void f360() {}
+ }
+
+ interface I19 {
+ default void f361() {}
+
+ default void f362() {}
+
+ default void f363() {}
+
+ default void f364() {}
+
+ default void f365() {}
+
+ default void f366() {}
+
+ default void f367() {}
+
+ default void f368() {}
+
+ default void f369() {}
+
+ default void f370() {}
+
+ default void f371() {}
+
+ default void f372() {}
+
+ default void f373() {}
+
+ default void f374() {}
+
+ default void f375() {}
+
+ default void f376() {}
+
+ default void f377() {}
+
+ default void f378() {}
+
+ default void f379() {}
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTestGen.py b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTestGen.py
new file mode 100755
index 0000000..eea3b84
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTestGen.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python3
+#
+# Copyright 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import sys
+
+max_conflict_depth = 20 # In practice does not go above 20 for reasonable IMT sizes
+try:
+ imt_size = int(sys.argv[1])
+except (IndexError, ValueError):
+ print("Usage: python ImtConflictPerfTestGen.py <IMT_SIZE>")
+ sys.exit(1)
+
+license = """\
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+"""
+description = """
+/**
+ * This file is script-generated by ImtConflictPerfTestGen.py.
+ * It measures the performance impact of conflicts in interface method tables.
+ * Run `python ImtConflictPerfTestGen.py > ImtConflictPerfTest.java` to regenerate.
+ *
+ * Each interface has 64 methods, which is the current size of an IMT. C0 implements
+ * one interface, C1 implements two, C2 implements three, and so on. The intent
+ * is that C0 has no conflicts in its IMT, C1 has depth-2 conflicts in
+ * its IMT, C2 has depth-3 conflicts, etc. This is currently guaranteed by
+ * the fact that we hash interface methods by taking their method index modulo 64.
+ * (Note that a "conflict depth" of 1 means no conflict at all.)
+ */\
+"""
+
+print(license)
+print("package android.libcore;")
+imports = """
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+"""
+print(imports)
+print(description)
+
+print("@RunWith(AndroidJUnit4.class)")
+print("@LargeTest")
+print("public class ImtConflictPerfTest {")
+print(" @Rule")
+print(" public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();")
+print("")
+# Warm up interface method tables
+print(" @Before")
+print(" public void setup() {")
+for i in range(max_conflict_depth):
+ print(" C{0} c{0} = new C{0}();".format(i))
+ for j in range(i+1):
+ print(" callF{}(c{});".format(imt_size * j, i))
+print(" }")
+
+# Print test cases--one for each conflict depth
+for i in range(max_conflict_depth):
+ print(" @Test")
+ print(" public void timeConflictDepth{:02d}() {{".format(i+1))
+ print(" C{0} c{0} = new C{0}();".format(i))
+ print(" BenchmarkState state = mPerfStatusReporter.getBenchmarkState();")
+ print(" while (state.keepRunning()) {")
+ # Cycle through each interface method in an IMT entry in order
+ # to test all conflict resolution possibilities
+ for j in range(max_conflict_depth):
+ print(" callF{}(c{});".format(imt_size * (j % (i + 1)), i))
+ print(" }")
+ print(" }")
+
+# Make calls through the IMTs
+for i in range(max_conflict_depth):
+ print(" public void callF{0}(I{1} i) {{ i.f{0}(); }}".format(imt_size*i, i))
+
+# Class definitions, implementing varying amounts of interfaces
+for i in range(max_conflict_depth):
+ interfaces = ", ".join(["I{}".format(j) for j in range(i+1)])
+ print(" static class C{} implements {} {{}}".format(i, interfaces))
+
+# Interface definitions, each with enough methods to fill an entire IMT
+for i in range(max_conflict_depth):
+ print(" interface I{} {{".format(i))
+ for j in range(imt_size):
+ print(" default void f{}() {{}}".format(i*imt_size + j))
+ print(" }")
+
+print("}")
\ No newline at end of file
diff --git a/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java
new file mode 100644
index 0000000..ca99779
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/** Compares various kinds of method invocation. */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class MethodInvocationPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ interface I {
+ void emptyInterface();
+ }
+
+ static class C implements I {
+ private int mField;
+
+ private int getField() {
+ return mField;
+ }
+
+ public void timeInternalGetter(BenchmarkState state) {
+ int result = 0;
+ while (state.keepRunning()) {
+ result = getField();
+ }
+ }
+
+ public void timeInternalFieldAccess(BenchmarkState state) {
+ int result = 0;
+ while (state.keepRunning()) {
+ result = mField;
+ }
+ }
+
+ public static void emptyStatic() {}
+
+ public void emptyVirtual() {}
+
+ public void emptyInterface() {}
+ }
+
+ public void timeInternalGetter() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ new C().timeInternalGetter(state);
+ }
+
+ public void timeInternalFieldAccess() {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ new C().timeInternalFieldAccess(state);
+ }
+
+ // Test an intrinsic.
+ @Test
+ public void timeStringLength() {
+ int result = 0;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result = "hello, world!".length();
+ }
+ }
+
+ @Test
+ public void timeEmptyStatic() {
+ C c = new C();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ c.emptyStatic();
+ }
+ }
+
+ @Test
+ public void timeEmptyVirtual() {
+ C c = new C();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ c.emptyVirtual();
+ }
+ }
+
+ @Test
+ public void timeEmptyInterface() {
+ I c = new C();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ c.emptyInterface();
+ }
+ }
+
+ public static class Inner {
+ private int mI;
+
+ private void privateMethod() {
+ ++mI;
+ }
+
+ protected void protectedMethod() {
+ ++mI;
+ }
+
+ public void publicMethod() {
+ ++mI;
+ }
+
+ void packageMethod() {
+ ++mI;
+ }
+
+ final void finalPackageMethod() {
+ ++mI;
+ }
+ }
+
+ @Test
+ public void timePrivateInnerPublicMethod() {
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ inner.publicMethod();
+ }
+ }
+
+ @Test
+ public void timePrivateInnerProtectedMethod() {
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ inner.protectedMethod();
+ }
+ }
+
+ @Test
+ public void timePrivateInnerPrivateMethod() {
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ inner.privateMethod();
+ }
+ }
+
+ @Test
+ public void timePrivateInnerPackageMethod() {
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ inner.packageMethod();
+ }
+ }
+
+ @Test
+ public void timePrivateInnerFinalPackageMethod() {
+ Inner inner = new Inner();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ inner.finalPackageMethod();
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java
new file mode 100644
index 0000000..8496fbe
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/** How much do various kinds of multiplication cost? */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class MultiplicationPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Test
+ public void timeMultiplyIntByConstant10() {
+ int result = 1;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result *= 10;
+ }
+ }
+
+ @Test
+ public void timeMultiplyIntByConstant8() {
+ int result = 1;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result *= 8;
+ }
+ }
+
+ @Test
+ public void timeMultiplyIntByVariable10() {
+ int result = 1;
+ int factor = 10;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result *= factor;
+ }
+ }
+
+ @Test
+ public void timeMultiplyIntByVariable8() {
+ int result = 1;
+ int factor = 8;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ result *= factor;
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java
new file mode 100644
index 0000000..bb79424
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
+
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class ReferenceGetPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ boolean mIntrinsicDisabled;
+
+ private Object mObj = "str";
+
+ @Before
+ public void setUp() throws Exception {
+ Field intrinsicDisabledField = Reference.class.getDeclaredField("disableIntrinsic");
+ intrinsicDisabledField.setAccessible(true);
+ intrinsicDisabledField.setBoolean(null, mIntrinsicDisabled);
+ }
+
+ @Test
+ public void timeSoftReferenceGet() throws Exception {
+ Reference soft = new SoftReference(mObj);
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ Object o = soft.get();
+ }
+ }
+
+ @Test
+ public void timeWeakReferenceGet() throws Exception {
+ Reference weak = new WeakReference(mObj);
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ Object o = weak.get();
+ }
+ }
+
+ @Test
+ public void timeNonPreservedWeakReferenceGet() throws Exception {
+ Reference weak = new WeakReference(mObj);
+ mObj = null;
+ Runtime.getRuntime().gc();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ Object o = weak.get();
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java
new file mode 100644
index 0000000..2ef68ca
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.lang.ref.PhantomReference;
+import java.lang.ref.ReferenceQueue;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/** Benchmark to evaluate the performance of References. */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class ReferencePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ private Object mObject;
+
+ // How fast can references can be allocated?
+ @Test
+ public void timeAlloc() {
+ ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ new PhantomReference(mObject, queue);
+ }
+ }
+
+ // How fast can references can be allocated and manually enqueued?
+ @Test
+ public void timeAllocAndEnqueue() {
+ ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ (new PhantomReference<Object>(mObject, queue)).enqueue();
+ }
+ }
+
+ // How fast can references can be allocated, enqueued, and polled?
+ @Test
+ public void timeAllocEnqueueAndPoll() {
+ ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ (new PhantomReference<Object>(mObject, queue)).enqueue();
+ queue.poll();
+ }
+ }
+
+ // How fast can references can be allocated, enqueued, and removed?
+ @Test
+ public void timeAllocEnqueueAndRemove() {
+ ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ (new PhantomReference<Object>(mObject, queue)).enqueue();
+ try {
+ queue.remove();
+ } catch (InterruptedException ie) {
+ }
+ }
+ }
+
+ private static class FinalizableObject {
+ AtomicInteger mCount;
+
+ FinalizableObject(AtomicInteger count) {
+ this.mCount = count;
+ }
+
+ @Override
+ protected void finalize() {
+ mCount.incrementAndGet();
+ }
+ }
+
+ // How fast does finalization run?
+ @Test
+ public void timeFinalization() {
+ // Allocate a bunch of finalizable objects.
+ int n = 0;
+ AtomicInteger count = new AtomicInteger(0);
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ n++;
+ new FinalizableObject(count);
+ }
+
+ // Run GC so the objects will be collected for finalization.
+ Runtime.getRuntime().gc();
+
+ // Wait for finalization.
+ Runtime.getRuntime().runFinalization();
+
+ // Double check all the objects were finalized.
+ int got = count.get();
+ if (n != got) {
+ throw new IllegalStateException(
+ String.format("Only %i of %i objects finalized?", got, n));
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java
new file mode 100644
index 0000000..65a2fdb
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.math.BigInteger;
+import java.util.Random;
+
+/**
+ * This measures performance of operations on small BigIntegers. We manually determine the number of
+ * iterations so that it should cause total memory allocation on the order of a few hundred
+ * megabytes. Due to BigInteger's reliance on finalization, these may unfortunately all be kept
+ * around at once.
+ *
+ * <p>This is not structured as a proper benchmark; just run main(), e.g. with vogar
+ * libcore/benchmarks/src/benchmarks/SmallBigIntegerBenchmark.java
+ */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class SmallBigIntegerPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+ // We allocate about 2 1/3 BigIntegers per iteration.
+ // Assuming 100 bytes/BigInteger, this gives us around 500MB total.
+ static final BigInteger BIG_THREE = BigInteger.valueOf(3);
+ static final BigInteger BIG_FOUR = BigInteger.valueOf(4);
+
+ @Test
+ public void testSmallBigInteger() {
+ final Random r = new Random();
+ BigInteger x = new BigInteger(20, r);
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ // We know this converges, but the compiler doesn't.
+ if (x.and(BigInteger.ONE).equals(BigInteger.ONE)) {
+ x = x.multiply(BIG_THREE).add(BigInteger.ONE);
+ } else {
+ x = x.shiftRight(1);
+ }
+ }
+ if (x.signum() < 0 || x.compareTo(BIG_FOUR) > 0) {
+ throw new AssertionError("Something went horribly wrong.");
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java b/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java
new file mode 100644
index 0000000..4f5c54d
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/** How long does it take to access a string in the dex cache? */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class StringDexCachePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Test
+ public void timeStringDexCacheAccess() {
+ int v = 0;
+ int count = 0;
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ // Deliberately obscured to make optimizations less likely.
+ String s = (count >= 0) ? "hello, world!" : null;
+ v += s.length();
+ ++count;
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java
new file mode 100644
index 0000000..08ad926
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/** How do the various schemes for iterating through a string compare? */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class StringIterationPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Test
+ public void timeStringIteration0() {
+ String s = "hello, world!";
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ char ch;
+ for (int i = 0; i < s.length(); ++i) {
+ ch = s.charAt(i);
+ }
+ }
+ }
+
+ @Test
+ public void timeStringIteration1() {
+ String s = "hello, world!";
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ char ch;
+ for (int i = 0, length = s.length(); i < length; ++i) {
+ ch = s.charAt(i);
+ }
+ }
+ }
+
+ @Test
+ public void timeStringIteration2() {
+ String s = "hello, world!";
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ char ch;
+ char[] chars = s.toCharArray();
+ for (int i = 0, length = chars.length; i < length; ++i) {
+ ch = chars[i];
+ }
+ }
+ }
+
+ @Test
+ public void timeStringToCharArray() {
+ String s = "hello, world!";
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ char[] chars = s.toCharArray();
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java b/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java
new file mode 100644
index 0000000..5aacfc2
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+@RunWith(Parameterized.class)
+@LargeTest
+public class SystemArrayCopyPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Parameters(name = "arrayLength={0}")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(
+ new Object[][] {
+ {2}, {4}, {8}, {16}, {32}, {64}, {128}, {256}, {512}, {1024}, {2048}, {4096},
+ {8192}, {16384}, {32768}, {65536}, {131072}, {262144}
+ });
+ }
+
+ @Parameterized.Parameter(0)
+ public int arrayLength;
+
+ // Provides benchmarking for different types of arrays using the arraycopy function.
+ @Test
+ public void timeSystemCharArrayCopy() {
+ final int len = arrayLength;
+ char[] src = new char[len];
+ char[] dst = new char[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+
+ @Test
+ public void timeSystemByteArrayCopy() {
+ final int len = arrayLength;
+ byte[] src = new byte[len];
+ byte[] dst = new byte[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+
+ @Test
+ public void timeSystemShortArrayCopy() {
+ final int len = arrayLength;
+ short[] src = new short[len];
+ short[] dst = new short[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+
+ @Test
+ public void timeSystemIntArrayCopy() {
+ final int len = arrayLength;
+ int[] src = new int[len];
+ int[] dst = new int[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+
+ @Test
+ public void timeSystemLongArrayCopy() {
+ final int len = arrayLength;
+ long[] src = new long[len];
+ long[] dst = new long[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+
+ @Test
+ public void timeSystemFloatArrayCopy() {
+ final int len = arrayLength;
+ float[] src = new float[len];
+ float[] dst = new float[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+
+ @Test
+ public void timeSystemDoubleArrayCopy() {
+ final int len = arrayLength;
+ double[] src = new double[len];
+ double[] dst = new double[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+
+ @Test
+ public void timeSystemBooleanArrayCopy() {
+ final int len = arrayLength;
+ boolean[] src = new boolean[len];
+ boolean[] dst = new boolean[len];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ System.arraycopy(src, 0, dst, 0, len);
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java b/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java
new file mode 100644
index 0000000..7e71976
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Is there a performance reason to "Prefer virtual over interface", as the Android documentation
+ * once claimed?
+ */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class VirtualVersusInterfacePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Test
+ public void timeMapPut() {
+ Map<String, String> map = new HashMap<String, String>();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ map.put("hello", "world");
+ }
+ }
+
+ @Test
+ public void timeHashMapPut() {
+ HashMap<String, String> map = new HashMap<String, String>();
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ map.put("hello", "world");
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java b/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java
new file mode 100644
index 0000000..eec0734
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.xmlpull.v1.XmlSerializer;
+
+import java.io.CharArrayWriter;
+import java.lang.reflect.Constructor;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Random;
+
+@RunWith(Parameterized.class)
+@LargeTest
+public class XmlSerializePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Parameters(name = "mDatasetAsString({0}), mSeed({1})")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(
+ new Object[][] {
+ {"0.99 0.7 0.7 0.7 0.7 0.7", 854328},
+ {"0.999 0.3 0.3 0.95 0.9 0.9", 854328},
+ {"0.99 0.7 0.7 0.7 0.7 0.7", 312547},
+ {"0.999 0.3 0.3 0.95 0.9 0.9", 312547}
+ });
+ }
+
+ @Parameterized.Parameter(0)
+ public String mDatasetAsString;
+
+ @Parameterized.Parameter(1)
+ public int mSeed;
+
+ double[] mDataset;
+ private Constructor<? extends XmlSerializer> mKxmlConstructor;
+ private Constructor<? extends XmlSerializer> mFastConstructor;
+
+ private void serializeRandomXml(Constructor<? extends XmlSerializer> ctor, long mSeed)
+ throws Exception {
+ double contChance = mDataset[0];
+ double levelUpChance = mDataset[1];
+ double levelDownChance = mDataset[2];
+ double attributeChance = mDataset[3];
+ double writeChance1 = mDataset[4];
+ double writeChance2 = mDataset[5];
+
+ XmlSerializer serializer = (XmlSerializer) ctor.newInstance();
+
+ CharArrayWriter w = new CharArrayWriter();
+ serializer.setOutput(w);
+ int level = 0;
+ Random r = new Random(mSeed);
+ char[] toWrite = {'a', 'b', 'c', 'd', 's', 'z'};
+ serializer.startDocument("UTF-8", true);
+ while (r.nextDouble() < contChance) {
+ while (level > 0 && r.nextDouble() < levelUpChance) {
+ serializer.endTag("aaaaaa", "bbbbbb");
+ level--;
+ }
+ while (r.nextDouble() < levelDownChance) {
+ serializer.startTag("aaaaaa", "bbbbbb");
+ level++;
+ }
+ serializer.startTag("aaaaaa", "bbbbbb");
+ level++;
+ while (r.nextDouble() < attributeChance) {
+ serializer.attribute("aaaaaa", "cccccc", "dddddd");
+ }
+ serializer.endTag("aaaaaa", "bbbbbb");
+ level--;
+ while (r.nextDouble() < writeChance1) serializer.text(toWrite, 0, 5);
+ while (r.nextDouble() < writeChance2) serializer.text("Textxtsxtxtxt ");
+ }
+ serializer.endDocument();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Before
+ public void setUp() throws Exception {
+ mKxmlConstructor =
+ (Constructor)
+ Class.forName("com.android.org.kxml2.io.KXmlSerializer").getConstructor();
+ mFastConstructor =
+ (Constructor)
+ Class.forName("com.android.internal.util.FastXmlSerializer")
+ .getConstructor();
+ String[] splitStrings = mDatasetAsString.split(" ");
+ mDataset = new double[splitStrings.length];
+ for (int i = 0; i < splitStrings.length; i++) {
+ mDataset[i] = Double.parseDouble(splitStrings[i]);
+ }
+ }
+
+ private void internalTimeSerializer(Constructor<? extends XmlSerializer> ctor)
+ throws Exception {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ serializeRandomXml(ctor, mSeed);
+ }
+ }
+
+ @Test
+ public void timeKxml() throws Exception {
+ internalTimeSerializer(mKxmlConstructor);
+ }
+
+ @Test
+ public void timeFast() throws Exception {
+ internalTimeSerializer(mFastConstructor);
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java
new file mode 100644
index 0000000..517e3ce
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Random;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+@RunWith(Parameterized.class)
+@LargeTest
+public class ZipFilePerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ private File mFile;
+
+ @Parameters(name = "numEntries={0}")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(new Object[][] {{128}, {1024}, {8192}});
+ }
+
+ @Parameterized.Parameter(0)
+ public int numEntries;
+
+ @Before
+ public void setUp() throws Exception {
+ mFile = File.createTempFile(getClass().getName(), ".zip");
+ mFile.deleteOnExit();
+ writeEntries(new ZipOutputStream(new FileOutputStream(mFile)), numEntries, 0);
+ ZipFile zipFile = new ZipFile(mFile);
+ for (Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements(); ) {
+ ZipEntry zipEntry = e.nextElement();
+ }
+ zipFile.close();
+ }
+
+ @Test
+ public void timeZipFileOpen() throws Exception {
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ ZipFile zf = new ZipFile(mFile);
+ }
+ }
+
+ /** Compresses the given number of files, each of the given size, into a .zip archive. */
+ protected void writeEntries(ZipOutputStream out, int entryCount, long entrySize)
+ throws IOException {
+ byte[] writeBuffer = new byte[8192];
+ Random random = new Random();
+ try {
+ for (int entry = 0; entry < entryCount; ++entry) {
+ ZipEntry ze = new ZipEntry(Integer.toHexString(entry));
+ ze.setSize(entrySize);
+ out.putNextEntry(ze);
+
+ for (long i = 0; i < entrySize; i += writeBuffer.length) {
+ random.nextBytes(writeBuffer);
+ int byteCount = (int) Math.min(writeBuffer.length, entrySize - i);
+ out.write(writeBuffer, 0, byteCount);
+ }
+
+ out.closeEntry();
+ }
+ } finally {
+ out.close();
+ }
+ }
+}
diff --git a/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java
new file mode 100644
index 0000000..faa9628
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.libcore;
+
+import android.perftests.utils.BenchmarkState;
+import android.perftests.utils.PerfStatusReporter;
+import android.test.suitebuilder.annotation.LargeTest;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Random;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+@RunWith(Parameterized.class)
+@LargeTest
+public class ZipFileReadPerfTest {
+ @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
+
+ @Parameters(name = "readBufferSize={0}")
+ public static Collection<Object[]> data() {
+ return Arrays.asList(new Object[][] {{1024}, {16384}, {65536}});
+ }
+
+ private File mFile;
+
+ @Parameterized.Parameter(0)
+ public int readBufferSize;
+
+ @Before
+ public void setUp() throws Exception {
+ mFile = File.createTempFile(getClass().getName(), ".zip");
+ writeEntries(new ZipOutputStream(new FileOutputStream(mFile)), 2, 1024 * 1024);
+ ZipFile zipFile = new ZipFile(mFile);
+ for (Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements(); ) {
+ ZipEntry zipEntry = e.nextElement();
+ }
+ zipFile.close();
+ }
+
+ /** Compresses the given number of files, each of the given size, into a .zip archive. */
+ protected void writeEntries(ZipOutputStream out, int entryCount, long entrySize)
+ throws IOException {
+ byte[] writeBuffer = new byte[8192];
+ Random random = new Random();
+ try {
+ for (int entry = 0; entry < entryCount; ++entry) {
+ ZipEntry ze = new ZipEntry(Integer.toHexString(entry));
+ ze.setSize(entrySize);
+ out.putNextEntry(ze);
+
+ for (long i = 0; i < entrySize; i += writeBuffer.length) {
+ random.nextBytes(writeBuffer);
+ int byteCount = (int) Math.min(writeBuffer.length, entrySize - i);
+ out.write(writeBuffer, 0, byteCount);
+ }
+
+ out.closeEntry();
+ }
+ } finally {
+ out.close();
+ }
+ }
+
+ @Test
+ public void timeZipFileRead() throws Exception {
+ byte[] readBuffer = new byte[readBufferSize];
+ BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+ while (state.keepRunning()) {
+ ZipFile zipFile = new ZipFile(mFile);
+ for (Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements(); ) {
+ ZipEntry zipEntry = e.nextElement();
+ InputStream is = zipFile.getInputStream(zipEntry);
+ while (true) {
+ if (is.read(readBuffer, 0, readBuffer.length) < 0) {
+ break;
+ }
+ }
+ }
+ zipFile.close();
+ }
+ }
+}
diff --git a/apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java b/apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java
index 38500af..f6ae56f 100644
--- a/apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java
+++ b/apex/blobstore/framework/java/android/app/blob/BlobStoreManager.java
@@ -507,6 +507,22 @@
}
/**
+ * Release all the leases which are currently held by the caller.
+ *
+ * @hide
+ */
+ public void releaseAllLeases() throws Exception {
+ try {
+ mService.releaseAllLeases(mContext.getOpPackageName());
+ } catch (ParcelableException e) {
+ e.maybeRethrow(IOException.class);
+ throw new RuntimeException(e);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Return the remaining quota size for acquiring a lease (in bytes) which indicates the
* remaining amount of data that an app can acquire a lease on before the System starts
* rejecting lease requests.
diff --git a/apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl b/apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl
index 39a9fb4..1566fa8 100644
--- a/apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl
+++ b/apex/blobstore/framework/java/android/app/blob/IBlobStoreManager.aidl
@@ -31,6 +31,7 @@
void acquireLease(in BlobHandle handle, int descriptionResId, in CharSequence description,
long leaseTimeoutMillis, in String packageName);
void releaseLease(in BlobHandle handle, in String packageName);
+ void releaseAllLeases(in String packageName);
long getRemainingLeaseQuotaBytes(String packageName);
void waitForIdle(in RemoteCallback callback);
diff --git a/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java b/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
index c83ca8c..9ac3e41 100644
--- a/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
+++ b/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
@@ -554,6 +554,21 @@
}
}
+ private void releaseAllLeasesInternal(int callingUid, String callingPackage) {
+ synchronized (mBlobsLock) {
+ // Remove the package from the leasee list
+ mBlobsMap.forEach((blobHandle, blobMetadata) -> {
+ blobMetadata.removeLeasee(callingPackage, callingUid);
+ });
+ writeBlobsInfoAsync();
+
+ if (LOGV) {
+ Slog.v(TAG, "Release all leases associated with pkg="
+ + callingPackage + ", uid=" + callingUid);
+ }
+ }
+ }
+
private long getRemainingLeaseQuotaBytesInternal(int callingUid, String callingPackage) {
synchronized (mBlobsLock) {
final long remainingQuota = BlobStoreConfig.getAppDataBytesLimit()
@@ -1376,7 +1391,7 @@
}
}
- private boolean isAllowedBlobAccess(int uid, String packageName) {
+ private boolean isAllowedBlobStoreAccess(int uid, String packageName) {
return (!Process.isSdkSandboxUid(uid) && !Process.isIsolated(uid)
&& !mPackageManagerInternal.isInstantApp(packageName, UserHandle.getUserId(uid)));
}
@@ -1442,7 +1457,7 @@
final int callingUid = Binder.getCallingUid();
verifyCallingPackage(callingUid, packageName);
- if (!isAllowedBlobAccess(callingUid, packageName)) {
+ if (!isAllowedBlobStoreAccess(callingUid, packageName)) {
throw new SecurityException("Caller not allowed to create session; "
+ "callingUid=" + callingUid + ", callingPackage=" + packageName);
}
@@ -1491,7 +1506,7 @@
final int callingUid = Binder.getCallingUid();
verifyCallingPackage(callingUid, packageName);
- if (!isAllowedBlobAccess(callingUid, packageName)) {
+ if (!isAllowedBlobStoreAccess(callingUid, packageName)) {
throw new SecurityException("Caller not allowed to open blob; "
+ "callingUid=" + callingUid + ", callingPackage=" + packageName);
}
@@ -1522,7 +1537,7 @@
final int callingUid = Binder.getCallingUid();
verifyCallingPackage(callingUid, packageName);
- if (!isAllowedBlobAccess(callingUid, packageName)) {
+ if (!isAllowedBlobStoreAccess(callingUid, packageName)) {
throw new SecurityException("Caller not allowed to open blob; "
+ "callingUid=" + callingUid + ", callingPackage=" + packageName);
}
@@ -1546,7 +1561,7 @@
final int callingUid = Binder.getCallingUid();
verifyCallingPackage(callingUid, packageName);
- if (!isAllowedBlobAccess(callingUid, packageName)) {
+ if (!isAllowedBlobStoreAccess(callingUid, packageName)) {
throw new SecurityException("Caller not allowed to open blob; "
+ "callingUid=" + callingUid + ", callingPackage=" + packageName);
}
@@ -1555,6 +1570,21 @@
}
@Override
+ public void releaseAllLeases(@NonNull String packageName) {
+ Objects.requireNonNull(packageName, "packageName must not be null");
+
+ final int callingUid = Binder.getCallingUid();
+ verifyCallingPackage(callingUid, packageName);
+
+ if (!isAllowedBlobStoreAccess(callingUid, packageName)) {
+ throw new SecurityException("Caller not allowed to open blob; "
+ + "callingUid=" + callingUid + ", callingPackage=" + packageName);
+ }
+
+ releaseAllLeasesInternal(callingUid, packageName);
+ }
+
+ @Override
public long getRemainingLeaseQuotaBytes(@NonNull String packageName) {
final int callingUid = Binder.getCallingUid();
verifyCallingPackage(callingUid, packageName);
@@ -1629,7 +1659,7 @@
final int callingUid = Binder.getCallingUid();
verifyCallingPackage(callingUid, packageName);
- if (!isAllowedBlobAccess(callingUid, packageName)) {
+ if (!isAllowedBlobStoreAccess(callingUid, packageName)) {
throw new SecurityException("Caller not allowed to open blob; "
+ "callingUid=" + callingUid + ", callingPackage=" + packageName);
}
diff --git a/apex/jobscheduler/OWNERS b/apex/jobscheduler/OWNERS
index c77ea33..58434f1 100644
--- a/apex/jobscheduler/OWNERS
+++ b/apex/jobscheduler/OWNERS
@@ -1,7 +1,9 @@
ctate@android.com
ctate@google.com
dplotnikov@google.com
+jji@google.com
kwekua@google.com
omakoto@google.com
suprabh@google.com
+varunshah@google.com
yamasani@google.com
diff --git a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
index b9673f2..18665e7 100644
--- a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
+++ b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
@@ -18,6 +18,7 @@
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_METERED;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_VPN;
import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED;
@@ -1332,6 +1333,7 @@
builder.addCapability(NET_CAPABILITY_INTERNET);
builder.addCapability(NET_CAPABILITY_VALIDATED);
builder.removeCapability(NET_CAPABILITY_NOT_VPN);
+ builder.removeCapability(NET_CAPABILITY_NOT_RESTRICTED);
if (networkType == NETWORK_TYPE_ANY) {
// No other capabilities
diff --git a/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java b/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java
index c572f82..ac8b2e2 100644
--- a/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java
+++ b/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java
@@ -369,6 +369,16 @@
* @hide
*/
public static final int REASON_CARRIER_PRIVILEGED_APP = 321;
+ /**
+ * Device/Profile owner protected apps.
+ * @hide
+ */
+ public static final int REASON_DPO_PROTECTED_APP = 322;
+ /**
+ * Apps control is disallowed for the user.
+ * @hide
+ */
+ public static final int REASON_DISALLOW_APPS_CONTROL = 323;
/** @hide The app requests out-out. */
public static final int REASON_OPT_OUT_REQUESTED = 1000;
@@ -447,6 +457,8 @@
REASON_SYSTEM_MODULE,
REASON_CARRIER_PRIVILEGED_APP,
REASON_OPT_OUT_REQUESTED,
+ REASON_DPO_PROTECTED_APP,
+ REASON_DISALLOW_APPS_CONTROL,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ReasonCode {}
@@ -653,6 +665,10 @@
return AppBackgroundRestrictionsInfo.REASON_ROLE_DIALER;
case REASON_ROLE_EMERGENCY:
return AppBackgroundRestrictionsInfo.REASON_ROLE_EMERGENCY;
+ case REASON_DPO_PROTECTED_APP:
+ return AppBackgroundRestrictionsInfo.REASON_DPO_PROTECTED_APP;
+ case REASON_DISALLOW_APPS_CONTROL:
+ return AppBackgroundRestrictionsInfo.REASON_DISALLOW_APPS_CONTROL;
default:
return AppBackgroundRestrictionsInfo.REASON_DENIED;
}
@@ -798,6 +814,10 @@
return "SYSTEM_MODULE";
case REASON_CARRIER_PRIVILEGED_APP:
return "CARRIER_PRIVILEGED_APP";
+ case REASON_DPO_PROTECTED_APP:
+ return "DPO_PROTECTED_APP";
+ case REASON_DISALLOW_APPS_CONTROL:
+ return "DISALLOW_APPS_CONTROL";
case REASON_OPT_OUT_REQUESTED:
return "REASON_OPT_OUT_REQUESTED";
default:
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/Agent.java b/apex/jobscheduler/service/java/com/android/server/tare/Agent.java
index c0a8148..f4faec8 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/Agent.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/Agent.java
@@ -28,8 +28,8 @@
import static com.android.server.tare.EconomicPolicy.eventToString;
import static com.android.server.tare.EconomicPolicy.getEventType;
import static com.android.server.tare.TareUtils.appToString;
+import static com.android.server.tare.TareUtils.cakeToString;
import static com.android.server.tare.TareUtils.getCurrentTimeMillis;
-import static com.android.server.tare.TareUtils.narcToString;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -161,7 +161,7 @@
@GuardedBy("mLock")
private boolean isAffordableLocked(long balance, long price, long ctp) {
- return balance >= price && mScribe.getRemainingConsumableNarcsLocked() >= ctp;
+ return balance >= price && mScribe.getRemainingConsumableCakesLocked() >= ctp;
}
@GuardedBy("mLock")
@@ -464,13 +464,13 @@
+ eventToString(transaction.eventId)
+ (transaction.tag == null ? "" : ":" + transaction.tag)
+ " for " + appToString(userId, pkgName)
- + " by " + narcToString(transaction.delta - newDelta));
+ + " by " + cakeToString(transaction.delta - newDelta));
transaction = new Ledger.Transaction(
transaction.startTimeMs, transaction.endTimeMs,
transaction.eventId, transaction.tag, newDelta, transaction.ctp);
}
ledger.recordTransaction(transaction);
- mScribe.adjustRemainingConsumableNarcsLocked(-transaction.ctp);
+ mScribe.adjustRemainingConsumableCakesLocked(-transaction.ctp);
if (transaction.delta != 0 && notifyOnAffordabilityChange) {
final ArraySet<ActionAffordabilityNote> actionAffordabilityNotes =
mActionAffordabilityNotes.get(userId, pkgName);
@@ -724,7 +724,7 @@
private void reclaimAssetsLocked(final int userId, @NonNull final String pkgName) {
final Ledger ledger = mScribe.getLedgerLocked(userId, pkgName);
if (ledger.getCurrentBalance() != 0) {
- mScribe.adjustRemainingConsumableNarcsLocked(-ledger.getCurrentBalance());
+ mScribe.adjustRemainingConsumableCakesLocked(-ledger.getCurrentBalance());
}
mScribe.discardLedgerLocked(userId, pkgName);
mCurrentOngoingEvents.delete(userId, pkgName);
@@ -872,7 +872,7 @@
return;
}
mTrendCalculator.reset(getBalanceLocked(userId, pkgName),
- mScribe.getRemainingConsumableNarcsLocked(),
+ mScribe.getRemainingConsumableCakesLocked(),
mActionAffordabilityNotes.get(userId, pkgName));
ongoingEvents.forEach(mTrendCalculator);
final long lowerTimeMs = mTrendCalculator.getTimeToCrossLowerThresholdMs();
@@ -1260,11 +1260,11 @@
pw.print(" runtime=");
TimeUtils.formatDuration(nowElapsed - ongoingEvent.startTimeElapsed, pw);
pw.print(" delta/sec=");
- pw.print(narcToString(ongoingEvent.getDeltaPerSec()));
+ pw.print(cakeToString(ongoingEvent.getDeltaPerSec()));
final long ctp = ongoingEvent.getCtpPerSec();
if (ctp != 0) {
pw.print(" ctp/sec=");
- pw.print(narcToString(ongoingEvent.getCtpPerSec()));
+ pw.print(cakeToString(ongoingEvent.getCtpPerSec()));
}
pw.print(" refCount=");
pw.print(ongoingEvent.refCount);
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/AlarmManagerEconomicPolicy.java b/apex/jobscheduler/service/java/com/android/server/tare/AlarmManagerEconomicPolicy.java
index 71e00cf..c2e8188 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/AlarmManagerEconomicPolicy.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/AlarmManagerEconomicPolicy.java
@@ -97,8 +97,8 @@
import static com.android.server.tare.Modifier.COST_MODIFIER_DEVICE_IDLE;
import static com.android.server.tare.Modifier.COST_MODIFIER_POWER_SAVE_MODE;
import static com.android.server.tare.Modifier.COST_MODIFIER_PROCESS_STATE;
-import static com.android.server.tare.TareUtils.arcToNarc;
-import static com.android.server.tare.TareUtils.narcToString;
+import static com.android.server.tare.TareUtils.arcToCake;
+import static com.android.server.tare.TareUtils.cakeToString;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -219,143 +219,143 @@
Slog.e(TAG, "Global setting key incorrect: ", e);
}
- mMinSatiatedBalanceExempted = arcToNarc(mParser.getInt(KEY_AM_MIN_SATIATED_BALANCE_EXEMPTED,
+ mMinSatiatedBalanceExempted = arcToCake(mParser.getInt(KEY_AM_MIN_SATIATED_BALANCE_EXEMPTED,
DEFAULT_AM_MIN_SATIATED_BALANCE_EXEMPTED));
- mMinSatiatedBalanceOther = arcToNarc(mParser.getInt(KEY_AM_MIN_SATIATED_BALANCE_OTHER_APP,
+ mMinSatiatedBalanceOther = arcToCake(mParser.getInt(KEY_AM_MIN_SATIATED_BALANCE_OTHER_APP,
DEFAULT_AM_MIN_SATIATED_BALANCE_OTHER_APP));
- mMaxSatiatedBalance = arcToNarc(mParser.getInt(KEY_AM_MAX_SATIATED_BALANCE,
+ mMaxSatiatedBalance = arcToCake(mParser.getInt(KEY_AM_MAX_SATIATED_BALANCE,
DEFAULT_AM_MAX_SATIATED_BALANCE));
- mInitialSatiatedConsumptionLimit = arcToNarc(mParser.getInt(
+ mInitialSatiatedConsumptionLimit = arcToCake(mParser.getInt(
KEY_AM_INITIAL_CONSUMPTION_LIMIT, DEFAULT_AM_INITIAL_CONSUMPTION_LIMIT));
mHardSatiatedConsumptionLimit = Math.max(mInitialSatiatedConsumptionLimit,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_HARD_CONSUMPTION_LIMIT, DEFAULT_AM_HARD_CONSUMPTION_LIMIT)));
- final long exactAllowWhileIdleWakeupBasePrice = arcToNarc(
+ final long exactAllowWhileIdleWakeupBasePrice = arcToCake(
mParser.getInt(KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_WAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_WAKEUP_BASE_PRICE));
mActions.put(ACTION_ALARM_WAKEUP_EXACT_ALLOW_WHILE_IDLE,
new Action(ACTION_ALARM_WAKEUP_EXACT_ALLOW_WHILE_IDLE,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_WAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_WAKEUP_CTP)),
exactAllowWhileIdleWakeupBasePrice));
mActions.put(ACTION_ALARM_WAKEUP_EXACT,
new Action(ACTION_ALARM_WAKEUP_EXACT,
- arcToNarc(mParser.getInt(KEY_AM_ACTION_ALARM_EXACT_WAKEUP_CTP,
+ arcToCake(mParser.getInt(KEY_AM_ACTION_ALARM_EXACT_WAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_EXACT_WAKEUP_CTP)),
- arcToNarc(mParser.getInt(KEY_AM_ACTION_ALARM_EXACT_WAKEUP_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_AM_ACTION_ALARM_EXACT_WAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_EXACT_WAKEUP_BASE_PRICE))));
final long inexactAllowWhileIdleWakeupBasePrice =
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_WAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_WAKEUP_BASE_PRICE));
mActions.put(ACTION_ALARM_WAKEUP_INEXACT_ALLOW_WHILE_IDLE,
new Action(ACTION_ALARM_WAKEUP_INEXACT_ALLOW_WHILE_IDLE,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_WAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_WAKEUP_CTP)),
inexactAllowWhileIdleWakeupBasePrice));
mActions.put(ACTION_ALARM_WAKEUP_INEXACT,
new Action(ACTION_ALARM_WAKEUP_INEXACT,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_INEXACT_WAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_INEXACT_WAKEUP_CTP)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_INEXACT_WAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_INEXACT_WAKEUP_BASE_PRICE))));
final long exactAllowWhileIdleNonWakeupBasePrice =
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_NONWAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_NONWAKEUP_BASE_PRICE));
mActions.put(ACTION_ALARM_NONWAKEUP_EXACT_ALLOW_WHILE_IDLE,
new Action(ACTION_ALARM_NONWAKEUP_EXACT_ALLOW_WHILE_IDLE,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_NONWAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_NONWAKEUP_CTP)),
exactAllowWhileIdleNonWakeupBasePrice));
mActions.put(ACTION_ALARM_NONWAKEUP_EXACT,
new Action(ACTION_ALARM_NONWAKEUP_EXACT,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_EXACT_NONWAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_EXACT_NONWAKEUP_CTP)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_EXACT_NONWAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_EXACT_NONWAKEUP_BASE_PRICE))));
final long inexactAllowWhileIdleNonWakeupBasePrice =
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_NONWAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_NONWAKEUP_BASE_PRICE));
mActions.put(ACTION_ALARM_NONWAKEUP_INEXACT_ALLOW_WHILE_IDLE,
new Action(ACTION_ALARM_NONWAKEUP_INEXACT_ALLOW_WHILE_IDLE,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_NONWAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_NONWAKEUP_CTP)),
inexactAllowWhileIdleNonWakeupBasePrice));
mActions.put(ACTION_ALARM_NONWAKEUP_INEXACT,
new Action(ACTION_ALARM_NONWAKEUP_INEXACT,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_INEXACT_NONWAKEUP_CTP,
DEFAULT_AM_ACTION_ALARM_INEXACT_NONWAKEUP_CTP)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_INEXACT_NONWAKEUP_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_INEXACT_NONWAKEUP_BASE_PRICE))));
mActions.put(ACTION_ALARM_CLOCK,
new Action(ACTION_ALARM_CLOCK,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALARMCLOCK_CTP,
DEFAULT_AM_ACTION_ALARM_ALARMCLOCK_CTP)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_ACTION_ALARM_ALARMCLOCK_BASE_PRICE,
DEFAULT_AM_ACTION_ALARM_ALARMCLOCK_BASE_PRICE))));
mRewards.put(REWARD_TOP_ACTIVITY, new Reward(REWARD_TOP_ACTIVITY,
- arcToNarc(mParser.getInt(KEY_AM_REWARD_TOP_ACTIVITY_INSTANT,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_TOP_ACTIVITY_INSTANT,
DEFAULT_AM_REWARD_TOP_ACTIVITY_INSTANT)),
- (long) (arcToNarc(1) * mParser.getFloat(KEY_AM_REWARD_TOP_ACTIVITY_ONGOING,
+ (long) (arcToCake(1) * mParser.getFloat(KEY_AM_REWARD_TOP_ACTIVITY_ONGOING,
DEFAULT_AM_REWARD_TOP_ACTIVITY_ONGOING)),
- arcToNarc(mParser.getInt(KEY_AM_REWARD_TOP_ACTIVITY_MAX,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_TOP_ACTIVITY_MAX,
DEFAULT_AM_REWARD_TOP_ACTIVITY_MAX))));
mRewards.put(REWARD_NOTIFICATION_SEEN, new Reward(REWARD_NOTIFICATION_SEEN,
- arcToNarc(mParser.getInt(KEY_AM_REWARD_NOTIFICATION_SEEN_INSTANT,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_NOTIFICATION_SEEN_INSTANT,
DEFAULT_AM_REWARD_NOTIFICATION_SEEN_INSTANT)),
- arcToNarc(mParser.getInt(KEY_AM_REWARD_NOTIFICATION_SEEN_ONGOING,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_NOTIFICATION_SEEN_ONGOING,
DEFAULT_AM_REWARD_NOTIFICATION_SEEN_ONGOING)),
- arcToNarc(mParser.getInt(KEY_AM_REWARD_NOTIFICATION_SEEN_MAX,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_NOTIFICATION_SEEN_MAX,
DEFAULT_AM_REWARD_NOTIFICATION_SEEN_MAX))));
mRewards.put(REWARD_NOTIFICATION_INTERACTION,
new Reward(REWARD_NOTIFICATION_INTERACTION,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_REWARD_NOTIFICATION_INTERACTION_INSTANT,
DEFAULT_AM_REWARD_NOTIFICATION_INTERACTION_INSTANT)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_REWARD_NOTIFICATION_INTERACTION_ONGOING,
DEFAULT_AM_REWARD_NOTIFICATION_INTERACTION_ONGOING)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_REWARD_NOTIFICATION_INTERACTION_MAX,
DEFAULT_AM_REWARD_NOTIFICATION_INTERACTION_MAX))));
mRewards.put(REWARD_WIDGET_INTERACTION, new Reward(REWARD_WIDGET_INTERACTION,
- arcToNarc(mParser.getInt(KEY_AM_REWARD_WIDGET_INTERACTION_INSTANT,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_WIDGET_INTERACTION_INSTANT,
DEFAULT_AM_REWARD_WIDGET_INTERACTION_INSTANT)),
- arcToNarc(mParser.getInt(KEY_AM_REWARD_WIDGET_INTERACTION_ONGOING,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_WIDGET_INTERACTION_ONGOING,
DEFAULT_AM_REWARD_WIDGET_INTERACTION_ONGOING)),
- arcToNarc(mParser.getInt(KEY_AM_REWARD_WIDGET_INTERACTION_MAX,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_WIDGET_INTERACTION_MAX,
DEFAULT_AM_REWARD_WIDGET_INTERACTION_MAX))));
mRewards.put(REWARD_OTHER_USER_INTERACTION,
new Reward(REWARD_OTHER_USER_INTERACTION,
- arcToNarc(mParser.getInt(KEY_AM_REWARD_OTHER_USER_INTERACTION_INSTANT,
+ arcToCake(mParser.getInt(KEY_AM_REWARD_OTHER_USER_INTERACTION_INSTANT,
DEFAULT_AM_REWARD_OTHER_USER_INTERACTION_INSTANT)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_REWARD_OTHER_USER_INTERACTION_ONGOING,
DEFAULT_AM_REWARD_OTHER_USER_INTERACTION_ONGOING)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_AM_REWARD_OTHER_USER_INTERACTION_MAX,
DEFAULT_AM_REWARD_OTHER_USER_INTERACTION_MAX))));
}
@@ -364,14 +364,14 @@
void dump(IndentingPrintWriter pw) {
pw.println("Min satiated balances:");
pw.increaseIndent();
- pw.print("Exempted", narcToString(mMinSatiatedBalanceExempted)).println();
- pw.print("Other", narcToString(mMinSatiatedBalanceOther)).println();
+ pw.print("Exempted", cakeToString(mMinSatiatedBalanceExempted)).println();
+ pw.print("Other", cakeToString(mMinSatiatedBalanceOther)).println();
pw.decreaseIndent();
- pw.print("Max satiated balance", narcToString(mMaxSatiatedBalance)).println();
+ pw.print("Max satiated balance", cakeToString(mMaxSatiatedBalance)).println();
pw.print("Consumption limits: [");
- pw.print(narcToString(mInitialSatiatedConsumptionLimit));
+ pw.print(cakeToString(mInitialSatiatedConsumptionLimit));
pw.print(", ");
- pw.print(narcToString(mHardSatiatedConsumptionLimit));
+ pw.print(cakeToString(mHardSatiatedConsumptionLimit));
pw.println("]");
pw.println();
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/EconomicPolicy.java b/apex/jobscheduler/service/java/com/android/server/tare/EconomicPolicy.java
index 1e48015..3a26aae 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/EconomicPolicy.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/EconomicPolicy.java
@@ -21,7 +21,7 @@
import static com.android.server.tare.Modifier.COST_MODIFIER_POWER_SAVE_MODE;
import static com.android.server.tare.Modifier.COST_MODIFIER_PROCESS_STATE;
import static com.android.server.tare.Modifier.NUM_COST_MODIFIERS;
-import static com.android.server.tare.TareUtils.narcToString;
+import static com.android.server.tare.TareUtils.cakeToString;
import android.annotation.CallSuper;
import android.annotation.IntDef;
@@ -203,7 +203,7 @@
abstract long getMaxSatiatedBalance();
/**
- * Returns the maximum number of narcs that should be consumed during a full 100% discharge
+ * Returns the maximum number of cakes that should be consumed during a full 100% discharge
* cycle. This is the initial limit. The system may choose to increase the limit over time,
* but the increased limit should never exceed the value returned from
* {@link #getHardSatiatedConsumptionLimit()}.
@@ -211,7 +211,7 @@
abstract long getInitialSatiatedConsumptionLimit();
/**
- * Returns the maximum number of narcs that should be consumed during a full 100% discharge
+ * Returns the maximum number of cakes that should be consumed during a full 100% discharge
* cycle. This is the hard limit that should never be exceeded.
*/
abstract long getHardSatiatedConsumptionLimit();
@@ -430,9 +430,9 @@
pw.print(actionToString(action.id));
pw.print(": ");
pw.print("ctp=");
- pw.print(narcToString(action.costToProduce));
+ pw.print(cakeToString(action.costToProduce));
pw.print(", basePrice=");
- pw.print(narcToString(action.basePrice));
+ pw.print(cakeToString(action.basePrice));
pw.println();
}
@@ -440,11 +440,11 @@
pw.print(rewardToString(reward.id));
pw.print(": ");
pw.print("instant=");
- pw.print(narcToString(reward.instantReward));
+ pw.print(cakeToString(reward.instantReward));
pw.print(", ongoing/sec=");
- pw.print(narcToString(reward.ongoingRewardPerSecond));
+ pw.print(cakeToString(reward.ongoingRewardPerSecond));
pw.print(", maxDaily=");
- pw.print(narcToString(reward.maxDailyReward));
+ pw.print(cakeToString(reward.maxDailyReward));
pw.println();
}
}
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java b/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java
index c934807..ce4604f 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java
@@ -23,8 +23,8 @@
import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
import static com.android.server.tare.TareUtils.appToString;
+import static com.android.server.tare.TareUtils.cakeToString;
import static com.android.server.tare.TareUtils.getCurrentTimeMillis;
-import static com.android.server.tare.TareUtils.narcToString;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -528,9 +528,9 @@
void maybePerformQuantitativeEasingLocked() {
// We don't need to increase the limit if the device runs out of consumable credits
// when the battery is low.
- final long remainingConsumableNarcs = mScribe.getRemainingConsumableNarcsLocked();
+ final long remainingConsumableCakes = mScribe.getRemainingConsumableCakesLocked();
if (mCurrentBatteryLevel <= QUANTITATIVE_EASING_BATTERY_THRESHOLD
- || remainingConsumableNarcs > 0) {
+ || remainingConsumableCakes > 0) {
return;
}
final long currentConsumptionLimit = mScribe.getSatiatedConsumptionLimitLocked();
@@ -539,8 +539,8 @@
final long newConsumptionLimit = Math.min(currentConsumptionLimit + shortfall,
mCompleteEconomicPolicy.getHardSatiatedConsumptionLimit());
if (newConsumptionLimit != currentConsumptionLimit) {
- Slog.i(TAG, "Increasing consumption limit from " + narcToString(currentConsumptionLimit)
- + " to " + narcToString(newConsumptionLimit));
+ Slog.i(TAG, "Increasing consumption limit from " + cakeToString(currentConsumptionLimit)
+ + " to " + cakeToString(newConsumptionLimit));
mScribe.setConsumptionLimitLocked(newConsumptionLimit);
adjustCreditSupplyLocked(/* allowIncrease */ true);
}
@@ -562,16 +562,16 @@
@GuardedBy("mLock")
private void adjustCreditSupplyLocked(boolean allowIncrease) {
final long newLimit = getConsumptionLimitLocked();
- final long remainingConsumableNarcs = mScribe.getRemainingConsumableNarcsLocked();
- if (remainingConsumableNarcs == newLimit) {
+ final long remainingConsumableCakes = mScribe.getRemainingConsumableCakesLocked();
+ if (remainingConsumableCakes == newLimit) {
return;
}
- if (remainingConsumableNarcs > newLimit) {
- mScribe.adjustRemainingConsumableNarcsLocked(newLimit - remainingConsumableNarcs);
+ if (remainingConsumableCakes > newLimit) {
+ mScribe.adjustRemainingConsumableCakesLocked(newLimit - remainingConsumableCakes);
} else if (allowIncrease) {
final double perc = mCurrentBatteryLevel / 100d;
- final long shortfall = newLimit - remainingConsumableNarcs;
- mScribe.adjustRemainingConsumableNarcsLocked((long) (perc * shortfall));
+ final long shortfall = newLimit - remainingConsumableCakes;
+ mScribe.adjustRemainingConsumableCakesLocked((long) (perc * shortfall));
}
mAgent.onCreditSupplyChanged();
}
@@ -919,7 +919,7 @@
+ cost.price * (action.ongoingDurationMs / 1000);
}
return mAgent.getBalanceLocked(userId, pkgName) >= requiredBalance
- && mScribe.getRemainingConsumableNarcsLocked() >= requiredBalance;
+ && mScribe.getRemainingConsumableCakesLocked() >= requiredBalance;
}
}
@@ -947,7 +947,7 @@
}
final long minBalance = Math.min(
mAgent.getBalanceLocked(userId, pkgName),
- mScribe.getRemainingConsumableNarcsLocked());
+ mScribe.getRemainingConsumableCakesLocked());
return minBalance * 1000 / totalCostPerSecond;
}
}
@@ -1103,21 +1103,21 @@
final long consumptionLimit = getConsumptionLimitLocked();
pw.print("Consumption limit (current/initial-satiated/current-satiated): ");
- pw.print(narcToString(consumptionLimit));
+ pw.print(cakeToString(consumptionLimit));
pw.print("/");
- pw.print(narcToString(mCompleteEconomicPolicy.getInitialSatiatedConsumptionLimit()));
+ pw.print(cakeToString(mCompleteEconomicPolicy.getInitialSatiatedConsumptionLimit()));
pw.print("/");
- pw.println(narcToString(mScribe.getSatiatedConsumptionLimitLocked()));
+ pw.println(cakeToString(mScribe.getSatiatedConsumptionLimitLocked()));
- final long remainingConsumable = mScribe.getRemainingConsumableNarcsLocked();
+ final long remainingConsumable = mScribe.getRemainingConsumableCakesLocked();
pw.print("Goods remaining: ");
- pw.print(narcToString(remainingConsumable));
+ pw.print(cakeToString(remainingConsumable));
pw.print(" (");
pw.print(String.format("%.2f", 100f * remainingConsumable / consumptionLimit));
pw.println("% of current limit)");
pw.print("Device wealth: ");
- pw.println(narcToString(mScribe.getNarcsInCirculationForLoggingLocked()));
+ pw.println(cakeToString(mScribe.getCakesInCirculationForLoggingLocked()));
pw.println();
pw.print("Exempted apps", mExemptedApps);
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/JobSchedulerEconomicPolicy.java b/apex/jobscheduler/service/java/com/android/server/tare/JobSchedulerEconomicPolicy.java
index 0eddd22..99b93ce 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/JobSchedulerEconomicPolicy.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/JobSchedulerEconomicPolicy.java
@@ -106,8 +106,8 @@
import static com.android.server.tare.Modifier.COST_MODIFIER_DEVICE_IDLE;
import static com.android.server.tare.Modifier.COST_MODIFIER_POWER_SAVE_MODE;
import static com.android.server.tare.Modifier.COST_MODIFIER_PROCESS_STATE;
-import static com.android.server.tare.TareUtils.arcToNarc;
-import static com.android.server.tare.TareUtils.narcToString;
+import static com.android.server.tare.TareUtils.arcToCake;
+import static com.android.server.tare.TareUtils.cakeToString;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -221,116 +221,116 @@
Slog.e(TAG, "Global setting key incorrect: ", e);
}
- mMinSatiatedBalanceExempted = arcToNarc(
+ mMinSatiatedBalanceExempted = arcToCake(
mParser.getInt(KEY_JS_MIN_SATIATED_BALANCE_EXEMPTED,
DEFAULT_JS_MIN_SATIATED_BALANCE_EXEMPTED));
- mMinSatiatedBalanceOther = arcToNarc(
+ mMinSatiatedBalanceOther = arcToCake(
mParser.getInt(KEY_JS_MIN_SATIATED_BALANCE_OTHER_APP,
DEFAULT_JS_MIN_SATIATED_BALANCE_OTHER_APP));
- mMaxSatiatedBalance = arcToNarc(mParser.getInt(KEY_JS_MAX_SATIATED_BALANCE,
+ mMaxSatiatedBalance = arcToCake(mParser.getInt(KEY_JS_MAX_SATIATED_BALANCE,
DEFAULT_JS_MAX_SATIATED_BALANCE));
- mInitialSatiatedConsumptionLimit = arcToNarc(mParser.getInt(
+ mInitialSatiatedConsumptionLimit = arcToCake(mParser.getInt(
KEY_JS_INITIAL_CONSUMPTION_LIMIT, DEFAULT_JS_INITIAL_CONSUMPTION_LIMIT));
mHardSatiatedConsumptionLimit = Math.max(mInitialSatiatedConsumptionLimit,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_JS_HARD_CONSUMPTION_LIMIT, DEFAULT_JS_HARD_CONSUMPTION_LIMIT)));
mActions.put(ACTION_JOB_MAX_START, new Action(ACTION_JOB_MAX_START,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MAX_START_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MAX_START_CTP,
DEFAULT_JS_ACTION_JOB_MAX_START_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MAX_START_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MAX_START_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_MAX_START_BASE_PRICE))));
mActions.put(ACTION_JOB_MAX_RUNNING, new Action(ACTION_JOB_MAX_RUNNING,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MAX_RUNNING_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MAX_RUNNING_CTP,
DEFAULT_JS_ACTION_JOB_MAX_RUNNING_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MAX_RUNNING_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MAX_RUNNING_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_MAX_RUNNING_BASE_PRICE))));
mActions.put(ACTION_JOB_HIGH_START, new Action(ACTION_JOB_HIGH_START,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_START_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_START_CTP,
DEFAULT_JS_ACTION_JOB_HIGH_START_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_START_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_START_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_HIGH_START_BASE_PRICE))));
mActions.put(ACTION_JOB_HIGH_RUNNING, new Action(ACTION_JOB_HIGH_RUNNING,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_RUNNING_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_RUNNING_CTP,
DEFAULT_JS_ACTION_JOB_HIGH_RUNNING_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_RUNNING_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_HIGH_RUNNING_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_HIGH_RUNNING_BASE_PRICE))));
mActions.put(ACTION_JOB_DEFAULT_START, new Action(ACTION_JOB_DEFAULT_START,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_START_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_START_CTP,
DEFAULT_JS_ACTION_JOB_DEFAULT_START_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_START_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_START_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_DEFAULT_START_BASE_PRICE))));
mActions.put(ACTION_JOB_DEFAULT_RUNNING, new Action(ACTION_JOB_DEFAULT_RUNNING,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_RUNNING_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_RUNNING_CTP,
DEFAULT_JS_ACTION_JOB_DEFAULT_RUNNING_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_RUNNING_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_DEFAULT_RUNNING_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_DEFAULT_RUNNING_BASE_PRICE))));
mActions.put(ACTION_JOB_LOW_START, new Action(ACTION_JOB_LOW_START,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_LOW_START_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_LOW_START_CTP,
DEFAULT_JS_ACTION_JOB_LOW_START_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_LOW_START_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_LOW_START_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_LOW_START_BASE_PRICE))));
mActions.put(ACTION_JOB_LOW_RUNNING, new Action(ACTION_JOB_LOW_RUNNING,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_LOW_RUNNING_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_LOW_RUNNING_CTP,
DEFAULT_JS_ACTION_JOB_LOW_RUNNING_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_LOW_RUNNING_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_LOW_RUNNING_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_LOW_RUNNING_BASE_PRICE))));
mActions.put(ACTION_JOB_MIN_START, new Action(ACTION_JOB_MIN_START,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MIN_START_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MIN_START_CTP,
DEFAULT_JS_ACTION_JOB_MIN_START_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MIN_START_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MIN_START_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_MIN_START_BASE_PRICE))));
mActions.put(ACTION_JOB_MIN_RUNNING, new Action(ACTION_JOB_MIN_RUNNING,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MIN_RUNNING_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MIN_RUNNING_CTP,
DEFAULT_JS_ACTION_JOB_MIN_RUNNING_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_MIN_RUNNING_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_MIN_RUNNING_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_MIN_RUNNING_BASE_PRICE))));
mActions.put(ACTION_JOB_TIMEOUT, new Action(ACTION_JOB_TIMEOUT,
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_TIMEOUT_PENALTY_CTP,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_TIMEOUT_PENALTY_CTP,
DEFAULT_JS_ACTION_JOB_TIMEOUT_PENALTY_CTP)),
- arcToNarc(mParser.getInt(KEY_JS_ACTION_JOB_TIMEOUT_PENALTY_BASE_PRICE,
+ arcToCake(mParser.getInt(KEY_JS_ACTION_JOB_TIMEOUT_PENALTY_BASE_PRICE,
DEFAULT_JS_ACTION_JOB_TIMEOUT_PENALTY_BASE_PRICE))));
mRewards.put(REWARD_TOP_ACTIVITY, new Reward(REWARD_TOP_ACTIVITY,
- arcToNarc(mParser.getInt(KEY_JS_REWARD_TOP_ACTIVITY_INSTANT,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_TOP_ACTIVITY_INSTANT,
DEFAULT_JS_REWARD_TOP_ACTIVITY_INSTANT)),
- (long) (arcToNarc(1) * mParser.getFloat(KEY_JS_REWARD_TOP_ACTIVITY_ONGOING,
+ (long) (arcToCake(1) * mParser.getFloat(KEY_JS_REWARD_TOP_ACTIVITY_ONGOING,
DEFAULT_JS_REWARD_TOP_ACTIVITY_ONGOING)),
- arcToNarc(mParser.getInt(KEY_JS_REWARD_TOP_ACTIVITY_MAX,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_TOP_ACTIVITY_MAX,
DEFAULT_JS_REWARD_TOP_ACTIVITY_MAX))));
mRewards.put(REWARD_NOTIFICATION_SEEN, new Reward(REWARD_NOTIFICATION_SEEN,
- arcToNarc(mParser.getInt(KEY_JS_REWARD_NOTIFICATION_SEEN_INSTANT,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_NOTIFICATION_SEEN_INSTANT,
DEFAULT_JS_REWARD_NOTIFICATION_SEEN_INSTANT)),
- arcToNarc(mParser.getInt(KEY_JS_REWARD_NOTIFICATION_SEEN_ONGOING,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_NOTIFICATION_SEEN_ONGOING,
DEFAULT_JS_REWARD_NOTIFICATION_SEEN_ONGOING)),
- arcToNarc(mParser.getInt(KEY_JS_REWARD_NOTIFICATION_SEEN_MAX,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_NOTIFICATION_SEEN_MAX,
DEFAULT_JS_REWARD_NOTIFICATION_SEEN_MAX))));
mRewards.put(REWARD_NOTIFICATION_INTERACTION,
new Reward(REWARD_NOTIFICATION_INTERACTION,
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_JS_REWARD_NOTIFICATION_INTERACTION_INSTANT,
DEFAULT_JS_REWARD_NOTIFICATION_INTERACTION_INSTANT)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_JS_REWARD_NOTIFICATION_INTERACTION_ONGOING,
DEFAULT_JS_REWARD_NOTIFICATION_INTERACTION_ONGOING)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_JS_REWARD_NOTIFICATION_INTERACTION_MAX,
DEFAULT_JS_REWARD_NOTIFICATION_INTERACTION_MAX))));
mRewards.put(REWARD_WIDGET_INTERACTION, new Reward(REWARD_WIDGET_INTERACTION,
- arcToNarc(mParser.getInt(KEY_JS_REWARD_WIDGET_INTERACTION_INSTANT,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_WIDGET_INTERACTION_INSTANT,
DEFAULT_JS_REWARD_WIDGET_INTERACTION_INSTANT)),
- arcToNarc(mParser.getInt(KEY_JS_REWARD_WIDGET_INTERACTION_ONGOING,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_WIDGET_INTERACTION_ONGOING,
DEFAULT_JS_REWARD_WIDGET_INTERACTION_ONGOING)),
- arcToNarc(mParser.getInt(KEY_JS_REWARD_WIDGET_INTERACTION_MAX,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_WIDGET_INTERACTION_MAX,
DEFAULT_JS_REWARD_WIDGET_INTERACTION_MAX))));
mRewards.put(REWARD_OTHER_USER_INTERACTION,
new Reward(REWARD_OTHER_USER_INTERACTION,
- arcToNarc(mParser.getInt(KEY_JS_REWARD_OTHER_USER_INTERACTION_INSTANT,
+ arcToCake(mParser.getInt(KEY_JS_REWARD_OTHER_USER_INTERACTION_INSTANT,
DEFAULT_JS_REWARD_OTHER_USER_INTERACTION_INSTANT)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_JS_REWARD_OTHER_USER_INTERACTION_ONGOING,
DEFAULT_JS_REWARD_OTHER_USER_INTERACTION_ONGOING)),
- arcToNarc(mParser.getInt(
+ arcToCake(mParser.getInt(
KEY_JS_REWARD_OTHER_USER_INTERACTION_MAX,
DEFAULT_JS_REWARD_OTHER_USER_INTERACTION_MAX))));
}
@@ -339,14 +339,14 @@
void dump(IndentingPrintWriter pw) {
pw.println("Min satiated balances:");
pw.increaseIndent();
- pw.print("Exempted", narcToString(mMinSatiatedBalanceExempted)).println();
- pw.print("Other", narcToString(mMinSatiatedBalanceOther)).println();
+ pw.print("Exempted", cakeToString(mMinSatiatedBalanceExempted)).println();
+ pw.print("Other", cakeToString(mMinSatiatedBalanceOther)).println();
pw.decreaseIndent();
- pw.print("Max satiated balance", narcToString(mMaxSatiatedBalance)).println();
+ pw.print("Max satiated balance", cakeToString(mMaxSatiatedBalance)).println();
pw.print("Consumption limits: [");
- pw.print(narcToString(mInitialSatiatedConsumptionLimit));
+ pw.print(cakeToString(mInitialSatiatedConsumptionLimit));
pw.print(", ");
- pw.print(narcToString(mHardSatiatedConsumptionLimit));
+ pw.print(cakeToString(mHardSatiatedConsumptionLimit));
pw.println("]");
pw.println();
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/Ledger.java b/apex/jobscheduler/service/java/com/android/server/tare/Ledger.java
index dfdc20a..2e2a9b5 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/Ledger.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/Ledger.java
@@ -18,9 +18,9 @@
import static android.text.format.DateUtils.HOUR_IN_MILLIS;
+import static com.android.server.tare.TareUtils.cakeToString;
import static com.android.server.tare.TareUtils.dumpTime;
import static com.android.server.tare.TareUtils.getCurrentTimeMillis;
-import static com.android.server.tare.TareUtils.narcToString;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -129,7 +129,7 @@
}
void dump(IndentingPrintWriter pw, int numRecentTransactions) {
- pw.print("Current balance", narcToString(getCurrentBalance())).println();
+ pw.print("Current balance", cakeToString(getCurrentBalance())).println();
final int size = mTransactions.size();
for (int i = Math.max(0, size - numRecentTransactions); i < size; ++i) {
@@ -146,9 +146,9 @@
pw.print(")");
}
pw.print(" --> ");
- pw.print(narcToString(transaction.delta));
+ pw.print(cakeToString(transaction.delta));
pw.print(" (ctp=");
- pw.print(narcToString(transaction.ctp));
+ pw.print(cakeToString(transaction.ctp));
pw.println(")");
}
}
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/README.md b/apex/jobscheduler/service/java/com/android/server/tare/README.md
index 33eadff..72d5069 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/README.md
+++ b/apex/jobscheduler/service/java/com/android/server/tare/README.md
@@ -105,5 +105,7 @@
* ARC: Android Resource Credits are the "currency" units used as an abstraction layer over the real
battery drain. They allow the system to standardize costs and prices across various devices.
+* Cake: A lie; also the smallest unit of an ARC (1 cake = one-billionth of an ARC = 1 nano-ARC).
+ When the apps request to do something, we shall let them eat cake.
* NARC: The smallest unit of an ARC. A narc is 1 nano-ARC.
* Satiated: used to refer to when the device is fully charged (at 100% battery level)
\ No newline at end of file
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/Scribe.java b/apex/jobscheduler/service/java/com/android/server/tare/Scribe.java
index 8662110..7442877 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/Scribe.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/Scribe.java
@@ -84,7 +84,7 @@
private static final String XML_ATTR_USER_ID = "userId";
private static final String XML_ATTR_VERSION = "version";
private static final String XML_ATTR_LAST_RECLAMATION_TIME = "lastReclamationTime";
- private static final String XML_ATTR_REMAINING_CONSUMABLE_NARCS = "remainingConsumableNarcs";
+ private static final String XML_ATTR_REMAINING_CONSUMABLE_CAKES = "remainingConsumableCakes";
private static final String XML_ATTR_CONSUMPTION_LIMIT = "consumptionLimit";
/** Version of the file schema. */
@@ -100,7 +100,7 @@
@GuardedBy("mIrs.getLock()")
private long mSatiatedConsumptionLimit;
@GuardedBy("mIrs.getLock()")
- private long mRemainingConsumableNarcs;
+ private long mRemainingConsumableCakes;
@GuardedBy("mIrs.getLock()")
private final SparseArrayMap<String, Ledger> mLedgers = new SparseArrayMap<>();
@@ -122,10 +122,10 @@
}
@GuardedBy("mIrs.getLock()")
- void adjustRemainingConsumableNarcsLocked(long delta) {
+ void adjustRemainingConsumableCakesLocked(long delta) {
if (delta != 0) {
// No point doing any work if the change is 0.
- mRemainingConsumableNarcs += delta;
+ mRemainingConsumableCakes += delta;
postWrite();
}
}
@@ -168,7 +168,7 @@
* call it for normal operation.
*/
@GuardedBy("mIrs.getLock()")
- long getNarcsInCirculationForLoggingLocked() {
+ long getCakesInCirculationForLoggingLocked() {
long sum = 0;
for (int uIdx = mLedgers.numMaps() - 1; uIdx >= 0; --uIdx) {
for (int pIdx = mLedgers.numElementsForKeyAt(uIdx) - 1; pIdx >= 0; --pIdx) {
@@ -178,10 +178,10 @@
return sum;
}
- /** Returns the total amount of narcs that remain to be consumed. */
+ /** Returns the total amount of cakes that remain to be consumed. */
@GuardedBy("mIrs.getLock()")
- long getRemainingConsumableNarcsLocked() {
- return mRemainingConsumableNarcs;
+ long getRemainingConsumableCakesLocked() {
+ return mRemainingConsumableCakes;
}
@GuardedBy("mIrs.getLock()")
@@ -189,11 +189,11 @@
mLedgers.clear();
if (!recordExists()) {
mSatiatedConsumptionLimit = mIrs.getInitialSatiatedConsumptionLimitLocked();
- mRemainingConsumableNarcs = mIrs.getConsumptionLimitLocked();
+ mRemainingConsumableCakes = mIrs.getConsumptionLimitLocked();
return;
}
mSatiatedConsumptionLimit = 0;
- mRemainingConsumableNarcs = 0;
+ mRemainingConsumableCakes = 0;
final SparseArray<ArraySet<String>> installedPackagesPerUser = new SparseArray<>();
final List<PackageInfo> installedPackages = mIrs.getInstalledPackages();
@@ -254,8 +254,8 @@
parser.getAttributeLong(null, XML_ATTR_CONSUMPTION_LIMIT,
mIrs.getInitialSatiatedConsumptionLimitLocked());
final long consumptionLimit = mIrs.getConsumptionLimitLocked();
- mRemainingConsumableNarcs = Math.min(consumptionLimit,
- parser.getAttributeLong(null, XML_ATTR_REMAINING_CONSUMABLE_NARCS,
+ mRemainingConsumableCakes = Math.min(consumptionLimit,
+ parser.getAttributeLong(null, XML_ATTR_REMAINING_CONSUMABLE_CAKES,
consumptionLimit));
break;
case XML_TAG_USER:
@@ -285,11 +285,11 @@
@GuardedBy("mIrs.getLock()")
void setConsumptionLimitLocked(long limit) {
- if (mRemainingConsumableNarcs > limit) {
- mRemainingConsumableNarcs = limit;
+ if (mRemainingConsumableCakes > limit) {
+ mRemainingConsumableCakes = limit;
} else if (limit > mSatiatedConsumptionLimit) {
- final long diff = mSatiatedConsumptionLimit - mRemainingConsumableNarcs;
- mRemainingConsumableNarcs = (limit - diff);
+ final long diff = mSatiatedConsumptionLimit - mRemainingConsumableCakes;
+ mRemainingConsumableCakes = (limit - diff);
}
mSatiatedConsumptionLimit = limit;
postWrite();
@@ -306,7 +306,7 @@
TareHandlerThread.getHandler().removeCallbacks(mCleanRunnable);
TareHandlerThread.getHandler().removeCallbacks(mWriteRunnable);
mLedgers.clear();
- mRemainingConsumableNarcs = 0;
+ mRemainingConsumableCakes = 0;
mSatiatedConsumptionLimit = 0;
mLastReclamationTime = 0;
}
@@ -491,8 +491,8 @@
out.startTag(null, XML_TAG_HIGH_LEVEL_STATE);
out.attributeLong(null, XML_ATTR_LAST_RECLAMATION_TIME, mLastReclamationTime);
out.attributeLong(null, XML_ATTR_CONSUMPTION_LIMIT, mSatiatedConsumptionLimit);
- out.attributeLong(null, XML_ATTR_REMAINING_CONSUMABLE_NARCS,
- mRemainingConsumableNarcs);
+ out.attributeLong(null, XML_ATTR_REMAINING_CONSUMABLE_CAKES,
+ mRemainingConsumableCakes);
out.endTag(null, XML_TAG_HIGH_LEVEL_STATE);
for (int uIdx = mLedgers.numMaps() - 1; uIdx >= 0; --uIdx) {
diff --git a/apex/jobscheduler/service/java/com/android/server/tare/TareUtils.java b/apex/jobscheduler/service/java/com/android/server/tare/TareUtils.java
index 78508d4..87db863 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/TareUtils.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/TareUtils.java
@@ -26,7 +26,7 @@
import java.time.Clock;
class TareUtils {
- private static final long NARC_IN_ARC = 1_000_000_000L;
+ private static final long CAKE_IN_ARC = 1_000_000_000L;
@SuppressLint("SimpleDateFormat")
private static final SimpleDateFormat sDumpDateFormat =
@@ -35,8 +35,8 @@
@VisibleForTesting
static Clock sSystemClock = Clock.systemUTC();
- static long arcToNarc(int arcs) {
- return arcs * NARC_IN_ARC;
+ static long arcToCake(int arcs) {
+ return arcs * CAKE_IN_ARC;
}
static void dumpTime(IndentingPrintWriter pw, long time) {
@@ -47,26 +47,26 @@
return sSystemClock.millis();
}
- static int narcToArc(long narcs) {
- return (int) (narcs / NARC_IN_ARC);
+ static int cakeToArc(long cakes) {
+ return (int) (cakes / CAKE_IN_ARC);
}
@NonNull
- static String narcToString(long narcs) {
- if (narcs == 0) {
+ static String cakeToString(long cakes) {
+ if (cakes == 0) {
return "0 ARCs";
}
- final long sub = Math.abs(narcs) % NARC_IN_ARC;
- final long arcs = narcToArc(narcs);
+ final long sub = Math.abs(cakes) % CAKE_IN_ARC;
+ final long arcs = cakeToArc(cakes);
if (arcs == 0) {
return sub == 1
- ? sub + " narc"
- : sub + " narcs";
+ ? sub + " cake"
+ : sub + " cakes";
}
StringBuilder sb = new StringBuilder();
sb.append(arcs);
if (sub > 0) {
- sb.append(".").append(sub / (NARC_IN_ARC / 1000));
+ sb.append(".").append(sub / (CAKE_IN_ARC / 1000));
}
sb.append(" ARC");
if (arcs != 1 || sub > 0) {
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 968be3e..fb68c6d 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -577,8 +577,8 @@
mDisplay = display;
mContext = context;
mSurface = surface;
- mWidth = w;
- mHeight = h;
+ mInitWidth = mWidth = w;
+ mInitHeight = mHeight = h;
mFlingerSurfaceControl = control;
mFlingerSurface = s;
mTargetInset = -1;
@@ -611,6 +611,7 @@
eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroySurface(mDisplay, mSurface);
+ mFlingerSurfaceControl->updateDefaultBufferSize(newWidth, newHeight);
const auto limitedSize = limitSurfaceSize(newWidth, newHeight);
mWidth = limitedSize.width;
mHeight = limitedSize.height;
@@ -1515,8 +1516,10 @@
processDisplayEvents();
- const int animationX = (mWidth - animation.width) / 2;
- const int animationY = (mHeight - animation.height) / 2;
+ const double ratio_w = static_cast<double>(mWidth) / mInitWidth;
+ const double ratio_h = static_cast<double>(mHeight) / mInitHeight;
+ const int animationX = (mWidth - animation.width * ratio_w) / 2;
+ const int animationY = (mHeight - animation.height * ratio_h) / 2;
const Animation::Frame& frame(part.frames[j]);
nsecs_t lastFrame = systemTime();
@@ -1532,12 +1535,16 @@
initTexture(frame.map, &w, &h, false /* don't premultiply alpha */);
}
- const int xc = animationX + frame.trimX;
- const int yc = animationY + frame.trimY;
+ const int trimWidth = frame.trimWidth * ratio_w;
+ const int trimHeight = frame.trimHeight * ratio_h;
+ const int trimX = frame.trimX * ratio_w;
+ const int trimY = frame.trimY * ratio_h;
+ const int xc = animationX + trimX;
+ const int yc = animationY + trimY;
glClear(GL_COLOR_BUFFER_BIT);
// specify the y center as ceiling((mHeight - frame.trimHeight) / 2)
// which is equivalent to mHeight - (yc + frame.trimHeight)
- const int frameDrawY = mHeight - (yc + frame.trimHeight);
+ const int frameDrawY = mHeight - (yc + trimHeight);
float fade = 0;
// if the part hasn't been stopped yet then continue fading if necessary
@@ -1554,7 +1561,7 @@
glUniform1f(mImageColorProgressLocation, colorProgress);
}
glEnable(GL_BLEND);
- drawTexturedQuad(xc, frameDrawY, frame.trimWidth, frame.trimHeight);
+ drawTexturedQuad(xc, frameDrawY, trimWidth, trimHeight);
glDisable(GL_BLEND);
if (mClockEnabled && mTimeIsAccurate && validClock(part)) {
diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h
index a136ad0..8658205 100644
--- a/cmds/bootanimation/BootAnimation.h
+++ b/cmds/bootanimation/BootAnimation.h
@@ -213,6 +213,8 @@
Texture mAndroid[2];
int mWidth;
int mHeight;
+ int mInitWidth;
+ int mInitHeight;
int mMaxWidth = 0;
int mMaxHeight = 0;
int mCurrentInset;
diff --git a/core/api/current.txt b/core/api/current.txt
index e260ad0..c8a43db 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -44254,6 +44254,9 @@
method @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.RegistrationManager.RegistrationCallback);
method public void unregisterImsStateCallback(@NonNull android.telephony.ims.ImsStateCallback);
field public static final String ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN = "android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN";
+ field public static final int CAPABILITY_TYPE_NONE = 0; // 0x0
+ field public static final int CAPABILITY_TYPE_OPTIONS_UCE = 1; // 0x1
+ field public static final int CAPABILITY_TYPE_PRESENCE_UCE = 2; // 0x2
}
public final class ImsReasonInfo implements android.os.Parcelable {
@@ -44475,10 +44478,10 @@
method public void unregisterFeatureProvisioningChangedCallback(@NonNull android.telephony.ims.ProvisioningManager.FeatureProvisioningCallback);
}
- public static class ProvisioningManager.FeatureProvisioningCallback {
+ public abstract static class ProvisioningManager.FeatureProvisioningCallback {
ctor public ProvisioningManager.FeatureProvisioningCallback();
- method public void onFeatureProvisioningChanged(int, int, boolean);
- method public void onRcsFeatureProvisioningChanged(int, int, boolean);
+ method public abstract void onFeatureProvisioningChanged(int, int, boolean);
+ method public abstract void onRcsFeatureProvisioningChanged(int, int, boolean);
}
public class RcsUceAdapter {
@@ -44521,15 +44524,6 @@
field public static final int CAPABILITY_TYPE_VOICE = 1; // 0x1
}
- public class RcsFeature {
- }
-
- public static class RcsFeature.RcsImsCapabilities {
- field public static final int CAPABILITY_TYPE_NONE = 0; // 0x0
- field public static final int CAPABILITY_TYPE_OPTIONS_UCE = 1; // 0x1
- field public static final int CAPABILITY_TYPE_PRESENCE_UCE = 2; // 0x2
- }
-
}
package android.telephony.ims.stub {
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index b25d1e3..ec4ad8b 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -15024,7 +15024,7 @@
method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE, android.Manifest.permission.READ_CONTACTS}) public void requestAvailability(@NonNull android.net.Uri, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.RcsUceAdapter.CapabilitiesCallback) throws android.telephony.ims.ImsException;
method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE, android.Manifest.permission.READ_CONTACTS}) public void requestCapabilities(@NonNull java.util.Collection<android.net.Uri>, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.RcsUceAdapter.CapabilitiesCallback) throws android.telephony.ims.ImsException;
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
- field public static final int CAPABILITY_TYPE_PRESENCE_UCE = 2; // 0x2
+ field @Deprecated public static final int CAPABILITY_TYPE_PRESENCE_UCE = 2; // 0x2
field public static final int CAPABILITY_UPDATE_TRIGGER_ETAG_EXPIRED = 1; // 0x1
field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_2G = 7; // 0x7
field public static final int CAPABILITY_UPDATE_TRIGGER_MOVE_TO_3G = 6; // 0x6
@@ -15307,6 +15307,9 @@
method public void addCapabilities(int);
method public boolean isCapable(int);
method public void removeCapabilities(int);
+ field public static final int CAPABILITY_TYPE_NONE = 0; // 0x0
+ field public static final int CAPABILITY_TYPE_OPTIONS_UCE = 1; // 0x1
+ field public static final int CAPABILITY_TYPE_PRESENCE_UCE = 2; // 0x2
}
}
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index f4a12a5..328708f 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -168,11 +168,11 @@
}
public static interface ActivityOptions.OnAnimationFinishedListener {
- method public void onAnimationFinished();
+ method public void onAnimationFinished(long);
}
public static interface ActivityOptions.OnAnimationStartedListener {
- method public void onAnimationStarted();
+ method public void onAnimationStarted(long);
}
public class ActivityTaskManager {
@@ -2403,8 +2403,6 @@
public abstract class DreamOverlayService extends android.app.Service {
ctor public DreamOverlayService();
- method @Nullable public final CharSequence getDreamLabel();
- method public final boolean isPreviewMode();
method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
method public abstract void onStartDream(@NonNull android.view.WindowManager.LayoutParams);
method public final void requestExit();
@@ -3387,6 +3385,7 @@
public final class WindowContainerTransaction implements android.os.Parcelable {
ctor public WindowContainerTransaction();
+ method @NonNull public android.window.WindowContainerTransaction clearLaunchAdjacentFlagRoot(@NonNull android.window.WindowContainerToken);
method @NonNull public android.window.WindowContainerTransaction createTaskFragment(@NonNull android.window.TaskFragmentCreationParams);
method @NonNull public android.window.WindowContainerTransaction deleteTaskFragment(@NonNull android.window.WindowContainerToken);
method public int describeContents();
@@ -3405,6 +3404,7 @@
method @NonNull public android.window.WindowContainerTransaction setErrorCallbackToken(@NonNull android.os.IBinder);
method @NonNull public android.window.WindowContainerTransaction setFocusable(@NonNull android.window.WindowContainerToken, boolean);
method @NonNull public android.window.WindowContainerTransaction setHidden(@NonNull android.window.WindowContainerToken, boolean);
+ method @NonNull public android.window.WindowContainerTransaction setLaunchAdjacentFlagRoot(@NonNull android.window.WindowContainerToken);
method @NonNull public android.window.WindowContainerTransaction setLaunchRoot(@NonNull android.window.WindowContainerToken, @Nullable int[], @Nullable int[]);
method @NonNull public android.window.WindowContainerTransaction setScreenSizeDp(@NonNull android.window.WindowContainerToken, int, int);
method @NonNull public android.window.WindowContainerTransaction setSmallestScreenWidthDp(@NonNull android.window.WindowContainerToken, int);
diff --git a/core/java/android/accessibilityservice/AccessibilityInputMethodSession.java b/core/java/android/accessibilityservice/AccessibilityInputMethodSession.java
new file mode 100644
index 0000000..ecf449d
--- /dev/null
+++ b/core/java/android/accessibilityservice/AccessibilityInputMethodSession.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.accessibilityservice;
+
+import android.view.inputmethod.EditorInfo;
+
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
+
+interface AccessibilityInputMethodSession {
+ void finishInput();
+
+ void updateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd,
+ int candidatesStart, int candidatesEnd);
+
+ void invalidateInput(EditorInfo editorInfo, IRemoteAccessibilityInputConnection connection,
+ int sessionId);
+
+ void setEnabled(boolean enabled);
+}
diff --git a/core/java/android/accessibilityservice/AccessibilityInputMethodSessionWrapper.java b/core/java/android/accessibilityservice/AccessibilityInputMethodSessionWrapper.java
new file mode 100644
index 0000000..3252ab2
--- /dev/null
+++ b/core/java/android/accessibilityservice/AccessibilityInputMethodSessionWrapper.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.accessibilityservice;
+
+import android.annotation.AnyThread;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.Handler;
+import android.os.Looper;
+import android.view.inputmethod.EditorInfo;
+
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+final class AccessibilityInputMethodSessionWrapper extends IAccessibilityInputMethodSession.Stub {
+ private final Handler mHandler;
+
+ @NonNull
+ private final AtomicReference<AccessibilityInputMethodSession> mSessionRef;
+
+ AccessibilityInputMethodSessionWrapper(
+ @NonNull Looper looper, @NonNull AccessibilityInputMethodSession session) {
+ mSessionRef = new AtomicReference<>(session);
+ mHandler = Handler.createAsync(looper);
+ }
+
+ @AnyThread
+ @Nullable
+ AccessibilityInputMethodSession getSession() {
+ return mSessionRef.get();
+ }
+
+ @Override
+ public void updateSelection(int oldSelStart, int oldSelEnd,
+ int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd) {
+ if (mHandler.getLooper().isCurrentThread()) {
+ doUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart,
+ candidatesEnd);
+ } else {
+ mHandler.post(() -> doUpdateSelection(oldSelStart, oldSelEnd, newSelStart,
+ newSelEnd, candidatesStart, candidatesEnd));
+ }
+ }
+
+ private void doUpdateSelection(int oldSelStart, int oldSelEnd,
+ int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd) {
+ final AccessibilityInputMethodSession session = mSessionRef.get();
+ if (session != null) {
+ session.updateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart,
+ candidatesEnd);
+ }
+ }
+
+ @Override
+ public void finishInput() {
+ if (mHandler.getLooper().isCurrentThread()) {
+ doFinishInput();
+ } else {
+ mHandler.post(this::doFinishInput);
+ }
+ }
+
+ private void doFinishInput() {
+ final AccessibilityInputMethodSession session = mSessionRef.get();
+ if (session != null) {
+ session.finishInput();
+ }
+ }
+
+ @Override
+ public void finishSession() {
+ if (mHandler.getLooper().isCurrentThread()) {
+ doFinishSession();
+ } else {
+ mHandler.post(this::doFinishSession);
+ }
+ }
+
+ private void doFinishSession() {
+ mSessionRef.set(null);
+ }
+
+ @Override
+ public void invalidateInput(EditorInfo editorInfo,
+ IRemoteAccessibilityInputConnection connection, int sessionId) {
+ if (mHandler.getLooper().isCurrentThread()) {
+ doInvalidateInput(editorInfo, connection, sessionId);
+ } else {
+ mHandler.post(() -> doInvalidateInput(editorInfo, connection, sessionId));
+ }
+ }
+
+ private void doInvalidateInput(EditorInfo editorInfo,
+ IRemoteAccessibilityInputConnection connection, int sessionId) {
+ final AccessibilityInputMethodSession session = mSessionRef.get();
+ if (session != null) {
+ session.invalidateInput(editorInfo, connection, sessionId);
+ }
+ }
+}
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index 3cb04e7..c17fbf1 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -40,8 +40,6 @@
import android.graphics.Region;
import android.hardware.HardwareBuffer;
import android.hardware.display.DisplayManager;
-import android.inputmethodservice.IInputMethodSessionWrapper;
-import android.inputmethodservice.RemoteInputConnection;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -68,22 +66,19 @@
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
import android.view.accessibility.AccessibilityWindowInfo;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputBinding;
-import android.view.inputmethod.InputConnection;
-import android.view.inputmethod.InputMethodSession;
import com.android.internal.inputmethod.CancellationGroup;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSessionCallback;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
+import com.android.internal.inputmethod.RemoteAccessibilityInputConnection;
import com.android.internal.os.HandlerCaller;
import com.android.internal.os.SomeArgs;
import com.android.internal.util.Preconditions;
import com.android.internal.util.function.pooled.PooledLambda;
-import com.android.internal.view.IInputContext;
-import com.android.internal.view.IInputMethodSession;
-import com.android.internal.view.IInputSessionWithIdCallback;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor;
@@ -639,20 +634,10 @@
/** This is called when the system action list is changed. */
void onSystemActionsChanged();
/** This is called when an app requests ime sessions or when the service is enabled. */
- void createImeSession(IInputSessionWithIdCallback callback);
- /**
- * This is called when InputMethodManagerService requests to set the session enabled or
- * disabled
- */
- void setImeSessionEnabled(InputMethodSession session, boolean enabled);
- /** This is called when an app binds input or when the service is enabled. */
- void bindInput(InputBinding binding);
- /** This is called when an app unbinds input or when the service is disabled. */
- void unbindInput();
+ void createImeSession(IAccessibilityInputMethodSessionCallback callback);
/** This is called when an app starts input or when the service is enabled. */
- void startInput(@Nullable InputConnection inputConnection,
- @NonNull EditorInfo editorInfo, boolean restarting,
- @NonNull IBinder startInputToken);
+ void startInput(@Nullable RemoteAccessibilityInputConnection inputConnection,
+ @NonNull EditorInfo editorInfo, boolean restarting);
}
/**
@@ -2740,42 +2725,20 @@
}
@Override
- public void createImeSession(IInputSessionWithIdCallback callback) {
+ public void createImeSession(IAccessibilityInputMethodSessionCallback callback) {
if (mInputMethod != null) {
mInputMethod.createImeSession(callback);
}
}
@Override
- public void setImeSessionEnabled(InputMethodSession session, boolean enabled) {
- if (mInputMethod != null) {
- mInputMethod.setImeSessionEnabled(session, enabled);
- }
- }
-
- @Override
- public void bindInput(InputBinding binding) {
- if (mInputMethod != null) {
- mInputMethod.bindInput(binding);
- }
- }
-
- @Override
- public void unbindInput() {
- if (mInputMethod != null) {
- mInputMethod.unbindInput();
- }
- }
-
- @Override
- public void startInput(@Nullable InputConnection inputConnection,
- @NonNull EditorInfo editorInfo, boolean restarting,
- @NonNull IBinder startInputToken) {
+ public void startInput(@Nullable RemoteAccessibilityInputConnection connection,
+ @NonNull EditorInfo editorInfo, boolean restarting) {
if (mInputMethod != null) {
if (restarting) {
- mInputMethod.restartInput(inputConnection, editorInfo);
+ mInputMethod.restartInput(connection, editorInfo);
} else {
- mInputMethod.startInput(inputConnection, editorInfo);
+ mInputMethod.startInput(connection, editorInfo);
}
}
}
@@ -2806,8 +2769,6 @@
private static final int DO_ON_SYSTEM_ACTIONS_CHANGED = 14;
private static final int DO_CREATE_IME_SESSION = 15;
private static final int DO_SET_IME_SESSION_ENABLED = 16;
- private static final int DO_BIND_INPUT = 17;
- private static final int DO_UNBIND_INPUT = 18;
private static final int DO_START_INPUT = 19;
private final HandlerCaller mCaller;
@@ -2818,15 +2779,14 @@
private int mConnectionId = AccessibilityInteractionClient.NO_ID;
/**
- * This is not {@null} only between {@link #bindInput(InputBinding)} and
- * {@link #unbindInput()} so that {@link RemoteInputConnection} can query if
- * {@link #unbindInput()} has already been called or not, mainly to avoid unnecessary
- * blocking operations.
+ * This is not {@code null} only between {@link #bindInput()} and {@link #unbindInput()} so
+ * that {@link RemoteAccessibilityInputConnection} can query if {@link #unbindInput()} has
+ * already been called or not, mainly to avoid unnecessary blocking operations.
*
* <p>This field must be set and cleared only from the binder thread(s), where the system
- * guarantees that {@link #bindInput(InputBinding)},
- * {@link #startInput(IBinder, IInputContext, EditorInfo, boolean)}, and
- * {@link #unbindInput()} are called with the same order as the original calls
+ * guarantees that {@link #bindInput()},
+ * {@link #startInput(IRemoteAccessibilityInputConnection, EditorInfo, boolean)},
+ * and {@link #unbindInput()} are called with the same order as the original calls
* in {@link com.android.server.inputmethod.InputMethodManagerService}.
* See {@link IBinder#FLAG_ONEWAY} for detailed semantics.</p>
*/
@@ -2927,7 +2887,7 @@
}
/** This is called when an app requests ime sessions or when the service is enabled. */
- public void createImeSession(IInputSessionWithIdCallback callback) {
+ public void createImeSession(IAccessibilityInputMethodSessionCallback callback) {
final Message message = mCaller.obtainMessageO(DO_CREATE_IME_SESSION, callback);
mCaller.sendMessage(message);
}
@@ -2936,10 +2896,11 @@
* This is called when InputMethodManagerService requests to set the session enabled or
* disabled
*/
- public void setImeSessionEnabled(IInputMethodSession session, boolean enabled) {
+ public void setImeSessionEnabled(IAccessibilityInputMethodSession session,
+ boolean enabled) {
try {
- InputMethodSession ls = ((IInputMethodSessionWrapper)
- session).getInternalInputMethodSession();
+ AccessibilityInputMethodSession ls =
+ ((AccessibilityInputMethodSessionWrapper) session).getSession();
if (ls == null) {
Log.w(LOG_TAG, "Session is already finished: " + session);
return;
@@ -2952,17 +2913,11 @@
}
/** This is called when an app binds input or when the service is enabled. */
- public void bindInput(InputBinding binding) {
+ public void bindInput() {
if (mCancellationGroup != null) {
Log.e(LOG_TAG, "bindInput must be paired with unbindInput.");
}
mCancellationGroup = new CancellationGroup();
- InputConnection ic = new RemoteInputConnection(new WeakReference<>(() -> mContext),
- IInputContext.Stub.asInterface(binding.getConnectionToken()),
- mCancellationGroup);
- InputBinding nu = new InputBinding(ic, binding);
- final Message message = mCaller.obtainMessageO(DO_BIND_INPUT, nu);
- mCaller.sendMessage(message);
}
/** This is called when an app unbinds input or when the service is disabled. */
@@ -2974,18 +2929,17 @@
} else {
Log.e(LOG_TAG, "unbindInput must be paired with bindInput.");
}
- mCaller.sendMessage(mCaller.obtainMessage(DO_UNBIND_INPUT));
}
/** This is called when an app starts input or when the service is enabled. */
- public void startInput(IBinder startInputToken, IInputContext inputContext,
+ public void startInput(IRemoteAccessibilityInputConnection connection,
EditorInfo editorInfo, boolean restarting) {
if (mCancellationGroup == null) {
Log.e(LOG_TAG, "startInput must be called after bindInput.");
mCancellationGroup = new CancellationGroup();
}
- final Message message = mCaller.obtainMessageOOOOII(DO_START_INPUT, startInputToken,
- inputContext, editorInfo, mCancellationGroup, restarting ? 1 : 0,
+ final Message message = mCaller.obtainMessageOOOOII(DO_START_INPUT, null /* unused */,
+ connection, editorInfo, mCancellationGroup, restarting ? 1 : 0,
0 /* unused */);
mCaller.sendMessage(message);
}
@@ -3157,44 +3111,33 @@
}
case DO_CREATE_IME_SESSION: {
if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
- IInputSessionWithIdCallback callback =
- (IInputSessionWithIdCallback) message.obj;
+ IAccessibilityInputMethodSessionCallback callback =
+ (IAccessibilityInputMethodSessionCallback) message.obj;
mCallback.createImeSession(callback);
}
return;
}
case DO_SET_IME_SESSION_ENABLED: {
if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
- mCallback.setImeSessionEnabled((InputMethodSession) message.obj,
- message.arg1 != 0);
- }
- return;
- }
- case DO_BIND_INPUT: {
- if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
- mCallback.bindInput((InputBinding) message.obj);
- }
- return;
- }
- case DO_UNBIND_INPUT: {
- if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
- mCallback.unbindInput();
+ AccessibilityInputMethodSession session =
+ (AccessibilityInputMethodSession) message.obj;
+ session.setEnabled(message.arg1 != 0);
}
return;
}
case DO_START_INPUT: {
if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
final SomeArgs args = (SomeArgs) message.obj;
- final IBinder startInputToken = (IBinder) args.arg1;
- final IInputContext inputContext = (IInputContext) args.arg2;
+ final IRemoteAccessibilityInputConnection connection =
+ (IRemoteAccessibilityInputConnection) args.arg2;
final EditorInfo info = (EditorInfo) args.arg3;
final CancellationGroup cancellationGroup = (CancellationGroup) args.arg4;
final boolean restarting = args.argi5 == 1;
- final InputConnection ic = inputContext != null
- ? new RemoteInputConnection(new WeakReference<>(() -> mContext),
- inputContext, cancellationGroup) : null;
+ final RemoteAccessibilityInputConnection ic = connection == null ? null
+ : new RemoteAccessibilityInputConnection(
+ connection, cancellationGroup);
info.makeCompatible(mContext.getApplicationInfo().targetSdkVersion);
- mCallback.startInput(ic, info, restarting, startInputToken);
+ mCallback.startInput(ic, info, restarting);
args.recycle();
}
return;
diff --git a/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl b/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl
index 94da61f..3bc61e5 100644
--- a/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl
+++ b/core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl
@@ -25,10 +25,9 @@
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputBinding;
-import com.android.internal.view.IInputContext;
-import com.android.internal.view.IInputMethodSession;
-import com.android.internal.view.IInputSessionWithIdCallback;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSessionCallback;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
/**
* Top-level interface to an accessibility service component.
@@ -69,14 +68,14 @@
void onSystemActionsChanged();
- void createImeSession(IInputSessionWithIdCallback callback);
+ void createImeSession(in IAccessibilityInputMethodSessionCallback callback);
- void setImeSessionEnabled(IInputMethodSession session, boolean enabled);
+ void setImeSessionEnabled(in IAccessibilityInputMethodSession session, boolean enabled);
- void bindInput(in InputBinding binding);
+ void bindInput();
void unbindInput();
- void startInput(in IBinder startInputToken, in IInputContext inputContext,
- in EditorInfo editorInfo, boolean restarting);
+ void startInput(in IRemoteAccessibilityInputConnection connection, in EditorInfo editorInfo,
+ boolean restarting);
}
diff --git a/core/java/android/accessibilityservice/InputMethod.java b/core/java/android/accessibilityservice/InputMethod.java
index 79bac9b..1585f99 100644
--- a/core/java/android/accessibilityservice/InputMethod.java
+++ b/core/java/android/accessibilityservice/InputMethod.java
@@ -18,36 +18,23 @@
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
-import android.annotation.CallbackExecutor;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.annotation.SuppressLint;
-import android.graphics.Rect;
-import android.inputmethodservice.IInputMethodSessionWrapper;
-import android.inputmethodservice.RemoteInputConnection;
-import android.os.Bundle;
import android.os.RemoteException;
import android.os.Trace;
import android.util.Log;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
-import android.view.MotionEvent;
-import android.view.inputmethod.CompletionInfo;
-import android.view.inputmethod.CursorAnchorInfo;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.ExtractedText;
-import android.view.inputmethod.InputBinding;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
-import android.view.inputmethod.InputMethodSession;
import android.view.inputmethod.SurroundingText;
import android.view.inputmethod.TextAttribute;
-import com.android.internal.view.IInputContext;
-import com.android.internal.view.IInputSessionWithIdCallback;
-
-import java.util.concurrent.Executor;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSessionCallback;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
+import com.android.internal.inputmethod.RemoteAccessibilityInputConnection;
/**
* This class provides input method APIs. Some public methods such as
@@ -61,9 +48,8 @@
private static final String LOG_TAG = "A11yInputMethod";
private final AccessibilityService mService;
- private InputBinding mInputBinding;
private boolean mInputStarted;
- private InputConnection mStartedInputConnection;
+ private RemoteAccessibilityInputConnection mStartedInputConnection;
private EditorInfo mInputEditorInfo;
/**
@@ -131,9 +117,7 @@
* to perform whatever behavior you would like.
*/
public void onFinishInput() {
- if (mStartedInputConnection != null) {
- mStartedInputConnection.finishComposingText();
- }
+ // Intentionally empty
}
/**
@@ -152,41 +136,26 @@
// Intentionally empty
}
- final void createImeSession(IInputSessionWithIdCallback callback) {
- InputMethodSession session = onCreateInputMethodSessionInterface();
+ final void createImeSession(IAccessibilityInputMethodSessionCallback callback) {
+ final AccessibilityInputMethodSessionWrapper wrapper =
+ new AccessibilityInputMethodSessionWrapper(mService.getMainLooper(),
+ new SessionImpl());
try {
- IInputMethodSessionWrapper wrap =
- new IInputMethodSessionWrapper(mService, session, null);
- callback.sessionCreated(wrap, mService.getConnectionId());
+ callback.sessionCreated(wrapper, mService.getConnectionId());
} catch (RemoteException ignored) {
}
}
- final void setImeSessionEnabled(@NonNull InputMethodSession session, boolean enabled) {
- ((InputMethodSessionForAccessibility) session).setEnabled(enabled);
- }
-
- final void bindInput(@NonNull InputBinding binding) {
- Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "AccessibilityService.bindInput");
- mInputBinding = binding;
- Log.v(LOG_TAG, "bindInput(): binding=" + binding);
- Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
- }
-
- final void unbindInput() {
- Log.v(LOG_TAG, "unbindInput(): binding=" + mInputBinding);
- // Unbind input is per process per display.
- mInputBinding = null;
- }
-
- final void startInput(@Nullable InputConnection ic, @NonNull EditorInfo attribute) {
+ final void startInput(@Nullable RemoteAccessibilityInputConnection ic,
+ @NonNull EditorInfo attribute) {
Log.v(LOG_TAG, "startInput(): editor=" + attribute);
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "AccessibilityService.startInput");
doStartInput(ic, attribute, false /* restarting */);
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
}
- final void restartInput(@Nullable InputConnection ic, @NonNull EditorInfo attribute) {
+ final void restartInput(@Nullable RemoteAccessibilityInputConnection ic,
+ @NonNull EditorInfo attribute) {
Log.v(LOG_TAG, "restartInput(): editor=" + attribute);
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "AccessibilityService.restartInput");
doStartInput(ic, attribute, true /* restarting */);
@@ -194,7 +163,8 @@
}
- final void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) {
+ final void doStartInput(RemoteAccessibilityInputConnection ic, EditorInfo attribute,
+ boolean restarting) {
if ((ic == null || !restarting) && mInputStarted) {
doFinishInput();
if (ic == null) {
@@ -220,17 +190,13 @@
mInputEditorInfo = null;
}
- private InputMethodSession onCreateInputMethodSessionInterface() {
- return new InputMethodSessionForAccessibility();
- }
-
/**
* This class provides the allowed list of {@link InputConnection} APIs for
* accessibility services.
*/
public final class AccessibilityInputConnection {
- private InputConnection mIc;
- AccessibilityInputConnection(InputConnection ic) {
+ private final RemoteAccessibilityInputConnection mIc;
+ AccessibilityInputConnection(RemoteAccessibilityInputConnection ic) {
this.mIc = ic;
}
@@ -249,7 +215,7 @@
* int, int)} on the current accessibility service after the batch input is over.
* <strong>Editor authors</strong>, for this to happen you need to
* make the changes known to the accessibility service by calling
- * {@link InputMethodManager#updateSelection(View, int, int, int, int)},
+ * {@link InputMethodManager#updateSelection(android.view.View, int, int, int, int)},
* but be careful to wait until the batch edit is over if one is
* in progress.</p>
*
@@ -282,7 +248,7 @@
* int,int, int)} on the current IME after the batch input is over.
* <strong>Editor authors</strong>, for this to happen you need to
* make the changes known to the input method by calling
- * {@link InputMethodManager#updateSelection(View, int, int, int, int)},
+ * {@link InputMethodManager#updateSelection(android.view.View, int, int, int, int)},
* but be careful to wait until the batch edit is over if one is
* in progress.</p>
*
@@ -367,9 +333,8 @@
* delete only half of a surrogate pair. Also take care not to
* delete more characters than are in the editor, as that may have
* ill effects on the application. Calling this method will cause
- * the editor to call
- * {@link android.inputmethodservice.InputMethodService#onUpdateSelection(int, int, int, int,
- * int, int)} on your service after the batch input is over.</p>
+ * the editor to call {@link InputMethod#onUpdateSelection(int, int, int, int, int, int)}
+ * on your service after the batch input is over.</p>
*
* <p><strong>Editor authors:</strong> please be careful of race
* conditions in implementing this call. An IME can make a change
@@ -381,7 +346,7 @@
* indices to the size of the contents to avoid crashes. Since
* this changes the contents of the editor, you need to make the
* changes known to the input method by calling
- * {@link InputMethodManager#updateSelection(View, int, int, int, int)},
+ * {@link InputMethodManager#updateSelection(android.view.View, int, int, int, int)},
* but be careful to wait until the batch edit is over if one is
* in progress.</p>
*
@@ -522,12 +487,13 @@
}
/**
- * Concrete implementation of InputMethodSession that provides all of the standard behavior
- * for an input method session.
+ * Concrete implementation of {@link AccessibilityInputMethodSession} that provides all of the
+ * standard behavior for an A11y input method session.
*/
- private final class InputMethodSessionForAccessibility implements InputMethodSession {
+ private final class SessionImpl implements AccessibilityInputMethodSession {
boolean mEnabled = true;
+ @Override
public void setEnabled(boolean enabled) {
mEnabled = enabled;
}
@@ -549,86 +515,15 @@
}
@Override
- public void viewClicked(boolean focusChanged) {
- }
-
- @Override
- public void updateCursor(@NonNull Rect newCursor) {
- }
-
- @Override
- public void displayCompletions(
- @SuppressLint("ArrayReturn") @NonNull CompletionInfo[] completions) {
- }
-
- @Override
- public void updateExtractedText(int token, @NonNull ExtractedText text) {
- }
-
- public void dispatchKeyEvent(int seq, @NonNull KeyEvent event,
- @NonNull @CallbackExecutor Executor executor, @NonNull EventCallback callback) {
- }
-
- @Override
- public void dispatchKeyEvent(int seq, @NonNull KeyEvent event,
- @NonNull EventCallback callback) {
- }
-
- public void dispatchTrackballEvent(int seq, @NonNull MotionEvent event,
- @NonNull @CallbackExecutor Executor executor, @NonNull EventCallback callback) {
- }
-
- @Override
- public void dispatchTrackballEvent(int seq, @NonNull MotionEvent event,
- @NonNull EventCallback callback) {
- }
-
- public void dispatchGenericMotionEvent(int seq, @NonNull MotionEvent event,
- @NonNull @CallbackExecutor Executor executor, @NonNull EventCallback callback) {
- }
-
- @Override
- public void dispatchGenericMotionEvent(int seq, @NonNull MotionEvent event,
- @NonNull EventCallback callback) {
- }
-
- @Override
- public void appPrivateCommand(@NonNull String action, @NonNull Bundle data) {
- }
-
- @Override
- public void toggleSoftInput(int showFlags, int hideFlags) {
- }
-
- @Override
- public void updateCursorAnchorInfo(@NonNull CursorAnchorInfo cursorAnchorInfo) {
- }
-
- @Override
- public void notifyImeHidden() {
- }
-
- @Override
- public void removeImeSurface() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void invalidateInputInternal(EditorInfo editorInfo, IInputContext inputContext,
- int sessionId) {
- if (mStartedInputConnection instanceof RemoteInputConnection) {
- final RemoteInputConnection ric =
- (RemoteInputConnection) mStartedInputConnection;
- if (!ric.isSameConnection(inputContext)) {
- // This is not an error, and can be safely ignored.
- return;
- }
- editorInfo.makeCompatible(
- mService.getApplicationInfo().targetSdkVersion);
- restartInput(new RemoteInputConnection(ric, sessionId), editorInfo);
+ public void invalidateInput(EditorInfo editorInfo,
+ IRemoteAccessibilityInputConnection connection, int sessionId) {
+ if (!mStartedInputConnection.isSameConnection(connection)) {
+ // This is not an error, and can be safely ignored.
+ return;
}
+ editorInfo.makeCompatible(mService.getApplicationInfo().targetSdkVersion);
+ restartInput(new RemoteAccessibilityInputConnection(mStartedInputConnection, sessionId),
+ editorInfo);
}
}
}
diff --git a/core/java/android/app/ActivityClient.java b/core/java/android/app/ActivityClient.java
index 7b7b1ef..668dc6b 100644
--- a/core/java/android/app/ActivityClient.java
+++ b/core/java/android/app/ActivityClient.java
@@ -454,7 +454,13 @@
}
}
- /** Removes the snapshot of home task. */
+ /**
+ * Removes the outdated snapshot of the home task.
+ *
+ * @param homeToken The token of the home task, or null if you have the
+ * {@link android.Manifest.permission#MANAGE_ACTIVITY_TASKS} permission and
+ * want us to find the home task token for you.
+ */
public void invalidateHomeTaskSnapshot(IBinder homeToken) {
try {
getActivityClientController().invalidateHomeTaskSnapshot(homeToken);
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java
index 709272c..2eebc01 100644
--- a/core/java/android/app/ActivityOptions.java
+++ b/core/java/android/app/ActivityOptions.java
@@ -46,6 +46,7 @@
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ResultReceiver;
+import android.os.SystemClock;
import android.os.UserHandle;
import android.transition.TransitionManager;
import android.util.Pair;
@@ -634,9 +635,10 @@
mAnimationStartedListener = new IRemoteCallback.Stub() {
@Override
public void sendResult(Bundle data) throws RemoteException {
+ final long elapsedRealtime = SystemClock.elapsedRealtime();
handler.post(new Runnable() {
@Override public void run() {
- listener.onAnimationStarted();
+ listener.onAnimationStarted(elapsedRealtime);
}
});
}
@@ -645,13 +647,15 @@
}
/**
- * Callback for use with {@link ActivityOptions#makeThumbnailScaleUpAnimation}
- * to find out when the given animation has started running.
+ * Callback for finding out when the given animation has started running.
* @hide
*/
@TestApi
public interface OnAnimationStartedListener {
- void onAnimationStarted();
+ /**
+ * @param elapsedRealTime {@link SystemClock#elapsedRealTime} when animation started.
+ */
+ void onAnimationStarted(long elapsedRealTime);
}
private void setOnAnimationFinishedListener(final Handler handler,
@@ -660,10 +664,11 @@
mAnimationFinishedListener = new IRemoteCallback.Stub() {
@Override
public void sendResult(Bundle data) throws RemoteException {
+ final long elapsedRealtime = SystemClock.elapsedRealtime();
handler.post(new Runnable() {
@Override
public void run() {
- listener.onAnimationFinished();
+ listener.onAnimationFinished(elapsedRealtime);
}
});
}
@@ -672,13 +677,15 @@
}
/**
- * Callback for use with {@link ActivityOptions#makeThumbnailAspectScaleDownAnimation}
- * to find out when the given animation has drawn its last frame.
+ * Callback for finding out when the given animation has drawn its last frame.
* @hide
*/
@TestApi
public interface OnAnimationFinishedListener {
- void onAnimationFinished();
+ /**
+ * @param elapsedRealTime {@link SystemClock#elapsedRealTime} when animation finished.
+ */
+ void onAnimationFinished(long elapsedRealTime);
}
/**
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 7d68eb9..b4cabad 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -7030,7 +7030,13 @@
// local, we'll need to wait for the publishing of the provider.
if (holder != null && holder.provider == null && !holder.mLocal) {
synchronized (key.mLock) {
- key.mLock.wait(ContentResolver.CONTENT_PROVIDER_READY_TIMEOUT_MILLIS);
+ if (key.mHolder != null) {
+ if (DEBUG_PROVIDER) {
+ Slog.i(TAG, "already received provider: " + auth);
+ }
+ } else {
+ key.mLock.wait(ContentResolver.CONTENT_PROVIDER_READY_TIMEOUT_MILLIS);
+ }
holder = key.mHolder;
}
if (holder != null && holder.provider == null) {
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 4829dc0..6e395be 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -2916,6 +2916,133 @@
};
/**
+ * This specifies whether each option is only allowed to be read
+ * by apps with manage appops permission.
+ */
+ private static boolean[] sOpRestrictRead = new boolean[] {
+ false, // COARSE_LOCATION
+ false, // FINE_LOCATION
+ false, // GPS
+ false, // VIBRATE
+ false, // READ_CONTACTS
+ false, // WRITE_CONTACTS
+ false, // READ_CALL_LOG
+ false, // WRITE_CALL_LOG
+ false, // READ_CALENDAR
+ false, // WRITE_CALENDAR
+ false, // WIFI_SCAN
+ false, // POST_NOTIFICATION
+ false, // NEIGHBORING_CELLS
+ false, // CALL_PHONE
+ false, // READ_SMS
+ false, // WRITE_SMS
+ false, // RECEIVE_SMS
+ false, // RECEIVE_EMERGENCY_BROADCAST
+ false, // RECEIVE_MMS
+ false, // RECEIVE_WAP_PUSH
+ false, // SEND_SMS
+ false, // READ_ICC_SMS
+ false, // WRITE_ICC_SMS
+ false, // WRITE_SETTINGS
+ false, // SYSTEM_ALERT_WINDOW
+ false, // ACCESS_NOTIFICATIONS
+ false, // CAMERA
+ false, // RECORD_AUDIO
+ false, // PLAY_AUDIO
+ false, // READ_CLIPBOARD
+ false, // WRITE_CLIPBOARD
+ false, // TAKE_MEDIA_BUTTONS
+ false, // TAKE_AUDIO_FOCUS
+ false, // AUDIO_MASTER_VOLUME
+ false, // AUDIO_VOICE_VOLUME
+ false, // AUDIO_RING_VOLUME
+ false, // AUDIO_MEDIA_VOLUME
+ false, // AUDIO_ALARM_VOLUME
+ false, // AUDIO_NOTIFICATION_VOLUME
+ false, // AUDIO_BLUETOOTH_VOLUME
+ false, // WAKE_LOCK
+ false, // MONITOR_LOCATION
+ false, // MONITOR_HIGH_POWER_LOCATION
+ false, // GET_USAGE_STATS
+ false, // MUTE_MICROPHONE
+ false, // TOAST_WINDOW
+ false, // PROJECT_MEDIA
+ false, // ACTIVATE_VPN
+ false, // WRITE_WALLPAPER
+ false, // ASSIST_STRUCTURE
+ false, // ASSIST_SCREENSHOT
+ false, // READ_PHONE_STATE
+ false, // ADD_VOICEMAIL
+ false, // USE_SIP
+ false, // PROCESS_OUTGOING_CALLS
+ false, // USE_FINGERPRINT
+ false, // BODY_SENSORS
+ false, // READ_CELL_BROADCASTS
+ false, // MOCK_LOCATION
+ false, // READ_EXTERNAL_STORAGE
+ false, // WRITE_EXTERNAL_STORAGE
+ false, // TURN_SCREEN_ON
+ false, // GET_ACCOUNTS
+ false, // RUN_IN_BACKGROUND
+ false, // AUDIO_ACCESSIBILITY_VOLUME
+ false, // READ_PHONE_NUMBERS
+ false, // REQUEST_INSTALL_PACKAGES
+ false, // PICTURE_IN_PICTURE
+ false, // INSTANT_APP_START_FOREGROUND
+ false, // ANSWER_PHONE_CALLS
+ false, // RUN_ANY_IN_BACKGROUND
+ false, // CHANGE_WIFI_STATE
+ false, // REQUEST_DELETE_PACKAGES
+ false, // BIND_ACCESSIBILITY_SERVICE
+ false, // ACCEPT_HANDOVER
+ false, // MANAGE_IPSEC_TUNNELS
+ false, // START_FOREGROUND
+ false, // BLUETOOTH_SCAN
+ false, // USE_BIOMETRIC
+ false, // ACTIVITY_RECOGNITION
+ false, // SMS_FINANCIAL_TRANSACTIONS
+ false, // READ_MEDIA_AUDIO
+ false, // WRITE_MEDIA_AUDIO
+ false, // READ_MEDIA_VIDEO
+ false, // WRITE_MEDIA_VIDEO
+ false, // READ_MEDIA_IMAGES
+ false, // WRITE_MEDIA_IMAGES
+ false, // LEGACY_STORAGE
+ false, // ACCESS_ACCESSIBILITY
+ false, // READ_DEVICE_IDENTIFIERS
+ false, // ACCESS_MEDIA_LOCATION
+ false, // QUERY_ALL_PACKAGES
+ false, // MANAGE_EXTERNAL_STORAGE
+ false, // INTERACT_ACROSS_PROFILES
+ false, // ACTIVATE_PLATFORM_VPN
+ false, // LOADER_USAGE_STATS
+ false, // deprecated operation
+ false, // AUTO_REVOKE_PERMISSIONS_IF_UNUSED
+ false, // AUTO_REVOKE_MANAGED_BY_INSTALLER
+ false, // NO_ISOLATED_STORAGE
+ false, // PHONE_CALL_MICROPHONE
+ false, // PHONE_CALL_CAMERA
+ false, // RECORD_AUDIO_HOTWORD
+ false, // MANAGE_ONGOING_CALLS
+ false, // MANAGE_CREDENTIALS
+ false, // USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
+ false, // RECORD_AUDIO_OUTPUT
+ false, // SCHEDULE_EXACT_ALARM
+ false, // ACCESS_FINE_LOCATION_SOURCE
+ false, // ACCESS_COARSE_LOCATION_SOURCE
+ false, // MANAGE_MEDIA
+ false, // BLUETOOTH_CONNECT
+ false, // UWB_RANGING
+ false, // ACTIVITY_RECOGNITION_SOURCE
+ false, // BLUETOOTH_ADVERTISE
+ false, // RECORD_INCOMING_PHONE_AUDIO
+ false, // NEARBY_WIFI_DEVICES
+ false, // OP_ESTABLISH_VPN_SERVICE
+ false, // OP_ESTABLISH_VPN_MANAGER
+ true, // ACCESS_RESTRICTED_SETTINGS
+ };
+
+ /**
* Mapping from an app op name to the app op code.
*/
private static HashMap<String, Integer> sOpStrToOp = new HashMap<>();
@@ -3143,6 +3270,14 @@
}
/**
+ * Retrieve whether the op can be read by apps with manage appops permission.
+ * @hide
+ */
+ public static boolean opRestrictsRead(int op) {
+ return sOpRestrictRead[op];
+ }
+
+ /**
* Retrieve whether the op allows itself to be reset.
* @hide
*/
diff --git a/core/java/android/app/Application.java b/core/java/android/app/Application.java
index 7c337a4..2767b43 100644
--- a/core/java/android/app/Application.java
+++ b/core/java/android/app/Application.java
@@ -30,11 +30,9 @@
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
-import android.util.Slog;
import android.view.autofill.AutofillManager;
import java.util.ArrayList;
-import java.util.concurrent.atomic.AtomicReference;
/**
* Base class for maintaining global application state. You can provide your own
@@ -56,9 +54,6 @@
public class Application extends ContextWrapper implements ComponentCallbacks2 {
private static final String TAG = "Application";
- /** Whether to enable the check to detect "duplicate application instances". */
- private static final boolean DEBUG_DUP_APP_INSTANCES = true;
-
@UnsupportedAppUsage
private ArrayList<ActivityLifecycleCallbacks> mActivityLifecycleCallbacks =
new ArrayList<ActivityLifecycleCallbacks>();
@@ -72,9 +67,6 @@
@UnsupportedAppUsage
public LoadedApk mLoadedApk;
- private static final AtomicReference<StackTrace> sConstructorStackTrace =
- new AtomicReference<>();
-
public interface ActivityLifecycleCallbacks {
/**
@@ -240,26 +232,6 @@
public Application() {
super(null);
- if (DEBUG_DUP_APP_INSTANCES) {
- checkDuplicateInstances();
- }
- }
-
- private void checkDuplicateInstances() {
- // STOPSHIP: Delete this check b/221248960
- // Only run this check for gms-core.
- if (!"com.google.android.gms".equals(ActivityThread.currentOpPackageName())) {
- return;
- }
-
- final StackTrace previousStackTrace = sConstructorStackTrace.getAndSet(
- new StackTrace("Previous stack trace"));
- if (previousStackTrace == null) {
- // This is the first call.
- return;
- }
- Slog.wtf(TAG, "Application ctor called twice for " + this.getClass(),
- new StackTrace("Current stack trace", previousStackTrace));
}
private String getLoadedApkInfo() {
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 56d655c..53e7559 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -361,9 +361,9 @@
* {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} flag, which requires
* that you take care of task management as described in the
* <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back
- * Stack</a> document. In particular, make sure to read the notification section
- * <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#HandlingNotifications">Handling
- * Notifications</a> for the correct ways to launch an application from a
+ * Stack</a> document. In particular, make sure to read the
+ * <a href="{@docRoot}/training/notify-user/navigation">Start
+ * an Activity from a Notification</a> page for the correct ways to launch an application from a
* notification.
*/
public PendingIntent contentIntent;
diff --git a/core/java/android/app/UiAutomation.java b/core/java/android/app/UiAutomation.java
index 893dc2f..ac67593 100644
--- a/core/java/android/app/UiAutomation.java
+++ b/core/java/android/app/UiAutomation.java
@@ -64,13 +64,11 @@
import android.view.accessibility.AccessibilityWindowInfo;
import android.view.accessibility.IAccessibilityInteractionConnection;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputBinding;
-import android.view.inputmethod.InputConnection;
-import android.view.inputmethod.InputMethodSession;
import com.android.internal.annotations.GuardedBy;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSessionCallback;
+import com.android.internal.inputmethod.RemoteAccessibilityInputConnection;
import com.android.internal.util.function.pooled.PooledLambda;
-import com.android.internal.view.IInputSessionWithIdCallback;
import libcore.io.IoUtils;
@@ -1574,26 +1572,14 @@
}
@Override
- public void createImeSession(IInputSessionWithIdCallback callback) {
+ public void createImeSession(IAccessibilityInputMethodSessionCallback callback) {
/* do nothing */
}
@Override
- public void setImeSessionEnabled(InputMethodSession session, boolean enabled) {
- }
-
- @Override
- public void bindInput(InputBinding binding) {
- }
-
- @Override
- public void unbindInput() {
- }
-
- @Override
- public void startInput(@Nullable InputConnection inputConnection,
- @NonNull EditorInfo editorInfo, boolean restarting,
- @NonNull IBinder startInputToken) {
+ public void startInput(
+ @Nullable RemoteAccessibilityInputConnection inputConnection,
+ @NonNull EditorInfo editorInfo, boolean restarting) {
}
@Override
diff --git a/core/java/android/app/admin/DevicePolicyCache.java b/core/java/android/app/admin/DevicePolicyCache.java
index 9c07f85..da62375 100644
--- a/core/java/android/app/admin/DevicePolicyCache.java
+++ b/core/java/android/app/admin/DevicePolicyCache.java
@@ -41,8 +41,7 @@
/**
* See {@link DevicePolicyManager#getScreenCaptureDisabled}
*/
- public abstract boolean isScreenCaptureAllowed(@UserIdInt int userHandle,
- boolean ownerCanAddInternalSystemWindow);
+ public abstract boolean isScreenCaptureAllowed(@UserIdInt int userHandle);
/**
* Caches {@link DevicePolicyManager#getPasswordQuality(android.content.ComponentName)} of the
@@ -70,8 +69,7 @@
private static final EmptyDevicePolicyCache INSTANCE = new EmptyDevicePolicyCache();
@Override
- public boolean isScreenCaptureAllowed(int userHandle,
- boolean ownerCanAddInternalSystemWindow) {
+ public boolean isScreenCaptureAllowed(int userHandle) {
return true;
}
diff --git a/core/java/android/app/trust/TEST_MAPPING b/core/java/android/app/trust/TEST_MAPPING
index b9c46bf..23923ee 100644
--- a/core/java/android/app/trust/TEST_MAPPING
+++ b/core/java/android/app/trust/TEST_MAPPING
@@ -11,5 +11,18 @@
}
]
}
+ ],
+ "trust-tablet": [
+ {
+ "name": "TrustTests",
+ "options": [
+ {
+ "include-filter": "android.trust.test"
+ },
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ }
+ ]
+ }
]
}
\ No newline at end of file
diff --git a/core/java/android/content/AbstractThreadedSyncAdapter.java b/core/java/android/content/AbstractThreadedSyncAdapter.java
index c4ac483..da4ecdd 100644
--- a/core/java/android/content/AbstractThreadedSyncAdapter.java
+++ b/core/java/android/content/AbstractThreadedSyncAdapter.java
@@ -172,17 +172,20 @@
}
private class ISyncAdapterImpl extends ISyncAdapter.Stub {
- private void enforceCallerSystem() {
+ private boolean isCallerSystem() {
final long callingUid = Binder.getCallingUid();
if (callingUid != Process.SYSTEM_UID) {
android.util.EventLog.writeEvent(0x534e4554, "203229608", -1, "");
- return;
+ return false;
}
+ return true;
}
@Override
public void onUnsyncableAccount(ISyncAdapterUnsyncableAccountCallback cb) {
- enforceCallerSystem();
+ if (!isCallerSystem()) {
+ return;
+ }
Handler.getMain().sendMessage(obtainMessage(
AbstractThreadedSyncAdapter::handleOnUnsyncableAccount,
AbstractThreadedSyncAdapter.this, cb));
@@ -191,13 +194,15 @@
@Override
public void startSync(ISyncContext syncContext, String authority, Account account,
Bundle extras) {
+ if (!isCallerSystem()) {
+ return;
+ }
if (ENABLE_LOG) {
if (extras != null) {
extras.size(); // Unparcel so its toString() will show the contents.
}
Log.d(TAG, "startSync() start " + authority + " " + account + " " + extras);
}
- enforceCallerSystem();
try {
final SyncContext syncContextClient = new SyncContext(syncContext);
@@ -254,7 +259,9 @@
@Override
public void cancelSync(ISyncContext syncContext) {
- enforceCallerSystem();
+ if (!isCallerSystem()) {
+ return;
+ }
try {
// synchronize to make sure that mSyncThreads doesn't change between when we
// check it and when we use it
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 0d258ce..4d56c1d 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -486,7 +486,7 @@
/**
* @hide Flag for {@link #bindService}: For only the case where the binding
- * is coming from the system, set the process state to FOREGROUND_SERVICE
+ * is coming from the system, set the process state to BOUND_FOREGROUND_SERVICE
* instead of the normal maximum of IMPORTANT_FOREGROUND. That is, this is
* saying that the process shouldn't participate in the normal power reduction
* modes (removing network access etc).
diff --git a/core/java/android/content/OWNERS b/core/java/android/content/OWNERS
index 660368a..1c9713d 100644
--- a/core/java/android/content/OWNERS
+++ b/core/java/android/content/OWNERS
@@ -1,7 +1,8 @@
# Remain no owner because multiple modules may touch this file.
per-file Context.java = *
per-file ContextWrapper.java = *
-per-file Content* = file:/services/core/java/com/android/server/am/OWNERS
+per-file *Content* = file:/services/core/java/com/android/server/am/OWNERS
+per-file *Sync* = file:/services/core/java/com/android/server/am/OWNERS
per-file IntentFilter.java = file:/PACKAGE_MANAGER_OWNERS
per-file IntentFilter.java = file:/services/core/java/com/android/server/am/OWNERS
per-file Intent.java = file:/PACKAGE_MANAGER_OWNERS
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index ca7d77b..54d57a1 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -571,8 +571,14 @@
/**
* Ask the package manager to dump profiles associated with a package.
+ *
+ * @param packageName The name of the package to dump.
+ * @param dumpClassesAndMethods If false, pass {@code --dump-only} to profman to dump the
+ * profile in a human readable form intended for debugging. If true, pass
+ * {@code --dump-classes-and-methods} to profman to dump a sorted list of classes and methods
+ * in a human readable form that is valid input for {@code profman --create-profile-from}.
*/
- void dumpProfiles(String packageName);
+ void dumpProfiles(String packageName, boolean dumpClassesAndMethods);
void forceDexOpt(String packageName);
diff --git a/core/java/android/content/pm/SigningDetails.java b/core/java/android/content/pm/SigningDetails.java
index 584a058..1e659b7 100644
--- a/core/java/android/content/pm/SigningDetails.java
+++ b/core/java/android/content/pm/SigningDetails.java
@@ -112,6 +112,29 @@
int AUTH = 16;
}
+ @IntDef(value = {CapabilityMergeRule.MERGE_SELF_CAPABILITY,
+ CapabilityMergeRule.MERGE_OTHER_CAPABILITY,
+ CapabilityMergeRule.MERGE_RESTRICTED_CAPABILITY})
+ public @interface CapabilityMergeRule {
+ /**
+ * When capabilities are different for a common signer in the lineage, use the capabilities
+ * from this instance.
+ */
+ int MERGE_SELF_CAPABILITY = 0;
+
+ /**
+ * When capabilities are different for a common signer in the lineage, use the capabilites
+ * from the other instance.
+ */
+ int MERGE_OTHER_CAPABILITY = 1;
+
+ /**
+ * When capabilities are different for a common signer in the lineage, use the most
+ * restrictive between the two signers.
+ */
+ int MERGE_RESTRICTED_CAPABILITY = 2;
+ }
+
/** A representation of unknown signing details. Use instead of null. */
public static final SigningDetails UNKNOWN = new SigningDetails(/* signatures */ null,
SignatureSchemeVersion.UNKNOWN, /* keys */ null, /* pastSigningCertificates */ null);
@@ -164,30 +187,60 @@
/**
* Merges the signing lineage of this instance with the lineage in the provided {@code
- * otherSigningDetails} when one has the same or an ancestor signer of the other.
+ * otherSigningDetails} using {@link CapabilityMergeRule#MERGE_OTHER_CAPABILITY} as the merge
+ * rule.
+ *
+ * @param otherSigningDetails the {@code SigningDetails} with which to merge
+ * @return Merged {@code SigningDetails} instance when one has the same or an ancestor signer
+ * of the other. If neither instance has a lineage, or if neither has the same or an
+ * ancestor signer then this instance is returned.
+ * @see #mergeLineageWith(SigningDetails, int)
+ */
+ public @NonNull SigningDetails mergeLineageWith(@NonNull SigningDetails otherSigningDetails) {
+ return mergeLineageWith(otherSigningDetails, CapabilityMergeRule.MERGE_OTHER_CAPABILITY);
+ }
+
+ /**
+ * Merges the signing lineage of this instance with the lineage in the provided {@code
+ * otherSigningDetails} when one has the same or an ancestor signer of the other using the
+ * provided {@code mergeRule} to handle differences in capabilities for shared signers.
*
* <p>Merging two signing lineages will result in a new {@code SigningDetails} instance
- * containing the longest common lineage with the most restrictive capabilities. If the two
- * lineages contain the same signers with the same capabilities then the instance on which
- * this was invoked is returned without any changes. Similarly if neither instance has a
- * lineage, or if neither has the same or an ancestor signer then this instance is returned.
+ * containing the longest common lineage with differences in capabilities for shared signers
+ * resolved using the provided {@code mergeRule}. If the two lineages contain the same signers
+ * with the same capabilities then the instance on which this was invoked is returned without
+ * any changes. Similarly if neither instance has a lineage, or if neither has the same or an
+ * ancestor signer then this instance is returned.
*
* Following are some example results of this method for lineages with signers A, B, C, D:
- * - lineage B merged with lineage A -> B returns lineage A -> B.
- * - lineage A -> B merged with lineage B -> C returns lineage A -> B -> C
- * - lineage A -> B with the {@code PERMISSION} capability revoked for A merged with
- * lineage A -> B with the {@code SHARED_USER_ID} capability revoked for A returns
- * lineage A -> B with both capabilities revoked for A.
- * - lineage A -> B -> C merged with lineage A -> B -> D would return the original lineage
- * A -> B -> C since the current signer of both instances is not the same or in the
- * lineage of the other.
+ * <ul>
+ * <li>lineage B merged with lineage A -> B returns lineage A -> B.
+ * <li>lineage A -> B merged with lineage B -> C returns lineage A -> B -> C
+ * <li>lineage A -> B with the {@code PERMISSION} capability revoked for A merged with
+ * lineage A -> B with the {@code SHARED_USER_ID} capability revoked for A returns the
+ * following based on the {@code mergeRule}:
+ * <ul>
+ * <li>{@code MERGE_SELF_CAPABILITY} - lineage A -> B with {@code PERMISSION} revoked
+ * for A.
+ * <li>{@code MERGE_OTHER_CAPABILITY} - lineage A -> B with {@code SHARED_USER_ID}
+ * revoked for A.
+ * <li>{@code MERGE_RESTRICTED_CAPABILITY} - lineage A -> B with {@code PERMISSION} and
+ * {@code SHARED_USER_ID} revoked for A.
+ * </ul>
+ * <li>lineage A -> B -> C merged with lineage A -> B -> D would return the original lineage
+ * A -> B -> C since the current signer of both instances is not the same or in the
+ * lineage of the other.
+ * </ul>
*
- * @param otherSigningDetails The {@code SigningDetails} you would like to merge with.
+ * @param otherSigningDetails the {@code SigningDetails} with which to merge
+ * @param mergeRule the {@link CapabilityMergeRule} to use when resolving differences in
+ * capabilities for shared signers
* @return Merged {@code SigningDetails} instance when one has the same or an ancestor signer
* of the other. If neither instance has a lineage, or if neither has the same or an
* ancestor signer then this instance is returned.
*/
- public @NonNull SigningDetails mergeLineageWith(@NonNull SigningDetails otherSigningDetails) {
+ public @NonNull SigningDetails mergeLineageWith(@NonNull SigningDetails otherSigningDetails,
+ @CapabilityMergeRule int mergeRule) {
if (!hasPastSigningCertificates()) {
return otherSigningDetails.hasPastSigningCertificates()
&& otherSigningDetails.hasAncestorOrSelf(this) ? otherSigningDetails : this;
@@ -201,19 +254,43 @@
if (descendantSigningDetails == null) {
return this;
}
- return descendantSigningDetails == this ? mergeLineageWithAncestorOrSelf(
- otherSigningDetails) : otherSigningDetails.mergeLineageWithAncestorOrSelf(this);
+ SigningDetails mergedDetails = this;
+ if (descendantSigningDetails == this) {
+ // If this instance is the descendant then the merge will also be invoked against this
+ // instance and the provided mergeRule can be used as is.
+ mergedDetails = mergeLineageWithAncestorOrSelf(otherSigningDetails, mergeRule);
+ } else {
+ // If the provided instance is the descendant then the merge will be invoked against the
+ // other instance and a self or other merge rule will need to be flipped.
+ switch (mergeRule) {
+ case CapabilityMergeRule.MERGE_SELF_CAPABILITY:
+ mergedDetails = otherSigningDetails.mergeLineageWithAncestorOrSelf(this,
+ CapabilityMergeRule.MERGE_OTHER_CAPABILITY);
+ break;
+ case CapabilityMergeRule.MERGE_OTHER_CAPABILITY:
+ mergedDetails = otherSigningDetails.mergeLineageWithAncestorOrSelf(this,
+ CapabilityMergeRule.MERGE_SELF_CAPABILITY);
+ break;
+ case CapabilityMergeRule.MERGE_RESTRICTED_CAPABILITY:
+ mergedDetails = otherSigningDetails.mergeLineageWithAncestorOrSelf(this,
+ mergeRule);
+ break;
+ }
+ }
+ return mergedDetails;
}
/**
* Merges the signing lineage of this instance with the lineage of the ancestor (or same)
* signer in the provided {@code otherSigningDetails}.
*
- * @param otherSigningDetails The {@code SigningDetails} you would like to merge with.
+ * @param otherSigningDetails the {@code SigningDetails} with which to merge
+ * @param mergeRule the {@link CapabilityMergeRule} to use when resolving differences in
+ * capabilities for shared signers
* @return Merged {@code SigningDetails} instance.
*/
private @NonNull SigningDetails mergeLineageWithAncestorOrSelf(
- @NonNull SigningDetails otherSigningDetails) {
+ @NonNull SigningDetails otherSigningDetails, @CapabilityMergeRule int mergeRule) {
// This method should only be called with instances that contain lineages.
int index = mPastSigningCertificates.length - 1;
int otherIndex = otherSigningDetails.mPastSigningCertificates.length - 1;
@@ -236,16 +313,26 @@
}
do {
- // Add the common signer to the merged lineage with the most restrictive
- // capabilities of the two lineages.
+ // Add the common signer to the merged lineage and resolve any differences in
+ // capabilites with the merge rule.
Signature signature = mPastSigningCertificates[index--];
Signature ancestorSignature =
otherSigningDetails.mPastSigningCertificates[otherIndex--];
Signature mergedSignature = new Signature(signature);
- int mergedCapabilities = signature.getFlags() & ancestorSignature.getFlags();
- if (signature.getFlags() != mergedCapabilities) {
+ if (signature.getFlags() != ancestorSignature.getFlags()) {
capabilitiesModified = true;
- mergedSignature.setFlags(mergedCapabilities);
+ switch (mergeRule) {
+ case CapabilityMergeRule.MERGE_SELF_CAPABILITY:
+ mergedSignature.setFlags(signature.getFlags());
+ break;
+ case CapabilityMergeRule.MERGE_OTHER_CAPABILITY:
+ mergedSignature.setFlags(ancestorSignature.getFlags());
+ break;
+ case CapabilityMergeRule.MERGE_RESTRICTED_CAPABILITY:
+ mergedSignature.setFlags(
+ signature.getFlags() & ancestorSignature.getFlags());
+ break;
+ }
}
mergedSignatures.add(mergedSignature);
} while (index >= 0 && otherIndex >= 0 && mPastSigningCertificates[index].equals(
@@ -858,7 +945,7 @@
- // Code below generated by codegen v1.0.22.
+ // Code below generated by codegen v1.0.23.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -914,10 +1001,10 @@
}
@DataClass.Generated(
- time = 1616984092921L,
- codegenVersion = "1.0.22",
+ time = 1650058974710L,
+ codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/content/pm/SigningDetails.java",
- inputSignatures = "private static final java.lang.String TAG\nprivate final @android.annotation.Nullable android.content.pm.Signature[] mSignatures\nprivate final @android.content.pm.SigningDetails.SignatureSchemeVersion int mSignatureSchemeVersion\nprivate final @android.annotation.Nullable android.util.ArraySet<java.security.PublicKey> mPublicKeys\nprivate final @android.annotation.Nullable android.content.pm.Signature[] mPastSigningCertificates\nprivate static final int PAST_CERT_EXISTS\npublic static final android.content.pm.SigningDetails UNKNOWN\npublic static final @android.annotation.NonNull android.os.Parcelable.Creator<android.content.pm.SigningDetails> CREATOR\npublic @android.annotation.NonNull android.content.pm.SigningDetails mergeLineageWith(android.content.pm.SigningDetails)\nprivate @android.annotation.NonNull android.content.pm.SigningDetails mergeLineageWithAncestorOrSelf(android.content.pm.SigningDetails)\npublic boolean hasCommonAncestor(android.content.pm.SigningDetails)\npublic boolean hasAncestorOrSelfWithDigest(java.util.Set<java.lang.String>)\nprivate @android.annotation.Nullable android.content.pm.SigningDetails getDescendantOrSelf(android.content.pm.SigningDetails)\npublic boolean hasSignatures()\npublic boolean hasPastSigningCertificates()\npublic boolean hasAncestorOrSelf(android.content.pm.SigningDetails)\npublic boolean hasAncestor(android.content.pm.SigningDetails)\npublic boolean hasCommonSignerWithCapability(android.content.pm.SigningDetails,int)\npublic boolean checkCapability(android.content.pm.SigningDetails,int)\npublic boolean checkCapabilityRecover(android.content.pm.SigningDetails,int)\npublic boolean hasCertificate(android.content.pm.Signature)\npublic boolean hasCertificate(android.content.pm.Signature,int)\npublic boolean hasCertificate(byte[])\nprivate boolean hasCertificateInternal(android.content.pm.Signature,int)\npublic boolean checkCapability(java.lang.String,int)\npublic boolean hasSha256Certificate(byte[])\npublic boolean hasSha256Certificate(byte[],int)\nprivate boolean hasSha256CertificateInternal(byte[],int)\npublic boolean signaturesMatchExactly(android.content.pm.SigningDetails)\npublic @java.lang.Override int describeContents()\npublic @java.lang.Override void writeToParcel(android.os.Parcel,int)\npublic @java.lang.Override boolean equals(java.lang.Object)\npublic @java.lang.Override int hashCode()\npublic static android.util.ArraySet<java.security.PublicKey> toSigningKeys(android.content.pm.Signature[])\nclass SigningDetails extends java.lang.Object implements [android.os.Parcelable]\nprivate @android.annotation.NonNull android.content.pm.Signature[] mSignatures\nprivate @android.content.pm.SigningDetails.SignatureSchemeVersion int mSignatureSchemeVersion\nprivate @android.annotation.Nullable android.content.pm.Signature[] mPastSigningCertificates\npublic android.content.pm.SigningDetails.Builder setSignatures(android.content.pm.Signature[])\npublic android.content.pm.SigningDetails.Builder setSignatureSchemeVersion(int)\npublic android.content.pm.SigningDetails.Builder setPastSigningCertificates(android.content.pm.Signature[])\nprivate void checkInvariants()\npublic android.content.pm.SigningDetails build()\nclass Builder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genConstDefs=false, genParcelable=true, genAidl=false)")
+ inputSignatures = "private static final java.lang.String TAG\nprivate final @android.annotation.Nullable android.content.pm.Signature[] mSignatures\nprivate final @android.content.pm.SigningDetails.SignatureSchemeVersion int mSignatureSchemeVersion\nprivate final @android.annotation.Nullable android.util.ArraySet<java.security.PublicKey> mPublicKeys\nprivate final @android.annotation.Nullable android.content.pm.Signature[] mPastSigningCertificates\nprivate static final int PAST_CERT_EXISTS\npublic static final android.content.pm.SigningDetails UNKNOWN\npublic static final @android.annotation.NonNull android.os.Parcelable.Creator<android.content.pm.SigningDetails> CREATOR\npublic @android.annotation.NonNull android.content.pm.SigningDetails mergeLineageWith(android.content.pm.SigningDetails)\npublic @android.annotation.NonNull android.content.pm.SigningDetails mergeLineageWith(android.content.pm.SigningDetails,int)\nprivate @android.annotation.NonNull android.content.pm.SigningDetails mergeLineageWithAncestorOrSelf(android.content.pm.SigningDetails,int)\npublic boolean hasCommonAncestor(android.content.pm.SigningDetails)\npublic boolean hasAncestorOrSelfWithDigest(java.util.Set<java.lang.String>)\nprivate @android.annotation.Nullable android.content.pm.SigningDetails getDescendantOrSelf(android.content.pm.SigningDetails)\npublic boolean hasSignatures()\npublic boolean hasPastSigningCertificates()\npublic boolean hasAncestorOrSelf(android.content.pm.SigningDetails)\npublic boolean hasAncestor(android.content.pm.SigningDetails)\npublic boolean hasCommonSignerWithCapability(android.content.pm.SigningDetails,int)\npublic boolean checkCapability(android.content.pm.SigningDetails,int)\npublic boolean checkCapabilityRecover(android.content.pm.SigningDetails,int)\npublic boolean hasCertificate(android.content.pm.Signature)\npublic boolean hasCertificate(android.content.pm.Signature,int)\npublic boolean hasCertificate(byte[])\nprivate boolean hasCertificateInternal(android.content.pm.Signature,int)\npublic boolean checkCapability(java.lang.String,int)\npublic boolean hasSha256Certificate(byte[])\npublic boolean hasSha256Certificate(byte[],int)\nprivate boolean hasSha256CertificateInternal(byte[],int)\npublic boolean signaturesMatchExactly(android.content.pm.SigningDetails)\npublic @java.lang.Override int describeContents()\npublic @java.lang.Override void writeToParcel(android.os.Parcel,int)\npublic @java.lang.Override boolean equals(java.lang.Object)\npublic @java.lang.Override int hashCode()\npublic static android.util.ArraySet<java.security.PublicKey> toSigningKeys(android.content.pm.Signature[])\nclass SigningDetails extends java.lang.Object implements [android.os.Parcelable]\nprivate @android.annotation.NonNull android.content.pm.Signature[] mSignatures\nprivate @android.content.pm.SigningDetails.SignatureSchemeVersion int mSignatureSchemeVersion\nprivate @android.annotation.Nullable android.content.pm.Signature[] mPastSigningCertificates\npublic android.content.pm.SigningDetails.Builder setSignatures(android.content.pm.Signature[])\npublic android.content.pm.SigningDetails.Builder setSignatureSchemeVersion(int)\npublic android.content.pm.SigningDetails.Builder setPastSigningCertificates(android.content.pm.Signature[])\nprivate void checkInvariants()\npublic android.content.pm.SigningDetails build()\nclass Builder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genConstDefs=false, genParcelable=true, genAidl=false)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java
index dd3ddaf..29f21f1 100644
--- a/core/java/android/content/res/Configuration.java
+++ b/core/java/android/content/res/Configuration.java
@@ -763,6 +763,14 @@
* (for example, when apps are displayed side by side in split-screen mode
* in landscape orientation).
*
+ * <p>In multiple-screen scenarios, the width measurement can span screens.
+ * For example, if the app is spanning both screens of a dual-screen device
+ * (with the screens side by side), {@code screenWidthDp} represents the
+ * width of both screens, excluding the area occupied by screen decorations.
+ * When the app is restricted to a single screen in a multiple-screen
+ * environment, {@code screenWidthDp} is the width of the screen on which
+ * the app is running.
+ *
* <p>Differs from {@link android.view.WindowMetrics} by not including
* screen decorations in the width measurement and by expressing the
* measurement in dp rather than px. Use {@code screenWidthDp} to obtain the
@@ -792,6 +800,14 @@
* (for example, when apps are displayed one above another in split-screen
* mode in portrait orientation).
*
+ * <p>In multiple-screen scenarios, the height measurement can span screens.
+ * For example, if the app is spanning both screens of a dual-screen device
+ * rotated 90 degrees (one screen above the other), {@code screenHeightDp}
+ * represents the height of both screens, excluding the area occupied by
+ * screen decorations. When the app is restricted to a single screen in a
+ * multiple-screen environment, {@code screenHeightDp} is the height of the
+ * screen on which the app is running.
+ *
* <p>Differs from {@link android.view.WindowMetrics} by not including
* screen decorations in the height measurement and by expressing the
* measurement in dp rather than px. Use {@code screenHeightDp} to obtain
diff --git a/core/java/android/hardware/biometrics/BiometricPrompt.java b/core/java/android/hardware/biometrics/BiometricPrompt.java
index dc65bef..d235f12 100644
--- a/core/java/android/hardware/biometrics/BiometricPrompt.java
+++ b/core/java/android/hardware/biometrics/BiometricPrompt.java
@@ -422,6 +422,18 @@
}
/**
+ * Set if BiometricPrompt is being used by the legacy fingerprint manager API.
+ * @param sensorId sensor id
+ * @return This builder.
+ * @hide
+ */
+ @NonNull
+ public Builder setIsForLegacyFingerprintManager(int sensorId) {
+ mPromptInfo.setIsForLegacyFingerprintManager(sensorId);
+ return this;
+ }
+
+ /**
* Creates a {@link BiometricPrompt}.
*
* @return An instance of {@link BiometricPrompt}.
@@ -883,28 +895,36 @@
@NonNull @CallbackExecutor Executor executor,
@NonNull AuthenticationCallback callback,
int userId) {
- authenticateUserForOperation(cancel, executor, callback, userId, 0 /* operationId */);
+ if (cancel == null) {
+ throw new IllegalArgumentException("Must supply a cancellation signal");
+ }
+ if (executor == null) {
+ throw new IllegalArgumentException("Must supply an executor");
+ }
+ if (callback == null) {
+ throw new IllegalArgumentException("Must supply a callback");
+ }
+
+ authenticateInternal(0 /* operationId */, cancel, executor, callback, userId);
}
/**
- * Authenticates for the given user and keystore operation.
+ * Authenticates for the given keystore operation.
*
* @param cancel An object that can be used to cancel authentication
* @param executor An executor to handle callback events
* @param callback An object to receive authentication events
- * @param userId The user to authenticate
* @param operationId The keystore operation associated with authentication
*
* @return A requestId that can be used to cancel this operation.
*
* @hide
*/
- @RequiresPermission(USE_BIOMETRIC_INTERNAL)
- public long authenticateUserForOperation(
+ @RequiresPermission(USE_BIOMETRIC)
+ public long authenticateForOperation(
@NonNull CancellationSignal cancel,
@NonNull @CallbackExecutor Executor executor,
@NonNull AuthenticationCallback callback,
- int userId,
long operationId) {
if (cancel == null) {
throw new IllegalArgumentException("Must supply a cancellation signal");
@@ -916,7 +936,7 @@
throw new IllegalArgumentException("Must supply a callback");
}
- return authenticateInternal(operationId, cancel, executor, callback, userId);
+ return authenticateInternal(operationId, cancel, executor, callback, mContext.getUserId());
}
/**
@@ -1050,7 +1070,7 @@
private void cancelAuthentication(long requestId) {
if (mService != null) {
try {
- mService.cancelAuthentication(mToken, mContext.getOpPackageName(), requestId);
+ mService.cancelAuthentication(mToken, mContext.getPackageName(), requestId);
} catch (RemoteException e) {
Log.e(TAG, "Unable to cancel authentication", e);
}
@@ -1109,7 +1129,7 @@
}
final long authId = mService.authenticate(mToken, operationId, userId,
- mBiometricServiceReceiver, mContext.getOpPackageName(), promptInfo);
+ mBiometricServiceReceiver, mContext.getPackageName(), promptInfo);
cancel.setOnCancelListener(new OnAuthenticationCancelListener(authId));
return authId;
} catch (RemoteException e) {
diff --git a/core/java/android/hardware/biometrics/ITestSessionCallback.aidl b/core/java/android/hardware/biometrics/ITestSessionCallback.aidl
index 3d9517f..b336a9f 100644
--- a/core/java/android/hardware/biometrics/ITestSessionCallback.aidl
+++ b/core/java/android/hardware/biometrics/ITestSessionCallback.aidl
@@ -19,7 +19,7 @@
* ITestSession callback for FingerprintManager and BiometricManager.
* @hide
*/
-interface ITestSessionCallback {
+oneway interface ITestSessionCallback {
void onCleanupStarted(int userId);
void onCleanupFinished(int userId);
}
diff --git a/core/java/android/hardware/biometrics/PromptInfo.java b/core/java/android/hardware/biometrics/PromptInfo.java
index 0c03948..a6b8096 100644
--- a/core/java/android/hardware/biometrics/PromptInfo.java
+++ b/core/java/android/hardware/biometrics/PromptInfo.java
@@ -46,6 +46,7 @@
@NonNull private List<Integer> mAllowedSensorIds = new ArrayList<>();
private boolean mAllowBackgroundAuthentication;
private boolean mIgnoreEnrollmentState;
+ private boolean mIsForLegacyFingerprintManager = false;
public PromptInfo() {
@@ -68,6 +69,7 @@
mAllowedSensorIds = in.readArrayList(Integer.class.getClassLoader(), java.lang.Integer.class);
mAllowBackgroundAuthentication = in.readBoolean();
mIgnoreEnrollmentState = in.readBoolean();
+ mIsForLegacyFingerprintManager = in.readBoolean();
}
public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() {
@@ -105,10 +107,15 @@
dest.writeList(mAllowedSensorIds);
dest.writeBoolean(mAllowBackgroundAuthentication);
dest.writeBoolean(mIgnoreEnrollmentState);
+ dest.writeBoolean(mIsForLegacyFingerprintManager);
}
public boolean containsTestConfigurations() {
- if (!mAllowedSensorIds.isEmpty()) {
+ if (mIsForLegacyFingerprintManager
+ && mAllowedSensorIds.size() == 1
+ && !mAllowBackgroundAuthentication) {
+ return false;
+ } else if (!mAllowedSensorIds.isEmpty()) {
return true;
} else if (mAllowBackgroundAuthentication) {
return true;
@@ -188,7 +195,8 @@
}
public void setAllowedSensorIds(@NonNull List<Integer> sensorIds) {
- mAllowedSensorIds = sensorIds;
+ mAllowedSensorIds.clear();
+ mAllowedSensorIds.addAll(sensorIds);
}
public void setAllowBackgroundAuthentication(boolean allow) {
@@ -199,6 +207,12 @@
mIgnoreEnrollmentState = ignoreEnrollmentState;
}
+ public void setIsForLegacyFingerprintManager(int sensorId) {
+ mIsForLegacyFingerprintManager = true;
+ mAllowedSensorIds.clear();
+ mAllowedSensorIds.add(sensorId);
+ }
+
// Getters
public CharSequence getTitle() {
@@ -272,4 +286,8 @@
public boolean isIgnoreEnrollmentState() {
return mIgnoreEnrollmentState;
}
+
+ public boolean isForLegacyFingerprintManager() {
+ return mIsForLegacyFingerprintManager;
+ }
}
diff --git a/core/java/android/hardware/biometrics/SensorLocationInternal.java b/core/java/android/hardware/biometrics/SensorLocationInternal.java
index fb25a2f..25c0f7c 100644
--- a/core/java/android/hardware/biometrics/SensorLocationInternal.java
+++ b/core/java/android/hardware/biometrics/SensorLocationInternal.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
@@ -109,4 +110,12 @@
+ ", y: " + sensorLocationY
+ ", r: " + sensorRadius + "]";
}
+
+ /** Returns coordinates of a bounding box around the sensor. */
+ public Rect getRect() {
+ return new Rect(sensorLocationX - sensorRadius,
+ sensorLocationY - sensorRadius,
+ sensorLocationX + sensorRadius,
+ sensorLocationY + sensorRadius);
+ }
}
diff --git a/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java b/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java
index aa98f1f..cf611fb 100644
--- a/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java
@@ -824,24 +824,34 @@
if (!isExtensionSupported(mCameraId, extension, mChars)) {
throw new IllegalArgumentException("Unsupported extension");
}
- Pair<IPreviewExtenderImpl, IImageCaptureExtenderImpl> extenders =
- initializeExtension(extension);
- extenders.second.onInit(mCameraId, mChars.getNativeMetadata());
- extenders.second.init(mCameraId, mChars.getNativeMetadata());
- CameraMetadataNative captureRequestMeta =
- extenders.second.getAvailableCaptureRequestKeys();
+
+ CameraMetadataNative captureRequestMeta = null;
+ if (areAdvancedExtensionsSupported()) {
+ IAdvancedExtenderImpl extender = initializeAdvancedExtension(extension);
+ extender.init(mCameraId);
+ captureRequestMeta = extender.getAvailableCaptureRequestKeys(mCameraId);
+ } else {
+ Pair<IPreviewExtenderImpl, IImageCaptureExtenderImpl> extenders =
+ initializeExtension(extension);
+ extenders.second.onInit(mCameraId, mChars.getNativeMetadata());
+ extenders.second.init(mCameraId, mChars.getNativeMetadata());
+ captureRequestMeta = extenders.second.getAvailableCaptureRequestKeys();
+ extenders.second.onDeInit();
+ }
if (captureRequestMeta != null) {
int[] requestKeys = captureRequestMeta.get(
CameraCharacteristics.REQUEST_AVAILABLE_REQUEST_KEYS);
if (requestKeys == null) {
- throw new AssertionError("android.request.availableRequestKeys must be non-null"
- + " in the characteristics");
+ throw new AssertionError(
+ "android.request.availableRequestKeys must be non-null"
+ + " in the characteristics");
}
- CameraCharacteristics requestChars = new CameraCharacteristics(captureRequestMeta);
+ CameraCharacteristics requestChars = new CameraCharacteristics(
+ captureRequestMeta);
Object crKey = CaptureRequest.Key.class;
- Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
+ Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>) crKey;
ret.addAll(requestChars.getAvailableKeyList(CaptureRequest.class, crKeyTyped,
requestKeys, /*includeSynthetic*/ false));
@@ -854,7 +864,6 @@
if (!ret.contains(CaptureRequest.JPEG_ORIENTATION)) {
ret.add(CaptureRequest.JPEG_ORIENTATION);
}
- extenders.second.onDeInit();
} catch (RemoteException e) {
throw new IllegalStateException("Failed to query the available capture request keys!");
} finally {
@@ -894,12 +903,19 @@
throw new IllegalArgumentException("Unsupported extension");
}
- Pair<IPreviewExtenderImpl, IImageCaptureExtenderImpl> extenders =
- initializeExtension(extension);
- extenders.second.onInit(mCameraId, mChars.getNativeMetadata());
- extenders.second.init(mCameraId, mChars.getNativeMetadata());
- CameraMetadataNative captureResultMeta =
- extenders.second.getAvailableCaptureResultKeys();
+ CameraMetadataNative captureResultMeta = null;
+ if (areAdvancedExtensionsSupported()) {
+ IAdvancedExtenderImpl extender = initializeAdvancedExtension(extension);
+ extender.init(mCameraId);
+ captureResultMeta = extender.getAvailableCaptureResultKeys(mCameraId);
+ } else {
+ Pair<IPreviewExtenderImpl, IImageCaptureExtenderImpl> extenders =
+ initializeExtension(extension);
+ extenders.second.onInit(mCameraId, mChars.getNativeMetadata());
+ extenders.second.init(mCameraId, mChars.getNativeMetadata());
+ captureResultMeta = extenders.second.getAvailableCaptureResultKeys();
+ extenders.second.onDeInit();
+ }
if (captureResultMeta != null) {
int[] resultKeys = captureResultMeta.get(
@@ -926,7 +942,6 @@
ret.add(CaptureResult.SENSOR_TIMESTAMP);
}
}
- extenders.second.onDeInit();
} catch (RemoteException e) {
throw new IllegalStateException("Failed to query the available capture result keys!");
} finally {
diff --git a/core/java/android/hardware/camera2/CameraExtensionSession.java b/core/java/android/hardware/camera2/CameraExtensionSession.java
index ee3441f..6ddaddf 100644
--- a/core/java/android/hardware/camera2/CameraExtensionSession.java
+++ b/core/java/android/hardware/camera2/CameraExtensionSession.java
@@ -265,8 +265,8 @@
* from the camera device, to produce a single high-quality output result.
*
* <p>Note that single capture requests currently do not support
- * client parameters except for {@link CaptureRequest#JPEG_ORIENTATION orientation} and
- * {@link CaptureRequest#JPEG_QUALITY quality} in case of ImageFormat.JPEG output target.
+ * client parameters except for controls advertised in
+ * {@link CameraExtensionCharacteristics#getAvailableCaptureRequestKeys}.
* The rest of the settings included in the request will be entirely overridden by
* the device-specific extension. </p>
*
@@ -275,6 +275,11 @@
* arguments that include further targets will cause
* IllegalArgumentException to be thrown. </p>
*
+ * <p>Starting with Android {@link android.os.Build.VERSION_CODES#TIRAMISU} single capture
+ * requests will also support the preview {@link android.graphics.ImageFormat#PRIVATE} target
+ * surface. These can typically be used for enabling AF/AE triggers. Do note, that single
+ * capture requests referencing both output surfaces remain unsupported.</p>
+ *
* <p>Each request will produce one new frame for one target Surface, set
* with the CaptureRequest builder's
* {@link CaptureRequest.Builder#addTarget} method.</p>
@@ -319,8 +324,10 @@
* rate possible.</p>
*
* <p>Note that repeating capture requests currently do not support
- * client parameters. Settings included in the request will
- * be completely overridden by the device-specific extension.</p>
+ * client parameters except for controls advertised in
+ * {@link CameraExtensionCharacteristics#getAvailableCaptureRequestKeys}.
+ * The rest of the settings included in the request will be entirely overridden by
+ * the device-specific extension. </p>
*
* <p>The {@link CaptureRequest.Builder#addTarget} supports only one
* target surface. {@link CaptureRequest} arguments that include further
diff --git a/core/java/android/hardware/camera2/extension/IAdvancedExtenderImpl.aidl b/core/java/android/hardware/camera2/extension/IAdvancedExtenderImpl.aidl
index f279c59..935a542 100644
--- a/core/java/android/hardware/camera2/extension/IAdvancedExtenderImpl.aidl
+++ b/core/java/android/hardware/camera2/extension/IAdvancedExtenderImpl.aidl
@@ -19,6 +19,7 @@
import android.hardware.camera2.extension.LatencyRange;
import android.hardware.camera2.extension.Size;
import android.hardware.camera2.extension.SizeList;
+import android.hardware.camera2.impl.CameraMetadataNative;
/** @hide */
interface IAdvancedExtenderImpl
@@ -30,4 +31,6 @@
@nullable List<SizeList> getSupportedPreviewOutputResolutions(in String cameraId);
@nullable List<SizeList> getSupportedCaptureOutputResolutions(in String cameraId);
ISessionProcessorImpl getSessionProcessor();
+ CameraMetadataNative getAvailableCaptureRequestKeys(in String cameraId);
+ CameraMetadataNative getAvailableCaptureResultKeys(in String cameraId);
}
diff --git a/core/java/android/hardware/camera2/extension/ICaptureCallback.aidl b/core/java/android/hardware/camera2/extension/ICaptureCallback.aidl
index 6ab0ad2..f3062ad 100644
--- a/core/java/android/hardware/camera2/extension/ICaptureCallback.aidl
+++ b/core/java/android/hardware/camera2/extension/ICaptureCallback.aidl
@@ -16,6 +16,7 @@
package android.hardware.camera2.extension;
import android.hardware.camera2.extension.Request;
+import android.hardware.camera2.impl.CameraMetadataNative;
/** @hide */
interface ICaptureCallback
@@ -25,4 +26,5 @@
void onCaptureFailed(int captureSequenceId);
void onCaptureSequenceCompleted(int captureSequenceId);
void onCaptureSequenceAborted(int captureSequenceId);
+ void onCaptureCompleted(long shutterTimestamp, int requestId, in CameraMetadataNative results);
}
diff --git a/core/java/android/hardware/camera2/extension/ISessionProcessorImpl.aidl b/core/java/android/hardware/camera2/extension/ISessionProcessorImpl.aidl
index 6fdf4df..0eca5a7 100644
--- a/core/java/android/hardware/camera2/extension/ISessionProcessorImpl.aidl
+++ b/core/java/android/hardware/camera2/extension/ISessionProcessorImpl.aidl
@@ -15,6 +15,7 @@
*/
package android.hardware.camera2.extension;
+import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.extension.CameraSessionConfig;
import android.hardware.camera2.extension.ICaptureCallback;
import android.hardware.camera2.extension.IRequestProcessorImpl;
@@ -30,5 +31,7 @@
void onCaptureSessionEnd();
int startRepeating(in ICaptureCallback callback);
void stopRepeating();
- int startCapture(in ICaptureCallback callback, int jpegRotation, int jpegQuality);
+ int startCapture(in ICaptureCallback callback);
+ void setParameters(in CaptureRequest captureRequest);
+ int startTrigger(in CaptureRequest captureRequest, in ICaptureCallback callback);
}
diff --git a/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java
index 3c52d65..5503e28 100644
--- a/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java
@@ -86,6 +86,7 @@
// maps camera extension output ids to camera registered image readers
private final HashMap<Integer, ImageReader> mReaderMap = new HashMap<>();
private final RequestProcessor mRequestProcessor = new RequestProcessor();
+ private final int mSessionId;
private Surface mClientRepeatingRequestSurface;
private Surface mClientCaptureSurface;
@@ -175,7 +176,7 @@
CameraAdvancedExtensionSessionImpl ret = new CameraAdvancedExtensionSessionImpl(clientId,
extender, cameraDevice, repeatingRequestSurface, burstCaptureSurface,
- config.getStateCallback(), config.getExecutor());
+ config.getStateCallback(), config.getExecutor(), sessionId);
ret.initialize();
return ret;
@@ -184,7 +185,8 @@
private CameraAdvancedExtensionSessionImpl(long extensionClientId,
@NonNull IAdvancedExtenderImpl extender, @NonNull CameraDevice cameraDevice,
@Nullable Surface repeatingRequestSurface, @Nullable Surface burstCaptureSurface,
- @NonNull CameraExtensionSession.StateCallback callback, @NonNull Executor executor) {
+ @NonNull CameraExtensionSession.StateCallback callback, @NonNull Executor executor,
+ int sessionId) {
mExtensionClientId = extensionClientId;
mAdvancedExtender = extender;
mCameraDevice = cameraDevice;
@@ -197,6 +199,7 @@
mHandler = new Handler(mHandlerThread.getLooper());
mInitialized = false;
mInitializeHandler = new InitializeSessionHandler();
+ mSessionId = sessionId;
}
/**
@@ -367,6 +370,8 @@
}
try {
+ mSessionProcessor.setParameters(request);
+
seqId = mSessionProcessor.startRepeating(new RequestCallbackHandler(request,
executor, listener));
} catch (RemoteException e) {
@@ -388,35 +393,33 @@
throw new IllegalStateException("Uninitialized component");
}
- if (mClientCaptureSurface == null) {
- throw new IllegalArgumentException("No output surface registered for single"
- + " requests!");
+ if (request.getTargets().size() != 1) {
+ throw new IllegalArgumentException("Single capture to both preview & still" +
+ " capture outputs target is not supported!");
}
- if (!request.containsTarget(mClientCaptureSurface) ||
- (request.getTargets().size() != 1)) {
+ if ((mClientCaptureSurface != null) && request.containsTarget(mClientCaptureSurface)) {
+ try {
+ mSessionProcessor.setParameters(request);
+
+ seqId = mSessionProcessor.startCapture(new RequestCallbackHandler(request,
+ executor, listener));
+ } catch (RemoteException e) {
+ throw new CameraAccessException(CameraAccessException.CAMERA_ERROR, "Failed " +
+ " to submit capture request, extension service failed to respond!");
+ }
+ } else if ((mClientRepeatingRequestSurface != null) &&
+ request.containsTarget(mClientRepeatingRequestSurface)) {
+ try {
+ seqId = mSessionProcessor.startTrigger(request,
+ new RequestCallbackHandler(request, executor, listener));
+ } catch (RemoteException e) {
+ throw new CameraAccessException(CameraAccessException.CAMERA_ERROR, "Failed " +
+ " to submit trigger request, extension service failed to respond!");
+ }
+ } else {
throw new IllegalArgumentException("Invalid single capture output target!");
}
-
- try {
- // This will override the extension capture stage jpeg parameters with the user set
- // jpeg quality and rotation. This will guarantee that client configured jpeg
- // parameters always have highest priority.
- Integer jpegRotation = request.get(CaptureRequest.JPEG_ORIENTATION);
- if (jpegRotation == null) {
- jpegRotation = CameraExtensionUtils.JPEG_DEFAULT_ROTATION;
- }
- Byte jpegQuality = request.get(CaptureRequest.JPEG_QUALITY);
- if (jpegQuality == null) {
- jpegQuality = CameraExtensionUtils.JPEG_DEFAULT_QUALITY;
- }
-
- seqId = mSessionProcessor.startCapture(new RequestCallbackHandler(request,
- executor, listener), jpegRotation, jpegQuality);
- } catch (RemoteException e) {
- throw new CameraAccessException(CameraAccessException.CAMERA_ERROR,
- "Failed to submit capture request, extension service failed to respond!");
- }
}
return seqId;
@@ -661,6 +664,28 @@
Binder.restoreCallingIdentity(ident);
}
}
+
+ @Override
+ public void onCaptureCompleted(long timestamp, int requestId, CameraMetadataNative result) {
+ if (result == null) {
+ Log.e(TAG,"Invalid capture result!");
+ return;
+ }
+
+ result.set(CaptureResult.SENSOR_TIMESTAMP, timestamp);
+ TotalCaptureResult totalResult = new TotalCaptureResult(mCameraDevice.getId(), result,
+ mClientRequest, requestId, timestamp, new ArrayList<>(), mSessionId,
+ new PhysicalCaptureResultInfo[0]);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ mExecutor.execute(
+ () -> mClientCallbacks.onCaptureResultAvailable(
+ CameraAdvancedExtensionSessionImpl.this, mClientRequest,
+ totalResult));
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ }
}
private final class CaptureCallbackHandler extends CameraCaptureSession.CaptureCallback {
diff --git a/core/java/android/hardware/camera2/impl/CameraExtensionJpegProcessor.java b/core/java/android/hardware/camera2/impl/CameraExtensionJpegProcessor.java
index 1514a2b..aee20db 100644
--- a/core/java/android/hardware/camera2/impl/CameraExtensionJpegProcessor.java
+++ b/core/java/android/hardware/camera2/impl/CameraExtensionJpegProcessor.java
@@ -303,6 +303,7 @@
jpegBuffer, jpegCapacity, jpegParams.mQuality,
0, 0, yuvImage.getWidth(), yuvImage.getHeight(),
jpegParams.mRotation);
+ jpegImage.setTimestamp(yuvImage.getTimestamp());
yuvImage.close();
try {
diff --git a/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java
index 916d16d..1263da6 100644
--- a/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java
@@ -475,8 +475,8 @@
mInternalRepeatingRequestEnabled = false;
try {
return setRepeatingRequest(mPreviewExtender.getCaptureStage(),
- new RepeatingRequestHandler(request, executor, listener,
- mRepeatingRequestImageCallback));
+ new PreviewRequestHandler(request, executor, listener,
+ mRepeatingRequestImageCallback), request);
} catch (RemoteException e) {
Log.e(TAG, "Failed to set repeating request! Extension service does not "
+ "respond");
@@ -530,7 +530,9 @@
CaptureRequest request = requestBuilder.build();
CameraMetadataNative.update(request.getNativeMetadata(), captureStage.parameters);
ret.add(request);
- captureMap.put(request, captureStage.id);
+ if (captureMap != null) {
+ captureMap.put(request, captureStage.id);
+ }
}
return ret;
@@ -583,33 +585,57 @@
throw new IllegalStateException("Uninitialized component");
}
- if (mClientCaptureSurface == null) {
- throw new IllegalArgumentException("No output surface registered for single requests!");
+ if (request.getTargets().size() != 1) {
+ throw new IllegalArgumentException("Single capture to both preview & still capture " +
+ "outputs target is not supported!");
}
- if (!request.containsTarget(mClientCaptureSurface) || (request.getTargets().size() != 1)) {
- throw new IllegalArgumentException("Invalid single capture output target!");
+ int seqId = -1;
+ if ((mClientCaptureSurface != null) && request.containsTarget(mClientCaptureSurface)) {
+ HashMap<CaptureRequest, Integer> requestMap = new HashMap<>();
+ List<CaptureRequest> burstRequest;
+ try {
+ burstRequest = createBurstRequest(mCameraDevice,
+ mImageExtender.getCaptureStages(), request, mCameraBurstSurface,
+ CameraDevice.TEMPLATE_STILL_CAPTURE, requestMap);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to initialize internal burst request! Extension service does"
+ + " not respond!");
+ throw new CameraAccessException(CameraAccessException.CAMERA_ERROR);
+ }
+ if (burstRequest == null) {
+ throw new UnsupportedOperationException(
+ "Failed to create still capture burst request");
+ }
+
+ seqId = mCaptureSession.captureBurstRequests(burstRequest,
+ new CameraExtensionUtils.HandlerExecutor(mHandler),
+ new BurstRequestHandler(request, executor, listener, requestMap,
+ mBurstCaptureImageCallback));
+ } else if ((mClientRepeatingRequestSurface != null) &&
+ request.containsTarget(mClientRepeatingRequestSurface)) {
+
+ CaptureRequest captureRequest = null;
+ try {
+ ArrayList<CaptureStageImpl> captureStageList = new ArrayList<>();
+ captureStageList.add(mPreviewExtender.getCaptureStage());
+
+ captureRequest = createRequest(mCameraDevice, captureStageList,
+ mCameraRepeatingSurface, CameraDevice.TEMPLATE_PREVIEW, request);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to initialize capture request! Extension service does"
+ + " not respond!");
+ throw new CameraAccessException(CameraAccessException.CAMERA_ERROR);
+ }
+
+ seqId = mCaptureSession.capture(captureRequest, new PreviewRequestHandler(request,
+ executor, listener, mRepeatingRequestImageCallback, true /*singleCapture*/),
+ mHandler);
+ } else {
+ throw new IllegalArgumentException("Capture request to unknown output surface!");
}
- HashMap<CaptureRequest, Integer> requestMap = new HashMap<>();
- List<CaptureRequest> burstRequest;
- try {
- burstRequest = createBurstRequest(mCameraDevice,
- mImageExtender.getCaptureStages(), request, mCameraBurstSurface,
- CameraDevice.TEMPLATE_STILL_CAPTURE, requestMap);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to initialize internal burst request! Extension service does"
- + " not respond!");
- throw new CameraAccessException(CameraAccessException.CAMERA_ERROR);
- }
- if (burstRequest == null) {
- throw new UnsupportedOperationException("Failed to create still capture burst request");
- }
-
- return mCaptureSession.captureBurstRequests(burstRequest,
- new CameraExtensionUtils.HandlerExecutor(mHandler),
- new BurstRequestHandler(request, executor, listener, requestMap,
- mBurstCaptureImageCallback));
+ return seqId;
}
@Override
@@ -847,7 +873,7 @@
} else {
try {
setRepeatingRequest(mPreviewExtender.getCaptureStage(),
- new RepeatingRequestHandler(null, null, null,
+ new PreviewRequestHandler(null, null, null,
mRepeatingRequestImageCallback));
} catch (CameraAccessException | RemoteException e) {
Log.e(TAG,
@@ -1010,7 +1036,7 @@
if (timestamp != null) {
if (mCaptureResultsSupported && (mCaptureResultHandler == null)) {
mCaptureResultHandler = new CaptureResultHandler(mClientRequest, mExecutor,
- mCallbacks, result.getSessionId());
+ mCallbacks, result.getSequenceId());
}
if (mImageProcessor != null) {
if (mCapturePendingMap.indexOfKey(timestamp) >= 0) {
@@ -1179,7 +1205,7 @@
*/
try {
setRepeatingRequest(mPreviewExtender.getCaptureStage(),
- new RepeatingRequestHandler(null, null, null,
+ new PreviewRequestHandler(null, null, null,
mImageCallback));
} catch (CameraAccessException | RemoteException e) {
Log.e(TAG, "Failed to start the internal repeating request!");
@@ -1320,17 +1346,20 @@
}
}
- // This handler can operate in two modes:
+ // This handler can operate in three modes:
// 1) Using valid client callbacks, which means camera buffers will be propagated the
// registered output surfaces and clients will be notified accordingly.
// 2) Without any client callbacks where an internal repeating request is kept active
// to satisfy the extensions continuous preview/(repeating request) requirement.
- private class RepeatingRequestHandler extends CameraCaptureSession.CaptureCallback {
+ // 3) Single capture mode, where internal repeating requests are ignored and the preview
+ // logic is only triggered for the image processor case.
+ private class PreviewRequestHandler extends CameraCaptureSession.CaptureCallback {
private final Executor mExecutor;
private final ExtensionCaptureCallback mCallbacks;
private final CaptureRequest mClientRequest;
private final boolean mClientNotificationsEnabled;
private final CameraOutputImageCallback mRepeatingImageCallback;
+ private final boolean mSingleCapture;
private OnImageAvailableListener mImageCallback = null;
private LongSparseArray<Pair<Image, TotalCaptureResult>> mPendingResultMap =
new LongSparseArray<>();
@@ -1338,15 +1367,22 @@
private boolean mRequestUpdatedNeeded = false;
- public RepeatingRequestHandler(@Nullable CaptureRequest clientRequest,
+ public PreviewRequestHandler(@Nullable CaptureRequest clientRequest,
@Nullable Executor executor, @Nullable ExtensionCaptureCallback listener,
@NonNull CameraOutputImageCallback imageCallback) {
+ this(clientRequest, executor, listener, imageCallback, false /*singleCapture*/);
+ }
+
+ public PreviewRequestHandler(@Nullable CaptureRequest clientRequest,
+ @Nullable Executor executor, @Nullable ExtensionCaptureCallback listener,
+ @NonNull CameraOutputImageCallback imageCallback, boolean singleCapture) {
mClientRequest = clientRequest;
mExecutor = executor;
mCallbacks = listener;
mClientNotificationsEnabled =
(mClientRequest != null) && (mExecutor != null) && (mCallbacks != null);
mRepeatingImageCallback = imageCallback;
+ mSingleCapture = singleCapture;
}
@Override
@@ -1393,7 +1429,7 @@
public void onCaptureSequenceAborted(@NonNull CameraCaptureSession session,
int sequenceId) {
synchronized (mInterfaceLock) {
- if (mInternalRepeatingRequestEnabled) {
+ if (mInternalRepeatingRequestEnabled && !mSingleCapture) {
resumeInternalRepeatingRequest(true);
}
}
@@ -1420,10 +1456,10 @@
long frameNumber) {
synchronized (mInterfaceLock) {
- if (mRequestUpdatedNeeded) {
+ if (mRequestUpdatedNeeded && !mSingleCapture) {
mRequestUpdatedNeeded = false;
resumeInternalRepeatingRequest(false);
- } else if (mInternalRepeatingRequestEnabled) {
+ } else if (mInternalRepeatingRequestEnabled && !mSingleCapture) {
resumeInternalRepeatingRequest(true);
}
}
@@ -1471,10 +1507,10 @@
if (mCaptureResultsSupported && mClientNotificationsEnabled &&
(mCaptureResultHandler == null)) {
mCaptureResultHandler = new CaptureResultHandler(mClientRequest, mExecutor,
- mCallbacks, result.getSessionId());
+ mCallbacks, result.getSequenceId());
}
- if (mPreviewProcessorType ==
- IPreviewExtenderImpl.PROCESSOR_TYPE_REQUEST_UPDATE_ONLY) {
+ if ((!mSingleCapture) && (mPreviewProcessorType ==
+ IPreviewExtenderImpl.PROCESSOR_TYPE_REQUEST_UPDATE_ONLY)) {
CaptureStageImpl captureStage = null;
try {
captureStage = mPreviewRequestUpdateProcessor.process(
@@ -1582,10 +1618,10 @@
try {
if (internal) {
setRepeatingRequest(mPreviewExtender.getCaptureStage(),
- new RepeatingRequestHandler(null, null, null,
+ new PreviewRequestHandler(null, null, null,
mRepeatingImageCallback));
} else {
- setRepeatingRequest(mPreviewExtender.getCaptureStage(), this);
+ setRepeatingRequest(mPreviewExtender.getCaptureStage(), this, mClientRequest);
}
} catch (RemoteException e) {
Log.e(TAG, "Failed to resume internal repeating request, extension service"
@@ -1733,7 +1769,7 @@
}
private static Size findSmallestAspectMatchedSize(@NonNull List<Size> sizes,
- @NonNull Size arSize) {
+ @NonNull Size arSize) {
final float TOLL = .01f;
if (arSize.getHeight() == 0) {
diff --git a/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java b/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java
index 75356d1..9a7ccc6 100644
--- a/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java
+++ b/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java
@@ -41,9 +41,7 @@
import com.android.internal.view.IInputContext;
import com.android.internal.view.IInputMethodSession;
-/** @hide */
-// TODO(b/215636776): move IInputMethodSessionWrapper to proper package
-public class IInputMethodSessionWrapper extends IInputMethodSession.Stub
+class IInputMethodSessionWrapper extends IInputMethodSession.Stub
implements HandlerCaller.Callback {
private static final String TAG = "InputMethodWrapper";
@@ -55,7 +53,6 @@
private static final int DO_APP_PRIVATE_COMMAND = 100;
private static final int DO_FINISH_SESSION = 110;
private static final int DO_VIEW_CLICKED = 115;
- private static final int DO_NOTIFY_IME_HIDDEN = 120;
private static final int DO_REMOVE_IME_SURFACE = 130;
private static final int DO_FINISH_INPUT = 140;
private static final int DO_INVALIDATE_INPUT = 150;
@@ -135,10 +132,6 @@
mInputMethodSession.viewClicked(msg.arg1 == 1);
return;
}
- case DO_NOTIFY_IME_HIDDEN: {
- mInputMethodSession.notifyImeHidden();
- return;
- }
case DO_REMOVE_IME_SURFACE: {
mInputMethodSession.removeImeSurface();
return;
@@ -200,11 +193,6 @@
}
@Override
- public void notifyImeHidden() {
- mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_NOTIFY_IME_HIDDEN));
- }
-
- @Override
public void removeImeSurface() {
mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_REMOVE_IME_SURFACE));
}
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 4fdd534..a6ed423 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1058,10 +1058,6 @@
return viewRoot == null ? null : viewRoot.getInputToken();
}
- private void notifyImeHidden() {
- requestHideSelf(0);
- }
-
private void scheduleImeSurfaceRemoval() {
if (mShowInputRequested || mWindowVisible || mWindow == null
|| mImeSurfaceScheduledForRemoval) {
@@ -1225,14 +1221,6 @@
}
/**
- * Notify IME that window is hidden.
- * @hide
- */
- public final void notifyImeHidden() {
- InputMethodService.this.notifyImeHidden();
- }
-
- /**
* Notify IME that surface can be now removed.
* @hide
*/
diff --git a/core/java/android/inputmethodservice/InputMethodServiceInternal.java b/core/java/android/inputmethodservice/InputMethodServiceInternal.java
index 09dbb2735..f44f49d 100644
--- a/core/java/android/inputmethodservice/InputMethodServiceInternal.java
+++ b/core/java/android/inputmethodservice/InputMethodServiceInternal.java
@@ -32,11 +32,8 @@
* framework classes for internal use.
*
* <p>CAVEATS: {@link AbstractInputMethodService} does not support all the methods here.</p>
- *
- * @hide
*/
-// TODO(b/215636776): move InputMethodServiceInternal to proper package
-public interface InputMethodServiceInternal {
+interface InputMethodServiceInternal {
/**
* @return {@link Context} associated with the service.
*/
diff --git a/core/java/android/inputmethodservice/RemoteInputConnection.java b/core/java/android/inputmethodservice/RemoteInputConnection.java
index 5b0129e..86e59e9 100644
--- a/core/java/android/inputmethodservice/RemoteInputConnection.java
+++ b/core/java/android/inputmethodservice/RemoteInputConnection.java
@@ -53,11 +53,8 @@
*
* <p>See also {@link IInputContext} for the actual {@link android.os.Binder} IPC protocols under
* the hood.</p>
- *
- * @hide
*/
-// TODO(b/215636776): move RemoteInputConnection to proper package
-public final class RemoteInputConnection implements InputConnection {
+final class RemoteInputConnection implements InputConnection {
private static final String TAG = "RemoteInputConnection";
private static final int MAX_WAIT_TIME_MILLIS = 2000;
@@ -98,7 +95,7 @@
@NonNull
private final CancellationGroup mCancellationGroup;
- public RemoteInputConnection(
+ RemoteInputConnection(
@NonNull WeakReference<InputMethodServiceInternal> inputMethodService,
IInputContext inputContext, @NonNull CancellationGroup cancellationGroup) {
mImsInternal = new InputMethodServiceInternalHolder(inputMethodService);
@@ -111,7 +108,7 @@
return mInvoker.isSameConnection(inputContext);
}
- public RemoteInputConnection(@NonNull RemoteInputConnection original, int sessionId) {
+ RemoteInputConnection(@NonNull RemoteInputConnection original, int sessionId) {
mImsInternal = original.mImsInternal;
mInvoker = original.mInvoker.cloneWithSessionId(sessionId);
mCancellationGroup = original.mCancellationGroup;
diff --git a/core/java/android/net/NetworkPolicy.java b/core/java/android/net/NetworkPolicy.java
index 714227d..570211e 100644
--- a/core/java/android/net/NetworkPolicy.java
+++ b/core/java/android/net/NetworkPolicy.java
@@ -396,7 +396,8 @@
return true;
case MATCH_CARRIER:
case MATCH_MOBILE:
- return !template.getSubscriberIds().isEmpty();
+ return !template.getSubscriberIds().isEmpty()
+ && template.getMeteredness() == METERED_YES;
case MATCH_WIFI:
if (template.getWifiNetworkKeys().isEmpty()
&& template.getSubscriberIds().isEmpty()) {
diff --git a/core/java/android/net/vcn/VcnManager.java b/core/java/android/net/vcn/VcnManager.java
index f1b110a..40e4083 100644
--- a/core/java/android/net/vcn/VcnManager.java
+++ b/core/java/android/net/vcn/VcnManager.java
@@ -104,6 +104,14 @@
// TODO: Add separate signal strength thresholds for 2.4 GHz and 5GHz
+ /** List of Carrier Config options to extract from Carrier Config bundles. @hide */
+ @NonNull
+ public static final String[] VCN_RELATED_CARRIER_CONFIG_KEYS =
+ new String[] {
+ VCN_NETWORK_SELECTION_WIFI_ENTRY_RSSI_THRESHOLD_KEY,
+ VCN_NETWORK_SELECTION_WIFI_EXIT_RSSI_THRESHOLD_KEY
+ };
+
private static final Map<
VcnNetworkPolicyChangeListener, VcnUnderlyingNetworkPolicyListenerBinder>
REGISTERED_POLICY_LISTENERS = new ConcurrentHashMap<>();
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index c6cf097..cb7e6f7 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -94,6 +94,8 @@
private static final int VULKAN_1_0 = 0x00400000;
private static final int VULKAN_1_1 = 0x00401000;
+ private static final int VULKAN_1_2 = 0x00402000;
+ private static final int VULKAN_1_3 = 0x00403000;
// Values for UPDATABLE_DRIVER_ALL_APPS
// 0: Default (Invalid values fallback to default as well)
@@ -213,6 +215,14 @@
private int getVulkanVersion(PackageManager pm) {
// PackageManager doesn't have an API to retrieve the version of a specific feature, and we
// need to avoid retrieving all system features here and looping through them.
+ if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_3)) {
+ return VULKAN_1_3;
+ }
+
+ if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_2)) {
+ return VULKAN_1_2;
+ }
+
if (pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_1)) {
return VULKAN_1_1;
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 9d166b99..34647b1 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -7086,7 +7086,7 @@
*
* @hide
*/
- @Readable
+ @Readable(maxTargetSdk = Build.VERSION_CODES.S)
public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST =
"always_on_vpn_lockdown_whitelist";
diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index 296877a..78f91ed 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -26,6 +26,7 @@
import android.annotation.SuppressLint;
import android.annotation.TestApi;
import android.app.Activity;
+import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.ParceledListSlice;
import android.os.Bundle;
@@ -306,6 +307,13 @@
* with the fully populated {@link FillResponse response} (or {@code null} if the screen
* cannot be autofilled).
*
+ * <p> <b>IMPORTANT</b>: Extras must be non-null on the intent being set for Android 12
+ * otherwise it will cause a crash. Do not use {@link Activity#setResult(int)}, instead use
+ * {@link Activity#setResult(int, Intent) with non-null extras. Consider setting {
+ * @link android.view.autofill.AutofillManager#EXTRA_AUTHENTICATION_RESULT} to null or use
+ * {@link Bundle#EMPTY} with {@link Intent#putExtras(Bundle)} on the intent when
+ * finishing activity to avoid crash). </p>
+ *
* <p>For example, if you provided an empty {@link FillResponse response} because the
* user's data was locked and marked that the response needs an authentication then
* in the response returned if authentication succeeds you need to provide all
diff --git a/core/java/android/service/dreams/DreamOverlayService.java b/core/java/android/service/dreams/DreamOverlayService.java
index bfc3b8b..163d6ed 100644
--- a/core/java/android/service/dreams/DreamOverlayService.java
+++ b/core/java/android/service/dreams/DreamOverlayService.java
@@ -36,9 +36,6 @@
private static final String TAG = "DreamOverlayService";
private static final boolean DEBUG = false;
private boolean mShowComplications;
- private boolean mIsPreviewMode;
- @Nullable
- private CharSequence mDreamLabel;
private IDreamOverlay mDreamOverlay = new IDreamOverlay.Stub() {
@Override
@@ -59,8 +56,6 @@
public final IBinder onBind(@NonNull Intent intent) {
mShowComplications = intent.getBooleanExtra(DreamService.EXTRA_SHOW_COMPLICATIONS,
DreamService.DEFAULT_SHOW_COMPLICATIONS);
- mIsPreviewMode = intent.getBooleanExtra(DreamService.EXTRA_IS_PREVIEW, false);
- mDreamLabel = intent.getCharSequenceExtra(DreamService.EXTRA_DREAM_LABEL);
return mDreamOverlay.asBinder();
}
@@ -89,19 +84,4 @@
public final boolean shouldShowComplications() {
return mShowComplications;
}
-
- /**
- * Returns whether the dream is running in preview mode.
- */
- public final boolean isPreviewMode() {
- return mIsPreviewMode;
- }
-
- /**
- * Returns the user-facing label of the currently running dream.
- */
- @Nullable
- public final CharSequence getDreamLabel() {
- return mDreamLabel;
- }
}
diff --git a/core/java/android/service/dreams/DreamService.java b/core/java/android/service/dreams/DreamService.java
index 95eae6c..6a9afdb 100644
--- a/core/java/android/service/dreams/DreamService.java
+++ b/core/java/android/service/dreams/DreamService.java
@@ -216,18 +216,6 @@
"android.service.dreams.SHOW_COMPLICATIONS";
/**
- * Extra containing a boolean for whether we are showing this dream in preview mode.
- * @hide
- */
- public static final String EXTRA_IS_PREVIEW = "android.service.dreams.IS_PREVIEW";
-
- /**
- * The user-facing label of the current dream service.
- * @hide
- */
- public static final String EXTRA_DREAM_LABEL = "android.service.dreams.DREAM_LABEL";
-
- /**
* The default value for whether to show complications on the overlay.
* @hide
*/
@@ -270,7 +258,7 @@
}
public void bind(Context context, @Nullable ComponentName overlayService,
- ComponentName dreamService, boolean isPreviewMode) {
+ ComponentName dreamService) {
if (overlayService == null) {
return;
}
@@ -281,8 +269,6 @@
overlayIntent.setComponent(overlayService);
overlayIntent.putExtra(EXTRA_SHOW_COMPLICATIONS,
fetchShouldShowComplications(context, serviceInfo));
- overlayIntent.putExtra(EXTRA_DREAM_LABEL, fetchDreamLabel(context, serviceInfo));
- overlayIntent.putExtra(EXTRA_IS_PREVIEW, isPreviewMode);
context.bindService(overlayIntent,
this, Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE);
@@ -1007,8 +993,7 @@
mOverlayConnection.bind(
/* context= */ this,
intent.getParcelableExtra(EXTRA_DREAM_OVERLAY_COMPONENT),
- new ComponentName(this, getClass()),
- intent.getBooleanExtra(EXTRA_IS_PREVIEW, /* defaultValue= */ false));
+ new ComponentName(this, getClass()));
}
return mDreamServiceWrapper;
diff --git a/core/java/android/util/DisplayUtils.java b/core/java/android/util/DisplayUtils.java
index 4fe7f83..9b76fc2 100644
--- a/core/java/android/util/DisplayUtils.java
+++ b/core/java/android/util/DisplayUtils.java
@@ -21,7 +21,7 @@
import com.android.internal.R;
/**
- * Utils for loading resources for multi-display.
+ * Utils for loading display related resources and calculations.
*
* @hide
*/
@@ -51,4 +51,17 @@
}
return index;
}
+
+ /**
+ * Get the display size ratio based on the stable display size.
+ */
+ public static float getPhysicalPixelDisplaySizeRatio(
+ int stableWidth, int stableHeight, int currentWidth, int currentHeight) {
+ if (stableWidth == currentWidth && stableHeight == currentHeight) {
+ return 1f;
+ }
+ final float widthRatio = (float) currentWidth / stableWidth;
+ final float heightRatio = (float) currentHeight / stableHeight;
+ return Math.min(widthRatio, heightRatio);
+ }
}
diff --git a/core/java/android/util/RotationUtils.java b/core/java/android/util/RotationUtils.java
index cebdbf6..c54d9b6 100644
--- a/core/java/android/util/RotationUtils.java
+++ b/core/java/android/util/RotationUtils.java
@@ -88,6 +88,40 @@
}
/**
+ * Rotates inOutBounds together with the parent for a given rotation delta. This assumes that
+ * the parent starts at 0,0 and remains at 0,0 after the rotation. The inOutBounds will remain
+ * at the same physical position within the parent.
+ *
+ * Only 'inOutBounds' is mutated.
+ */
+ public static void rotateBounds(Rect inOutBounds, int parentWidth, int parentHeight,
+ @Rotation int rotation) {
+ final int origLeft = inOutBounds.left;
+ final int origTop = inOutBounds.top;
+ switch (rotation) {
+ case ROTATION_0:
+ return;
+ case ROTATION_90:
+ inOutBounds.left = inOutBounds.top;
+ inOutBounds.top = parentWidth - inOutBounds.right;
+ inOutBounds.right = inOutBounds.bottom;
+ inOutBounds.bottom = parentWidth - origLeft;
+ return;
+ case ROTATION_180:
+ inOutBounds.left = parentWidth - inOutBounds.right;
+ inOutBounds.right = parentWidth - origLeft;
+ inOutBounds.top = parentHeight - inOutBounds.bottom;
+ inOutBounds.bottom = parentHeight - origTop;
+ return;
+ case ROTATION_270:
+ inOutBounds.left = parentHeight - inOutBounds.bottom;
+ inOutBounds.bottom = inOutBounds.right;
+ inOutBounds.right = parentHeight - inOutBounds.top;
+ inOutBounds.top = origLeft;
+ }
+ }
+
+ /**
* Rotates bounds as if parentBounds and bounds are a group. The group is rotated by `delta`
* 90-degree counter-clockwise increments. This assumes that parentBounds is at 0,0 and
* remains at 0,0 after rotation. The bounds will be at the same physical position in
@@ -96,29 +130,7 @@
* Only 'inOutBounds' is mutated.
*/
public static void rotateBounds(Rect inOutBounds, Rect parentBounds, @Rotation int rotation) {
- final int origLeft = inOutBounds.left;
- final int origTop = inOutBounds.top;
- switch (rotation) {
- case ROTATION_0:
- return;
- case ROTATION_90:
- inOutBounds.left = inOutBounds.top;
- inOutBounds.top = parentBounds.right - inOutBounds.right;
- inOutBounds.right = inOutBounds.bottom;
- inOutBounds.bottom = parentBounds.right - origLeft;
- return;
- case ROTATION_180:
- inOutBounds.left = parentBounds.right - inOutBounds.right;
- inOutBounds.right = parentBounds.right - origLeft;
- inOutBounds.top = parentBounds.bottom - inOutBounds.bottom;
- inOutBounds.bottom = parentBounds.bottom - origTop;
- return;
- case ROTATION_270:
- inOutBounds.left = parentBounds.bottom - inOutBounds.bottom;
- inOutBounds.bottom = inOutBounds.right;
- inOutBounds.right = parentBounds.bottom - inOutBounds.top;
- inOutBounds.top = origLeft;
- }
+ rotateBounds(inOutBounds, parentBounds.right, parentBounds.bottom, rotation);
}
/** @return the rotation needed to rotate from oldRotation to newRotation. */
diff --git a/core/java/android/view/CutoutSpecification.java b/core/java/android/view/CutoutSpecification.java
index 850e9fc..bb6005c 100644
--- a/core/java/android/view/CutoutSpecification.java
+++ b/core/java/android/view/CutoutSpecification.java
@@ -94,7 +94,7 @@
private final Rect mTopBound;
private final Rect mRightBound;
private final Rect mBottomBound;
- private final Insets mInsets;
+ private Insets mInsets;
private CutoutSpecification(@NonNull Parser parser) {
mPath = parser.mPath;
@@ -104,6 +104,8 @@
mBottomBound = parser.mBottomBound;
mInsets = parser.mInsets;
+ applyPhysicalPixelDisplaySizeRatio(parser.mPhysicalPixelDisplaySizeRatio);
+
if (DEBUG) {
Log.d(TAG, String.format(Locale.ENGLISH,
"left cutout = %s, top cutout = %s, right cutout = %s, bottom cutout = %s",
@@ -114,6 +116,38 @@
}
}
+ private void applyPhysicalPixelDisplaySizeRatio(float physicalPixelDisplaySizeRatio) {
+ if (physicalPixelDisplaySizeRatio == 1f) {
+ return;
+ }
+
+ if (mPath != null && !mPath.isEmpty()) {
+ final Matrix matrix = new Matrix();
+ matrix.postScale(physicalPixelDisplaySizeRatio, physicalPixelDisplaySizeRatio);
+ mPath.transform(matrix);
+ }
+
+ scaleBounds(mLeftBound, physicalPixelDisplaySizeRatio);
+ scaleBounds(mTopBound, physicalPixelDisplaySizeRatio);
+ scaleBounds(mRightBound, physicalPixelDisplaySizeRatio);
+ scaleBounds(mBottomBound, physicalPixelDisplaySizeRatio);
+ mInsets = scaleInsets(mInsets, physicalPixelDisplaySizeRatio);
+ }
+
+ private void scaleBounds(Rect r, float ratio) {
+ if (r != null && !r.isEmpty()) {
+ r.scale(ratio);
+ }
+ }
+
+ private Insets scaleInsets(Insets insets, float ratio) {
+ return Insets.of(
+ (int) (insets.left * ratio + 0.5f),
+ (int) (insets.top * ratio + 0.5f),
+ (int) (insets.right * ratio + 0.5f),
+ (int) (insets.bottom * ratio + 0.5f));
+ }
+
@VisibleForTesting(visibility = PACKAGE)
@Nullable
public Path getPath() {
@@ -168,9 +202,10 @@
@VisibleForTesting(visibility = PACKAGE)
public static class Parser {
private final boolean mIsShortEdgeOnTop;
- private final float mDensity;
- private final int mDisplayWidth;
- private final int mDisplayHeight;
+ private final float mStableDensity;
+ private final int mStableDisplayWidth;
+ private final int mStableDisplayHeight;
+ private final float mPhysicalPixelDisplaySizeRatio;
private final Matrix mMatrix;
private Insets mInsets;
private int mSafeInsetLeft;
@@ -202,19 +237,26 @@
private boolean mIsTouchShortEdgeEnd;
private boolean mIsCloserToStartSide;
+ @VisibleForTesting(visibility = PACKAGE)
+ public Parser(float stableDensity, int stableDisplayWidth, int stableDisplayHeight) {
+ this(stableDensity, stableDisplayWidth, stableDisplayHeight, 1f);
+ }
+
/**
* The constructor of the CutoutSpecification parser to parse the specification of cutout.
- * @param density the display density.
- * @param displayWidth the display width.
- * @param displayHeight the display height.
+ * @param stableDensity the display density.
+ * @param stableDisplayWidth the display width.
+ * @param stableDisplayHeight the display height.
+ * @param physicalPixelDisplaySizeRatio the display size ratio based on stable display size.
*/
- @VisibleForTesting(visibility = PACKAGE)
- public Parser(float density, int displayWidth, int displayHeight) {
- mDensity = density;
- mDisplayWidth = displayWidth;
- mDisplayHeight = displayHeight;
+ Parser(float stableDensity, int stableDisplayWidth, int stableDisplayHeight,
+ float physicalPixelDisplaySizeRatio) {
+ mStableDensity = stableDensity;
+ mStableDisplayWidth = stableDisplayWidth;
+ mStableDisplayHeight = stableDisplayHeight;
+ mPhysicalPixelDisplaySizeRatio = physicalPixelDisplaySizeRatio;
mMatrix = new Matrix();
- mIsShortEdgeOnTop = mDisplayWidth < mDisplayHeight;
+ mIsShortEdgeOnTop = mStableDisplayWidth < mStableDisplayHeight;
}
private void computeBoundsRectAndAddToRegion(Path p, Region inoutRegion, Rect inoutRect) {
@@ -239,38 +281,38 @@
private void translateMatrix() {
final float offsetX;
if (mPositionFromRight) {
- offsetX = mDisplayWidth;
+ offsetX = mStableDisplayWidth;
} else if (mPositionFromLeft) {
offsetX = 0;
} else {
- offsetX = mDisplayWidth / 2f;
+ offsetX = mStableDisplayWidth / 2f;
}
final float offsetY;
if (mPositionFromBottom) {
- offsetY = mDisplayHeight;
+ offsetY = mStableDisplayHeight;
} else if (mPositionFromCenterVertical) {
- offsetY = mDisplayHeight / 2f;
+ offsetY = mStableDisplayHeight / 2f;
} else {
offsetY = 0;
}
mMatrix.reset();
if (mInDp) {
- mMatrix.postScale(mDensity, mDensity);
+ mMatrix.postScale(mStableDensity, mStableDensity);
}
mMatrix.postTranslate(offsetX, offsetY);
}
private int computeSafeInsets(int gravity, Rect rect) {
- if (gravity == LEFT && rect.right > 0 && rect.right < mDisplayWidth) {
+ if (gravity == LEFT && rect.right > 0 && rect.right < mStableDisplayWidth) {
return rect.right;
- } else if (gravity == TOP && rect.bottom > 0 && rect.bottom < mDisplayHeight) {
+ } else if (gravity == TOP && rect.bottom > 0 && rect.bottom < mStableDisplayHeight) {
return rect.bottom;
- } else if (gravity == RIGHT && rect.left > 0 && rect.left < mDisplayWidth) {
- return mDisplayWidth - rect.left;
- } else if (gravity == BOTTOM && rect.top > 0 && rect.top < mDisplayHeight) {
- return mDisplayHeight - rect.top;
+ } else if (gravity == RIGHT && rect.left > 0 && rect.left < mStableDisplayWidth) {
+ return mStableDisplayWidth - rect.left;
+ } else if (gravity == BOTTOM && rect.top > 0 && rect.top < mStableDisplayHeight) {
+ return mStableDisplayHeight - rect.top;
}
return 0;
}
@@ -373,12 +415,12 @@
if (mIsShortEdgeOnTop) {
mIsTouchShortEdgeStart = mTmpRect.top <= 0;
- mIsTouchShortEdgeEnd = mTmpRect.bottom >= mDisplayHeight;
- mIsCloserToStartSide = mTmpRect.centerY() < mDisplayHeight / 2;
+ mIsTouchShortEdgeEnd = mTmpRect.bottom >= mStableDisplayHeight;
+ mIsCloserToStartSide = mTmpRect.centerY() < mStableDisplayHeight / 2;
} else {
mIsTouchShortEdgeStart = mTmpRect.left <= 0;
- mIsTouchShortEdgeEnd = mTmpRect.right >= mDisplayWidth;
- mIsCloserToStartSide = mTmpRect.centerX() < mDisplayWidth / 2;
+ mIsTouchShortEdgeEnd = mTmpRect.right >= mStableDisplayWidth;
+ mIsCloserToStartSide = mTmpRect.centerX() < mStableDisplayWidth / 2;
}
setEdgeCutout(newPath);
@@ -476,7 +518,6 @@
}
parseSpecWithoutDp(spec);
-
mInsets = Insets.of(mSafeInsetLeft, mSafeInsetTop, mSafeInsetRight, mSafeInsetBottom);
return new CutoutSpecification(this);
}
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index 0c4d9bf..f8a848e 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -26,11 +26,9 @@
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.annotation.TestApi;
-import android.app.ActivityThread;
import android.app.KeyguardManager;
import android.app.WindowConfiguration;
import android.compat.annotation.UnsupportedAppUsage;
-import android.content.ComponentName;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -52,14 +50,11 @@
import android.util.DisplayMetrics;
import android.util.Log;
-import com.android.internal.R;
-
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.Optional;
/**
* Provides information about the size and density of a logical display.
@@ -116,12 +111,6 @@
private int mCachedAppHeightCompat;
/**
- * Cache if the application is the recents component.
- * TODO(b/179308296) Remove once Launcher addresses issue
- */
- private Optional<Boolean> mIsRecentsComponent = Optional.empty();
-
- /**
* The default Display id, which is the id of the primary display assuming there is one.
*/
public static final int DEFAULT_DISPLAY = 0;
@@ -1584,36 +1573,7 @@
return false;
}
final Configuration config = mResources.getConfiguration();
- // TODO(b/179308296) Temporarily exclude Launcher from being given max bounds, by checking
- // if the caller is the recents component.
- return config != null && !config.windowConfiguration.getMaxBounds().isEmpty()
- && !isRecentsComponent();
- }
-
- /**
- * Returns {@code true} when the calling package is the recents component.
- * TODO(b/179308296) Remove once Launcher addresses issue
- */
- boolean isRecentsComponent() {
- if (mIsRecentsComponent.isPresent()) {
- return mIsRecentsComponent.get();
- }
- if (mResources == null) {
- return false;
- }
- try {
- String recentsComponent = mResources.getString(R.string.config_recentsComponentName);
- if (recentsComponent == null) {
- return false;
- }
- String recentsPackage = ComponentName.unflattenFromString(recentsComponent)
- .getPackageName();
- mIsRecentsComponent = Optional.of(recentsPackage != null
- && recentsPackage.equals(ActivityThread.currentPackageName()));
- return mIsRecentsComponent.get();
- } catch (Resources.NotFoundException e) {
- return false;
- }
+ return config != null && !config.windowConfiguration.getMaxBounds().isEmpty();
}
/**
diff --git a/core/java/android/view/DisplayCutout.java b/core/java/android/view/DisplayCutout.java
index b3b7f10..ece8460 100644
--- a/core/java/android/view/DisplayCutout.java
+++ b/core/java/android/view/DisplayCutout.java
@@ -77,8 +77,10 @@
private static final Rect ZERO_RECT = new Rect();
private static final CutoutPathParserInfo EMPTY_PARSER_INFO = new CutoutPathParserInfo(
- 0 /* displayWidth */, 0 /* displayHeight */, 0f /* density */, "" /* cutoutSpec */,
- 0 /* rotation */, 0f /* scale */);
+ 0 /* displayWidth */, 0 /* stableDisplayHeight */,
+ 0 /* stableDisplayHeight */, 0 /* displayHeight */, 0f /* density */,
+ "" /* cutoutSpec */, 0 /* ROTATION_0 */, 0f /* scale */,
+ 0f /* physicalPixelDisplaySizeRatio*/);
/**
* An instance where {@link #isEmpty()} returns {@code true}.
@@ -105,6 +107,8 @@
private static Pair<Path, DisplayCutout> sCachedCutout = NULL_PAIR;
@GuardedBy("CACHE_LOCK")
private static Insets sCachedWaterfallInsets;
+ @GuardedBy("CACHE_LOCK")
+ private static float sCachedPhysicalPixelDisplaySizeRatio;
@GuardedBy("CACHE_LOCK")
private static CutoutPathParserInfo sCachedCutoutPathParserInfo;
@@ -254,28 +258,38 @@
public static class CutoutPathParserInfo {
private final int mDisplayWidth;
private final int mDisplayHeight;
+ private final int mStableDisplayWidth;
+ private final int mStableDisplayHeight;
private final float mDensity;
private final String mCutoutSpec;
private final @Rotation int mRotation;
private final float mScale;
+ private final float mPhysicalPixelDisplaySizeRatio;
- public CutoutPathParserInfo(int displayWidth, int displayHeight, float density,
- @Nullable String cutoutSpec, @Rotation int rotation, float scale) {
+ public CutoutPathParserInfo(int displayWidth, int displayHeight, int stableDisplayWidth,
+ int stableDisplayHeight, float density, @Nullable String cutoutSpec,
+ @Rotation int rotation, float scale, float physicalPixelDisplaySizeRatio) {
mDisplayWidth = displayWidth;
mDisplayHeight = displayHeight;
+ mStableDisplayWidth = stableDisplayWidth;
+ mStableDisplayHeight = stableDisplayHeight;
mDensity = density;
mCutoutSpec = cutoutSpec == null ? "" : cutoutSpec;
mRotation = rotation;
mScale = scale;
+ mPhysicalPixelDisplaySizeRatio = physicalPixelDisplaySizeRatio;
}
public CutoutPathParserInfo(@NonNull CutoutPathParserInfo cutoutPathParserInfo) {
mDisplayWidth = cutoutPathParserInfo.mDisplayWidth;
mDisplayHeight = cutoutPathParserInfo.mDisplayHeight;
+ mStableDisplayWidth = cutoutPathParserInfo.mStableDisplayWidth;
+ mStableDisplayHeight = cutoutPathParserInfo.mStableDisplayHeight;
mDensity = cutoutPathParserInfo.mDensity;
mCutoutSpec = cutoutPathParserInfo.mCutoutSpec;
mRotation = cutoutPathParserInfo.mRotation;
mScale = cutoutPathParserInfo.mScale;
+ mPhysicalPixelDisplaySizeRatio = cutoutPathParserInfo.mPhysicalPixelDisplaySizeRatio;
}
public int getDisplayWidth() {
@@ -286,6 +300,14 @@
return mDisplayHeight;
}
+ public int getStableDisplayWidth() {
+ return mStableDisplayWidth;
+ }
+
+ public int getStableDisplayHeight() {
+ return mStableDisplayHeight;
+ }
+
public float getDensity() {
return mDensity;
}
@@ -302,6 +324,10 @@
return mScale;
}
+ public float getPhysicalPixelDisplaySizeRatio() {
+ return mPhysicalPixelDisplaySizeRatio;
+ }
+
private boolean hasCutout() {
return !mCutoutSpec.isEmpty();
}
@@ -315,6 +341,9 @@
result = result * 48271 + mCutoutSpec.hashCode();
result = result * 48271 + Integer.hashCode(mRotation);
result = result * 48271 + Float.hashCode(mScale);
+ result = result * 48271 + Float.hashCode(mPhysicalPixelDisplaySizeRatio);
+ result = result * 48271 + Integer.hashCode(mStableDisplayWidth);
+ result = result * 48271 + Integer.hashCode(mStableDisplayHeight);
return result;
}
@@ -326,8 +355,11 @@
if (o instanceof CutoutPathParserInfo) {
CutoutPathParserInfo c = (CutoutPathParserInfo) o;
return mDisplayWidth == c.mDisplayWidth && mDisplayHeight == c.mDisplayHeight
+ && mStableDisplayWidth == c.mStableDisplayWidth
+ && mStableDisplayHeight == c.mStableDisplayHeight
&& mDensity == c.mDensity && mCutoutSpec.equals(c.mCutoutSpec)
- && mRotation == c.mRotation && mScale == c.mScale;
+ && mRotation == c.mRotation && mScale == c.mScale
+ && mPhysicalPixelDisplaySizeRatio == c.mPhysicalPixelDisplaySizeRatio;
}
return false;
}
@@ -336,10 +368,13 @@
public String toString() {
return "CutoutPathParserInfo{displayWidth=" + mDisplayWidth
+ " displayHeight=" + mDisplayHeight
+ + " stableDisplayHeight=" + mStableDisplayWidth
+ + " stableDisplayHeight=" + mStableDisplayHeight
+ " density={" + mDensity + "}"
+ " cutoutSpec={" + mCutoutSpec + "}"
+ " rotation={" + mRotation + "}"
+ " scale={" + mScale + "}"
+ + " physicalPixelDisplaySizeRatio={" + mPhysicalPixelDisplaySizeRatio + "}"
+ "}";
}
}
@@ -715,8 +750,9 @@
}
}
final CutoutSpecification cutoutSpec = new CutoutSpecification.Parser(
- mCutoutPathParserInfo.getDensity(), mCutoutPathParserInfo.getDisplayWidth(),
- mCutoutPathParserInfo.getDisplayHeight())
+ mCutoutPathParserInfo.getDensity(), mCutoutPathParserInfo.getStableDisplayWidth(),
+ mCutoutPathParserInfo.getStableDisplayHeight(),
+ mCutoutPathParserInfo.getPhysicalPixelDisplaySizeRatio())
.parse(mCutoutPathParserInfo.getCutoutSpec());
final Path cutoutPath = cutoutSpec.getPath();
@@ -1014,30 +1050,19 @@
* Creates the display cutout according to
* @android:string/config_mainBuiltInDisplayCutoutRectApproximation, which is the closest
* rectangle-base approximation of the cutout.
- *
* @hide
*/
public static DisplayCutout fromResourcesRectApproximation(Resources res,
- String displayUniqueId, int displayWidth, int displayHeight) {
+ String displayUniqueId, int stableDisplayWidth, int stableDisplayHeight,
+ int displayWidth, int displayHeight) {
return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId),
- getDisplayCutoutApproximationRect(res, displayUniqueId),
- displayWidth, displayHeight, DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT,
+ getDisplayCutoutApproximationRect(res, displayUniqueId), stableDisplayWidth,
+ stableDisplayHeight, displayWidth, displayHeight,
+ DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT,
getWaterfallInsets(res, displayUniqueId)).second;
}
/**
- * Creates an instance according to @android:string/config_mainBuiltInDisplayCutout.
- *
- * @hide
- */
- public static Path pathFromResources(Resources res, String displayUniqueId, int displayWidth,
- int displayHeight) {
- return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId), null,
- displayWidth, displayHeight, DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT,
- getWaterfallInsets(res, displayUniqueId)).first;
- }
-
- /**
* Creates an instance according to the supplied {@link android.util.PathParser.PathData} spec.
*
* @hide
@@ -1046,8 +1071,8 @@
public static DisplayCutout fromSpec(String pathSpec, int displayWidth,
int displayHeight, float density, Insets waterfallInsets) {
return pathAndDisplayCutoutFromSpec(
- pathSpec, null, displayWidth, displayHeight, density, waterfallInsets)
- .second;
+ pathSpec, null, displayWidth, displayHeight, displayWidth, displayHeight, density,
+ waterfallInsets).second;
}
/**
@@ -1055,6 +1080,8 @@
*
* @param pathSpec the spec string read from config_mainBuiltInDisplayCutout.
* @param rectSpec the spec string read from config_mainBuiltInDisplayCutoutRectApproximation.
+ * @param stableDisplayWidth the stable display width.
+ * @param stableDisplayHeight the stable display height.
* @param displayWidth the display width.
* @param displayHeight the display height.
* @param density the display density.
@@ -1062,8 +1089,8 @@
* @return a Pair contains the cutout path and the corresponding DisplayCutout instance.
*/
private static Pair<Path, DisplayCutout> pathAndDisplayCutoutFromSpec(
- String pathSpec, String rectSpec, int displayWidth, int displayHeight, float density,
- Insets waterfallInsets) {
+ String pathSpec, String rectSpec, int stableDisplayWidth, int stableDisplayHeight,
+ int displayWidth, int displayHeight, float density, Insets waterfallInsets) {
// Always use the rect approximation spec to create the cutout if it's not null because
// transforming and sending a Region constructed from a path is very costly.
String spec = rectSpec != null ? rectSpec : pathSpec;
@@ -1071,11 +1098,15 @@
return NULL_PAIR;
}
+ final float physicalPixelDisplaySizeRatio = DisplayUtils.getPhysicalPixelDisplaySizeRatio(
+ stableDisplayWidth, stableDisplayHeight, displayWidth, displayHeight);
+
synchronized (CACHE_LOCK) {
if (spec.equals(sCachedSpec) && sCachedDisplayWidth == displayWidth
&& sCachedDisplayHeight == displayHeight
&& sCachedDensity == density
- && waterfallInsets.equals(sCachedWaterfallInsets)) {
+ && waterfallInsets.equals(sCachedWaterfallInsets)
+ && sCachedPhysicalPixelDisplaySizeRatio == physicalPixelDisplaySizeRatio) {
return sCachedCutout;
}
}
@@ -1083,7 +1114,7 @@
spec = spec.trim();
CutoutSpecification cutoutSpec = new CutoutSpecification.Parser(density,
- displayWidth, displayHeight).parse(spec);
+ stableDisplayWidth, stableDisplayHeight, physicalPixelDisplaySizeRatio).parse(spec);
Rect safeInset = cutoutSpec.getSafeInset();
final Rect boundLeft = cutoutSpec.getLeftBound();
final Rect boundTop = cutoutSpec.getTopBound();
@@ -1099,8 +1130,9 @@
Math.max(waterfallInsets.bottom, safeInset.bottom));
}
- final CutoutPathParserInfo cutoutPathParserInfo = new CutoutPathParserInfo(displayWidth,
- displayHeight, density, pathSpec.trim(), ROTATION_0, 1f /* scale */);
+ final CutoutPathParserInfo cutoutPathParserInfo = new CutoutPathParserInfo(
+ displayWidth, displayHeight, stableDisplayWidth, stableDisplayHeight, density,
+ pathSpec.trim(), ROTATION_0, 1f /* scale */, physicalPixelDisplaySizeRatio);
final DisplayCutout cutout = new DisplayCutout(
safeInset, waterfallInsets, boundLeft, boundTop, boundRight, boundBottom,
@@ -1113,6 +1145,7 @@
sCachedDensity = density;
sCachedCutout = result;
sCachedWaterfallInsets = waterfallInsets;
+ sCachedPhysicalPixelDisplaySizeRatio = physicalPixelDisplaySizeRatio;
}
return result;
}
@@ -1149,8 +1182,9 @@
Collections.rotate(Arrays.asList(newBounds), -rotation);
final CutoutPathParserInfo info = getCutoutPathParserInfo();
final CutoutPathParserInfo newInfo = new CutoutPathParserInfo(
- info.getDisplayWidth(), info.getDisplayHeight(), info.getDensity(),
- info.getCutoutSpec(), toRotation, info.getScale());
+ info.getDisplayWidth(), info.getDisplayHeight(), info.getStableDisplayWidth(),
+ info.getStableDisplayHeight(), info.getDensity(), info.getCutoutSpec(), toRotation,
+ info.getScale(), info.getPhysicalPixelDisplaySizeRatio());
final boolean swapAspect = (rotation % 2) != 0;
final int endWidth = swapAspect ? startHeight : startWidth;
final int endHeight = swapAspect ? startWidth : startHeight;
@@ -1250,10 +1284,13 @@
out.writeTypedObject(cutout.mWaterfallInsets, flags);
out.writeInt(cutout.mCutoutPathParserInfo.getDisplayWidth());
out.writeInt(cutout.mCutoutPathParserInfo.getDisplayHeight());
+ out.writeInt(cutout.mCutoutPathParserInfo.getStableDisplayWidth());
+ out.writeInt(cutout.mCutoutPathParserInfo.getStableDisplayHeight());
out.writeFloat(cutout.mCutoutPathParserInfo.getDensity());
out.writeString(cutout.mCutoutPathParserInfo.getCutoutSpec());
out.writeInt(cutout.mCutoutPathParserInfo.getRotation());
out.writeFloat(cutout.mCutoutPathParserInfo.getScale());
+ out.writeFloat(cutout.mCutoutPathParserInfo.getPhysicalPixelDisplaySizeRatio());
}
}
@@ -1299,12 +1336,16 @@
Insets waterfallInsets = in.readTypedObject(Insets.CREATOR);
int displayWidth = in.readInt();
int displayHeight = in.readInt();
+ int stableDisplayWidth = in.readInt();
+ int stableDisplayHeight = in.readInt();
float density = in.readFloat();
String cutoutSpec = in.readString();
int rotation = in.readInt();
float scale = in.readFloat();
+ float physicalPixelDisplaySizeRatio = in.readFloat();
final CutoutPathParserInfo info = new CutoutPathParserInfo(
- displayWidth, displayHeight, density, cutoutSpec, rotation, scale);
+ displayWidth, displayHeight, stableDisplayWidth, stableDisplayHeight, density,
+ cutoutSpec, rotation, scale, physicalPixelDisplaySizeRatio);
return new DisplayCutout(
safeInsets, waterfallInsets, bounds, info, false /* copyArguments */);
@@ -1332,10 +1373,13 @@
final CutoutPathParserInfo info = new CutoutPathParserInfo(
mInner.mCutoutPathParserInfo.getDisplayWidth(),
mInner.mCutoutPathParserInfo.getDisplayHeight(),
+ mInner.mCutoutPathParserInfo.getStableDisplayWidth(),
+ mInner.mCutoutPathParserInfo.getStableDisplayHeight(),
mInner.mCutoutPathParserInfo.getDensity(),
mInner.mCutoutPathParserInfo.getCutoutSpec(),
mInner.mCutoutPathParserInfo.getRotation(),
- scale);
+ scale,
+ mInner.mCutoutPathParserInfo.getPhysicalPixelDisplaySizeRatio());
mInner = new DisplayCutout(safeInsets, Insets.of(waterfallInsets), bounds, info);
}
@@ -1387,7 +1431,7 @@
if (mCutoutPath != null) {
// Create a fake CutoutPathParserInfo and set it to sCachedCutoutPathParserInfo so
// that when getCutoutPath() is called, it will return the cached Path.
- info = new CutoutPathParserInfo(0, 0, 0, "test", 0, 1f);
+ info = new CutoutPathParserInfo(0, 0, 0, 0, 0, "test", ROTATION_0, 1f, 1f);
synchronized (CACHE_LOCK) {
DisplayCutout.sCachedCutoutPathParserInfo = info;
DisplayCutout.sCachedCutoutPath = mCutoutPath;
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl
index 5ce5477..c83869c 100644
--- a/core/java/android/view/IWindowManager.aidl
+++ b/core/java/android/view/IWindowManager.aidl
@@ -249,7 +249,7 @@
* Set whether screen capture is disabled for all windows of a specific user from
* the device policy cache.
*/
- void refreshScreenCaptureDisabled(int userId);
+ void refreshScreenCaptureDisabled();
// These can only be called with the SET_ORIENTATION permission.
/**
diff --git a/core/java/android/view/ImeInsetsSourceConsumer.java b/core/java/android/view/ImeInsetsSourceConsumer.java
index d609fb8..4fdea3b 100644
--- a/core/java/android/view/ImeInsetsSourceConsumer.java
+++ b/core/java/android/view/ImeInsetsSourceConsumer.java
@@ -18,12 +18,13 @@
import static android.os.Trace.TRACE_TAG_VIEW;
import static android.view.ImeInsetsSourceConsumerProto.INSETS_SOURCE_CONSUMER;
+import static android.view.ImeInsetsSourceConsumerProto.IS_HIDE_ANIMATION_RUNNING;
import static android.view.ImeInsetsSourceConsumerProto.IS_REQUESTED_VISIBLE_AWAITING_CONTROL;
+import static android.view.ImeInsetsSourceConsumerProto.IS_SHOW_REQUESTED_DURING_HIDE_ANIMATION;
import static android.view.InsetsController.AnimationType;
import static android.view.InsetsState.ITYPE_IME;
import android.annotation.Nullable;
-import android.inputmethodservice.InputMethodService;
import android.os.IBinder;
import android.os.Trace;
import android.util.proto.ProtoOutputStream;
@@ -44,6 +45,16 @@
*/
private boolean mIsRequestedVisibleAwaitingControl;
+ private boolean mIsHideAnimationRunning;
+
+ /**
+ * Tracks whether {@link WindowInsetsController#show(int)} or
+ * {@link InputMethodManager#showSoftInput(View, int)} is called during IME hide animation.
+ * If it was called, we should not call {@link InputMethodManager#notifyImeHidden(IBinder)},
+ * because the IME is being shown.
+ */
+ private boolean mIsShowRequestedDuringHideAnimation;
+
public ImeInsetsSourceConsumer(
InsetsState state, Supplier<Transaction> transactionSupplier,
InsetsController controller) {
@@ -64,6 +75,12 @@
}
@Override
+ public void show(boolean fromIme) {
+ super.show(fromIme);
+ onShowRequested();
+ }
+
+ @Override
public void hide() {
super.hide();
mIsRequestedVisibleAwaitingControl = false;
@@ -74,10 +91,20 @@
hide();
if (animationFinished) {
- // remove IME surface as IME has finished hide animation.
- notifyHidden();
- removeSurface();
+ // Remove IME surface as IME has finished hide animation, if there is no pending
+ // show request.
+ if (!mIsShowRequestedDuringHideAnimation) {
+ notifyHidden();
+ removeSurface();
+ }
}
+ // This method is called
+ // (1) before the hide animation starts.
+ // (2) after the hide animation ends.
+ // (3) if the IME is not controllable (animationFinished == true in this case).
+ // We should reset mIsShowRequestedDuringHideAnimation in all cases.
+ mIsHideAnimationRunning = !animationFinished;
+ mIsShowRequestedDuringHideAnimation = false;
}
/**
@@ -104,7 +131,8 @@
}
/**
- * Notify {@link InputMethodService} that IME window is hidden.
+ * Notify {@link com.android.server.inputmethod.InputMethodManagerService} that
+ * IME insets are hidden.
*/
@Override
void notifyHidden() {
@@ -157,9 +185,20 @@
final long token = proto.start(fieldId);
super.dumpDebug(proto, INSETS_SOURCE_CONSUMER);
proto.write(IS_REQUESTED_VISIBLE_AWAITING_CONTROL, mIsRequestedVisibleAwaitingControl);
+ proto.write(IS_HIDE_ANIMATION_RUNNING, mIsHideAnimationRunning);
+ proto.write(IS_SHOW_REQUESTED_DURING_HIDE_ANIMATION, mIsShowRequestedDuringHideAnimation);
proto.end(token);
}
+ /**
+ * Called when {@link #show} or {@link InputMethodManager#showSoftInput(View, int)} is called.
+ */
+ public void onShowRequested() {
+ if (mIsHideAnimationRunning) {
+ mIsShowRequestedDuringHideAnimation = true;
+ }
+ }
+
private InputMethodManager getImm() {
return mController.getHost().getInputMethodManager();
}
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index cc93adc..0bed342 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -2280,8 +2280,11 @@
}
/**
- * {@link #getX(int)} for the first pointer index (may be an
- * arbitrary pointer identifier).
+ * Equivalent to {@link #getX(int)} for pointer index 0 (regardless of the
+ * pointer identifier).
+ *
+ * @return The X coordinate of the first pointer index in the coordinate
+ * space of the view that received this motion event.
*
* @see #AXIS_X
*/
@@ -2290,8 +2293,11 @@
}
/**
- * {@link #getY(int)} for the first pointer index (may be an
- * arbitrary pointer identifier).
+ * Equivalent to {@link #getY(int)} for pointer index 0 (regardless of the
+ * pointer identifier).
+ *
+ * @return The Y coordinate of the first pointer index in the coordinate
+ * space of the view that received this motion event.
*
* @see #AXIS_Y
*/
@@ -2433,13 +2439,20 @@
}
/**
- * Returns the X coordinate of this event for the given pointer
- * <em>index</em> (use {@link #getPointerId(int)} to find the pointer
- * identifier for this index).
- * Whole numbers are pixels; the
- * value may have a fraction for input devices that are sub-pixel precise.
- * @param pointerIndex Raw index of pointer to retrieve. Value may be from 0
- * (the first pointer that is down) to {@link #getPointerCount()}-1.
+ * Returns the X coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The coordinate is in the
+ * coordinate space of the view that received this motion event.
+ *
+ * <p>Use {@link #getPointerId(int)} to get the pointer identifier for the
+ * pointer referenced by {@code pointerIndex}.
+ *
+ * @param pointerIndex Index of the pointer for which the X coordinate is
+ * returned. May be a value in the range of 0 (the first pointer that
+ * is down) to {@link #getPointerCount()} - 1.
+ * @return The X coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The unit is pixels. The
+ * value may contain a fractional portion for devices that are subpixel
+ * precise.
*
* @see #AXIS_X
*/
@@ -2448,13 +2461,20 @@
}
/**
- * Returns the Y coordinate of this event for the given pointer
- * <em>index</em> (use {@link #getPointerId(int)} to find the pointer
- * identifier for this index).
- * Whole numbers are pixels; the
- * value may have a fraction for input devices that are sub-pixel precise.
- * @param pointerIndex Raw index of pointer to retrieve. Value may be from 0
- * (the first pointer that is down) to {@link #getPointerCount()}-1.
+ * Returns the Y coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The coordinate is in the
+ * coordinate space of the view that received this motion event.
+ *
+ * <p>Use {@link #getPointerId(int)} to get the pointer identifier for the
+ * pointer referenced by {@code pointerIndex}.
+ *
+ * @param pointerIndex Index of the pointer for which the Y coordinate is
+ * returned. May be a value in the range of 0 (the first pointer that
+ * is down) to {@link #getPointerCount()} - 1.
+ * @return The Y coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The unit is pixels. The
+ * value may contain a fractional portion for devices that are subpixel
+ * precise.
*
* @see #AXIS_Y
*/
@@ -2700,12 +2720,13 @@
}
/**
- * Returns the original raw X coordinate of this event. For touch
- * events on the screen, this is the original location of the event
- * on the screen, before it had been adjusted for the containing window
- * and views.
+ * Equivalent to {@link #getRawX(int)} for pointer index 0 (regardless of
+ * the pointer identifier).
*
- * @see #getX(int)
+ * @return The X coordinate of the first pointer index in the coordinate
+ * space of the device display.
+ *
+ * @see #getX()
* @see #AXIS_X
*/
public final float getRawX() {
@@ -2713,12 +2734,13 @@
}
/**
- * Returns the original raw Y coordinate of this event. For touch
- * events on the screen, this is the original location of the event
- * on the screen, before it had been adjusted for the containing window
- * and views.
+ * Equivalent to {@link #getRawY(int)} for pointer index 0 (regardless of
+ * the pointer identifier).
*
- * @see #getY(int)
+ * @return The Y coordinate of the first pointer index in the coordinate
+ * space of the device display.
+ *
+ * @see #getY()
* @see #AXIS_Y
*/
public final float getRawY() {
@@ -2726,13 +2748,38 @@
}
/**
- * Returns the original raw X coordinate of this event. For touch
- * events on the screen, this is the original location of the event
- * on the screen, before it had been adjusted for the containing window
- * and views.
+ * Returns the X coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The coordinate is in the
+ * coordinate space of the device display, irrespective of system
+ * decorations and whether or not the system is in multi-window mode. If the
+ * app spans multiple screens in a multiple-screen environment, the
+ * coordinate space includes all of the spanned screens.
*
- * @param pointerIndex Raw index of pointer to retrieve. Value may be from 0
- * (the first pointer that is down) to {@link #getPointerCount()}-1.
+ * <p>In multi-window mode, the coordinate space extends beyond the bounds
+ * of the app window to encompass the entire display area. For example, if
+ * the motion event occurs in the right-hand window of split-screen mode in
+ * landscape orientation, the left edge of the screen—not the left
+ * edge of the window—is the origin from which the X coordinate is
+ * calculated.
+ *
+ * <p>In multiple-screen scenarios, the coordinate space can span screens.
+ * For example, if the app is spanning both screens of a dual-screen device,
+ * and the motion event occurs on the right-hand screen, the X coordinate is
+ * calculated from the left edge of the left-hand screen to the point of the
+ * motion event on the right-hand screen. When the app is restricted to a
+ * single screen in a multiple-screen environment, the coordinate space
+ * includes only the screen on which the app is running.
+ *
+ * <p>Use {@link #getPointerId(int)} to get the pointer identifier for the
+ * pointer referenced by {@code pointerIndex}.
+ *
+ * @param pointerIndex Index of the pointer for which the X coordinate is
+ * returned. May be a value in the range of 0 (the first pointer that
+ * is down) to {@link #getPointerCount()} - 1.
+ * @return The X coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The unit is pixels. The
+ * value may contain a fractional portion for devices that are subpixel
+ * precise.
*
* @see #getX(int)
* @see #AXIS_X
@@ -2742,13 +2789,38 @@
}
/**
- * Returns the original raw Y coordinate of this event. For touch
- * events on the screen, this is the original location of the event
- * on the screen, before it had been adjusted for the containing window
- * and views.
+ * Returns the Y coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The coordinate is in the
+ * coordinate space of the device display, irrespective of system
+ * decorations and whether or not the system is in multi-window mode. If the
+ * app spans multiple screens in a multiple-screen environment, the
+ * coordinate space includes all of the spanned screens.
*
- * @param pointerIndex Raw index of pointer to retrieve. Value may be from 0
- * (the first pointer that is down) to {@link #getPointerCount()}-1.
+ * <p>In multi-window mode, the coordinate space extends beyond the bounds
+ * of the app window to encompass the entire device screen. For example, if
+ * the motion event occurs in the lower window of split-screen mode in
+ * portrait orientation, the top edge of the screen—not the top edge
+ * of the window—is the origin from which the Y coordinate is
+ * determined.
+ *
+ * <p>In multiple-screen scenarios, the coordinate space can span screens.
+ * For example, if the app is spanning both screens of a dual-screen device
+ * that's rotated 90 degrees, and the motion event occurs on the lower
+ * screen, the Y coordinate is calculated from the top edge of the upper
+ * screen to the point of the motion event on the lower screen. When the app
+ * is restricted to a single screen in a multiple-screen environment, the
+ * coordinate space includes only the screen on which the app is running.
+ *
+ * <p>Use {@link #getPointerId(int)} to get the pointer identifier for the
+ * pointer referenced by {@code pointerIndex}.
+ *
+ * @param pointerIndex Index of the pointer for which the Y coordinate is
+ * returned. May be a value in the range of 0 (the first pointer that
+ * is down) to {@link #getPointerCount()} - 1.
+ * @return The Y coordinate of the pointer referenced by
+ * {@code pointerIndex} for this motion event. The unit is pixels. The
+ * value may contain a fractional portion for devices that are subpixel
+ * precise.
*
* @see #getY(int)
* @see #AXIS_Y
diff --git a/core/java/android/view/RoundedCorners.java b/core/java/android/view/RoundedCorners.java
index 3eade77..9f30487 100644
--- a/core/java/android/view/RoundedCorners.java
+++ b/core/java/android/view/RoundedCorners.java
@@ -67,6 +67,8 @@
private static Pair<Integer, Integer> sCachedRadii;
@GuardedBy("CACHE_LOCK")
private static RoundedCorners sCachedRoundedCorners;
+ @GuardedBy("CACHE_LOCK")
+ private static float sCachedPhysicalPixelDisplaySizeRatio;
@VisibleForTesting
public final RoundedCorner[] mRoundedCorners;
@@ -96,8 +98,10 @@
* @android:dimen/rounded_corner_radius_top and @android:dimen/rounded_corner_radius_bottom
*/
public static RoundedCorners fromResources(
- Resources res, String displayUniqueId, int displayWidth, int displayHeight) {
- return fromRadii(loadRoundedCornerRadii(res, displayUniqueId), displayWidth, displayHeight);
+ Resources res, String displayUniqueId, int stableDisplayWidth, int stableDisplayHeight,
+ int displayWidth, int displayHeight) {
+ return fromRadii(loadRoundedCornerRadii(res, displayUniqueId), stableDisplayWidth,
+ stableDisplayHeight, displayWidth, displayHeight);
}
/**
@@ -106,20 +110,33 @@
@VisibleForTesting
public static RoundedCorners fromRadii(Pair<Integer, Integer> radii, int displayWidth,
int displayHeight) {
+ return fromRadii(radii, displayWidth, displayHeight, displayWidth, displayHeight);
+ }
+
+ private static RoundedCorners fromRadii(Pair<Integer, Integer> radii, int stableDisplayWidth,
+ int stableDisplayHeight, int displayWidth, int displayHeight) {
if (radii == null) {
return null;
}
+ final float physicalPixelDisplaySizeRatio = DisplayUtils.getPhysicalPixelDisplaySizeRatio(
+ stableDisplayWidth, stableDisplayHeight, displayWidth, displayHeight);
+
synchronized (CACHE_LOCK) {
if (radii.equals(sCachedRadii) && sCachedDisplayWidth == displayWidth
- && sCachedDisplayHeight == displayHeight) {
+ && sCachedDisplayHeight == displayHeight
+ && sCachedPhysicalPixelDisplaySizeRatio == physicalPixelDisplaySizeRatio) {
return sCachedRoundedCorners;
}
}
final RoundedCorner[] roundedCorners = new RoundedCorner[ROUNDED_CORNER_POSITION_LENGTH];
- final int topRadius = radii.first > 0 ? radii.first : 0;
- final int bottomRadius = radii.second > 0 ? radii.second : 0;
+ int topRadius = radii.first > 0 ? radii.first : 0;
+ int bottomRadius = radii.second > 0 ? radii.second : 0;
+ if (physicalPixelDisplaySizeRatio != 1f) {
+ topRadius = (int) (topRadius * physicalPixelDisplaySizeRatio + 0.5);
+ bottomRadius = (int) (bottomRadius * physicalPixelDisplaySizeRatio + 0.5);
+ }
for (int i = 0; i < ROUNDED_CORNER_POSITION_LENGTH; i++) {
roundedCorners[i] = createRoundedCorner(
i,
@@ -134,6 +151,7 @@
sCachedDisplayHeight = displayHeight;
sCachedRadii = radii;
sCachedRoundedCorners = result;
+ sCachedPhysicalPixelDisplaySizeRatio = physicalPixelDisplaySizeRatio;
}
return result;
}
diff --git a/core/java/android/view/SurfaceControlViewHost.java b/core/java/android/view/SurfaceControlViewHost.java
index 7cfc983..f7bca5b 100644
--- a/core/java/android/view/SurfaceControlViewHost.java
+++ b/core/java/android/view/SurfaceControlViewHost.java
@@ -273,8 +273,14 @@
/** @hide */
public SurfaceControlViewHost(@NonNull Context c, @NonNull Display d,
@NonNull WindowlessWindowManager wwm) {
+ this(c, d, wwm, false /* useSfChoreographer */);
+ }
+
+ /** @hide */
+ public SurfaceControlViewHost(@NonNull Context c, @NonNull Display d,
+ @NonNull WindowlessWindowManager wwm, boolean useSfChoreographer) {
mWm = wwm;
- mViewRoot = new ViewRootImpl(c, d, mWm);
+ mViewRoot = new ViewRootImpl(c, d, mWm, useSfChoreographer);
addConfigCallback(c, d);
WindowManagerGlobal.getInstance().addWindowlessRoot(mViewRoot);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 569461e..cf5727e 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1282,6 +1282,17 @@
public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
/**
+ * A hint indicating that this view can be autofilled with a password.
+ *
+ * This is a heuristic-based hint that is meant to be used by UI Toolkit developers when a
+ * view is a password field but doesn't specify a
+ * <code>{@value View#AUTOFILL_HINT_PASSWORD}</code>.
+ * @hide
+ */
+ // TODO(229765029): unhide this for UI toolkit
+ public static final String AUTOFILL_HINT_PASSWORD_AUTO = "passwordAuto";
+
+ /**
* Hints for the autofill services that describes the content of the view.
*/
private @Nullable String[] mAutofillHints;
@@ -8207,12 +8218,12 @@
// becomes true where it should issue notifyViewEntered().
afm.notifyViewEntered(this);
} else {
- afm.enableFillRequestActivityStarted();
+ afm.enableFillRequestActivityStarted(this);
}
} else if (!enter && !isFocused()) {
afm.notifyViewExited(this);
} else if (enter) {
- afm.enableFillRequestActivityStarted();
+ afm.enableFillRequestActivityStarted(this);
}
}
}
@@ -12052,6 +12063,9 @@
* Gets the coordinates of this view in the coordinate space of the
* {@link Surface} that contains the view.
*
+ * <p>In multiple-screen scenarios, if the surface spans multiple screens,
+ * the coordinate space of the surface also spans multiple screens.
+ *
* <p>After the method returns, the argument array contains the x- and
* y-coordinates of the view relative to the view's left and top edges,
* respectively.
@@ -25574,19 +25588,23 @@
}
/**
- * Gets the global coordinates of this view. The coordinates are in the
- * coordinate space of the device screen, irrespective of system decorations
- * and whether the system is in multi-window mode.
+ * Gets the coordinates of this view in the coordinate space of the device
+ * screen, irrespective of system decorations and whether the system is in
+ * multi-window mode.
*
- * <p>In multi-window mode, the global coordinate space encompasses the
- * entire device screen, ignoring the bounds of the app window. For
- * example, if the view is in the bottom portion of a horizontal split
- * screen, the top edge of the screen—not the top edge of the
- * window—is the origin from which the y-coordinate is calculated.
+ * <p>In multi-window mode, the coordinate space encompasses the entire
+ * device screen, ignoring the bounds of the app window. For example, if the
+ * view is in the bottom portion of a horizontal split screen, the top edge
+ * of the screen—not the top edge of the window—is the origin
+ * from which the y-coordinate is calculated.
*
- * <p><b>Note:</b> In multiple-screen scenarios, the global coordinate space
- * is restricted to the screen on which the view is displayed. The
- * coordinate space does not span multiple screens.
+ * <p>In multiple-screen scenarios, the coordinate space can span screens.
+ * For example, if the app is spanning both screens of a dual-screen device
+ * and the view is located on the right-hand screen, the x-coordinate is
+ * calculated from the left edge of the left-hand screen to the left edge of
+ * the view. When the app is restricted to a single screen in a
+ * multiple-screen environment, the coordinate space includes only the
+ * screen on which the app is running.
*
* <p>After the method returns, the argument array contains the x- and
* y-coordinates of the view relative to the view's left and top edges,
@@ -25614,6 +25632,11 @@
* top left corner of the window that contains the view. In full screen
* mode, the origin is the top left corner of the device screen.
*
+ * <p>In multiple-screen scenarios, if the app spans multiple screens, the
+ * coordinate space also spans multiple screens. But if the app is
+ * restricted to a single screen, the coordinate space includes only the
+ * screen on which the app is running.
+ *
* <p>After the method returns, the argument array contains the x- and
* y-coordinates of the view relative to the view's left and top edges,
* respectively.
@@ -28722,7 +28745,7 @@
* {@link InputDevice#SOURCE_MOUSE_RELATIVE}, and relative position changes will be
* available through {@link MotionEvent#getX} and {@link MotionEvent#getY}.</li>
*
- * <li>Events from a touchpad will be delivered with the source
+ * <li>Events from a touchpad or trackpad will be delivered with the source
* {@link InputDevice#SOURCE_TOUCHPAD}, where the absolute position of each of the pointers
* on the touchpad will be available through {@link MotionEvent#getX(int)} and
* {@link MotionEvent#getY(int)}, and their relative movements are stored in
@@ -28731,6 +28754,12 @@
* <li>Events from other types of devices, such as touchscreens, will not be affected.</li>
* </ul>
* <p>
+ * When pointer capture changes, connected mouse and trackpad devices may be reconfigured,
+ * and their properties (such as their sources or motion ranges) may change. Use an
+ * {@link android.hardware.input.InputManager.InputDeviceListener} to be notified when a device
+ * changes (which may happen after enabling or disabling pointer capture), and use
+ * {@link InputDevice#getDevice(int)} to get the updated {@link InputDevice}.
+ * <p>
* Events captured through pointer capture will be dispatched to
* {@link OnCapturedPointerListener#onCapturedPointer(View, MotionEvent)} if an
* {@link OnCapturedPointerListener} is set, and otherwise to
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 27ce711..fbb86ff 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -854,10 +854,16 @@
private String mTag = TAG;
public ViewRootImpl(Context context, Display display) {
- this(context, display, WindowManagerGlobal.getWindowSession());
+ this(context, display, WindowManagerGlobal.getWindowSession(),
+ false /* useSfChoreographer */);
}
public ViewRootImpl(@UiContext Context context, Display display, IWindowSession session) {
+ this(context, display, session, false /* useSfChoreographer */);
+ }
+
+ public ViewRootImpl(@UiContext Context context, Display display, IWindowSession session,
+ boolean useSfChoreographer) {
mContext = context;
mWindowSession = session;
mDisplay = display;
@@ -889,7 +895,8 @@
mNoncompatDensity = context.getResources().getDisplayMetrics().noncompatDensityDpi;
mFallbackEventHandler = new PhoneFallbackEventHandler(context);
// TODO(b/222696368): remove getSfInstance usage and use vsyncId for transactions
- mChoreographer = Choreographer.getInstance();
+ mChoreographer = useSfChoreographer
+ ? Choreographer.getSfInstance() : Choreographer.getInstance();
mDisplayManager = (DisplayManager)context.getSystemService(Context.DISPLAY_SERVICE);
mInsetsController = new InsetsController(new ViewRootInsetsControllerHost(this));
mHandwritingInitiator = new HandwritingInitiator(mViewConfiguration,
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 90e3498..4baad1e 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -1058,11 +1058,6 @@
/**
* Refreshes this info with the latest state of the view it represents.
- * <p>
- * <strong>Note:</strong> If this method returns false this info is obsolete
- * since it represents a view that is no longer in the view tree and should
- * be recycled.
- * </p>
*
* @param bypassCache Whether to bypass the cache.
* @return Whether the refresh succeeded.
@@ -1089,8 +1084,7 @@
* Refreshes this info with the latest state of the view it represents.
*
* @return {@code true} if the refresh succeeded. {@code false} if the {@link View} represented
- * by this node is no longer in the view tree (and thus this node is obsolete and should be
- * recycled).
+ * by this node is no longer in the view tree (and thus this node is obsolete).
*/
public boolean refresh() {
return refresh(null, true);
@@ -1109,8 +1103,7 @@
* @param args A bundle of arguments for the request. These depend on the particular request.
*
* @return {@code true} if the refresh succeeded. {@code false} if the {@link View} represented
- * by this node is no longer in the view tree (and thus this node is obsolete and should be
- * recycled).
+ * by this node is no longer in the view tree (and thus this node is obsolete).
*/
public boolean refreshWithExtraData(String extraDataKey, Bundle args) {
// limits the text location length to make sure the rectangle array allocation avoids
@@ -1823,11 +1816,6 @@
* this info is the root of the traversed tree.
*
* <p>
- * <strong>Note:</strong> It is a client responsibility to recycle the
- * received info by calling {@link AccessibilityNodeInfo#recycle()}
- * to avoid creating of multiple instances.
- * </p>
- * <p>
* <strong>Note:</strong> If this view hierarchy has a {@link SurfaceView} embedding another
* view hierarchy via {@link SurfaceView#setChildSurfacePackage}, there is a limitation that
* this API won't be able to find the node for the view on the embedded view hierarchy. It's
@@ -1855,11 +1843,6 @@
* resource name is "baz", the fully qualified resource id is "foo.bar:id/baz".
*
* <p>
- * <strong>Note:</strong> It is a client responsibility to recycle the
- * received info by calling {@link AccessibilityNodeInfo#recycle()}
- * to avoid creating of multiple instances.
- * </p>
- * <p>
* <strong>Note:</strong> The primary usage of this API is for UI test automation
* and in order to report the fully qualified view id if an {@link AccessibilityNodeInfo}
* the client has to set the {@link AccessibilityServiceInfo#FLAG_REPORT_VIEW_IDS}
@@ -3282,11 +3265,6 @@
/**
* Gets the node info for which the view represented by this info serves as
* a label for accessibility purposes.
- * <p>
- * <strong>Note:</strong> It is a client responsibility to recycle the
- * received info by calling {@link AccessibilityNodeInfo#recycle()}
- * to avoid creating of multiple instances.
- * </p>
*
* @return The labeled info.
*/
@@ -3334,11 +3312,6 @@
/**
* Gets the node info which serves as the label of the view represented by
* this info for accessibility purposes.
- * <p>
- * <strong>Note:</strong> It is a client responsibility to recycle the
- * received info by calling {@link AccessibilityNodeInfo#recycle()}
- * to avoid creating of multiple instances.
- * </p>
*
* @return The label.
*/
@@ -5312,9 +5285,7 @@
}
/**
- * Class with information if a node is a range. Use
- * {@link RangeInfo#obtain(int, float, float, float)} to get an instance. Recycling is
- * handled by the {@link AccessibilityNodeInfo} to which this object is attached.
+ * Class with information if a node is a range.
*/
public static final class RangeInfo {
@@ -5423,9 +5394,7 @@
}
/**
- * Class with information if a node is a collection. Use
- * {@link CollectionInfo#obtain(int, int, boolean)} to get an instance. Recycling is
- * handled by the {@link AccessibilityNodeInfo} to which this object is attached.
+ * Class with information if a node is a collection.
* <p>
* A collection of items has rows and columns and may be hierarchical.
* For example, a horizontal list is a collection with one column, as
@@ -5591,10 +5560,7 @@
}
/**
- * Class with information if a node is a collection item. Use
- * {@link CollectionItemInfo#obtain(int, int, int, int, boolean)}
- * to get an instance. Recycling is handled by the {@link AccessibilityNodeInfo} to which this
- * object is attached.
+ * Class with information if a node is a collection item.
* <p>
* A collection item is contained in a collection, it starts at
* a given row and column in the collection, and spans one or
@@ -6085,11 +6051,6 @@
* <p>
* <strong>Note:</strong> This api can only be called from {@link AccessibilityService}.
* </p>
- * <p>
- * <strong>Note:</strong> It is a client responsibility to recycle the
- * received info by calling {@link AccessibilityNodeInfo#recycle()}
- * to avoid creating of multiple instances.
- * </p>
*
* @param region The region retrieved from {@link #getRegionAt(int)}.
* @return The target node associates with the given region.
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index b05b791..0a75992 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -488,6 +488,25 @@
public static final String DEVICE_CONFIG_AUTOFILL_DIALOG_ENABLED =
"autofill_dialog_enabled";
+ /**
+ * Sets the autofill hints allowed list for the fields that can trigger the fill dialog
+ * feature at Activity starting.
+ *
+ * The list of autofill hints is {@code ":"} colon delimited.
+ *
+ * <p>For example, a list with 3 hints {@code password}, {@code phone}, and
+ * {@code emailAddress}, would be {@code password:phone:emailAddress}
+ *
+ * Note: By default the password field is enabled even there is no password hint in the list
+ *
+ * @see View#setAutofillHints(String...)
+ * @hide
+ */
+ public static final String DEVICE_CONFIG_AUTOFILL_DIALOG_HINTS =
+ "autofill_dialog_hints";
+
+ private static final String DIALOG_HINTS_DELIMITER = ":";
+
/** @hide */
public static final int RESULT_OK = 0;
/** @hide */
@@ -537,6 +556,7 @@
public static final int NO_SESSION = Integer.MAX_VALUE;
private static final boolean HAS_FILL_DIALOG_UI_FEATURE_DEFAULT = false;
+ private static final String FILL_DIALOG_ENABLED_DEFAULT_HINTS = "";
private final IAutoFillManager mService;
@@ -652,6 +672,8 @@
// Indicates whether called the showAutofillDialog() method.
private boolean mShowAutofillDialogCalled = false;
+ private final String[] mFillDialogEnabledHints;
+
/** @hide */
public interface AutofillClient {
/**
@@ -796,8 +818,10 @@
DeviceConfig.NAMESPACE_AUTOFILL,
DEVICE_CONFIG_AUTOFILL_DIALOG_ENABLED,
HAS_FILL_DIALOG_UI_FEATURE_DEFAULT);
+ mFillDialogEnabledHints = getFillDialogEnabledHints();
if (sDebug) {
- Log.d(TAG, "Fill dialog is enabled:" + mIsFillDialogEnabled);
+ Log.d(TAG, "Fill dialog is enabled:" + mIsFillDialogEnabled
+ + ", hints=" + Arrays.toString(mFillDialogEnabledHints));
}
if (mOptions != null) {
@@ -806,6 +830,19 @@
}
}
+ private String[] getFillDialogEnabledHints() {
+ final String dialogHints = DeviceConfig.getString(
+ DeviceConfig.NAMESPACE_AUTOFILL,
+ DEVICE_CONFIG_AUTOFILL_DIALOG_HINTS,
+ FILL_DIALOG_ENABLED_DEFAULT_HINTS);
+ if (TextUtils.isEmpty(dialogHints)) {
+ return new String[0];
+ }
+
+ return ArrayUtils.filter(dialogHints.split(DIALOG_HINTS_DELIMITER), String[]::new,
+ (str) -> !TextUtils.isEmpty(str));
+ }
+
/**
* @hide
*/
@@ -1076,17 +1113,27 @@
}
/**
- * The view is autofillable, marked to perform a fill request after layout if
+ * The view have the allowed autofill hints, marked to perform a fill request after layout if
* the field does not trigger a fill request.
*
* @hide
*/
- public void enableFillRequestActivityStarted() {
- mRequireAutofill = true;
+ public void enableFillRequestActivityStarted(View v) {
+ if (mRequireAutofill) {
+ return;
+ }
+
+ if (mIsFillDialogEnabled
+ || ArrayUtils.containsAny(v.getAutofillHints(), mFillDialogEnabledHints)) {
+ if (sDebug) {
+ Log.d(TAG, "Trigger fill request at starting");
+ }
+ mRequireAutofill = true;
+ }
}
private boolean hasFillDialogUiFeature() {
- return mIsFillDialogEnabled;
+ return mIsFillDialogEnabled || !ArrayUtils.isEmpty(mFillDialogEnabledHints);
}
/**
@@ -1911,7 +1958,7 @@
if (newClientState != null) {
responseData.putBundle(EXTRA_CLIENT_STATE, newClientState);
}
- if (data.getExtras().containsKey(EXTRA_AUTHENTICATION_RESULT_EPHEMERAL_DATASET)) {
+ if (data.hasExtra(EXTRA_AUTHENTICATION_RESULT_EPHEMERAL_DATASET)) {
responseData.putBoolean(EXTRA_AUTHENTICATION_RESULT_EPHEMERAL_DATASET,
data.getBooleanExtra(EXTRA_AUTHENTICATION_RESULT_EPHEMERAL_DATASET,
false));
@@ -2977,6 +3024,8 @@
pw.print(pfx); pw.print("compat mode enabled: ");
synchronized (mLock) {
pw.print(pfx); pw.print("fill dialog enabled: "); pw.println(mIsFillDialogEnabled);
+ pw.print(pfx); pw.print("fill dialog enabled hints: ");
+ pw.println(Arrays.toString(mFillDialogEnabledHints));
if (mCompatibilityBridge != null) {
final String pfx2 = pfx + " ";
pw.println("true");
diff --git a/core/java/android/view/inputmethod/IAccessibilityInputMethodSessionInvoker.java b/core/java/android/view/inputmethod/IAccessibilityInputMethodSessionInvoker.java
new file mode 100644
index 0000000..240e38b
--- /dev/null
+++ b/core/java/android/view/inputmethod/IAccessibilityInputMethodSessionInvoker.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.view.inputmethod;
+
+import android.annotation.AnyThread;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
+
+final class IAccessibilityInputMethodSessionInvoker {
+ private static final String TAG = "IAccessibilityInputMethodSessionInvoker";
+
+ /**
+ * The actual instance of the method to make calls on it.
+ */
+ @NonNull
+ private final IAccessibilityInputMethodSession mSession;
+
+ private IAccessibilityInputMethodSessionInvoker(
+ @NonNull IAccessibilityInputMethodSession session) {
+ mSession = session;
+ }
+
+ /**
+ * Create a {@link IAccessibilityInputMethodSessionInvoker} instance if applicable.
+ *
+ * @param session {@link IAccessibilityInputMethodSession} object to be wrapped.
+ * @return an instance of {@link IAccessibilityInputMethodSessionInvoker} if
+ * {@code inputMethodSession} is not {@code null}. {@code null} otherwise.
+ */
+ @Nullable
+ public static IAccessibilityInputMethodSessionInvoker createOrNull(
+ @NonNull IAccessibilityInputMethodSession session) {
+ return session == null ? null : new IAccessibilityInputMethodSessionInvoker(session);
+ }
+
+ @AnyThread
+ void finishInput() {
+ try {
+ mSession.finishInput();
+ } catch (RemoteException e) {
+ Log.w(TAG, "A11yIME died", e);
+ }
+ }
+
+ @AnyThread
+ void updateSelection(int oldSelStart, int oldSelEnd, int selStart, int selEnd,
+ int candidatesStart, int candidatesEnd) {
+ try {
+ mSession.updateSelection(
+ oldSelStart, oldSelEnd, selStart, selEnd, candidatesStart, candidatesEnd);
+ } catch (RemoteException e) {
+ Log.w(TAG, "A11yIME died", e);
+ }
+ }
+
+ @AnyThread
+ void invalidateInput(EditorInfo editorInfo, IRemoteAccessibilityInputConnection connection,
+ int sessionId) {
+ try {
+ mSession.invalidateInput(editorInfo, connection, sessionId);
+ } catch (RemoteException e) {
+ Log.w(TAG, "A11yIME died", e);
+ }
+ }
+}
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 805f8e7..8502568 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -93,6 +93,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.inputmethod.DirectBootAwareness;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
import com.android.internal.inputmethod.ImeTracing;
import com.android.internal.inputmethod.InputBindResult;
import com.android.internal.inputmethod.InputMethodDebug;
@@ -506,8 +507,8 @@
*/
@Nullable
@GuardedBy("mH")
- private final SparseArray<InputMethodSessionWrapper> mAccessibilityInputMethodSession =
- new SparseArray<>();
+ private final SparseArray<IAccessibilityInputMethodSessionInvoker>
+ mAccessibilityInputMethodSession = new SparseArray<>();
InputChannel mCurChannel;
ImeInputEventSender mCurSender;
@@ -542,6 +543,7 @@
static final int MSG_BIND_ACCESSIBILITY_SERVICE = 11;
static final int MSG_UNBIND_ACCESSIBILITY_SERVICE = 12;
static final int MSG_UPDATE_VIRTUAL_DISPLAY_TO_SCREEN_MATRIX = 30;
+ static final int MSG_ON_SHOW_REQUESTED = 31;
private static boolean isAutofillUIShowing(View servedView) {
AutofillManager afm = servedView.getContext().getSystemService(AutofillManager.class);
@@ -669,7 +671,8 @@
if (mCurrentInputMethodSession != null) {
mCurrentInputMethodSession.finishInput();
}
- forAccessibilitySessions(InputMethodSessionWrapper::finishInput);
+ forAccessibilitySessionsLocked(
+ IAccessibilityInputMethodSessionInvoker::finishInput);
}
}
@@ -730,7 +733,7 @@
focusedView.getWindowToken(), startInputFlags, softInputMode,
windowFlags,
null,
- null,
+ null, null,
mCurRootView.mContext.getApplicationInfo().targetSdkVersion);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
@@ -963,13 +966,13 @@
// we send a notification so that the a11y service knows the session is
// registered and update the a11y service with the current cursor positions.
if (res.accessibilitySessions != null) {
- InputMethodSessionWrapper wrapper =
- InputMethodSessionWrapper.createOrNull(
+ IAccessibilityInputMethodSessionInvoker invoker =
+ IAccessibilityInputMethodSessionInvoker.createOrNull(
res.accessibilitySessions.get(id));
- if (wrapper != null) {
- mAccessibilityInputMethodSession.put(id, wrapper);
+ if (invoker != null) {
+ mAccessibilityInputMethodSession.put(id, invoker);
if (mServedInputConnection != null) {
- wrapper.updateSelection(mInitialSelStart, mInitialSelEnd,
+ invoker.updateSelection(mInitialSelStart, mInitialSelEnd,
mCursorSelStart, mCursorSelEnd, mCursorCandStart,
mCursorCandEnd);
} else {
@@ -978,9 +981,7 @@
// binds before or after input starts, it may wonder if it binds
// after input starts, why it doesn't receive a notification of
// the current cursor positions.
- wrapper.updateSelection(-1, -1,
- -1, -1, -1,
- -1);
+ invoker.updateSelection(-1, -1, -1, -1, -1, -1);
}
}
}
@@ -1117,6 +1118,14 @@
}
return;
}
+ case MSG_ON_SHOW_REQUESTED: {
+ synchronized (mH) {
+ if (mImeInsetsConsumer != null) {
+ mImeInsetsConsumer.onShowRequested();
+ }
+ }
+ return;
+ }
}
}
}
@@ -1834,6 +1843,9 @@
return false;
}
+ // Makes sure to call ImeInsetsSourceConsumer#onShowRequested on the UI thread.
+ // TODO(b/229426865): call WindowInsetsController#show instead.
+ mH.executeOrSendMessage(Message.obtain(mH, MSG_ON_SHOW_REQUESTED));
try {
Log.d(TAG, "showSoftInput() view=" + view + " flags=" + flags + " reason="
+ InputMethodDebug.softInputDisplayReasonToString(reason));
@@ -1869,6 +1881,9 @@
Log.w(TAG, "No current root view, ignoring showSoftInputUnchecked()");
return;
}
+ // Makes sure to call ImeInsetsSourceConsumer#onShowRequested on the UI thread.
+ // TODO(b/229426865): call WindowInsetsController#show instead.
+ mH.executeOrSendMessage(Message.obtain(mH, MSG_ON_SHOW_REQUESTED));
mService.showSoftInput(
mClient,
mCurRootView.getView().getWindowToken(),
@@ -2148,8 +2163,10 @@
editorInfo.setInitialSurroundingTextInternal(textSnapshot.getSurroundingText());
mCurrentInputMethodSession.invalidateInput(editorInfo, mServedInputConnection,
sessionId);
- forAccessibilitySessions(wrapper -> wrapper.invalidateInput(editorInfo,
- mServedInputConnection, sessionId));
+ final IRemoteAccessibilityInputConnection accessibilityInputConnection =
+ mServedInputConnection.asIRemoteAccessibilityInputConnection();
+ forAccessibilitySessionsLocked(wrapper -> wrapper.invalidateInput(editorInfo,
+ accessibilityInputConnection, sessionId));
return true;
}
}
@@ -2323,6 +2340,8 @@
res = mService.startInputOrWindowGainedFocus(
startInputReason, mClient, windowGainingFocus, startInputFlags,
softInputMode, windowFlags, tba, servedInputConnection,
+ servedInputConnection == null ? null
+ : servedInputConnection.asIRemoteAccessibilityInputConnection(),
view.getContext().getApplicationInfo().targetSdkVersion);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
@@ -2347,8 +2366,9 @@
mAccessibilityInputMethodSession.clear();
if (res.accessibilitySessions != null) {
for (int i = 0; i < res.accessibilitySessions.size(); i++) {
- InputMethodSessionWrapper wrapper = InputMethodSessionWrapper.createOrNull(
- res.accessibilitySessions.valueAt(i));
+ IAccessibilityInputMethodSessionInvoker wrapper =
+ IAccessibilityInputMethodSessionInvoker.createOrNull(
+ res.accessibilitySessions.valueAt(i));
if (wrapper != null) {
mAccessibilityInputMethodSession.append(
res.accessibilitySessions.keyAt(i), wrapper);
@@ -2516,7 +2536,7 @@
}
/**
- * Notify IME directly that it is no longer visible.
+ * Notify IMMS that IME insets are no longer visible.
*
* @param windowToken the window from which this request originates. If this doesn't match the
* currently served view, the request is ignored.
@@ -2528,7 +2548,13 @@
synchronized (mH) {
if (mCurrentInputMethodSession != null && mCurRootView != null
&& mCurRootView.getWindowToken() == windowToken) {
- mCurrentInputMethodSession.notifyImeHidden();
+ try {
+ mService.hideSoftInput(mClient, windowToken, 0 /* flags */,
+ null /* resultReceiver */,
+ SoftInputShowHideReason.HIDE_SOFT_INPUT);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
}
}
@@ -2598,7 +2624,7 @@
mCursorCandEnd = candidatesEnd;
mCurrentInputMethodSession.updateSelection(
oldSelStart, oldSelEnd, selStart, selEnd, candidatesStart, candidatesEnd);
- forAccessibilitySessions(wrapper -> wrapper.updateSelection(oldSelStart,
+ forAccessibilitySessionsLocked(wrapper -> wrapper.updateSelection(oldSelStart,
oldSelEnd, selStart, selEnd, candidatesStart, candidatesEnd));
}
}
@@ -3658,7 +3684,8 @@
}
}
- private void forAccessibilitySessions(Consumer<InputMethodSessionWrapper> consumer) {
+ private void forAccessibilitySessionsLocked(
+ Consumer<IAccessibilityInputMethodSessionInvoker> consumer) {
for (int i = 0; i < mAccessibilityInputMethodSession.size(); i++) {
consumer.accept(mAccessibilityInputMethodSession.valueAt(i));
}
diff --git a/core/java/android/view/inputmethod/InputMethodSession.java b/core/java/android/view/inputmethod/InputMethodSession.java
index a178ee8..28c4450 100644
--- a/core/java/android/view/inputmethod/InputMethodSession.java
+++ b/core/java/android/view/inputmethod/InputMethodSession.java
@@ -195,13 +195,6 @@
public void updateCursorAnchorInfo(CursorAnchorInfo cursorAnchorInfo);
/**
- * Notifies {@link android.inputmethodservice.InputMethodService} that IME has been
- * hidden from user.
- * @hide
- */
- public void notifyImeHidden();
-
- /**
* Notify IME directly to remove surface as it is no longer visible.
* @hide
*/
diff --git a/core/java/android/view/inputmethod/InputMethodSessionWrapper.java b/core/java/android/view/inputmethod/InputMethodSessionWrapper.java
index a199520..ee22b65 100644
--- a/core/java/android/view/inputmethod/InputMethodSessionWrapper.java
+++ b/core/java/android/view/inputmethod/InputMethodSessionWrapper.java
@@ -106,15 +106,6 @@
}
@AnyThread
- void notifyImeHidden() {
- try {
- mSession.notifyImeHidden();
- } catch (RemoteException e) {
- Log.w(TAG, "IME died", e);
- }
- }
-
- @AnyThread
void viewClicked(boolean focusChanged) {
try {
mSession.viewClicked(focusChanged);
diff --git a/core/java/android/view/translation/UiTranslationStateCallback.java b/core/java/android/view/translation/UiTranslationStateCallback.java
index 3ccca5f..96b6f8c 100644
--- a/core/java/android/view/translation/UiTranslationStateCallback.java
+++ b/core/java/android/view/translation/UiTranslationStateCallback.java
@@ -25,14 +25,28 @@
* Callback for listening to UI Translation state changes. See {@link
* UiTranslationManager#registerUiTranslationStateCallback(Executor, UiTranslationStateCallback)}.
* <p>
- * Prior to Android version {@link android.os.Build.VERSION_CODES#TIRAMISU}, callback methods
- * <em>without</em> {@code packageName} are invoked. Apps with minSdkVersion lower than {@link
- * android.os.Build.VERSION_CODES#TIRAMISU} <em>must</em> implement those methods if they want to
- * handle the events.
+ * Prior to Android version {@link android.os.Build.VERSION_CODES#TIRAMISU}:
+ * <ul>
+ * <li>Callback methods <em>without</em> {@code packageName} are invoked. Apps with
+ * minSdkVersion lower than {@link android.os.Build.VERSION_CODES#TIRAMISU} <em>must</em>
+ * implement those methods if they want to handle the events.</li>
+ * <li>Callback methods for a particular event <em>may</em> be called multiple times
+ * consecutively, even when the translation state has not changed (e.g.,
+ * {@link #onStarted(ULocale, ULocale, String)} may be called multiple times even after
+ * translation has already started).</li>
+ * </ul>
* <p>
- * In Android version {@link android.os.Build.VERSION_CODES#TIRAMISU} and later, if both methods
- * with and without {@code packageName} are implemented (e.g., {@link #onFinished()} and {@link
- * #onFinished(String)}, only the one <em>with</em> {@code packageName} will be called.
+ * In Android version {@link android.os.Build.VERSION_CODES#TIRAMISU} and later:
+ * <ul>
+ * <li>If both methods with and without {@code packageName} are implemented (e.g.,
+ * {@link #onFinished()} and {@link #onFinished(String)}, only the one <em>with</em> {@code
+ * packageName} will be called.</li>
+ * <li>Callback methods for a particular event will <em>not</em> be called multiple times
+ * consecutively. They will only be called when the translation state has actually changed
+ * (e.g., from "started" to "paused"). Note: "resumed" is not considered a separate state
+ * from "started", so {@link #onResumed(ULocale, ULocale, String)} will never be called after
+ * {@link #onStarted(ULocale, ULocale, String)}.<</li>
+ * </ul>
*/
public interface UiTranslationStateCallback {
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index 2c62647..41ff69d 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -32,6 +32,7 @@
import android.database.ContentObserver;
import android.os.Build;
import android.os.Handler;
+import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.PluralsMessageFormatter;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -230,7 +231,7 @@
// Set the text
String text = format.format(new Date(time));
- setText(text);
+ maybeSetText(text);
// Schedule the next update
if (display == SHOW_TIME) {
@@ -258,7 +259,7 @@
boolean past = (now >= mTimeMillis);
String result;
if (duration < MINUTE_IN_MILLIS) {
- setText(mNowText);
+ maybeSetText(mNowText);
mUpdateTimeMillis = mTimeMillis + MINUTE_IN_MILLIS + 1;
return;
} else if (duration < HOUR_IN_MILLIS) {
@@ -308,7 +309,19 @@
mUpdateTimeMillis = mTimeMillis - millisIncrease * count + 1;
}
}
- setText(result);
+ maybeSetText(result);
+ }
+
+ /**
+ * Sets text only if the text has actually changed. This prevents needles relayouts of this
+ * view when set to wrap_content.
+ */
+ private void maybeSetText(String text) {
+ if (TextUtils.equals(getText(), text)) {
+ return;
+ }
+
+ setText(text);
}
/**
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index fbad38f..2879cd8 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -1588,24 +1588,33 @@
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
ArrayList<Bitmap> mBitmaps;
+ SparseIntArray mBitmapHashes;
int mBitmapMemory = -1;
public BitmapCache() {
mBitmaps = new ArrayList<>();
+ mBitmapHashes = new SparseIntArray();
}
public BitmapCache(Parcel source) {
mBitmaps = source.createTypedArrayList(Bitmap.CREATOR);
+ mBitmapHashes = source.readSparseIntArray();
}
public int getBitmapId(Bitmap b) {
if (b == null) {
return -1;
} else {
- if (mBitmaps.contains(b)) {
- return mBitmaps.indexOf(b);
+ int hash = b.hashCode();
+ int hashId = mBitmapHashes.get(hash, -1);
+ if (hashId != -1) {
+ return hashId;
} else {
+ if (b.isMutable()) {
+ b = b.asShared();
+ }
mBitmaps.add(b);
+ mBitmapHashes.put(mBitmaps.size() - 1, hash);
mBitmapMemory = -1;
return (mBitmaps.size() - 1);
}
@@ -1616,13 +1625,13 @@
public Bitmap getBitmapForId(int id) {
if (id == -1 || id >= mBitmaps.size()) {
return null;
- } else {
- return mBitmaps.get(id);
}
+ return mBitmaps.get(id);
}
public void writeBitmapsToParcel(Parcel dest, int flags) {
dest.writeTypedList(mBitmaps, flags);
+ dest.writeSparseIntArray(mBitmapHashes);
}
public int getBitmapMemory() {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 54c0d7c..93f7264 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -6974,6 +6974,18 @@
mEditor.mInputType = type;
}
+ @Override
+ public String[] getAutofillHints() {
+ String[] hints = super.getAutofillHints();
+ if (isAnyPasswordInputType()) {
+ if (!ArrayUtils.contains(hints, AUTOFILL_HINT_PASSWORD_AUTO)) {
+ hints = ArrayUtils.appendElement(String.class, hints,
+ AUTOFILL_HINT_PASSWORD_AUTO);
+ }
+ }
+ return hints;
+ }
+
/**
* @return {@code null} if the key listener should use pre-O (locale-independent). Otherwise
* a {@code Locale} object that can be used to customize key various listeners.
diff --git a/core/java/android/window/ITaskFragmentOrganizer.aidl b/core/java/android/window/ITaskFragmentOrganizer.aidl
index cdfa206..8dfda7d 100644
--- a/core/java/android/window/ITaskFragmentOrganizer.aidl
+++ b/core/java/android/window/ITaskFragmentOrganizer.aidl
@@ -16,6 +16,7 @@
package android.window;
+import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.IBinder;
@@ -48,4 +49,20 @@
* {@link TaskFragmentOrganizer#putExceptionInBundle}.
*/
void onTaskFragmentError(in IBinder errorCallbackToken, in Bundle exceptionBundle);
+
+ /**
+ * Called when an Activity is reparented to the Task with organized TaskFragment. For example,
+ * when an Activity enters and then exits Picture-in-picture, it will be reparented back to its
+ * orginial Task. In this case, we need to notify the organizer so that it can check if the
+ * Activity matches any split rule.
+ *
+ * @param taskId The Task that the activity is reparented to.
+ * @param activityIntent The intent that the activity is original launched with.
+ * @param activityToken If the activity belongs to the same process as the organizer, this
+ * will be the actual activity token; if the activity belongs to a
+ * different process, the server will generate a temporary token that
+ * the organizer can use to reparent the activity through
+ * {@link WindowContainerTransaction} if needed.
+ */
+ void onActivityReparentToTask(int taskId, in Intent activityIntent, in IBinder activityToken);
}
diff --git a/core/java/android/window/ITaskOrganizerController.aidl b/core/java/android/window/ITaskOrganizerController.aidl
index 172456e4..e6bb1f6 100644
--- a/core/java/android/window/ITaskOrganizerController.aidl
+++ b/core/java/android/window/ITaskOrganizerController.aidl
@@ -69,4 +69,14 @@
/** Updates a state of camera compat control for stretched issues in the viewfinder. */
void updateCameraCompatControlState(in WindowContainerToken task, int state);
+
+ /**
+ * Controls whether ignore orientation request logic in {@link
+ * com.android.server.wm.DisplayArea} is disabled at runtime.
+ *
+ * @param isDisabled when {@code true}, the system always ignores the value of {@link
+ * com.android.server.wm.DisplayArea#getIgnoreOrientationRequest} and app
+ * requested orientation is respected.
+ */
+ void setIsIgnoreOrientationRequestDisabled(boolean isDisabled);
}
diff --git a/core/java/android/window/SurfaceSyncer.md b/core/java/android/window/SurfaceSyncer.md
new file mode 100644
index 0000000..1394bd1
--- /dev/null
+++ b/core/java/android/window/SurfaceSyncer.md
@@ -0,0 +1,80 @@
+## SurfaceSyncer
+
+### Overview
+
+A generic way for data to be gathered so multiple surfaces can be synced. This is intended to be used with Views, SurfaceView, and any other surface that wants to be involved in a sync. This allows different parts of the Android system to synchronize different windows and layers themselves without having to go through WindowManagerService
+
+### Code
+
+SurfaceSyncer is a class that manages sync requests and reports back when all participants in the sync are ready.
+
+##### setupSync
+The first step is to create a sync request. This is done by calling `setupSync`.
+There are two setupSync methods: one that accepts a `Runnable` and one that accepts a `Consumer<Transaction>`. The `setupSync(Runnable)` will automatically apply the final transaction and invokes the Runnable to notify the caller that the sync is complete. The `Runnable` can be null since not all cases care about the sync being complete. The second `setupSync(Consumer<Transaction>)` should only be used by ViewRootImpl. The purpose of this one is to allow the caller to get back the merged transaction without it being applied. ViewRootImpl uses it to send the transaction to WindowManagerService to be synced there. Using this one for other cases is unsafe because the caller may hold the transaction longer than expected and prevent buffers from being latched and released.
+
+The setupSync returns a syncId which is used for the other APIs
+
+##### markSyncReady
+
+When the caller has added all the `SyncTarget` to the sync, they should call `markSyncReady(syncId)` If the caller doesn't call this, the sync will never complete since the SurfaceSyncer wants to give the caller a chance to add all the SyncTargets before considering the sync ready. Before `markSyncReady` is called, the `SyncTargets` can actually produce a frame, which will just be held in a transaction until all other `SyncTargets` are ready AND `markSyncReady` has been called. Once markSyncReady has been called, you cannot add any more `SyncTargets` to that particular syncId.
+
+##### addToSync
+
+The caller will invoke `addToSync` for every `SyncTarget` that it wants included. The caller must specify which syncId they want to add the `SyncTarget` too since there can be multiple syncs open at the same time. There are a few helper methods since the most common cases are Views and SurfaceView
+* `addToSync(int syncId, View)` - This is used for syncing the root of the View, specificially the ViewRootImpl
+* `addToSync(int syncId, SurfaceView, Consumer<SurfaceViewFrameCallback>)` - This is to sync a SurfaceView. Since SurfaceViews are rendered by the app, the caller will be expected to provide a way to get back the buffer to sync. More details about that [below](#surfaceviewframecallback)
+* `addToSync(int syncId, SyncTarget)` - This is the generic method. It can be used to sync arbitrary info. The SyncTarget interface has required methods that need to be implemented to properly get the transaction to sync.
+
+When calling addToSync with either View or SurfaceView, it must occur on the UI Thread. This is to ensure consistent behavior, where any UI changes done while still on the UI thread are included in this frame. The next vsync will pick up those changes and request to draw.
+
+##### addTransactionToSync
+
+This is a simple method that allows callers to add generic Transactions to the sync. The caller invokes `addTransactionToSync(int syncId, Transaction)`. This can be used for things that need to be synced with content, but aren't updating content themselves.
+
+##### SyncTarget
+
+This interface is used to handle syncs. The interface has two methods
+* `onReadyToSync(SyncBufferCallback)` - This one must be implemented. The sync will notify the `SyncTarget` so it can invoke the `SyncBufferCallback`, letting the sync know when it's ready.
+* `onSyncComplete()` - This method is optional. It's used to notify the `SyncTarget` that the entire sync is complete. This is similar to the callback sent in `setupSync`, but it's invoked to the `SyncTargets` rather than the caller who started the sync. This is used by ViewRootImpl to restore the state when the entire sync is done
+
+When syncing ViewRootImpl, these methods are implemented already since ViewRootImpl handles the rendering requests and timing.
+
+##### SyncBufferCallback
+
+This interface is used to tell the sync that this SyncTarget is ready. There's only method here, `onBufferReady(Transaction)`, that sends back the transaction that contains the data to be synced, normally with a buffer.
+
+##### SurfaceViewFrameCallback
+
+As mentioned above, SurfaceViews are a special case because the buffers produced are handled by the app, and not the framework. Because of this, the syncer doesn't know which frame to sync. Therefore, to sync SurfaceViews, the caller must provide a way to notify the syncer that it's going to render a buffer and that this next buffer is the one to sync. The `SurfaceViewFrameCallback` has one method `onFrameStarted()`. When this is invoked, the Syncer sets up a request to sync the next buffer for the SurfaceView.
+
+
+### Example
+
+A simple example where you want to sync two windows and also include a transaction in the sync
+
+```java
+SurfaceSyncer syncer = new SurfaceSyncer();
+int syncId = syncer.setupSync(() -> {
+ Log.d(TAG, "syncComplete");
+};
+syncer.addToSync(syncId, view1);
+syncer.addToSync(syncId, view2);
+syncer.addTransactionToSync(syncId, transaction);
+syncer.markSyncReady(syncId);
+```
+
+A SurfaceView example:
+See `frameworks/base/tests/SurfaceViewSyncTest` for a working example
+
+```java
+SurfaceSyncer syncer = new SurfaceSyncer();
+int syncId = syncer.setupSync(() -> {
+ Log.d(TAG, "syncComplete");
+};
+syncer.addToSync(syncId, container);
+syncer.addToSync(syncId, surfaceView, frameCallback -> {
+ // Call this when the SurfaceView is ready to render a new frame with the changes.
+ frameCallback.onFrameStarted()
+}
+syncer.markSyncReady(syncId);
+```
\ No newline at end of file
diff --git a/core/java/android/window/TaskFragmentOrganizer.java b/core/java/android/window/TaskFragmentOrganizer.java
index 1d1deac..2ef49c3 100644
--- a/core/java/android/window/TaskFragmentOrganizer.java
+++ b/core/java/android/window/TaskFragmentOrganizer.java
@@ -19,6 +19,7 @@
import android.annotation.CallSuper;
import android.annotation.NonNull;
import android.annotation.TestApi;
+import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.IBinder;
@@ -154,6 +155,24 @@
public void onTaskFragmentError(
@NonNull IBinder errorCallbackToken, @NonNull Throwable exception) {}
+ /**
+ * Called when an Activity is reparented to the Task with organized TaskFragment. For example,
+ * when an Activity enters and then exits Picture-in-picture, it will be reparented back to its
+ * orginial Task. In this case, we need to notify the organizer so that it can check if the
+ * Activity matches any split rule.
+ *
+ * @param taskId The Task that the activity is reparented to.
+ * @param activityIntent The intent that the activity is original launched with.
+ * @param activityToken If the activity belongs to the same process as the organizer, this
+ * will be the actual activity token; if the activity belongs to a
+ * different process, the server will generate a temporary token that
+ * the organizer can use to reparent the activity through
+ * {@link WindowContainerTransaction} if needed.
+ * @hide
+ */
+ public void onActivityReparentToTask(int taskId, @NonNull Intent activityIntent,
+ @NonNull IBinder activityToken) {}
+
@Override
public void applyTransaction(@NonNull WindowContainerTransaction t) {
t.setTaskFragmentOrganizer(mInterface);
@@ -203,6 +222,14 @@
errorCallbackToken,
(Throwable) exceptionBundle.getSerializable(KEY_ERROR_CALLBACK_EXCEPTION)));
}
+
+ @Override
+ public void onActivityReparentToTask(int taskId, @NonNull Intent activityIntent,
+ @NonNull IBinder activityToken) {
+ mExecutor.execute(
+ () -> TaskFragmentOrganizer.this.onActivityReparentToTask(
+ taskId, activityIntent, activityToken));
+ }
};
private final TaskFragmentOrganizerToken mToken = new TaskFragmentOrganizerToken(mInterface);
diff --git a/core/java/android/window/TaskOrganizer.java b/core/java/android/window/TaskOrganizer.java
index 8d88f80..bffd4e4 100644
--- a/core/java/android/window/TaskOrganizer.java
+++ b/core/java/android/window/TaskOrganizer.java
@@ -253,6 +253,24 @@
}
/**
+ * Controls whether ignore orientation request logic in {@link
+ * com.android.server.wm.DisplayArea} is disabled at runtime.
+ *
+ * @param isDisabled when {@code true}, the system always ignores the value of {@link
+ * com.android.server.wm.DisplayArea#getIgnoreOrientationRequest} and app
+ * requested orientation is respected.
+ * @hide
+ */
+ @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS)
+ public void setIsIgnoreOrientationRequestDisabled(boolean isDisabled) {
+ try {
+ mTaskOrganizerController.setIsIgnoreOrientationRequestDisabled(isDisabled);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Gets the executor to run callbacks on.
* @hide
*/
diff --git a/core/java/android/window/WindowContainerTransaction.java b/core/java/android/window/WindowContainerTransaction.java
index f2db564..79dac19 100644
--- a/core/java/android/window/WindowContainerTransaction.java
+++ b/core/java/android/window/WindowContainerTransaction.java
@@ -396,8 +396,6 @@
/**
* Sets the container as launch adjacent flag root. Task starting with
* {@link FLAG_ACTIVITY_LAUNCH_ADJACENT} will be launching to.
- *
- * @hide
*/
@NonNull
public WindowContainerTransaction setLaunchAdjacentFlagRoot(
@@ -409,8 +407,6 @@
/**
* Clears launch adjacent flag root for the display area of passing container.
- *
- * @hide
*/
@NonNull
public WindowContainerTransaction clearLaunchAdjacentFlagRoot(
diff --git a/core/java/com/android/internal/app/AbstractResolverComparator.java b/core/java/com/android/internal/app/AbstractResolverComparator.java
index 42fc7bd..9759540 100644
--- a/core/java/com/android/internal/app/AbstractResolverComparator.java
+++ b/core/java/com/android/internal/app/AbstractResolverComparator.java
@@ -228,12 +228,6 @@
*/
abstract float getScore(ComponentName name);
- /**
- * Returns the list of top K component names which have highest
- * {@link #getScore(ComponentName)}
- */
- abstract List<ComponentName> getTopComponentNames(int topK);
-
/** Handles result message sent to mHandler. */
abstract void handleResultMessage(Message message);
diff --git a/core/java/com/android/internal/app/AppPredictionServiceResolverComparator.java b/core/java/com/android/internal/app/AppPredictionServiceResolverComparator.java
index bc9eff0..b19ac2f 100644
--- a/core/java/com/android/internal/app/AppPredictionServiceResolverComparator.java
+++ b/core/java/com/android/internal/app/AppPredictionServiceResolverComparator.java
@@ -18,6 +18,7 @@
import static android.app.prediction.AppTargetEvent.ACTION_LAUNCH;
+import android.annotation.Nullable;
import android.app.prediction.AppPredictor;
import android.app.prediction.AppTarget;
import android.app.prediction.AppTargetEvent;
@@ -33,12 +34,11 @@
import com.android.internal.app.ResolverActivity.ResolvedComponentInfo;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.concurrent.Executors;
-import java.util.stream.Collectors;
/**
* Uses an {@link AppPredictor} to sort Resolver targets. If the AppPredictionService appears to be
@@ -58,7 +58,9 @@
private final String mReferrerPackage;
// If this is non-null (and this is not destroyed), it means APS is disabled and we should fall
// back to using the ResolverRankerService.
+ // TODO: responsibility for this fallback behavior can live outside of the AppPrediction client.
private ResolverRankerServiceResolverComparator mResolverRankerService;
+ private AppPredictionServiceComparatorModel mComparatorModel;
AppPredictionServiceResolverComparator(
Context context,
@@ -74,25 +76,12 @@
mUser = user;
mReferrerPackage = referrerPackage;
setChooserActivityLogger(chooserActivityLogger);
+ mComparatorModel = buildUpdatedModel();
}
@Override
int compare(ResolveInfo lhs, ResolveInfo rhs) {
- if (mResolverRankerService != null) {
- return mResolverRankerService.compare(lhs, rhs);
- }
- Integer lhsRank = mTargetRanks.get(new ComponentName(lhs.activityInfo.packageName,
- lhs.activityInfo.name));
- Integer rhsRank = mTargetRanks.get(new ComponentName(rhs.activityInfo.packageName,
- rhs.activityInfo.name));
- if (lhsRank == null && rhsRank == null) {
- return 0;
- } else if (lhsRank == null) {
- return -1;
- } else if (rhsRank == null) {
- return 1;
- }
- return lhsRank - rhsRank;
+ return mComparatorModel.getComparator().compare(lhs, rhs);
}
@Override
@@ -121,6 +110,7 @@
mContext, mIntent, mReferrerPackage,
() -> mHandler.sendEmptyMessage(RANKER_SERVICE_RESULT),
getChooserActivityLogger());
+ mComparatorModel = buildUpdatedModel();
mResolverRankerService.compute(targets);
} else {
Log.i(TAG, "AppPredictionService response received");
@@ -163,6 +153,7 @@
mTargetRanks.put(componentName, i);
Log.i(TAG, "handleSortedAppTargets, sortedAppTargets #" + i + ": " + componentName);
}
+ mComparatorModel = buildUpdatedModel();
}
private boolean checkAppTargetRankValid(List<AppTarget> sortedAppTargets) {
@@ -176,43 +167,12 @@
@Override
float getScore(ComponentName name) {
- if (mResolverRankerService != null) {
- return mResolverRankerService.getScore(name);
- }
- Integer rank = mTargetRanks.get(name);
- if (rank == null) {
- Log.w(TAG, "Score requested for unknown component. Did you call compute yet?");
- return 0f;
- }
- int consecutiveSumOfRanks = (mTargetRanks.size() - 1) * (mTargetRanks.size()) / 2;
- return 1.0f - (((float) rank) / consecutiveSumOfRanks);
- }
-
- @Override
- List<ComponentName> getTopComponentNames(int topK) {
- if (mResolverRankerService != null) {
- return mResolverRankerService.getTopComponentNames(topK);
- }
- return mTargetRanks.entrySet().stream()
- .sorted(Entry.comparingByValue())
- .limit(topK)
- .map(Entry::getKey)
- .collect(Collectors.toList());
+ return mComparatorModel.getScore(name);
}
@Override
void updateModel(ComponentName componentName) {
- if (mResolverRankerService != null) {
- mResolverRankerService.updateModel(componentName);
- return;
- }
- mAppPredictor.notifyAppTargetEvent(
- new AppTargetEvent.Builder(
- new AppTarget.Builder(
- new AppTargetId(componentName.toString()),
- componentName.getPackageName(), mUser)
- .setClassName(componentName.getClassName()).build(),
- ACTION_LAUNCH).build());
+ mComparatorModel.notifyOnTargetSelected(componentName);
}
@Override
@@ -220,6 +180,97 @@
if (mResolverRankerService != null) {
mResolverRankerService.destroy();
mResolverRankerService = null;
+ mComparatorModel = buildUpdatedModel();
+ }
+ }
+
+ /**
+ * Re-construct an {@code AppPredictionServiceComparatorModel} to replace the current model
+ * instance (if any) using the up-to-date {@code AppPredictionServiceResolverComparator} ivar
+ * values.
+ *
+ * TODO: each time we replace the model instance, we're either updating the model to use
+ * adjusted data (which is appropriate), or we're providing a (late) value for one of our ivars
+ * that wasn't available the last time the model was updated. For those latter cases, we should
+ * just avoid creating the model altogether until we have all the prerequisites we'll need. Then
+ * we can probably simplify the logic in {@code AppPredictionServiceComparatorModel} since we
+ * won't need to handle edge cases when the model data isn't fully prepared.
+ * (In some cases, these kinds of "updates" might interleave -- e.g., we might have finished
+ * initializing the first time and now want to adjust some data, but still need to wait for
+ * changes to propagate to the other ivars before rebuilding the model.)
+ */
+ private AppPredictionServiceComparatorModel buildUpdatedModel() {
+ return new AppPredictionServiceComparatorModel(
+ mAppPredictor, mResolverRankerService, mUser, mTargetRanks);
+ }
+
+ // TODO: Finish separating behaviors of AbstractResolverComparator, then (probably) make this a
+ // standalone class once clients are written in terms of ResolverComparatorModel.
+ static class AppPredictionServiceComparatorModel implements ResolverComparatorModel {
+ private final AppPredictor mAppPredictor;
+ private final ResolverRankerServiceResolverComparator mResolverRankerService;
+ private final UserHandle mUser;
+ private final Map<ComponentName, Integer> mTargetRanks; // Treat as immutable.
+
+ AppPredictionServiceComparatorModel(
+ AppPredictor appPredictor,
+ @Nullable ResolverRankerServiceResolverComparator resolverRankerService,
+ UserHandle user,
+ Map<ComponentName, Integer> targetRanks) {
+ mAppPredictor = appPredictor;
+ mResolverRankerService = resolverRankerService;
+ mUser = user;
+ mTargetRanks = targetRanks;
+ }
+
+ @Override
+ public Comparator<ResolveInfo> getComparator() {
+ return (lhs, rhs) -> {
+ if (mResolverRankerService != null) {
+ return mResolverRankerService.compare(lhs, rhs);
+ }
+ Integer lhsRank = mTargetRanks.get(new ComponentName(lhs.activityInfo.packageName,
+ lhs.activityInfo.name));
+ Integer rhsRank = mTargetRanks.get(new ComponentName(rhs.activityInfo.packageName,
+ rhs.activityInfo.name));
+ if (lhsRank == null && rhsRank == null) {
+ return 0;
+ } else if (lhsRank == null) {
+ return -1;
+ } else if (rhsRank == null) {
+ return 1;
+ }
+ return lhsRank - rhsRank;
+ };
+ }
+
+ @Override
+ public float getScore(ComponentName name) {
+ if (mResolverRankerService != null) {
+ return mResolverRankerService.getScore(name);
+ }
+ Integer rank = mTargetRanks.get(name);
+ if (rank == null) {
+ Log.w(TAG, "Score requested for unknown component. Did you call compute yet?");
+ return 0f;
+ }
+ int consecutiveSumOfRanks = (mTargetRanks.size() - 1) * (mTargetRanks.size()) / 2;
+ return 1.0f - (((float) rank) / consecutiveSumOfRanks);
+ }
+
+ @Override
+ public void notifyOnTargetSelected(ComponentName componentName) {
+ if (mResolverRankerService != null) {
+ mResolverRankerService.updateModel(componentName);
+ return;
+ }
+ mAppPredictor.notifyAppTargetEvent(
+ new AppTargetEvent.Builder(
+ new AppTarget.Builder(
+ new AppTargetId(componentName.toString()),
+ componentName.getPackageName(), mUser)
+ .setClassName(componentName.getClassName()).build(),
+ ACTION_LAUNCH).build());
}
}
}
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index d4a8a16..3cb39e7 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -194,9 +194,6 @@
private static final String PLURALS_COUNT = "count";
private static final String PLURALS_FILE_NAME = "file_name";
- @VisibleForTesting
- public static final int LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS = 250;
-
private boolean mIsAppPredictorComponentAvailable;
private Map<ChooserTarget, AppTarget> mDirectShareAppTargetCache;
private Map<ChooserTarget, ShortcutInfo> mDirectShareShortcutInfoCache;
@@ -248,6 +245,13 @@
SystemUiDeviceConfigFlags.IS_NEARBY_SHARE_FIRST_TARGET_IN_RANKED_APP,
DEFAULT_IS_NEARBY_SHARE_FIRST_TARGET_IN_RANKED_APP);
+ private static final int DEFAULT_LIST_VIEW_UPDATE_DELAY_MS = 250;
+
+ @VisibleForTesting
+ int mListViewUpdateDelayMs = DeviceConfig.getInt(DeviceConfig.NAMESPACE_SYSTEMUI,
+ SystemUiDeviceConfigFlags.SHARESHEET_LIST_VIEW_UPDATE_DELAY,
+ DEFAULT_LIST_VIEW_UPDATE_DELAY_MS);
+
private Bundle mReplacementExtras;
private IntentSender mChosenComponentSender;
private IntentSender mRefinementIntentSender;
@@ -1616,29 +1620,48 @@
return getIntent().getBooleanExtra(Intent.EXTRA_AUTO_LAUNCH_SINGLE_CHOICE, true);
}
- private void showTargetDetails(DisplayResolveInfo ti) {
- if (ti == null) return;
+ private void showTargetDetails(TargetInfo targetInfo) {
+ if (targetInfo == null) return;
ArrayList<DisplayResolveInfo> targetList;
+ ChooserTargetActionsDialogFragment fragment = new ChooserTargetActionsDialogFragment();
+ Bundle bundle = new Bundle();
- // For multiple targets, include info on all targets
- if (ti instanceof MultiDisplayResolveInfo) {
- MultiDisplayResolveInfo mti = (MultiDisplayResolveInfo) ti;
+ if (targetInfo instanceof SelectableTargetInfo) {
+ SelectableTargetInfo selectableTargetInfo = (SelectableTargetInfo) targetInfo;
+ if (selectableTargetInfo.getDisplayResolveInfo() == null
+ || selectableTargetInfo.getChooserTarget() == null) {
+ Log.e(TAG, "displayResolveInfo or chooserTarget in selectableTargetInfo are null");
+ return;
+ }
+ targetList = new ArrayList<>();
+ targetList.add(selectableTargetInfo.getDisplayResolveInfo());
+ bundle.putString(ChooserTargetActionsDialogFragment.SHORTCUT_ID_KEY,
+ selectableTargetInfo.getChooserTarget().getIntentExtras().getString(
+ Intent.EXTRA_SHORTCUT_ID));
+ bundle.putBoolean(ChooserTargetActionsDialogFragment.IS_SHORTCUT_PINNED_KEY,
+ selectableTargetInfo.isPinned());
+ bundle.putParcelable(ChooserTargetActionsDialogFragment.INTENT_FILTER_KEY,
+ getTargetIntentFilter());
+ if (selectableTargetInfo.getDisplayLabel() != null) {
+ bundle.putString(ChooserTargetActionsDialogFragment.SHORTCUT_TITLE_KEY,
+ selectableTargetInfo.getDisplayLabel().toString());
+ }
+ } else if (targetInfo instanceof MultiDisplayResolveInfo) {
+ // For multiple targets, include info on all targets
+ MultiDisplayResolveInfo mti = (MultiDisplayResolveInfo) targetInfo;
targetList = mti.getTargets();
} else {
targetList = new ArrayList<DisplayResolveInfo>();
- targetList.add(ti);
+ targetList.add((DisplayResolveInfo) targetInfo);
}
-
- ChooserTargetActionsDialogFragment f = new ChooserTargetActionsDialogFragment();
- Bundle b = new Bundle();
- b.putParcelable(ChooserTargetActionsDialogFragment.USER_HANDLE_KEY,
+ bundle.putParcelable(ChooserTargetActionsDialogFragment.USER_HANDLE_KEY,
mChooserMultiProfilePagerAdapter.getCurrentUserHandle());
- b.putParcelableArrayList(ChooserTargetActionsDialogFragment.TARGET_INFOS_KEY,
+ bundle.putParcelableArrayList(ChooserTargetActionsDialogFragment.TARGET_INFOS_KEY,
targetList);
- f.setArguments(b);
+ fragment.setArguments(bundle);
- f.show(getFragmentManager(), TARGET_DETAILS_FRAGMENT_TAG);
+ fragment.show(getFragmentManager(), TARGET_DETAILS_FRAGMENT_TAG);
}
private void modifyTargetIntent(Intent in) {
@@ -2605,7 +2628,7 @@
Message msg = Message.obtain();
msg.what = ChooserHandler.LIST_VIEW_UPDATE_MESSAGE;
msg.obj = userHandle;
- mChooserHandler.sendMessageDelayed(msg, LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ mChooserHandler.sendMessageDelayed(msg, mListViewUpdateDelayMs);
}
@Override
@@ -2864,8 +2887,10 @@
private boolean shouldShowTargetDetails(TargetInfo ti) {
ComponentName nearbyShare = getNearbySharingComponent();
// Suppress target details for nearby share to hide pin/unpin action
- return !(nearbyShare != null && nearbyShare.equals(ti.getResolvedComponentName())
- && shouldNearbyShareBeFirstInRankedRow());
+ boolean isNearbyShare = nearbyShare != null && nearbyShare.equals(
+ ti.getResolvedComponentName()) && shouldNearbyShareBeFirstInRankedRow();
+ return ti instanceof SelectableTargetInfo
+ || (ti instanceof DisplayResolveInfo && !isNearbyShare);
}
/**
@@ -2962,8 +2987,6 @@
private DirectShareViewHolder mDirectShareViewHolder;
private int mChooserTargetWidth = 0;
private boolean mShowAzLabelIfPoss;
-
- private boolean mHideContentPreview = false;
private boolean mLayoutRequested = false;
private int mFooterHeight = 0;
@@ -3034,7 +3057,6 @@
* personal and work tabs.
*/
public void hideContentPreview() {
- mHideContentPreview = true;
mLayoutRequested = true;
notifyDataSetChanged();
}
@@ -3224,18 +3246,15 @@
}
});
- // Direct Share targets should not show any menu
- if (!isDirectShare) {
- v.setOnLongClickListener(v1 -> {
- final TargetInfo ti = mChooserListAdapter.targetInfoForPosition(
- holder.getItemIndex(column), true);
- // This should always be the case for non-DS targets, check for validity
- if (ti instanceof DisplayResolveInfo && shouldShowTargetDetails(ti)) {
- showTargetDetails((DisplayResolveInfo) ti);
- }
- return true;
- });
- }
+ // Show menu for both direct share and app share targets after long click.
+ v.setOnLongClickListener(v1 -> {
+ TargetInfo ti = mChooserListAdapter.targetInfoForPosition(
+ holder.getItemIndex(column), true);
+ if (shouldShowTargetDetails(ti)) {
+ showTargetDetails(ti);
+ }
+ return true;
+ });
holder.addView(i, v);
diff --git a/core/java/com/android/internal/app/ChooserListAdapter.java b/core/java/com/android/internal/app/ChooserListAdapter.java
index 140fabc..f644584 100644
--- a/core/java/com/android/internal/app/ChooserListAdapter.java
+++ b/core/java/com/android/internal/app/ChooserListAdapter.java
@@ -74,6 +74,7 @@
public static final float CALLER_TARGET_SCORE_BOOST = 900.f;
/** {@link #getBaseScore} */
public static final float SHORTCUT_TARGET_SCORE_BOOST = 90.f;
+ private static final float PINNED_SHORTCUT_TARGET_SCORE_BOOST = 1000.f;
private final int mMaxShortcutTargetsPerApp;
private final ChooserListCommunicator mChooserListCommunicator;
@@ -275,8 +276,10 @@
Drawable bkg = mContext.getDrawable(R.drawable.chooser_group_background);
holder.text.setPaddingRelative(0, 0, bkg.getIntrinsicWidth() /* end */, 0);
holder.text.setBackground(bkg);
- } else if (info.isPinned() && getPositionTargetType(position) == TARGET_STANDARD) {
- // If the target is pinned and in the suggested row show a pinned indicator
+ } else if (info.isPinned() && (getPositionTargetType(position) == TARGET_STANDARD
+ || getPositionTargetType(position) == TARGET_SERVICE)) {
+ // If the appShare or directShare target is pinned and in the suggested row show a
+ // pinned indicator
Drawable bkg = mContext.getDrawable(R.drawable.chooser_pinned_background);
holder.text.setPaddingRelative(bkg.getIntrinsicWidth() /* start */, 0, 0, 0);
holder.text.setBackground(bkg);
@@ -523,11 +526,16 @@
targetScore = lastScore * 0.95f;
}
}
+ ShortcutInfo shortcutInfo = isShortcutResult ? directShareToShortcutInfos.get(target)
+ : null;
+ if ((shortcutInfo != null) && shortcutInfo.isPinned()) {
+ targetScore += PINNED_SHORTCUT_TARGET_SCORE_BOOST;
+ }
UserHandle userHandle = getUserHandle();
Context contextAsUser = mContext.createContextAsUser(userHandle, 0 /* flags */);
boolean isInserted = insertServiceTarget(new SelectableTargetInfo(contextAsUser,
origTarget, target, targetScore, mSelectableTargetInfoCommunicator,
- (isShortcutResult ? directShareToShortcutInfos.get(target) : null)));
+ shortcutInfo));
if (isInserted && isShortcutResult) {
mNumShortcutResults++;
diff --git a/core/java/com/android/internal/app/ChooserTargetActionsDialogFragment.java b/core/java/com/android/internal/app/ChooserTargetActionsDialogFragment.java
index 9afc0e9..4f1f380 100644
--- a/core/java/com/android/internal/app/ChooserTargetActionsDialogFragment.java
+++ b/core/java/com/android/internal/app/ChooserTargetActionsDialogFragment.java
@@ -29,9 +29,14 @@
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.ComponentName;
+import android.content.Context;
import android.content.DialogInterface;
+import android.content.IntentFilter;
import android.content.SharedPreferences;
+import android.content.pm.LauncherApps;
import android.content.pm.PackageManager;
+import android.content.pm.ShortcutInfo;
+import android.content.pm.ShortcutManager;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@@ -51,6 +56,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
/**
* Shows a dialog with actions to take on a chooser target.
@@ -60,9 +66,17 @@
protected ArrayList<DisplayResolveInfo> mTargetInfos = new ArrayList<>();
protected UserHandle mUserHandle;
+ protected String mShortcutId;
+ protected String mShortcutTitle;
+ protected boolean mIsShortcutPinned;
+ protected IntentFilter mIntentFilter;
public static final String USER_HANDLE_KEY = "user_handle";
public static final String TARGET_INFOS_KEY = "target_infos";
+ public static final String SHORTCUT_ID_KEY = "shortcut_id";
+ public static final String SHORTCUT_TITLE_KEY = "shortcut_title";
+ public static final String IS_SHORTCUT_PINNED_KEY = "is_shortcut_pinned";
+ public static final String INTENT_FILTER_KEY = "intent_filter";
public ChooserTargetActionsDialogFragment() {}
@@ -79,6 +93,10 @@
void setStateFromBundle(Bundle b) {
mTargetInfos = (ArrayList<DisplayResolveInfo>) b.get(TARGET_INFOS_KEY);
mUserHandle = (UserHandle) b.get(USER_HANDLE_KEY);
+ mShortcutId = b.getString(SHORTCUT_ID_KEY);
+ mShortcutTitle = b.getString(SHORTCUT_TITLE_KEY);
+ mIsShortcutPinned = b.getBoolean(IS_SHORTCUT_PINNED_KEY);
+ mIntentFilter = (IntentFilter) b.get(INTENT_FILTER_KEY);
}
@Override
@@ -89,6 +107,11 @@
mUserHandle);
outState.putParcelableArrayList(ChooserTargetActionsDialogFragment.TARGET_INFOS_KEY,
mTargetInfos);
+ outState.putString(ChooserTargetActionsDialogFragment.SHORTCUT_ID_KEY, mShortcutId);
+ outState.putBoolean(ChooserTargetActionsDialogFragment.IS_SHORTCUT_PINNED_KEY,
+ mIsShortcutPinned);
+ outState.putString(ChooserTargetActionsDialogFragment.SHORTCUT_TITLE_KEY, mShortcutTitle);
+ outState.putParcelable(ChooserTargetActionsDialogFragment.INTENT_FILTER_KEY, mIntentFilter);
}
/**
@@ -121,7 +144,7 @@
RecyclerView rv = v.findViewById(R.id.listContainer);
final ResolveInfoPresentationGetter pg = getProvidingAppPresentationGetter();
- title.setText(pg.getLabel());
+ title.setText(isShortcutTarget() ? mShortcutTitle : pg.getLabel());
icon.setImageDrawable(pg.getIcon(mUserHandle));
rv.setAdapter(new VHAdapter(items));
@@ -180,11 +203,45 @@
@Override
public void onClick(DialogInterface dialog, int which) {
- pinComponent(mTargetInfos.get(which).getResolvedComponentName());
+ if (isShortcutTarget()) {
+ toggleShortcutPinned(mTargetInfos.get(which).getResolvedComponentName());
+ } else {
+ pinComponent(mTargetInfos.get(which).getResolvedComponentName());
+ }
((ChooserActivity) getActivity()).handlePackagesChanged();
dismiss();
}
+ private void toggleShortcutPinned(ComponentName name) {
+ if (mIntentFilter == null) {
+ return;
+ }
+ // Fetch existing pinned shortcuts of the given package.
+ List<String> pinnedShortcuts = getPinnedShortcutsFromPackageAsUser(getContext(),
+ mUserHandle, mIntentFilter, name.getPackageName());
+ // If the shortcut has already been pinned, unpin it; otherwise, pin it.
+ if (mIsShortcutPinned) {
+ pinnedShortcuts.remove(mShortcutId);
+ } else {
+ pinnedShortcuts.add(mShortcutId);
+ }
+ // Update pinned shortcut list in ShortcutService via LauncherApps
+ getContext().getSystemService(LauncherApps.class).pinShortcuts(
+ name.getPackageName(), pinnedShortcuts, mUserHandle);
+ }
+
+ private static List<String> getPinnedShortcutsFromPackageAsUser(Context context,
+ UserHandle user, IntentFilter filter, String packageName) {
+ Context contextAsUser = context.createContextAsUser(user, 0 /* flags */);
+ List<ShortcutManager.ShareShortcutInfo> targets = contextAsUser.getSystemService(
+ ShortcutManager.class).getShareTargets(filter);
+ return targets.stream()
+ .map(ShortcutManager.ShareShortcutInfo::getShortcutInfo)
+ .filter(s -> s.isPinned() && s.getPackage().equals(packageName))
+ .map(ShortcutInfo::getId)
+ .collect(Collectors.toList());
+ }
+
private void pinComponent(ComponentName name) {
SharedPreferences sp = ChooserActivity.getPinnedSharedPrefs(getContext());
final String key = name.flattenToString();
@@ -211,12 +268,13 @@
@NonNull
protected CharSequence getItemLabel(DisplayResolveInfo dri) {
final PackageManager pm = getContext().getPackageManager();
- return getPinLabel(dri.isPinned(), dri.getResolveInfo().loadLabel(pm));
+ return getPinLabel(isPinned(dri),
+ isShortcutTarget() ? "" : dri.getResolveInfo().loadLabel(pm));
}
@Nullable
protected Drawable getItemIcon(DisplayResolveInfo dri) {
- return getPinIcon(dri.isPinned());
+ return getPinIcon(isPinned(dri));
}
private ResolveInfoPresentationGetter getProvidingAppPresentationGetter() {
@@ -229,4 +287,11 @@
mTargetInfos.get(0).getResolveInfo());
}
+ private boolean isPinned(DisplayResolveInfo dri) {
+ return isShortcutTarget() ? mIsShortcutPinned : dri.isPinned();
+ }
+
+ private boolean isShortcutTarget() {
+ return mShortcutId != null;
+ }
}
diff --git a/core/java/com/android/internal/app/ChooserUtil.java b/core/java/com/android/internal/app/ChooserUtil.java
deleted file mode 100644
index 3f8788c..0000000
--- a/core/java/com/android/internal/app/ChooserUtil.java
+++ /dev/null
@@ -1,57 +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.internal.app;
-
-import java.nio.charset.Charset;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-/**
- * Utility method for common computation operations for Share sheet.
- */
-public class ChooserUtil {
-
- private static final Charset UTF_8 = Charset.forName("UTF-8");
-
- /**
- * Hashes the given input based on MD5 algorithm.
- *
- * @return a string representation of the hash computation.
- */
- public static String md5(String input) {
- try {
- MessageDigest md = MessageDigest.getInstance("MD5");
- md.update(input.getBytes(UTF_8));
- return convertBytesToHexString(md.digest());
- } catch (NoSuchAlgorithmException e) {
- throw new IllegalStateException(e);
- }
- }
-
- /** Converts byte array input into an hex string. */
- private static String convertBytesToHexString(byte[] input) {
- char[] chars = new char[input.length * 2];
- for (int i = 0; i < input.length; i++) {
- byte b = input[i];
- chars[i * 2] = Character.forDigit((b >> 4) & 0xF, 16 /* radix */);
- chars[i * 2 + 1] = Character.forDigit(b & 0xF, 16 /* radix */);
- }
- return new String(chars);
- }
-
- private ChooserUtil() {}
-}
diff --git a/core/java/com/android/internal/app/ResolverComparatorModel.java b/core/java/com/android/internal/app/ResolverComparatorModel.java
new file mode 100644
index 0000000..3e8f64b
--- /dev/null
+++ b/core/java/com/android/internal/app/ResolverComparatorModel.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.app;
+
+import android.content.ComponentName;
+import android.content.pm.ResolveInfo;
+
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * A ranking model for resolver targets, providing ordering and (optionally) numerical scoring.
+ *
+ * As required by the {@link Comparator} contract, objects returned by {@code getComparator()} must
+ * apply a total ordering on its inputs consistent across all calls to {@code Comparator#compare()}.
+ * Other query methods and ranking feedback should refer to that same ordering, so implementors are
+ * generally advised to "lock in" an immutable snapshot of their model data when this object is
+ * initialized (preferring to replace the entire {@code ResolverComparatorModel} instance if the
+ * backing data needs to be updated in the future).
+ */
+interface ResolverComparatorModel {
+ /**
+ * Get a {@code Comparator} that can be used to sort {@code ResolveInfo} targets according to
+ * the model ranking.
+ */
+ Comparator<ResolveInfo> getComparator();
+
+ /**
+ * Get the numerical score, if any, that the model assigns to the component with the specified
+ * {@code name}. Scores range from zero to one, with one representing the highest possible
+ * likelihood that the user will select that component as the target. Implementations that don't
+ * assign numerical scores are <em>recommended</em> to return a value of 0 for all components.
+ */
+ float getScore(ComponentName name);
+
+ /**
+ * Notify the model that the user selected a target. (Models may log this information, use it as
+ * a feedback signal for their ranking, etc.) Because the data in this
+ * {@code ResolverComparatorModel} instance is immutable, clients will need to get an up-to-date
+ * instance in order to see any changes in the ranking that might result from this feedback.
+ */
+ void notifyOnTargetSelected(ComponentName componentName);
+}
diff --git a/core/java/com/android/internal/app/ResolverListAdapter.java b/core/java/com/android/internal/app/ResolverListAdapter.java
index ac9b2d8..351ac45 100644
--- a/core/java/com/android/internal/app/ResolverListAdapter.java
+++ b/core/java/com/android/internal/app/ResolverListAdapter.java
@@ -155,14 +155,6 @@
return mResolverListController.getScore(componentName);
}
- /**
- * Returns the list of top K component names which have highest
- * {@link #getScore(DisplayResolveInfo)}
- */
- public List<ComponentName> getTopComponentNames(int topK) {
- return mResolverListController.getTopComponentNames(topK);
- }
-
public void updateModel(ComponentName componentName) {
mResolverListController.updateModel(componentName);
}
@@ -177,107 +169,206 @@
}
/**
- * Rebuild the list of resolvers. In some cases some parts will need some asynchronous work
- * to complete.
+ * Rebuild the list of resolvers. When rebuilding is complete, queue the {@code onPostListReady}
+ * callback on the main handler with {@code rebuildCompleted} true.
*
- * The {@code doPostProcessing } parameter is used to specify whether to update the UI and
- * load additional targets (e.g. direct share) after the list has been rebuilt. This is used
- * in the case where we want to load the inactive profile's resolved apps to know the
+ * In some cases some parts will need some asynchronous work to complete. Then this will first
+ * immediately queue {@code onPostListReady} (on the main handler) with {@code rebuildCompleted}
+ * false; only when the asynchronous work completes will this then go on to queue another
+ * {@code onPostListReady} callback with {@code rebuildCompleted} true.
+ *
+ * The {@code doPostProcessing} parameter is used to specify whether to update the UI and
+ * load additional targets (e.g. direct share) after the list has been rebuilt. We may choose
+ * to skip that step if we're only loading the inactive profile's resolved apps to know the
* number of targets.
*
- * @return Whether or not the list building is completed.
+ * @return Whether the list building was completed synchronously. If not, we'll queue the
+ * {@code onPostListReady} callback first with {@code rebuildCompleted} false, and then again
+ * with {@code rebuildCompleted} true at the end of some newly-launched asynchronous work.
+ * Otherwise the callback is only queued once, with {@code rebuildCompleted} true.
*/
protected boolean rebuildList(boolean doPostProcessing) {
- List<ResolvedComponentInfo> currentResolveList = null;
- // Clear the value of mOtherProfile from previous call.
- mOtherProfile = null;
- mLastChosen = null;
- mLastChosenPosition = -1;
mDisplayList.clear();
mIsTabLoaded = false;
+ mLastChosenPosition = -1;
- if (mBaseResolveList != null) {
- currentResolveList = mUnfilteredResolveList = new ArrayList<>();
- mResolverListController.addResolveListDedupe(currentResolveList,
- mResolverListCommunicator.getTargetIntent(),
- mBaseResolveList);
- } else {
- currentResolveList = mUnfilteredResolveList =
- mResolverListController.getResolversForIntent(
- /* shouldGetResolvedFilter= */ true,
- mResolverListCommunicator.shouldGetActivityMetadata(),
- mIntents);
- if (currentResolveList == null) {
- processSortedList(currentResolveList, doPostProcessing);
- return true;
- }
- List<ResolvedComponentInfo> originalList =
- mResolverListController.filterIneligibleActivities(currentResolveList,
- true);
- if (originalList != null) {
- mUnfilteredResolveList = originalList;
- }
- }
+ List<ResolvedComponentInfo> currentResolveList = getInitialRebuiltResolveList();
+
+ /* TODO: this seems like unnecessary extra complexity; why do we need to do this "primary"
+ * (i.e. "eligibility") filtering before evaluating the "other profile" special-treatment,
+ * but the "secondary" (i.e. "priority") filtering after? Are there in fact cases where the
+ * eligibility conditions will filter out a result that would've otherwise gotten the "other
+ * profile" treatment? Or, are there cases where the priority conditions *would* filter out
+ * a result, but we *want* that result to get the "other profile" treatment, so we only
+ * filter *after* evaluating the special-treatment conditions? If the answer to either is
+ * "no," then the filtering steps can be consolidated. (And that also makes the "unfiltered
+ * list" bookkeeping a little cleaner.)
+ */
+ mUnfilteredResolveList = performPrimaryResolveListFiltering(currentResolveList);
// So far we only support a single other profile at a time.
// The first one we see gets special treatment.
- for (ResolvedComponentInfo info : currentResolveList) {
- ResolveInfo resolveInfo = info.getResolveInfoAt(0);
- if (resolveInfo.targetUserId != UserHandle.USER_CURRENT) {
- Intent pOrigIntent = mResolverListCommunicator.getReplacementIntent(
- resolveInfo.activityInfo,
- info.getIntentAt(0));
- Intent replacementIntent = mResolverListCommunicator.getReplacementIntent(
- resolveInfo.activityInfo,
- mResolverListCommunicator.getTargetIntent());
- mOtherProfile = new DisplayResolveInfo(info.getIntentAt(0),
- resolveInfo,
- resolveInfo.loadLabel(mPm),
- resolveInfo.loadLabel(mPm),
- pOrigIntent != null ? pOrigIntent : replacementIntent,
- makePresentationGetter(resolveInfo));
- currentResolveList.remove(info);
- break;
- }
+ ResolvedComponentInfo otherProfileInfo =
+ getFirstNonCurrentUserResolvedComponentInfo(currentResolveList);
+ updateOtherProfileTreatment(otherProfileInfo);
+ if (otherProfileInfo != null) {
+ currentResolveList.remove(otherProfileInfo);
+ /* TODO: the previous line removed the "other profile info" item from
+ * mUnfilteredResolveList *ONLY IF* that variable is an alias for the same List instance
+ * as currentResolveList (i.e., if no items were filtered out as the result of the
+ * earlier "primary" filtering). It seems wrong for our behavior to depend on that.
+ * Should we:
+ * A. replicate the above removal to mUnfilteredResolveList (which is idempotent, so we
+ * don't even have to check whether they're aliases); or
+ * B. break the alias relationship by copying currentResolveList to a new
+ * mUnfilteredResolveList instance if necessary before removing otherProfileInfo?
+ * In other words: do we *want* otherProfileInfo in the "unfiltered" results? Either
+ * way, we'll need one of the changes suggested above.
+ */
}
- if (mOtherProfile == null) {
+ // If no results have yet been filtered, mUnfilteredResolveList is an alias for the same
+ // List instance as currentResolveList. Then we need to make a copy to store as the
+ // mUnfilteredResolveList if we go on to filter any more items. Otherwise we've already
+ // copied the original unfiltered items to a separate List instance and can now filter
+ // the remainder in-place without any further bookkeeping.
+ boolean needsCopyOfUnfiltered = (mUnfilteredResolveList == currentResolveList);
+ mUnfilteredResolveList = performSecondaryResolveListFiltering(
+ currentResolveList, needsCopyOfUnfiltered);
+
+ return finishRebuildingListWithFilteredResults(currentResolveList, doPostProcessing);
+ }
+
+ /**
+ * Get the full (unfiltered) set of {@code ResolvedComponentInfo} records for all resolvers
+ * to be considered in a newly-rebuilt list. This list will be filtered and ranked before the
+ * rebuild is complete.
+ */
+ List<ResolvedComponentInfo> getInitialRebuiltResolveList() {
+ if (mBaseResolveList != null) {
+ List<ResolvedComponentInfo> currentResolveList = new ArrayList<>();
+ mResolverListController.addResolveListDedupe(currentResolveList,
+ mResolverListCommunicator.getTargetIntent(),
+ mBaseResolveList);
+ return currentResolveList;
+ } else {
+ return mResolverListController.getResolversForIntent(
+ /* shouldGetResolvedFilter= */ true,
+ mResolverListCommunicator.shouldGetActivityMetadata(),
+ mIntents);
+ }
+ }
+
+ /**
+ * Remove ineligible activities from {@code currentResolveList} (if non-null), in-place. More
+ * broadly, filtering logic should apply in the "primary" stage if it should preclude items from
+ * receiving the "other profile" special-treatment described in {@code rebuildList()}.
+ *
+ * @return A copy of the original {@code currentResolveList}, if any items were removed, or a
+ * (possibly null) reference to the original list otherwise. (That is, this always returns a
+ * list of all the unfiltered items, but if no items were filtered, it's just an alias for the
+ * same list that was passed in).
+ */
+ @Nullable
+ List<ResolvedComponentInfo> performPrimaryResolveListFiltering(
+ @Nullable List<ResolvedComponentInfo> currentResolveList) {
+ /* TODO: mBaseResolveList appears to be(?) some kind of configured mode. Why is it not
+ * subject to filterIneligibleActivities, even though all the other logic still applies
+ * (including "secondary" filtering)? (This also relates to the earlier question; do we
+ * believe there's an item that would be eligible for "other profile" special treatment,
+ * except we want to filter it out as ineligible... but only if we're not in
+ * "mBaseResolveList mode"? */
+ if ((mBaseResolveList != null) || (currentResolveList == null)) {
+ return currentResolveList;
+ }
+
+ List<ResolvedComponentInfo> originalList =
+ mResolverListController.filterIneligibleActivities(currentResolveList, true);
+ return (originalList == null) ? currentResolveList : originalList;
+ }
+
+ /**
+ * Remove low-priority activities from {@code currentResolveList} (if non-null), in place. More
+ * broadly, filtering logic should apply in the "secondary" stage to prevent items from
+ * appearing in the rebuilt-list results, while still considering those items for the "other
+ * profile" special-treatment described in {@code rebuildList()}.
+ *
+ * @return the same (possibly null) List reference as {@code currentResolveList}, if the list is
+ * unmodified as a result of filtering; or, if some item(s) were removed, then either a copy of
+ * the original {@code currentResolveList} (if {@code returnCopyOfOriginalListIfModified} is
+ * true), or null (otherwise).
+ */
+ @Nullable
+ List<ResolvedComponentInfo> performSecondaryResolveListFiltering(
+ @Nullable List<ResolvedComponentInfo> currentResolveList,
+ boolean returnCopyOfOriginalListIfModified) {
+ if ((currentResolveList == null) || currentResolveList.isEmpty()) {
+ return currentResolveList;
+ }
+ return mResolverListController.filterLowPriority(
+ currentResolveList, returnCopyOfOriginalListIfModified);
+ }
+
+ /**
+ * Update the special "other profile" UI treatment based on the components resolved for a
+ * newly-built list.
+ *
+ * @param otherProfileInfo the first {@code ResolvedComponentInfo} specifying a
+ * {@code targetUserId} other than {@code USER_CURRENT}, or null if no such component info was
+ * found in the process of rebuilding the list (or if any such candidates were already removed
+ * due to "primary filtering").
+ */
+ void updateOtherProfileTreatment(@Nullable ResolvedComponentInfo otherProfileInfo) {
+ mLastChosen = null;
+
+ if (otherProfileInfo != null) {
+ mOtherProfile = makeOtherProfileDisplayResolveInfo(
+ mContext, otherProfileInfo, mPm, mResolverListCommunicator, mIconDpi);
+ } else {
+ mOtherProfile = null;
try {
mLastChosen = mResolverListController.getLastChosen();
+ // TODO: does this also somehow need to update mLastChosenPosition? If so, maybe
+ // the current method should also take responsibility for re-initializing
+ // mLastChosenPosition, where it's currently done at the start of rebuildList()?
+ // (Why is this related to the presence of mOtherProfile in fhe first place?)
} catch (RemoteException re) {
Log.d(TAG, "Error calling getLastChosenActivity\n" + re);
}
}
+ }
- setPlaceholderCount(0);
- int n;
- if ((currentResolveList != null) && ((n = currentResolveList.size()) > 0)) {
- // We only care about fixing the unfilteredList if the current resolve list and
- // current resolve list are currently the same.
- List<ResolvedComponentInfo> originalList =
- mResolverListController.filterLowPriority(currentResolveList,
- mUnfilteredResolveList == currentResolveList);
- if (originalList != null) {
- mUnfilteredResolveList = originalList;
- }
-
- if (currentResolveList.size() > 1) {
- int placeholderCount = currentResolveList.size();
- if (mResolverListCommunicator.useLayoutWithDefault()) {
- --placeholderCount;
- }
- setPlaceholderCount(placeholderCount);
- createSortingTask(doPostProcessing).execute(currentResolveList);
- postListReadyRunnable(doPostProcessing, /* rebuildCompleted */ false);
- return false;
- } else {
- processSortedList(currentResolveList, doPostProcessing);
- return true;
- }
- } else {
- processSortedList(currentResolveList, doPostProcessing);
+ /**
+ * Prepare the appropriate placeholders to eventually display the final set of resolved
+ * components in a newly-rebuilt list, and spawn an asynchronous sorting task if necessary.
+ * This eventually results in a {@code onPostListReady} callback with {@code rebuildCompleted}
+ * true; if any asynchronous work is required, that will first be preceded by a separate
+ * occurrence of the callback with {@code rebuildCompleted} false (once there are placeholders
+ * set up to represent the pending asynchronous results).
+ * @return Whether we were able to do all the work to prepare the list for display
+ * synchronously; if false, there will eventually be two separate {@code onPostListReady}
+ * callbacks, first with placeholders to represent pending asynchronous results, then later when
+ * the results are ready for presentation.
+ */
+ boolean finishRebuildingListWithFilteredResults(
+ @Nullable List<ResolvedComponentInfo> filteredResolveList, boolean doPostProcessing) {
+ if (filteredResolveList == null || filteredResolveList.size() < 2) {
+ // No asynchronous work to do.
+ setPlaceholderCount(0);
+ processSortedList(filteredResolveList, doPostProcessing);
return true;
}
+
+ int placeholderCount = filteredResolveList.size();
+ if (mResolverListCommunicator.useLayoutWithDefault()) {
+ --placeholderCount;
+ }
+ setPlaceholderCount(placeholderCount);
+
+ // Send an "incomplete" list-ready while the async task is running.
+ postListReadyRunnable(doPostProcessing, /* rebuildCompleted */ false);
+ createSortingTask(doPostProcessing).execute(filteredResolveList);
+ return false;
}
AsyncTask<List<ResolvedComponentInfo>,
@@ -644,6 +735,59 @@
}
/**
+ * Find the first element in a list of {@code ResolvedComponentInfo} objects whose
+ * {@code ResolveInfo} specifies a {@code targetUserId} other than the current user.
+ * @return the first ResolvedComponentInfo targeting a non-current user, or null if there are
+ * none (or if the list itself is null).
+ */
+ private static ResolvedComponentInfo getFirstNonCurrentUserResolvedComponentInfo(
+ @Nullable List<ResolvedComponentInfo> resolveList) {
+ if (resolveList == null) {
+ return null;
+ }
+
+ for (ResolvedComponentInfo info : resolveList) {
+ ResolveInfo resolveInfo = info.getResolveInfoAt(0);
+ if (resolveInfo.targetUserId != UserHandle.USER_CURRENT) {
+ return info;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Set up a {@code DisplayResolveInfo} to provide "special treatment" for the first "other"
+ * profile in the resolve list (i.e., the first non-current profile to appear as the target user
+ * of an element in the resolve list).
+ */
+ private static DisplayResolveInfo makeOtherProfileDisplayResolveInfo(
+ Context context,
+ ResolvedComponentInfo resolvedComponentInfo,
+ PackageManager pm,
+ ResolverListCommunicator resolverListCommunicator,
+ int iconDpi) {
+ ResolveInfo resolveInfo = resolvedComponentInfo.getResolveInfoAt(0);
+
+ Intent pOrigIntent = resolverListCommunicator.getReplacementIntent(
+ resolveInfo.activityInfo,
+ resolvedComponentInfo.getIntentAt(0));
+ Intent replacementIntent = resolverListCommunicator.getReplacementIntent(
+ resolveInfo.activityInfo,
+ resolverListCommunicator.getTargetIntent());
+
+ ResolveInfoPresentationGetter presentationGetter =
+ new ResolveInfoPresentationGetter(context, iconDpi, resolveInfo);
+
+ return new DisplayResolveInfo(
+ resolvedComponentInfo.getIntentAt(0),
+ resolveInfo,
+ resolveInfo.loadLabel(pm),
+ resolveInfo.loadLabel(pm),
+ pOrigIntent != null ? pOrigIntent : replacementIntent,
+ presentationGetter);
+ }
+
+ /**
* Necessary methods to communicate between {@link ResolverListAdapter}
* and {@link ResolverActivity}.
*/
diff --git a/core/java/com/android/internal/app/ResolverListController.java b/core/java/com/android/internal/app/ResolverListController.java
index 9a95e64..2757363 100644
--- a/core/java/com/android/internal/app/ResolverListController.java
+++ b/core/java/com/android/internal/app/ResolverListController.java
@@ -393,14 +393,6 @@
return mResolverComparator.getScore(componentName);
}
- /**
- * Returns the list of top K component names which have highest
- * {@link #getScore(DisplayResolveInfo)}
- */
- public List<ComponentName> getTopComponentNames(int topK) {
- return mResolverComparator.getTopComponentNames(topK);
- }
-
public void updateModel(ComponentName componentName) {
mResolverComparator.updateModel(componentName);
}
diff --git a/core/java/com/android/internal/app/ResolverRankerServiceResolverComparator.java b/core/java/com/android/internal/app/ResolverRankerServiceResolverComparator.java
index cb946c0..c5b21ac 100644
--- a/core/java/com/android/internal/app/ResolverRankerServiceResolverComparator.java
+++ b/core/java/com/android/internal/app/ResolverRankerServiceResolverComparator.java
@@ -43,12 +43,12 @@
import java.text.Collator;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
/**
* Ranks and compares packages based on usage stats and uses the {@link ResolverRankerService}.
@@ -83,6 +83,7 @@
private ResolverRankerServiceConnection mConnection;
private Context mContext;
private CountDownLatch mConnectSignal;
+ private ResolverRankerServiceComparatorModel mComparatorModel;
public ResolverRankerServiceResolverComparator(Context context, Intent intent,
String referrerPackage, AfterCompute afterCompute,
@@ -99,6 +100,8 @@
mRankerServiceName = new ComponentName(mContext, this.getClass());
setCallBack(afterCompute);
setChooserActivityLogger(chooserActivityLogger);
+
+ mComparatorModel = buildUpdatedModel();
}
@Override
@@ -125,6 +128,7 @@
}
if (isUpdated) {
mRankerServiceName = mResolvedRankerName;
+ mComparatorModel = buildUpdatedModel();
}
} else {
Log.e(TAG, "Sizes of sent and received ResolverTargets diff.");
@@ -218,83 +222,25 @@
}
}
predictSelectProbabilities(mTargets);
+
+ mComparatorModel = buildUpdatedModel();
}
@Override
public int compare(ResolveInfo lhs, ResolveInfo rhs) {
- if (mStats != null) {
- final ResolverTarget lhsTarget = mTargetsDict.get(new ComponentName(
- lhs.activityInfo.packageName, lhs.activityInfo.name));
- final ResolverTarget rhsTarget = mTargetsDict.get(new ComponentName(
- rhs.activityInfo.packageName, rhs.activityInfo.name));
-
- if (lhsTarget != null && rhsTarget != null) {
- final int selectProbabilityDiff = Float.compare(
- rhsTarget.getSelectProbability(), lhsTarget.getSelectProbability());
-
- if (selectProbabilityDiff != 0) {
- return selectProbabilityDiff > 0 ? 1 : -1;
- }
- }
- }
-
- CharSequence sa = lhs.loadLabel(mPm);
- if (sa == null) sa = lhs.activityInfo.name;
- CharSequence sb = rhs.loadLabel(mPm);
- if (sb == null) sb = rhs.activityInfo.name;
-
- return mCollator.compare(sa.toString().trim(), sb.toString().trim());
+ return mComparatorModel.getComparator().compare(lhs, rhs);
}
@Override
public float getScore(ComponentName name) {
- final ResolverTarget target = mTargetsDict.get(name);
- if (target != null) {
- return target.getSelectProbability();
- }
- return 0;
- }
-
- @Override
- List<ComponentName> getTopComponentNames(int topK) {
- return mTargetsDict.entrySet().stream()
- .sorted((o1, o2) -> -Float.compare(getScore(o1.getKey()), getScore(o2.getKey())))
- .limit(topK)
- .map(Map.Entry::getKey)
- .collect(Collectors.toList());
+ return mComparatorModel.getScore(name);
}
// update ranking model when the connection to it is valid.
@Override
public void updateModel(ComponentName componentName) {
synchronized (mLock) {
- if (mRanker != null) {
- try {
- int selectedPos = new ArrayList<ComponentName>(mTargetsDict.keySet())
- .indexOf(componentName);
- if (selectedPos >= 0 && mTargets != null) {
- final float selectedProbability = getScore(componentName);
- int order = 0;
- for (ResolverTarget target : mTargets) {
- if (target.getSelectProbability() > selectedProbability) {
- order++;
- }
- }
- logMetrics(order);
- mRanker.train(mTargets, selectedPos);
- } else {
- if (DEBUG) {
- Log.d(TAG, "Selected a unknown component: " + componentName);
- }
- }
- } catch (RemoteException e) {
- Log.e(TAG, "Error in Train: " + e);
- }
- } else {
- if (DEBUG) {
- Log.d(TAG, "Ranker is null; skip updateModel.");
- }
- }
+ mComparatorModel.notifyOnTargetSelected(componentName);
}
}
@@ -313,19 +259,6 @@
}
}
- // records metrics for evaluation.
- private void logMetrics(int selectedPos) {
- if (mRankerServiceName != null) {
- MetricsLogger metricsLogger = new MetricsLogger();
- LogMaker log = new LogMaker(MetricsEvent.ACTION_TARGET_SELECTED);
- log.setComponentName(mRankerServiceName);
- int isCategoryUsed = (mAnnotations == null) ? 0 : 1;
- log.addTaggedData(MetricsEvent.FIELD_IS_CATEGORY_USED, isCategoryUsed);
- log.addTaggedData(MetricsEvent.FIELD_RANKED_POSITION, selectedPos);
- metricsLogger.write(log);
- }
- }
-
// connect to a ranking service.
private void initRanker(Context context) {
synchronized (mLock) {
@@ -426,6 +359,7 @@
}
synchronized (mLock) {
mRanker = IResolverRankerService.Stub.asInterface(service);
+ mComparatorModel = buildUpdatedModel();
mConnectSignal.countDown();
}
}
@@ -443,6 +377,7 @@
public void destroy() {
synchronized (mLock) {
mRanker = null;
+ mComparatorModel = buildUpdatedModel();
}
}
}
@@ -453,6 +388,7 @@
mTargetsDict.clear();
mTargets = null;
mRankerServiceName = new ComponentName(mContext, this.getClass());
+ mComparatorModel = buildUpdatedModel();
mResolvedRankerName = null;
initRanker(mContext);
}
@@ -508,4 +444,155 @@
}
return false;
}
+
+ /**
+ * Re-construct a {@code ResolverRankerServiceComparatorModel} to replace the current model
+ * instance (if any) using the up-to-date {@code ResolverRankerServiceResolverComparator} ivar
+ * values.
+ *
+ * TODO: each time we replace the model instance, we're either updating the model to use
+ * adjusted data (which is appropriate), or we're providing a (late) value for one of our ivars
+ * that wasn't available the last time the model was updated. For those latter cases, we should
+ * just avoid creating the model altogether until we have all the prerequisites we'll need. Then
+ * we can probably simplify the logic in {@code ResolverRankerServiceComparatorModel} since we
+ * won't need to handle edge cases when the model data isn't fully prepared.
+ * (In some cases, these kinds of "updates" might interleave -- e.g., we might have finished
+ * initializing the first time and now want to adjust some data, but still need to wait for
+ * changes to propagate to the other ivars before rebuilding the model.)
+ */
+ private ResolverRankerServiceComparatorModel buildUpdatedModel() {
+ // TODO: we don't currently guarantee that the underlying target list/map won't be mutated,
+ // so the ResolverComparatorModel may provide inconsistent results. We should make immutable
+ // copies of the data (waiting for any necessary remaining data before creating the model).
+ return new ResolverRankerServiceComparatorModel(
+ mStats,
+ mTargetsDict,
+ mTargets,
+ mCollator,
+ mRanker,
+ mRankerServiceName,
+ (mAnnotations != null),
+ mPm);
+ }
+
+ /**
+ * Implementation of a {@code ResolverComparatorModel} that provides the same ranking logic as
+ * the legacy {@code ResolverRankerServiceResolverComparator}, as a refactoring step toward
+ * removing the complex legacy API.
+ */
+ static class ResolverRankerServiceComparatorModel implements ResolverComparatorModel {
+ private final Map<String, UsageStats> mStats; // Treat as immutable.
+ private final Map<ComponentName, ResolverTarget> mTargetsDict; // Treat as immutable.
+ private final List<ResolverTarget> mTargets; // Treat as immutable.
+ private final Collator mCollator;
+ private final IResolverRankerService mRanker;
+ private final ComponentName mRankerServiceName;
+ private final boolean mAnnotationsUsed;
+ private final PackageManager mPm;
+
+ // TODO: it doesn't look like we should have to pass both targets and targetsDict, but it's
+ // not written in a way that makes it clear whether we can derive one from the other (at
+ // least in this constructor).
+ ResolverRankerServiceComparatorModel(
+ Map<String, UsageStats> stats,
+ Map<ComponentName, ResolverTarget> targetsDict,
+ List<ResolverTarget> targets,
+ Collator collator,
+ IResolverRankerService ranker,
+ ComponentName rankerServiceName,
+ boolean annotationsUsed,
+ PackageManager pm) {
+ mStats = stats;
+ mTargetsDict = targetsDict;
+ mTargets = targets;
+ mCollator = collator;
+ mRanker = ranker;
+ mRankerServiceName = rankerServiceName;
+ mAnnotationsUsed = annotationsUsed;
+ mPm = pm;
+ }
+
+ @Override
+ public Comparator<ResolveInfo> getComparator() {
+ // TODO: doCompute() doesn't seem to be concerned about null-checking mStats. Is that
+ // a bug there, or do we have a way of knowing it will be non-null under certain
+ // conditions?
+ return (lhs, rhs) -> {
+ if (mStats != null) {
+ final ResolverTarget lhsTarget = mTargetsDict.get(new ComponentName(
+ lhs.activityInfo.packageName, lhs.activityInfo.name));
+ final ResolverTarget rhsTarget = mTargetsDict.get(new ComponentName(
+ rhs.activityInfo.packageName, rhs.activityInfo.name));
+
+ if (lhsTarget != null && rhsTarget != null) {
+ final int selectProbabilityDiff = Float.compare(
+ rhsTarget.getSelectProbability(), lhsTarget.getSelectProbability());
+
+ if (selectProbabilityDiff != 0) {
+ return selectProbabilityDiff > 0 ? 1 : -1;
+ }
+ }
+ }
+
+ CharSequence sa = lhs.loadLabel(mPm);
+ if (sa == null) sa = lhs.activityInfo.name;
+ CharSequence sb = rhs.loadLabel(mPm);
+ if (sb == null) sb = rhs.activityInfo.name;
+
+ return mCollator.compare(sa.toString().trim(), sb.toString().trim());
+ };
+ }
+
+ @Override
+ public float getScore(ComponentName name) {
+ final ResolverTarget target = mTargetsDict.get(name);
+ if (target != null) {
+ return target.getSelectProbability();
+ }
+ return 0;
+ }
+
+ @Override
+ public void notifyOnTargetSelected(ComponentName componentName) {
+ if (mRanker != null) {
+ try {
+ int selectedPos = new ArrayList<ComponentName>(mTargetsDict.keySet())
+ .indexOf(componentName);
+ if (selectedPos >= 0 && mTargets != null) {
+ final float selectedProbability = getScore(componentName);
+ int order = 0;
+ for (ResolverTarget target : mTargets) {
+ if (target.getSelectProbability() > selectedProbability) {
+ order++;
+ }
+ }
+ logMetrics(order);
+ mRanker.train(mTargets, selectedPos);
+ } else {
+ if (DEBUG) {
+ Log.d(TAG, "Selected a unknown component: " + componentName);
+ }
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error in Train: " + e);
+ }
+ } else {
+ if (DEBUG) {
+ Log.d(TAG, "Ranker is null; skip updateModel.");
+ }
+ }
+ }
+
+ /** Records metrics for evaluation. */
+ private void logMetrics(int selectedPos) {
+ if (mRankerServiceName != null) {
+ MetricsLogger metricsLogger = new MetricsLogger();
+ LogMaker log = new LogMaker(MetricsEvent.ACTION_TARGET_SELECTED);
+ log.setComponentName(mRankerServiceName);
+ log.addTaggedData(MetricsEvent.FIELD_IS_CATEGORY_USED, mAnnotationsUsed);
+ log.addTaggedData(MetricsEvent.FIELD_RANKED_POSITION, selectedPos);
+ metricsLogger.write(log);
+ }
+ }
+ }
}
diff --git a/core/java/com/android/internal/app/SimpleIconFactory.java b/core/java/com/android/internal/app/SimpleIconFactory.java
index 43dacd7..354eb62 100644
--- a/core/java/com/android/internal/app/SimpleIconFactory.java
+++ b/core/java/com/android/internal/app/SimpleIconFactory.java
@@ -71,7 +71,7 @@
new SynchronizedPool<>(Runtime.getRuntime().availableProcessors());
private static final int DEFAULT_WRAPPER_BACKGROUND = Color.WHITE;
- private static final float BLUR_FACTOR = 0.5f / 48;
+ private static final float BLUR_FACTOR = 1.5f / 48;
private Context mContext;
private Canvas mCanvas;
@@ -650,8 +650,8 @@
/* Shadow generator block */
private static final float KEY_SHADOW_DISTANCE = 1f / 48;
- private static final int KEY_SHADOW_ALPHA = 61;
- private static final int AMBIENT_SHADOW_ALPHA = 30;
+ private static final int KEY_SHADOW_ALPHA = 10;
+ private static final int AMBIENT_SHADOW_ALPHA = 7;
private Paint mBlurPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
private Paint mDrawPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
diff --git a/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java b/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java
index 0153363..264e4f7 100644
--- a/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java
+++ b/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java
@@ -64,6 +64,7 @@
private Drawable mDisplayIcon;
private final Intent mFillInIntent;
private final int mFillInFlags;
+ private final boolean mIsPinned;
private final float mModifiedScore;
private boolean mIsSuspended = false;
@@ -77,6 +78,7 @@
mModifiedScore = modifiedScore;
mPm = mContext.getPackageManager();
mSelectableTargetInfoCommunicator = selectableTargetInfoComunicator;
+ mIsPinned = shortcutInfo != null && shortcutInfo.isPinned();
if (sourceInfo != null) {
final ResolveInfo ri = sourceInfo.getResolveInfo();
if (ri != null) {
@@ -120,6 +122,7 @@
mFillInIntent = fillInIntent;
mFillInFlags = flags;
mModifiedScore = other.mModifiedScore;
+ mIsPinned = other.mIsPinned;
mDisplayLabel = sanitizeDisplayLabel(mChooserTarget.getTitle());
}
@@ -292,7 +295,7 @@
@Override
public boolean isPinned() {
- return mSourceInfo != null && mSourceInfo.isPinned();
+ return mIsPinned;
}
/**
diff --git a/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java b/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java
index c94438e..ffb3752 100644
--- a/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java
+++ b/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java
@@ -520,6 +520,13 @@
public static final String USE_UNBUNDLED_SHARESHEET = "use_unbundled_sharesheet";
/**
+ * (int) The delay (in ms) before refreshing the Sharesheet UI after a change to the share
+ * target data model. For more info see go/sharesheet-list-view-update-delay.
+ */
+ public static final String SHARESHEET_LIST_VIEW_UPDATE_DELAY =
+ "sharesheet_list_view_update_delay";
+
+ /**
* (string) Name of the default QR code scanner activity. On the eligible devices this activity
* is provided by GMS core.
*/
diff --git a/core/java/com/android/internal/content/FileSystemProvider.java b/core/java/com/android/internal/content/FileSystemProvider.java
index a60b310..563cf04 100644
--- a/core/java/com/android/internal/content/FileSystemProvider.java
+++ b/core/java/com/android/internal/content/FileSystemProvider.java
@@ -414,6 +414,12 @@
final File parent = getFileForDocId(parentDocumentId);
final MatrixCursor result = new DirectoryCursor(
resolveProjection(projection), parentDocumentId, parent);
+
+ if (!filter.test(parent)) {
+ Log.w(TAG, "No permission to access parentDocumentId: " + parentDocumentId);
+ return result;
+ }
+
if (parent.isDirectory()) {
for (File file : FileUtils.listFilesOrEmpty(parent)) {
if (filter.test(file)) {
diff --git a/core/java/com/android/internal/inputmethod/IAccessibilityInputMethodSession.aidl b/core/java/com/android/internal/inputmethod/IAccessibilityInputMethodSession.aidl
new file mode 100644
index 0000000..ccfe3fb
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/IAccessibilityInputMethodSession.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.inputmethod;
+
+import android.graphics.Rect;
+import android.os.Bundle;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.inputmethod.CompletionInfo;
+import android.view.inputmethod.CursorAnchorInfo;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.ExtractedText;
+
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
+import com.android.internal.view.IInputContext;
+
+/**
+ * Sub-interface of IInputMethodSession which is safe to give to A11y IME.
+ */
+oneway interface IAccessibilityInputMethodSession {
+ void updateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd,
+ int candidatesStart, int candidatesEnd);
+
+ void finishInput();
+
+ void finishSession();
+
+ void invalidateInput(in EditorInfo editorInfo,
+ in IRemoteAccessibilityInputConnection connection, int sessionId);
+}
diff --git a/core/java/com/android/internal/view/IInputSessionWithIdCallback.aidl b/core/java/com/android/internal/inputmethod/IAccessibilityInputMethodSessionCallback.aidl
similarity index 69%
rename from core/java/com/android/internal/view/IInputSessionWithIdCallback.aidl
rename to core/java/com/android/internal/inputmethod/IAccessibilityInputMethodSessionCallback.aidl
index 8fbdefe..bb42c60 100644
--- a/core/java/com/android/internal/view/IInputSessionWithIdCallback.aidl
+++ b/core/java/com/android/internal/inputmethod/IAccessibilityInputMethodSessionCallback.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 The Android Open Source Project
+ * 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.
@@ -14,14 +14,14 @@
* limitations under the License.
*/
- package com.android.internal.view;
+ package com.android.internal.inputmethod;
- import com.android.internal.view.IInputMethodSession;
+ import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
/**
* Helper interface for IInputMethod to allow the input method to notify the client when a new
* session has been created.
*/
-oneway interface IInputSessionWithIdCallback {
- void sessionCreated(IInputMethodSession session, int id);
-}
\ No newline at end of file
+oneway interface IAccessibilityInputMethodSessionCallback {
+ void sessionCreated(IAccessibilityInputMethodSession session, int id);
+}
diff --git a/core/java/com/android/internal/inputmethod/IRemoteAccessibilityInputConnection.aidl b/core/java/com/android/internal/inputmethod/IRemoteAccessibilityInputConnection.aidl
new file mode 100644
index 0000000..f2064bb
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/IRemoteAccessibilityInputConnection.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.inputmethod;
+
+import android.view.KeyEvent;
+import android.view.inputmethod.TextAttribute;
+
+import com.android.internal.infra.AndroidFuture;
+import com.android.internal.inputmethod.InputConnectionCommandHeader;
+
+/**
+ * Interface from A11y IMEs to the application, allowing it to perform edits on the current input
+ * field and other interactions with the application.
+ */
+oneway interface IRemoteAccessibilityInputConnection {
+ void commitText(in InputConnectionCommandHeader header, CharSequence text,
+ int newCursorPosition, in TextAttribute textAttribute);
+
+ void setSelection(in InputConnectionCommandHeader header, int start, int end);
+
+ void getSurroundingText(in InputConnectionCommandHeader header, int beforeLength,
+ int afterLength, int flags, in AndroidFuture future /* T=SurroundingText */);
+
+ void deleteSurroundingText(in InputConnectionCommandHeader header, int beforeLength,
+ int afterLength);
+
+ void sendKeyEvent(in InputConnectionCommandHeader header, in KeyEvent event);
+
+ void performEditorAction(in InputConnectionCommandHeader header, int actionCode);
+
+ void performContextMenuAction(in InputConnectionCommandHeader header, int id);
+
+ void getCursorCapsMode(in InputConnectionCommandHeader header, int reqModes,
+ in AndroidFuture future /* T=Integer */);
+
+ void clearMetaKeyStates(in InputConnectionCommandHeader header, int states);
+}
diff --git a/core/java/com/android/internal/inputmethod/IRemoteAccessibilityInputConnectionInvoker.java b/core/java/com/android/internal/inputmethod/IRemoteAccessibilityInputConnectionInvoker.java
new file mode 100644
index 0000000..dcc67d4
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/IRemoteAccessibilityInputConnectionInvoker.java
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.inputmethod;
+
+import android.annotation.AnyThread;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.RemoteException;
+import android.view.KeyEvent;
+import android.view.inputmethod.SurroundingText;
+import android.view.inputmethod.TextAttribute;
+
+import com.android.internal.infra.AndroidFuture;
+
+import java.util.Objects;
+
+final class IRemoteAccessibilityInputConnectionInvoker {
+ @NonNull
+ private final IRemoteAccessibilityInputConnection mConnection;
+ private final int mSessionId;
+
+ private IRemoteAccessibilityInputConnectionInvoker(
+ @NonNull IRemoteAccessibilityInputConnection inputContext, int sessionId) {
+ mConnection = inputContext;
+ mSessionId = sessionId;
+ }
+
+ /**
+ * Creates a new instance of {@link IRemoteAccessibilityInputConnectionInvoker} for the given
+ * {@link IRemoteAccessibilityInputConnection}.
+ *
+ * @param connection {@link IRemoteAccessibilityInputConnection} to be wrapped.
+ * @return A new instance of {@link IRemoteAccessibilityInputConnectionInvoker}.
+ */
+ public static IRemoteAccessibilityInputConnectionInvoker create(
+ @NonNull IRemoteAccessibilityInputConnection connection) {
+ Objects.requireNonNull(connection);
+ return new IRemoteAccessibilityInputConnectionInvoker(connection, 0);
+ }
+
+ /**
+ * Creates a new instance of {@link IRemoteAccessibilityInputConnectionInvoker} with the given
+ * {@code sessionId}.
+ *
+ * @param sessionId the new session ID to be used.
+ * @return A new instance of {@link IRemoteAccessibilityInputConnectionInvoker}.
+ */
+ @NonNull
+ public IRemoteAccessibilityInputConnectionInvoker cloneWithSessionId(int sessionId) {
+ return new IRemoteAccessibilityInputConnectionInvoker(mConnection, sessionId);
+ }
+
+ /**
+ * @param connection {@code IRemoteAccessibilityInputConnection} to be compared with
+ * @return {@code true} if the underlying {@code IRemoteAccessibilityInputConnection} is the
+ * same. {@code false} if {@code connection} is {@code null}.
+ */
+ @AnyThread
+ public boolean isSameConnection(@NonNull IRemoteAccessibilityInputConnection connection) {
+ if (connection == null) {
+ return false;
+ }
+ return mConnection.asBinder() == connection.asBinder();
+ }
+
+ @NonNull
+ InputConnectionCommandHeader createHeader() {
+ return new InputConnectionCommandHeader(mSessionId);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#commitText(InputConnectionCommandHeader,
+ * int, CharSequence)}.
+ *
+ * @param text {@code text} parameter to be passed.
+ * @param newCursorPosition {@code newCursorPosition} parameter to be passed.
+ * @param textAttribute The extra information about the text.
+ */
+ @AnyThread
+ public void commitText(CharSequence text, int newCursorPosition,
+ @Nullable TextAttribute textAttribute) {
+ try {
+ mConnection.commitText(createHeader(), text, newCursorPosition, textAttribute);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#setSelection(InputConnectionCommandHeader,
+ * int, int)}.
+ *
+ * @param start {@code start} parameter to be passed.
+ * @param end {@code start} parameter to be passed.
+ */
+ @AnyThread
+ public void setSelection(int start, int end) {
+ try {
+ mConnection.setSelection(createHeader(), start, end);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#getSurroundingText(
+ * InputConnectionCommandHeader, int, int, int, AndroidFuture)}.
+ *
+ * @param beforeLength {@code beforeLength} parameter to be passed.
+ * @param afterLength {@code afterLength} parameter to be passed.
+ * @param flags {@code flags} parameter to be passed.
+ * @return {@link AndroidFuture< SurroundingText >} that can be used to retrieve the
+ * invocation result. {@link RemoteException} will be treated as an error.
+ */
+ @AnyThread
+ @NonNull
+ public AndroidFuture<SurroundingText> getSurroundingText(int beforeLength, int afterLength,
+ int flags) {
+ final AndroidFuture<SurroundingText> future = new AndroidFuture<>();
+ try {
+ mConnection.getSurroundingText(createHeader(), beforeLength, afterLength, flags,
+ future);
+ } catch (RemoteException e) {
+ future.completeExceptionally(e);
+ }
+ return future;
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#deleteSurroundingText(
+ * InputConnectionCommandHeader, int, int)}.
+ *
+ * @param beforeLength {@code beforeLength} parameter to be passed.
+ * @param afterLength {@code afterLength} parameter to be passed.
+ */
+ @AnyThread
+ public void deleteSurroundingText(int beforeLength, int afterLength) {
+ try {
+ mConnection.deleteSurroundingText(createHeader(), beforeLength, afterLength);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#sendKeyEvent(
+ * InputConnectionCommandHeader, KeyEvent)}.
+ *
+ * @param event {@code event} parameter to be passed.
+ */
+ @AnyThread
+ public void sendKeyEvent(KeyEvent event) {
+ try {
+ mConnection.sendKeyEvent(createHeader(), event);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#performEditorAction(
+ * InputConnectionCommandHeader, int)}.
+ *
+ * @param actionCode {@code start} parameter to be passed.
+ */
+ @AnyThread
+ public void performEditorAction(int actionCode) {
+ try {
+ mConnection.performEditorAction(createHeader(), actionCode);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#performContextMenuAction(
+ * InputConnectionCommandHeader, int)}.
+ *
+ * @param id {@code id} parameter to be passed.
+ */
+ @AnyThread
+ public void performContextMenuAction(int id) {
+ try {
+ mConnection.performContextMenuAction(createHeader(), id);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#getCursorCapsMode(
+ * InputConnectionCommandHeader, int, AndroidFuture)}.
+ *
+ * @param reqModes {@code reqModes} parameter to be passed.
+ * @return {@link AndroidFuture<Integer>} that can be used to retrieve the invocation
+ * result. {@link RemoteException} will be treated as an error.
+ */
+ @AnyThread
+ @NonNull
+ public AndroidFuture<Integer> getCursorCapsMode(int reqModes) {
+ final AndroidFuture<Integer> future = new AndroidFuture<>();
+ try {
+ mConnection.getCursorCapsMode(createHeader(), reqModes, future);
+ } catch (RemoteException e) {
+ future.completeExceptionally(e);
+ }
+ return future;
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#clearMetaKeyStates(
+ * InputConnectionCommandHeader, int)}.
+ *
+ * @param states {@code states} parameter to be passed.
+ */
+ @AnyThread
+ public void clearMetaKeyStates(int states) {
+ try {
+ mConnection.clearMetaKeyStates(createHeader(), states);
+ } catch (RemoteException e) {
+ }
+ }
+}
diff --git a/core/java/com/android/internal/inputmethod/InputBindResult.java b/core/java/com/android/internal/inputmethod/InputBindResult.java
index f7341a5..10c83c3 100644
--- a/core/java/com/android/internal/inputmethod/InputBindResult.java
+++ b/core/java/com/android/internal/inputmethod/InputBindResult.java
@@ -186,7 +186,7 @@
/**
* The accessibility services.
*/
- public SparseArray<IInputMethodSession> accessibilitySessions;
+ public SparseArray<IAccessibilityInputMethodSession> accessibilitySessions;
/**
* The input channel used to send input events to this IME.
@@ -231,8 +231,8 @@
*
* @param result A result code defined in {@link ResultCode}.
* @param method {@link IInputMethodSession} to interact with the IME.
- * @param accessibilitySessions {@link IInputMethodSession} to interact with accessibility
- * services.
+ * @param accessibilitySessions {@link IAccessibilityInputMethodSession} to interact with
+ * accessibility services.
* @param channel {@link InputChannel} to forward input events to the IME.
* @param id The {@link String} representations of the IME, which is the same as
* {@link android.view.inputmethod.InputMethodInfo#getId()} and
@@ -242,7 +242,8 @@
* {@code suppressesSpellChecker="true"}.
*/
public InputBindResult(@ResultCode int result,
- IInputMethodSession method, SparseArray<IInputMethodSession> accessibilitySessions,
+ IInputMethodSession method,
+ SparseArray<IAccessibilityInputMethodSession> accessibilitySessions,
InputChannel channel, String id, int sequence,
@Nullable Matrix virtualDisplayToScreenMatrix,
boolean isInputMethodSuppressingSpellChecker) {
@@ -271,8 +272,9 @@
accessibilitySessions = new SparseArray<>(n);
while (n > 0) {
int key = source.readInt();
- IInputMethodSession value =
- IInputMethodSession.Stub.asInterface(source.readStrongBinder());
+ IAccessibilityInputMethodSession value =
+ IAccessibilityInputMethodSession.Stub.asInterface(
+ source.readStrongBinder());
accessibilitySessions.append(key, value);
n--;
}
diff --git a/core/java/com/android/internal/inputmethod/RemoteAccessibilityInputConnection.java b/core/java/com/android/internal/inputmethod/RemoteAccessibilityInputConnection.java
new file mode 100644
index 0000000..0ee8ee7
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/RemoteAccessibilityInputConnection.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.inputmethod;
+
+import android.annotation.AnyThread;
+import android.annotation.DurationMillisLong;
+import android.annotation.IntRange;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.view.KeyEvent;
+import android.view.inputmethod.SurroundingText;
+import android.view.inputmethod.TextAttribute;
+
+import com.android.internal.infra.AndroidFuture;
+import com.android.internal.view.IInputMethod;
+
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * A wrapper object for A11y IME.
+ *
+ * <p>This needs to be public to be referenced from {@link android.app.UiAutomation}.</p>
+ */
+public final class RemoteAccessibilityInputConnection {
+ private static final String TAG = "RemoteA11yInputConnection";
+
+ @DurationMillisLong
+ private static final int MAX_WAIT_TIME_MILLIS = 2000;
+
+ @NonNull
+ IRemoteAccessibilityInputConnectionInvoker mInvoker;
+
+ /**
+ * Signaled when the system decided to take away IME focus from the target app.
+ *
+ * <p>This is expected to be signaled immediately when the IME process receives
+ * {@link IInputMethod#unbindInput()}.</p>
+ */
+ @NonNull
+ private final CancellationGroup mCancellationGroup;
+
+ public RemoteAccessibilityInputConnection(
+ @NonNull IRemoteAccessibilityInputConnection connection,
+ @NonNull CancellationGroup cancellationGroup) {
+ mInvoker = IRemoteAccessibilityInputConnectionInvoker.create(connection);
+ mCancellationGroup = cancellationGroup;
+ }
+
+ public RemoteAccessibilityInputConnection(@NonNull RemoteAccessibilityInputConnection original,
+ int sessionId) {
+ mInvoker = original.mInvoker.cloneWithSessionId(sessionId);
+ mCancellationGroup = original.mCancellationGroup;
+ }
+
+ /**
+ * Test if this object holds the given {@link IRemoteAccessibilityInputConnection} or not.
+ *
+ * @param connection {@link IRemoteAccessibilityInputConnection} to be tested.
+ * @return {@code true} if this object holds the same object.
+ */
+ @AnyThread
+ public boolean isSameConnection(@NonNull IRemoteAccessibilityInputConnection connection) {
+ return mInvoker.isSameConnection(connection);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#commitText(InputConnectionCommandHeader,
+ * CharSequence, int, TextAttribute)}.
+ *
+ * @param text The {@code "text"} parameter to be passed.
+ * @param newCursorPosition The {@code "newCursorPosition"} parameter to be passed.
+ * @param textAttribute The {@code "textAttribute"} parameter to be passed.
+ */
+ @AnyThread
+ public void commitText(@NonNull CharSequence text, int newCursorPosition,
+ @Nullable TextAttribute textAttribute) {
+ mInvoker.commitText(text, newCursorPosition, textAttribute);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#setSelection(InputConnectionCommandHeader,
+ * int, int)}.
+ *
+ * @param start The {@code "start"} parameter to be passed.
+ * @param end The {@code "end"} parameter to be passed.
+ */
+ @AnyThread
+ public void setSelection(int start, int end) {
+ mInvoker.setSelection(start, end);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#getSurroundingText(
+ * InputConnectionCommandHeader, int, int, int, AndroidFuture)}.
+ *
+ * @param beforeLength The {@code "beforeLength"} parameter to be passed.
+ * @param afterLength The {@code "afterLength"} parameter to be passed.
+ * @param flags The {@code "flags"} parameter to be passed.
+ * @return The {@link SurroundingText} object returned from the target application.
+ */
+ @AnyThread
+ public SurroundingText getSurroundingText(
+ @IntRange(from = 0) int beforeLength, @IntRange(from = 0) int afterLength, int flags) {
+ if (mCancellationGroup.isCanceled()) {
+ return null;
+ }
+
+ final CompletableFuture<SurroundingText> value = mInvoker.getSurroundingText(beforeLength,
+ afterLength, flags);
+ return CompletableFutureUtil.getResultOrNull(
+ value, TAG, "getSurroundingText()", mCancellationGroup, MAX_WAIT_TIME_MILLIS);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#deleteSurroundingText(
+ * InputConnectionCommandHeader, int, int)}.
+ *
+ * @param beforeLength The {@code "beforeLength"} parameter to be passed.
+ * @param afterLength The {@code "afterLength"} parameter to be passed.
+ */
+ @AnyThread
+ public void deleteSurroundingText(int beforeLength, int afterLength) {
+ mInvoker.deleteSurroundingText(beforeLength, afterLength);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#sendKeyEvent(InputConnectionCommandHeader,
+ * KeyEvent)}.
+ *
+ * @param event The {@code "event"} parameter to be passed.
+ */
+ @AnyThread
+ public void sendKeyEvent(KeyEvent event) {
+ mInvoker.sendKeyEvent(event);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#performEditorAction(
+ * InputConnectionCommandHeader, int)}.
+ *
+ * @param actionCode The {@code "actionCode"} parameter to be passed.
+ */
+ @AnyThread
+ public void performEditorAction(int actionCode) {
+ mInvoker.performEditorAction(actionCode);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#performContextMenuAction(
+ * InputConnectionCommandHeader, int)}.
+ *
+ * @param id The {@code "id"} parameter to be passed.
+ */
+ @AnyThread
+ public void performContextMenuAction(int id) {
+ mInvoker.performContextMenuAction(id);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#getCursorCapsMode(
+ * InputConnectionCommandHeader, int, AndroidFuture)}.
+ *
+ * @param reqModes The {@code "reqModes"} parameter to be passed.
+ * @return integer result returned from the target application.
+ */
+ @AnyThread
+ public int getCursorCapsMode(int reqModes) {
+ if (mCancellationGroup.isCanceled()) {
+ return 0;
+ }
+
+ final CompletableFuture<Integer> value = mInvoker.getCursorCapsMode(reqModes);
+
+ return CompletableFutureUtil.getResultOrZero(
+ value, TAG, "getCursorCapsMode()", mCancellationGroup, MAX_WAIT_TIME_MILLIS);
+ }
+
+ /**
+ * Invokes {@link IRemoteAccessibilityInputConnection#clearMetaKeyStates(
+ * InputConnectionCommandHeader, int)}.
+ *
+ * @param states The {@code "states"} parameter to be passed.
+ */
+ @AnyThread
+ public void clearMetaKeyStates(int states) {
+ mInvoker.clearMetaKeyStates(states);
+ }
+}
diff --git a/core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java b/core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java
index 7f11e30..12b522b 100644
--- a/core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java
+++ b/core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java
@@ -66,6 +66,13 @@
* {@link IInputContext} binder calls in the IME client (editor app) process, and forwards them to
* {@link InputConnection} that the IME client provided, on the {@link Looper} associated to the
* {@link InputConnection}.</p>
+ *
+ * <p>{@link com.android.internal.inputmethod.RemoteAccessibilityInputConnection} code is executed
+ * in the {@link android.accessibilityservice.AccessibilityService} process. It makes
+ * {@link com.android.internal.inputmethod.IRemoteAccessibilityInputConnection} binder calls under
+ * the hood. {@link #mAccessibilityInputConnection} receives the binder calls in the IME client
+ * (editor app) process, and forwards them to {@link InputConnection} that the IME client provided,
+ * on the {@link Looper} associated to the {@link InputConnection}.</p>
*/
public final class RemoteInputConnectionImpl extends IInputContext.Stub {
private static final String TAG = "RemoteInputConnectionImpl";
@@ -1043,6 +1050,179 @@
});
}
+ private final IRemoteAccessibilityInputConnection mAccessibilityInputConnection =
+ new IRemoteAccessibilityInputConnection.Stub() {
+ @Dispatching(cancellable = true)
+ @Override
+ public void commitText(InputConnectionCommandHeader header, CharSequence text,
+ int newCursorPosition, @Nullable TextAttribute textAttribute) {
+ dispatchWithTracing("commitTextFromA11yIme", () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return; // cancelled
+ }
+ InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "commitText on inactive InputConnection");
+ return;
+ }
+ // A11yIME's commitText() also triggers finishComposingText() automatically.
+ ic.beginBatchEdit();
+ ic.finishComposingText();
+ ic.commitText(text, newCursorPosition, textAttribute);
+ ic.endBatchEdit();
+ });
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void setSelection(InputConnectionCommandHeader header, int start, int end) {
+ dispatchWithTracing("setSelectionFromA11yIme", () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return; // cancelled
+ }
+ InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "setSelection on inactive InputConnection");
+ return;
+ }
+ ic.setSelection(start, end);
+ });
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void getSurroundingText(InputConnectionCommandHeader header, int beforeLength,
+ int afterLength, int flags, AndroidFuture future /* T=SurroundingText */) {
+ dispatchWithTracing("getSurroundingTextFromA11yIme", future, () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return null; // cancelled
+ }
+ final InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "getSurroundingText on inactive InputConnection");
+ return null;
+ }
+ if (beforeLength < 0) {
+ Log.i(TAG, "Returning null to getSurroundingText due to an invalid"
+ + " beforeLength=" + beforeLength);
+ return null;
+ }
+ if (afterLength < 0) {
+ Log.i(TAG, "Returning null to getSurroundingText due to an invalid"
+ + " afterLength=" + afterLength);
+ return null;
+ }
+ return ic.getSurroundingText(beforeLength, afterLength, flags);
+ }, useImeTracing() ? result -> buildGetSurroundingTextProto(
+ beforeLength, afterLength, flags, result) : null);
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void deleteSurroundingText(InputConnectionCommandHeader header, int beforeLength,
+ int afterLength) {
+ dispatchWithTracing("deleteSurroundingTextFromA11yIme", () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return; // cancelled
+ }
+ InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "deleteSurroundingText on inactive InputConnection");
+ return;
+ }
+ ic.deleteSurroundingText(beforeLength, afterLength);
+ });
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void sendKeyEvent(InputConnectionCommandHeader header, KeyEvent event) {
+ dispatchWithTracing("sendKeyEventFromA11yIme", () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return; // cancelled
+ }
+ InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "sendKeyEvent on inactive InputConnection");
+ return;
+ }
+ ic.sendKeyEvent(event);
+ });
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void performEditorAction(InputConnectionCommandHeader header, int id) {
+ dispatchWithTracing("performEditorActionFromA11yIme", () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return; // cancelled
+ }
+ InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "performEditorAction on inactive InputConnection");
+ return;
+ }
+ ic.performEditorAction(id);
+ });
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void performContextMenuAction(InputConnectionCommandHeader header, int id) {
+ dispatchWithTracing("performContextMenuActionFromA11yIme", () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return; // cancelled
+ }
+ InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "performContextMenuAction on inactive InputConnection");
+ return;
+ }
+ ic.performContextMenuAction(id);
+ });
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void getCursorCapsMode(InputConnectionCommandHeader header, int reqModes,
+ AndroidFuture future /* T=Integer */) {
+ dispatchWithTracing("getCursorCapsModeFromA11yIme", future, () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return 0; // cancelled
+ }
+ final InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "getCursorCapsMode on inactive InputConnection");
+ return 0;
+ }
+ return ic.getCursorCapsMode(reqModes);
+ }, useImeTracing() ? result -> buildGetCursorCapsModeProto(reqModes, result) : null);
+ }
+
+ @Dispatching(cancellable = true)
+ @Override
+ public void clearMetaKeyStates(InputConnectionCommandHeader header, int states) {
+ dispatchWithTracing("clearMetaKeyStatesFromA11yIme", () -> {
+ if (header.mSessionId != mCurrentSessionId.get()) {
+ return; // cancelled
+ }
+ InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "clearMetaKeyStates on inactive InputConnection");
+ return;
+ }
+ ic.clearMetaKeyStates(states);
+ });
+ }
+ };
+
+ /**
+ * @return {@link IRemoteAccessibilityInputConnection} associated with this object.
+ */
+ public IRemoteAccessibilityInputConnection asIRemoteAccessibilityInputConnection() {
+ return mAccessibilityInputConnection;
+ }
+
private void dispatch(@NonNull Runnable runnable) {
// If we are calling this from the target thread, then we can call right through.
// Otherwise, we need to send the message to the target thread.
diff --git a/core/java/com/android/internal/jank/FrameTracker.java b/core/java/com/android/internal/jank/FrameTracker.java
index 4f51a5b..825b486 100644
--- a/core/java/com/android/internal/jank/FrameTracker.java
+++ b/core/java/com/android/internal/jank/FrameTracker.java
@@ -36,7 +36,6 @@
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
-import android.util.StatsLog;
import android.view.Choreographer;
import android.view.FrameMetrics;
import android.view.SurfaceControl;
@@ -481,6 +480,8 @@
int missedFramesCount = 0;
int missedAppFramesCount = 0;
int missedSfFramesCount = 0;
+ int maxSuccessiveMissedFramesCount = 0;
+ int successiveMissedFramesCount = 0;
for (int i = 0; i < mJankInfos.size(); i++) {
JankInfo info = mJankInfos.valueAt(i);
@@ -510,6 +511,11 @@
}
if (missedFrame) {
missedFramesCount++;
+ successiveMissedFramesCount++;
+ } else {
+ maxSuccessiveMissedFramesCount = Math.max(
+ maxSuccessiveMissedFramesCount, successiveMissedFramesCount);
+ successiveMissedFramesCount = 0;
}
// TODO (b/174755489): Early latch currently gets fired way too often, so we have
// to ignore it for now.
@@ -524,6 +530,8 @@
}
}
}
+ maxSuccessiveMissedFramesCount = Math.max(
+ maxSuccessiveMissedFramesCount, successiveMissedFramesCount);
// Log the frame stats as counters to make them easily accessible in traces.
Trace.traceCounter(Trace.TRACE_TAG_APP, mSession.getName() + "#missedFrames",
@@ -536,6 +544,8 @@
totalFramesCount);
Trace.traceCounter(Trace.TRACE_TAG_APP, mSession.getName() + "#maxFrameTimeMillis",
(int) (maxFrameTimeNanos / NANOS_IN_MILLISECOND));
+ Trace.traceCounter(Trace.TRACE_TAG_APP, mSession.getName() + "#maxSuccessiveMissedFrames",
+ maxSuccessiveMissedFramesCount);
// Trigger perfetto if necessary.
if (shouldTriggerPerfetto(missedFramesCount, (int) maxFrameTimeNanos)) {
@@ -549,7 +559,8 @@
missedFramesCount,
maxFrameTimeNanos, /* will be 0 if mSurfaceOnly == true */
missedSfFramesCount,
- missedAppFramesCount);
+ missedAppFramesCount,
+ maxSuccessiveMissedFramesCount);
}
if (DEBUG) {
Log.i(TAG, "finish: CUJ=" + mSession.getName()
@@ -558,7 +569,8 @@
+ " missedAppFrames=" + missedAppFramesCount
+ " missedSfFrames=" + missedSfFramesCount
+ " missedFrames=" + missedFramesCount
- + " maxFrameTimeMillis=" + maxFrameTimeNanos / NANOS_IN_MILLISECOND);
+ + " maxFrameTimeMillis=" + maxFrameTimeNanos / NANOS_IN_MILLISECOND
+ + " maxSuccessiveMissedFramesCount=" + maxSuccessiveMissedFramesCount);
}
}
@@ -694,8 +706,8 @@
public static class StatsLogWrapper {
public void write(int code,
- int arg1, long arg2, long arg3, long arg4, long arg5, long arg6) {
- FrameworkStatsLog.write(code, arg1, arg2, arg3, arg4, arg5, arg6);
+ int arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7) {
+ FrameworkStatsLog.write(code, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
}
diff --git a/core/java/com/android/internal/jank/InteractionJankMonitor.java b/core/java/com/android/internal/jank/InteractionJankMonitor.java
index 3da37f8..6424989 100644
--- a/core/java/com/android/internal/jank/InteractionJankMonitor.java
+++ b/core/java/com/android/internal/jank/InteractionJankMonitor.java
@@ -61,6 +61,9 @@
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_SCROLL_FLING;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLASHSCREEN_AVD;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLASHSCREEN_EXIT_ANIM;
+import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_ENTER;
+import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_EXIT;
+import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_RESIZE;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__STATUS_BAR_APP_LAUNCH_FROM_CALL_CHIP;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_LOADING_SCREEN_FOR_STATUS;
import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_LOADING_TO_NEXT_FLOW;
@@ -184,6 +187,9 @@
public static final int CUJ_SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS = 46;
public static final int CUJ_SUW_LOADING_TO_NEXT_FLOW = 47;
public static final int CUJ_SUW_LOADING_SCREEN_FOR_STATUS = 48;
+ public static final int CUJ_SPLIT_SCREEN_ENTER = 49;
+ public static final int CUJ_SPLIT_SCREEN_EXIT = 50;
+ public static final int CUJ_SPLIT_SCREEN_RESIZE = 51;
private static final int NO_STATSD_LOGGING = -1;
@@ -241,6 +247,9 @@
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS,
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_LOADING_TO_NEXT_FLOW,
UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SUW_LOADING_SCREEN_FOR_STATUS,
+ UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_ENTER,
+ UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_EXIT,
+ UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SPLIT_SCREEN_RESIZE,
};
private static volatile InteractionJankMonitor sInstance;
@@ -309,7 +318,10 @@
CUJ_SUW_LOADING_TO_SHOW_INFO_WITH_ACTIONS,
CUJ_SUW_SHOW_FUNCTION_SCREEN_WITH_ACTIONS,
CUJ_SUW_LOADING_TO_NEXT_FLOW,
- CUJ_SUW_LOADING_SCREEN_FOR_STATUS
+ CUJ_SUW_LOADING_SCREEN_FOR_STATUS,
+ CUJ_SPLIT_SCREEN_ENTER,
+ CUJ_SPLIT_SCREEN_EXIT,
+ CUJ_SPLIT_SCREEN_RESIZE
})
@Retention(RetentionPolicy.SOURCE)
public @interface CujType {
@@ -726,6 +738,12 @@
return "SUW_LOADING_TO_NEXT_FLOW";
case CUJ_SUW_LOADING_SCREEN_FOR_STATUS:
return "SUW_LOADING_SCREEN_FOR_STATUS";
+ case CUJ_SPLIT_SCREEN_ENTER:
+ return "SPLIT_SCREEN_ENTER";
+ case CUJ_SPLIT_SCREEN_EXIT:
+ return "SPLIT_SCREEN_EXIT";
+ case CUJ_SPLIT_SCREEN_RESIZE:
+ return "CUJ_SPLIT_SCREEN_RESIZE";
}
return "UNKNOWN";
}
diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl
index 616411f..d7bb2cb 100644
--- a/core/java/com/android/internal/view/IInputMethodManager.aidl
+++ b/core/java/com/android/internal/view/IInputMethodManager.aidl
@@ -22,6 +22,7 @@
import android.view.inputmethod.EditorInfo;
import com.android.internal.inputmethod.InputBindResult;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
import com.android.internal.view.IInputContext;
import com.android.internal.view.IInputMethodClient;
@@ -54,7 +55,8 @@
in IInputMethodClient client, in IBinder windowToken,
/* @StartInputFlags */ int startInputFlags,
/* @android.view.WindowManager.LayoutParams.SoftInputModeFlags */ int softInputMode,
- int windowFlags, in EditorInfo attribute, IInputContext inputContext,
+ int windowFlags, in EditorInfo attribute, in IInputContext inputContext,
+ in IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
int unverifiedTargetSdkVersion);
void showInputMethodPickerFromClient(in IInputMethodClient client,
diff --git a/core/java/com/android/internal/view/IInputMethodSession.aidl b/core/java/com/android/internal/view/IInputMethodSession.aidl
index b9eb997..d505c19 100644
--- a/core/java/com/android/internal/view/IInputMethodSession.aidl
+++ b/core/java/com/android/internal/view/IInputMethodSession.aidl
@@ -50,8 +50,6 @@
void updateCursorAnchorInfo(in CursorAnchorInfo cursorAnchorInfo);
- void notifyImeHidden();
-
void removeImeSurface();
void finishInput();
diff --git a/core/java/com/android/internal/widget/LocalImageResolver.java b/core/java/com/android/internal/widget/LocalImageResolver.java
index c995351..b866723 100644
--- a/core/java/com/android/internal/widget/LocalImageResolver.java
+++ b/core/java/com/android/internal/widget/LocalImageResolver.java
@@ -198,6 +198,11 @@
}
final Size size = info.getSize();
+ if (size.getWidth() <= maxWidth && size.getHeight() <= maxHeight) {
+ // We don't want to upscale images needlessly.
+ return;
+ }
+
if (size.getWidth() > size.getHeight()) {
if (size.getWidth() > maxWidth) {
final int targetHeight = size.getHeight() * maxWidth / size.getWidth();
diff --git a/core/jni/android_content_res_ApkAssets.cpp b/core/jni/android_content_res_ApkAssets.cpp
index fc12e17..a8d7231 100644
--- a/core/jni/android_content_res_ApkAssets.cpp
+++ b/core/jni/android_content_res_ApkAssets.cpp
@@ -459,8 +459,12 @@
return nullptr;
}
- auto overlayable_name_native = std::string(env->GetStringUTFChars(overlayable_name, NULL));
+ const char* overlayable_name_native = env->GetStringUTFChars(overlayable_name, nullptr);
+ if (overlayable_name_native == nullptr) {
+ return nullptr;
+ }
auto actor = overlayable_map.find(overlayable_name_native);
+ env->ReleaseStringUTFChars(overlayable_name, overlayable_name_native);
if (actor == overlayable_map.end()) {
return nullptr;
}
diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp
index db33863d..c947fba 100644
--- a/core/jni/android_hardware_camera2_DngCreator.cpp
+++ b/core/jni/android_hardware_camera2_DngCreator.cpp
@@ -48,6 +48,7 @@
#include <jni.h>
#include <nativehelper/JNIHelp.h>
+#include <nativehelper/ScopedUtfChars.h>
using namespace android;
using namespace img_utils;
@@ -1264,16 +1265,14 @@
sp<NativeContext> nativeContext = new NativeContext(characteristics, results);
- const char* captureTime = env->GetStringUTFChars(formattedCaptureTime, nullptr);
-
- size_t len = strlen(captureTime) + 1;
- if (len != NativeContext::DATETIME_COUNT) {
+ ScopedUtfChars captureTime(env, formattedCaptureTime);
+ if (captureTime.size() + 1 != NativeContext::DATETIME_COUNT) {
jniThrowException(env, "java/lang/IllegalArgumentException",
"Formatted capture time string length is not required 20 characters");
return;
}
- nativeContext->setCaptureTime(String8(captureTime));
+ nativeContext->setCaptureTime(String8(captureTime.c_str()));
DngCreator_setNativeContext(env, thiz, nativeContext);
}
diff --git a/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp b/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp
index 6e7ebda..0ebf2dd 100644
--- a/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp
+++ b/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp
@@ -111,17 +111,17 @@
jint flags) {
battery::LongArrayMultiStateCounter *counter =
reinterpret_cast<battery::LongArrayMultiStateCounter *>(nativePtr);
- AParcel *parcel = AParcel_fromJavaParcel(env, jParcel);
+ ndk::ScopedAParcel parcel(AParcel_fromJavaParcel(env, jParcel));
uint16_t stateCount = counter->getStateCount();
- THROW_ON_WRITE_ERROR(AParcel_writeInt32(parcel, stateCount));
+ THROW_ON_WRITE_ERROR(AParcel_writeInt32(parcel.get(), stateCount));
// LongArrayMultiStateCounter has at least state 0
const std::vector<uint64_t> &anyState = counter->getCount(0);
- THROW_ON_WRITE_ERROR(AParcel_writeInt32(parcel, anyState.size()));
+ THROW_ON_WRITE_ERROR(AParcel_writeInt32(parcel.get(), anyState.size()));
for (battery::state_t state = 0; state < stateCount; state++) {
- THROW_ON_WRITE_ERROR(ndk::AParcel_writeVector(parcel, counter->getCount(state)));
+ THROW_ON_WRITE_ERROR(ndk::AParcel_writeVector(parcel.get(), counter->getCount(state)));
}
}
@@ -139,13 +139,13 @@
}
static jlong native_initFromParcel(JNIEnv *env, jclass theClass, jobject jParcel) {
- AParcel *parcel = AParcel_fromJavaParcel(env, jParcel);
+ ndk::ScopedAParcel parcel(AParcel_fromJavaParcel(env, jParcel));
int32_t stateCount;
- THROW_ON_READ_ERROR(AParcel_readInt32(parcel, &stateCount));
+ THROW_ON_READ_ERROR(AParcel_readInt32(parcel.get(), &stateCount));
int32_t arrayLength;
- THROW_ON_READ_ERROR(AParcel_readInt32(parcel, &arrayLength));
+ THROW_ON_READ_ERROR(AParcel_readInt32(parcel.get(), &arrayLength));
battery::LongArrayMultiStateCounter *counter =
new battery::LongArrayMultiStateCounter(stateCount, std::vector<uint64_t>(arrayLength));
@@ -154,7 +154,7 @@
value.reserve(arrayLength);
for (battery::state_t state = 0; state < stateCount; state++) {
- THROW_ON_READ_ERROR(ndk::AParcel_readVector(parcel, &value));
+ THROW_ON_READ_ERROR(ndk::AParcel_readVector(parcel.get(), &value));
counter->setValue(state, value);
}
diff --git a/core/jni/com_android_internal_os_LongMultiStateCounter.cpp b/core/jni/com_android_internal_os_LongMultiStateCounter.cpp
index 69c4f3d..8c69d27 100644
--- a/core/jni/com_android_internal_os_LongMultiStateCounter.cpp
+++ b/core/jni/com_android_internal_os_LongMultiStateCounter.cpp
@@ -120,13 +120,13 @@
static void native_writeToParcel(JNIEnv *env, jobject self, jlong nativePtr, jobject jParcel,
jint flags) {
battery::LongMultiStateCounter *counter = asLongMultiStateCounter(nativePtr);
- AParcel *parcel = AParcel_fromJavaParcel(env, jParcel);
+ ndk::ScopedAParcel parcel(AParcel_fromJavaParcel(env, jParcel));
uint16_t stateCount = counter->getStateCount();
- THROW_ON_WRITE_ERROR(AParcel_writeInt32(parcel, stateCount));
+ THROW_ON_WRITE_ERROR(AParcel_writeInt32(parcel.get(), stateCount));
for (battery::state_t state = 0; state < stateCount; state++) {
- THROW_ON_WRITE_ERROR(AParcel_writeInt64(parcel, counter->getCount(state)));
+ THROW_ON_WRITE_ERROR(AParcel_writeInt64(parcel.get(), counter->getCount(state)));
}
}
@@ -144,16 +144,16 @@
}
static jlong native_initFromParcel(JNIEnv *env, jclass theClass, jobject jParcel) {
- AParcel *parcel = AParcel_fromJavaParcel(env, jParcel);
+ ndk::ScopedAParcel parcel(AParcel_fromJavaParcel(env, jParcel));
int32_t stateCount;
- THROW_ON_READ_ERROR(AParcel_readInt32(parcel, &stateCount));
+ THROW_ON_READ_ERROR(AParcel_readInt32(parcel.get(), &stateCount));
battery::LongMultiStateCounter *counter = new battery::LongMultiStateCounter(stateCount, 0);
for (battery::state_t state = 0; state < stateCount; state++) {
int64_t value;
- THROW_ON_READ_ERROR(AParcel_readInt64(parcel, &value));
+ THROW_ON_READ_ERROR(AParcel_readInt64(parcel.get(), &value));
counter->setValue(state, value);
}
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 7bc6905..21bbac0 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -110,6 +110,8 @@
using android::zygote::ZygoteFailure;
+using Action = android_mallopt_gwp_asan_options_t::Action;
+
// This type is duplicated in fd_utils.h
typedef const std::function<void(std::string)>& fail_fn_t;
@@ -1717,16 +1719,24 @@
// runtime.
runtime_flags &= ~RuntimeFlags::NATIVE_HEAP_ZERO_INIT_ENABLED;
- bool forceEnableGwpAsan = false;
+ const char* nice_name_ptr = nice_name.has_value() ? nice_name.value().c_str() : nullptr;
+ android_mallopt_gwp_asan_options_t gwp_asan_options;
+ // The system server doesn't have its nice name set by the time SpecializeCommon is called.
+ gwp_asan_options.program_name = nice_name_ptr ?: process_name;
switch (runtime_flags & RuntimeFlags::GWP_ASAN_LEVEL_MASK) {
default:
case RuntimeFlags::GWP_ASAN_LEVEL_NEVER:
+ gwp_asan_options.desire = Action::DONT_TURN_ON_UNLESS_OVERRIDDEN;
+ android_mallopt(M_INITIALIZE_GWP_ASAN, &gwp_asan_options, sizeof(gwp_asan_options));
break;
case RuntimeFlags::GWP_ASAN_LEVEL_ALWAYS:
- forceEnableGwpAsan = true;
- [[fallthrough]];
+ gwp_asan_options.desire = Action::TURN_ON_FOR_APP;
+ android_mallopt(M_INITIALIZE_GWP_ASAN, &gwp_asan_options, sizeof(gwp_asan_options));
+ break;
case RuntimeFlags::GWP_ASAN_LEVEL_LOTTERY:
- android_mallopt(M_INITIALIZE_GWP_ASAN, &forceEnableGwpAsan, sizeof(forceEnableGwpAsan));
+ gwp_asan_options.desire = Action::TURN_ON_WITH_SAMPLING;
+ android_mallopt(M_INITIALIZE_GWP_ASAN, &gwp_asan_options, sizeof(gwp_asan_options));
+ break;
}
// Now that we've used the flag, clear it so that we don't pass unknown flags to the ART
// runtime.
@@ -1739,7 +1749,6 @@
AStatsSocket_close();
const char* se_info_ptr = se_info.has_value() ? se_info.value().c_str() : nullptr;
- const char* nice_name_ptr = nice_name.has_value() ? nice_name.value().c_str() : nullptr;
if (selinux_android_setcontext(uid, is_system_server, se_info_ptr, nice_name_ptr) == -1) {
fail_fn(CREATE_ERROR("selinux_android_setcontext(%d, %d, \"%s\", \"%s\") failed", uid,
diff --git a/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp b/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp
index 679a4f0..add645d 100644
--- a/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp
+++ b/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp
@@ -296,7 +296,7 @@
++buffersAllocd;
// MMap explicitly to get it page aligned.
void *bufferMem = mmap(NULL, sizeof(NativeCommandBuffer), PROT_READ | PROT_WRITE,
- MAP_ANONYMOUS | MAP_PRIVATE | MAP_POPULATE, -1, 0);
+ MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
// Currently we mmap and unmap one for every request handled by the Java code.
// That could be improved, but unclear it matters.
if (bufferMem == MAP_FAILED) {
diff --git a/core/proto/android/os/appbackgroundrestrictioninfo.proto b/core/proto/android/os/appbackgroundrestrictioninfo.proto
index 8445641..502fd64 100644
--- a/core/proto/android/os/appbackgroundrestrictioninfo.proto
+++ b/core/proto/android/os/appbackgroundrestrictioninfo.proto
@@ -169,6 +169,8 @@
REASON_ROLE_EMERGENCY = 319;
REASON_SYSTEM_MODULE = 320;
REASON_CARRIER_PRIVILEGED_APP = 321;
+ REASON_DPO_PROTECTED_APP = 322;
+ REASON_DISALLOW_APPS_CONTROL = 323;
// app requested to be exempt
REASON_OPT_OUT_REQUESTED = 1000;
}
diff --git a/core/proto/android/service/usb.proto b/core/proto/android/service/usb.proto
index c5eaf42..df5e0a9 100644
--- a/core/proto/android/service/usb.proto
+++ b/core/proto/android/service/usb.proto
@@ -110,6 +110,7 @@
repeated UsbDeviceProto devices = 2;
optional int32 num_connects = 3;
repeated UsbConnectionRecordProto connections = 4;
+ repeated UsbDirectMidiDeviceProto midi_devices = 5;
}
message UsbDeviceProto {
@@ -305,6 +306,42 @@
optional string device_address = 3;
}
+message UsbDirectMidiDeviceProto {
+ option (android.msg_privacy).dest = DEST_AUTOMATIC;
+
+ optional int32 num_inputs = 1;
+ optional int32 num_outputs = 2;
+ optional bool is_universal = 3;
+ optional string name = 4;
+ optional UsbMidiBlockParserProto block_parser = 5;
+}
+
+message UsbMidiBlockParserProto {
+ option (android.msg_privacy).dest = DEST_AUTOMATIC;
+
+ optional int32 length = 1;
+ optional int32 descriptor_type = 2;
+ optional int32 descriptor_subtype = 3;
+ optional int32 total_length = 4;
+ repeated UsbGroupTerminalBlockProto block = 5;
+}
+
+message UsbGroupTerminalBlockProto {
+ option (android.msg_privacy).dest = DEST_AUTOMATIC;
+
+ optional int32 length = 1;
+ optional int32 descriptor_type = 2;
+ optional int32 descriptor_subtype = 3;
+ optional int32 group_block_id = 4;
+ optional int32 group_terminal_block_type = 5;
+ optional int32 group_terminal = 6;
+ optional int32 num_group_terminals = 7;
+ optional int32 block_item = 8;
+ optional int32 midi_protocol = 9;
+ optional int32 max_input_bandwidth = 10;
+ optional int32 max_output_bandwidth = 11;
+}
+
message UsbSettingsManagerProto {
option (android.msg_privacy).dest = DEST_AUTOMATIC;
diff --git a/core/proto/android/view/imeinsetssourceconsumer.proto b/core/proto/android/view/imeinsetssourceconsumer.proto
index b1ed365..6e007fa 100644
--- a/core/proto/android/view/imeinsetssourceconsumer.proto
+++ b/core/proto/android/view/imeinsetssourceconsumer.proto
@@ -29,4 +29,6 @@
optional InsetsSourceConsumerProto insets_source_consumer = 1;
reserved 2; // focused_editor = 2
optional bool is_requested_visible_awaiting_control = 3;
+ optional bool is_hide_animation_running = 4;
+ optional bool is_show_requested_during_hide_animation = 5;
}
\ No newline at end of file
diff --git a/core/res/res/drawable/chooser_pinned_background.xml b/core/res/res/drawable/chooser_pinned_background.xml
index fbbe8c1..e8c9910 100644
--- a/core/res/res/drawable/chooser_pinned_background.xml
+++ b/core/res/res/drawable/chooser_pinned_background.xml
@@ -17,7 +17,8 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_chooser_pin"
- android:gravity="start|center_vertical"
+ android:gravity="start|top"
+ android:top="4dp"
android:width="12dp"
android:height="12dp"
android:start="0dp"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index febd14c..cae6165 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Moenie Steur Nie het verander"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tik om te kyk wat geblokkeer word."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Gaan kennisgewinginstellings na"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13 het programme wat jy installeer jou toestemming nodig om kennisgewings te stuur. Tik om hierdie toestemming vir bestaande programme te verander."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Herinner my later"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Maak toe"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Stelsel"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 1fd1b51..8bac983 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"አትረብሽ ተቀይሯል"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"ምን እንደታገደ ለመፈተሽ መታ ያድርጉ።"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"የማሳወቂያ ቅንብሮችን ይገምግሙ"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"በAndroid 13 ላይ የሚጭኗቸው መተግበሪያዎች ማሳወቂያዎችን ለመላክ የእርስዎ ፈቃድ ያስፈልጋቸዋል። ይህን ፈቃድ ለነባር መተግበሪያዎች ለመቀየር መታ ያድርጉ።"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"በኋላ አስታውሰኝ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"አሰናብት"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ሥርዓት"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 59d67e9..6134918 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -2057,7 +2057,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"تم تغيير ميزة \"عدم الإزعاج\""</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"انقر للاطّلاع على ما تم حظره."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"مراجعة إعدادات الإشعارات"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"في نظام التشغيل Android 13، يجب أن تحصل التطبيقات التي تُثبِّتها على إذن لإرسال الإشعارات. انقر لتغيير هذا الإذن للتطبيقات الحالية."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"تذكيري لاحقًا"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"إغلاق"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"النظام"</string>
@@ -2278,11 +2279,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> (مُترجَم)."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"الرسالة مُترجَمة من <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> إلى <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"النشاط في الخلفية"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"تطبيق يستنزف طاقة البطارية"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"ثمة تطبيق لا يزال نشطًا"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"التطبيق <xliff:g id="APP">%1$s</xliff:g> قيد التشغيل في الخلفية. انقر لإدارة استخدام البطارية."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"قد يؤثر استخدام التطبيق <xliff:g id="APP">%1$s</xliff:g> على عمر البطارية. انقر للاطّلاع على التطبيقات النشطة."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"التحقّق من التطبيقات النشطة"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"يتعذّر الوصول إلى كاميرا الهاتف من على جهاز <xliff:g id="DEVICE">%1$s</xliff:g>."</string>
diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml
index 80b2c32..4f3ed4c 100644
--- a/core/res/res/values-as/strings.xml
+++ b/core/res/res/values-as/strings.xml
@@ -1037,7 +1037,7 @@
<string name="permdesc_readHistoryBookmarks" msgid="2323799501008967852">"ব্ৰাউজাৰৰ বুকমার্ক আৰু ব্ৰাউজাৰে ব্যৱহাৰ কৰা আটাইবোৰ URLৰ ইতিহাস পঢ়িবলৈ এপক অনুমতি দিয়ে। টোকা: এই অনুমতি তৃতীয় পক্ষৰ ব্ৰাউজাৰবোৰ বা ৱেব ব্ৰাউজিং কৰিব পৰা অন্য এপ্লিকেশ্বনবোৰৰ দ্বাৰা বলৱৎ নহ\'বও পাৰে।"</string>
<string name="permlab_writeHistoryBookmarks" msgid="6090259925187986937">"আপোনাৰ ৱেব বুকমার্কবোৰ আৰু ইতিহাস লিখক"</string>
<string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="573341025292489065">"আপোনাৰ টেবলেটত সঞ্চয় কৰি ৰখা ব্ৰাউজাৰৰ বুকমার্ক আৰু ব্ৰাউজাৰৰ ইতিহাস সংশোধন কৰিবলৈ এপক অনুমতি দিয়ে। টোকা: এই অনুমতি তৃতীয় পক্ষৰ ব্ৰাউজাৰবোৰ বা ৱেব ব্ৰাউজিং কৰিব পৰা অন্য এপ্লিকেশ্বনবোৰৰ দ্বাৰা বলৱৎ নহ\'বও পাৰে।"</string>
- <string name="permdesc_writeHistoryBookmarks" product="tv" msgid="88642768580408561">"এপ্টোক আপোনাৰ Android TV ডিভাইচত ষ্ট’ৰ কৰি ৰখা ব্ৰাউজাৰৰ ইতিহাস আৰু বুকমার্কবোৰ সংশোধন কৰিবলৈ অনুমতি দিয়ে। ব্ৰাউজাৰ ডাটা মোহাৰিবলৈ অথবা সংশোধন কৰিবলৈ ই এপ্টোক অনুমতি দিব পাৰে। টোকা: এই অনুমতি তৃতীয় পক্ষৰ ব্ৰাউজাৰবোৰ অথবা ৱেব ব্ৰাউজিঙৰ ক্ষমতা থকা অন্য এপ্লিকেশ্বনবোৰৰ দ্বাৰা বলৱৎ কৰা নহ’বও পাৰে।"</string>
+ <string name="permdesc_writeHistoryBookmarks" product="tv" msgid="88642768580408561">"এপ্টোক আপোনাৰ Android TV ডিভাইচত ষ্ট’ৰ কৰি ৰখা ব্ৰাউজাৰৰ ইতিহাস আৰু বুকমার্কবোৰ সংশোধন কৰিবলৈ অনুমতি দিয়ে। ব্ৰাউজাৰ ডেটা মোহাৰিবলৈ অথবা সংশোধন কৰিবলৈ ই এপ্টোক অনুমতি দিব পাৰে। টোকা: এই অনুমতি তৃতীয় পক্ষৰ ব্ৰাউজাৰবোৰ অথবা ৱেব ব্ৰাউজিঙৰ ক্ষমতা থকা অন্য এপ্লিকেশ্বনবোৰৰ দ্বাৰা বলৱৎ কৰা নহ’বও পাৰে।"</string>
<string name="permdesc_writeHistoryBookmarks" product="default" msgid="2245203087160913652">"আপোনাৰ ফ\'নত সঞ্চয় কৰি ৰখা ব্ৰাউজাৰৰ বুকমার্ক আৰু ব্ৰাউজাৰৰ ইতিহাস সংশোধন কৰিবলৈ এপক অনুমতি দিয়ে। টোকা: এই অনুমতি তৃতীয় পক্ষৰ ব্ৰাউজাৰবোৰ বা ৱেব ব্ৰাউজিং কৰিব পৰা অন্য এপ্লিকেশ্বনবোৰৰ দ্বাৰা বলৱৎ নহ\'বও পাৰে।"</string>
<string name="permlab_setAlarm" msgid="1158001610254173567">"এলাৰ্ম ছেট কৰক"</string>
<string name="permdesc_setAlarm" msgid="2185033720060109640">"এপটোক ইনষ্টল হৈ থকা এলাৰ্ম ক্লক এপত এলাৰ্ম ছেট কৰিবলৈ অনুমতি দিয়ে। কিছুমান এলাৰ্ম ক্লক এপত এই সুবিধাটো প্ৰযোজ্য নহ’ব পাৰে।"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"অসুবিধা নিদিব সলনি হৈছে"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"কি কি অৱৰোধ কৰা হৈছে জানিবলৈ টিপক।"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"জাননীৰ ছেটিং পৰ্যালোচনা কৰক"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"আপুনি Android 13ত ইনষ্টল কৰা এপক জাননী পঠিয়াবলৈ আপোনাৰ অনুমতিৰ প্ৰয়োজন। আগৰে পৰা থকা এপৰ বাবে এই অনুমতিটো সলনি কৰিবলৈ টিপক।"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"পাছত মনত পেলাই দিব"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"অগ্ৰাহ্য কৰক"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ছিষ্টেম"</string>
diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml
index 64007d9..52a43af 100644
--- a/core/res/res/values-az/strings.xml
+++ b/core/res/res/values-az/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\"Narahat Etməyin\" rejimi dəyişdirildi"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Nəyin blok edildiyini yoxlamaq üçün klikləyin."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Bildiriş ayarlarını nəzərdən keçirin"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-də quraşdırdığınız tətbiqlər bildiriş göndərmək üçün icazənizi tələb edir. Mövcud tətbiqlər üçün bu icazəni dəyişmək üçün toxunun."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Sonra xatırladın"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Qapadın"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index 117120c..e854f43 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -2054,7 +2054,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Režim Ne uznemiravaj je promenjen"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Dodirnite da biste proverili šta je blokirano."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Pregledajte podešavanja obaveštenja"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"U Android-u 13 aplikacije koje instalirate moraju da imaju dozvolu za slanje obaveštenja. Dodirnite da biste promenili ovu dozvolu za postojeće aplikacije."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Podseti me kasnije"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Odbaci"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 4dbd03c..3197b73 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Зменены налады рэжыму \"Не турбаваць\""</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Націсніце, каб паглядзець заблакіраванае."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Праверце налады апавяшчэнняў"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"У версіі Android 13 усталяваным вамі праграмам неабходна даць дазвол на адпраўку апавяшчэнняў. Націсніце, каб змяніць дазвол для існуючых праграм."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Нагадаць пазней"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Закрыць"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Сістэма"</string>
@@ -2276,11 +2277,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Паведамленне \"<xliff:g id="MESSAGE">%1$s</xliff:g>\" перакладзена."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Паведамленне перакладзена з мовы \"<xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>\" на мову \"<xliff:g id="TO_LANGUAGE">%2$s</xliff:g>\"."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Фонавая дзейнасць"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Праграма разраджае акумулятар"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Праграма па-ранейшаму актыўная"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"Праграма \"<xliff:g id="APP">%1$s</xliff:g>\" працуе ў фонавым рэжыме. Націсніце, каб кіраваць выкарыстаннем зараду."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> можа скараціць час працы прылады ад акумулятара. Націсніце, каб праглядзець актыўныя праграмы."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Праверце актыўныя праграмы"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Не ўдалося атрымаць доступ да камеры тэлефона з прылады \"<xliff:g id="DEVICE">%1$s</xliff:g>\""</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index ea5aed4..ee7af66 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Настройките за „Не безпокойте“ са променени"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Докоснете, за да проверите какво е блокирано."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Преглед на настройките за известия"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Под Android 13 инсталираните от вас приложения трябва да получат разрешението ви, за да изпращат известия. Докоснете, за да промените това разрешение за съществуващите приложения."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Напомняне по-късно"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Отхвърляне"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Система"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Съобщението <xliff:g id="MESSAGE">%1$s</xliff:g> бе преведено."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Съобщението бе преведено от <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> на <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Активност на заден план"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Приложение изтощава батерията"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Приложение е все още активно"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> работи на заден план. Докоснете, за да управлявате използването на батерията."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> може да засегне живота на батерията. Докоснете за преглед на активните приложения."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Проверете активните приложения"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Няма достъп до камерата на телефона от вашия <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml
index 386677c..b0a832e 100644
--- a/core/res/res/values-bn/strings.xml
+++ b/core/res/res/values-bn/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\'বিরক্ত করবে না\' মোডের সেটিং বদলে গেছে"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"কী কী ব্লক করা আছে তা দেখতে ট্যাপ করুন।"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"বিজ্ঞপ্তির সেটিংস পর্যালোচনা করুন"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-এ, আপনার ইনস্টল করা অ্যাপের বিজ্ঞপ্তি পাঠানোর জন্য অনুমতি প্রয়োজন। আগে থাকা অ্যাপের জন্য এই অনুমতি পরিবর্তন করতে ট্যাপ করুন।"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"পরে মনে করিয়ে দিও"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"বাতিল করুন"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"সিস্টেম"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> অনুবাদ করা হয়েছে।"</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"মেসেজ <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> থেকে <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> ভাষাতে অনুবাদ করা হয়েছে।"</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"ব্যাকগ্রাউন্ড অ্যাক্টিভিটি"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"কোনও অ্যাপ ব্যাটারির চার্জ দ্রুত শেষ করে ফেলছে"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"কোনও একটি অ্যাপ এখনও চালু আছে"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"ব্যাকগ্রাউন্ডে <xliff:g id="APP">%1$s</xliff:g> চলছে। ব্যাটারির ব্যবহার ম্যানেজ করতে ট্যাপ করুন।"</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> ব্যাটারির আয়ুকে প্রভাবিত করতে পারে। চালু থাকা অ্যাপ পর্যালোচনা করতে ট্যাপ করুন।"</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"অ্যাক্টিভ অ্যাপ চেক করুন"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"আপনার <xliff:g id="DEVICE">%1$s</xliff:g> থেকে ফোনের ক্যামেরা অ্যাক্সেস করা যাচ্ছে না"</string>
diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml
index b1b0e05..b73b6a9 100644
--- a/core/res/res/values-bs/strings.xml
+++ b/core/res/res/values-bs/strings.xml
@@ -2054,7 +2054,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Način rada Ne ometaj je promijenjen"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Dodirnite da provjerite šta je blokirano."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Pregledajte postavke obavještenja"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"U Androidu 13 aplikacije koje instalirate trebaju odobrenje da šalju obavještenja. Dodirnite da promijenite odobrenje za postojeće aplikacije."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Podsjeti me kasnije"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Odbaci"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
@@ -2275,9 +2276,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> – prevedeno."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Poruka je prevedena s jezika <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> na <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Aktivnost u pozadini"</string>
- <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Aplikacija prazni bateriju"</string>
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Aplikacija troši bateriju"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Aplikacija je i dalje aktivna"</string>
- <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> se pokreće u pozadini. Dodirnite da biste upravljali potrošnjom baterije."</string>
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"Aplikacija <xliff:g id="APP">%1$s</xliff:g> radi u pozadini. Dodirnite da upravljate potrošnjom baterije."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"Aplikacija <xliff:g id="APP">%1$s</xliff:g> može uticati na vijek trajanja baterije. Dodirnite da pregledate aktivne aplikacije."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Provjerite aktivne aplikacije"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Nije moguće pristupiti kameri telefona s uređaja <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index c40da71..ded50c7 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"S\'ha canviat el mode No molestis"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Toca per consultar què s\'ha bloquejat."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Consulta la configuració de notificacions"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"A Android 13, les aplicacions que instal·les necessiten el teu permís per enviar notificacions. Toca per canviar aquest permís per a les aplicacions existents."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Recorda-m\'ho més tard"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Ignora"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index bb6a14d..aad6bc4 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Nastavení režimu Nerušit se změnilo"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Klepnutím zkontrolujete, co je blokováno."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Zkontrolujte nastavení oznámení"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"V systému Android 13 od vás nainstalované aplikace potřebují oprávnění k odesílání oznámení. Klepnutím toto oprávnění změníte pro stávající aplikace."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Připomenout později"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Zavřít"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Systém"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 879e001..6c12cc2 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Tilstanden Forstyr ikke blev ændret"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tryk for at se, hvad der er blokeret."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Gennemgå indstillinger for notifikationer"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"I Android 13 skal apps, som du installerer, have din tilladelse til at sende notifikationer. Tryk for at ændre denne indstilling for eksisterende apps."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Påmind mig senere"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Luk"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> er oversat."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Meddelelsen er oversat fra <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> til <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Aktivitet i baggrunden"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"En app aflader batteriet"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"En app er stadig aktiv"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> kører i baggrunden. Tryk for at administrere batteriforbruget."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> kan påvirke batteritiden. Tryk for at gennemgå nye apps."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Tjek aktive apps"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Kameraet på din telefon kan ikke tilgås via din <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 78e986e..f8c7596 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"„Bitte nicht stören“ wurde geändert"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tippe, um zu überprüfen, welche Inhalte blockiert werden."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Benachrichtigungseinstellungen überprüfen"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Bei Android 13 benötigen Apps, die du installierst, die Berechtigung zum Senden von Benachrichtigungen. Wenn du diese Berechtigung für bereits installierte Apps ändern möchtest, tippe hier."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Später erinnern"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Schließen"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index fca6363..e949ce1 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -1912,8 +1912,8 @@
<string name="importance_from_user" msgid="2782756722448800447">"Μπορείτε να ρυθμίσετε τη βαρύτητα αυτών των ειδοποιήσεων."</string>
<string name="importance_from_person" msgid="4235804979664465383">"Αυτό είναι σημαντικό λόγω των ατόμων που συμμετέχουν."</string>
<string name="notification_history_title_placeholder" msgid="7748630986182249599">"Προσαρμοσμένη ειδοποίηση εφαρμογής"</string>
- <string name="user_creation_account_exists" msgid="2239146360099708035">"Επιτρέπετε στην εφαρμογή <xliff:g id="APP">%1$s</xliff:g> να δημιουργήσει έναν νέο χρήστη με τον λογαριασμό <xliff:g id="ACCOUNT">%2$s</xliff:g> (υπάρχει ήδη χρήστης με αυτόν τον λογαριασμό);"</string>
- <string name="user_creation_adding" msgid="7305185499667958364">"Επιτρέπετε στην εφαρμογή <xliff:g id="APP">%1$s</xliff:g> να δημιουργήσει έναν νέο χρήστη με τον λογαριασμό <xliff:g id="ACCOUNT">%2$s</xliff:g>;"</string>
+ <string name="user_creation_account_exists" msgid="2239146360099708035">"Επιτρέπετε στο <xliff:g id="APP">%1$s</xliff:g> να δημιουργήσει έναν νέο χρήστη με τον λογαριασμό <xliff:g id="ACCOUNT">%2$s</xliff:g> (υπάρχει ήδη χρήστης με αυτόν τον λογαριασμό);"</string>
+ <string name="user_creation_adding" msgid="7305185499667958364">"Επιτρέπετε στο <xliff:g id="APP">%1$s</xliff:g> να δημιουργήσει έναν νέο χρήστη με τον λογαριασμό <xliff:g id="ACCOUNT">%2$s</xliff:g>;"</string>
<string name="supervised_user_creation_label" msgid="6884904353827427515">"Προσθήκη εποπτευόμενου χρήστη"</string>
<string name="language_selection_title" msgid="52674936078683285">"Προσθήκη γλώσσας"</string>
<string name="country_selection_title" msgid="5221495687299014379">"Προτίμηση περιοχής"</string>
@@ -2037,7 +2037,7 @@
<string name="harmful_app_warning_uninstall" msgid="6472912975664191772">"ΑΠΕΓΚΑΤΑΣΤΑΣΗ"</string>
<string name="harmful_app_warning_open_anyway" msgid="5963657791740211807">"ΑΝΟΙΓΜΑ"</string>
<string name="harmful_app_warning_title" msgid="8794823880881113856">"Εντοπίστηκε επιβλαβής εφαρμογή"</string>
- <string name="log_access_confirmation_title" msgid="2343578467290592708">"Να επιτρέπεται στην εφαρμογή <xliff:g id="LOG_ACCESS_APP_NAME">%s</xliff:g> η πρόσβαση σε όλα τα αρχεία καταγραφής συσκευής;"</string>
+ <string name="log_access_confirmation_title" msgid="2343578467290592708">"Να επιτρέπεται στο <xliff:g id="LOG_ACCESS_APP_NAME">%s</xliff:g> η πρόσβαση σε όλα τα αρχεία καταγραφής συσκευής;"</string>
<string name="log_access_confirmation_allow" msgid="5302517782599389507">"Να επιτρέπεται η πρόσβαση για μία φορά"</string>
<string name="log_access_confirmation_deny" msgid="7685790957455099845">"Να μην επιτραπεί"</string>
<string name="log_access_confirmation_body" msgid="6581985716241928135">"Τα αρχεία καταγραφής συσκευής καταγράφουν ό,τι συμβαίνει στη συσκευή σας. Οι εφαρμογές μπορούν να χρησιμοποιούν αυτά τα αρχεία καταγραφής για να εντοπίζουν και να διορθώνουν ζητήματα.\n\nΟρισμένα αρχεία καταγραφής ενδέχεται να περιέχουν ευαίσθητες πληροφορίες. Ως εκ τούτου, επιτρέψτε την πρόσβαση σε όλα τα αρχεία καταγραφής συσκευής μόνο στις εφαρμογές που εμπιστεύεστε. \n\nΕάν δεν επιτρέψετε σε αυτήν την εφαρμογή την πρόσβαση σε όλα τα αρχεία καταγραφής συσκευής, η εφαρμογή εξακολουθεί να έχει πρόσβαση στα δικά της αρχεία καταγραφής. Ο κατασκευαστής της συσκευής σας ενδέχεται να εξακολουθεί να έχει πρόσβαση σε ορισμένα αρχεία καταγραφής ή ορισμένες πληροφορίες στη συσκευή σας. Μάθετε περισσότερα"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Η λειτουργία \"Μην ενοχλείτε\" άλλαξε"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Πατήστε για να ελέγξετε το περιεχόμενο που έχει αποκλειστεί."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Έλεγχος ρυθμίσεων ειδοποιήσεων"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Στο Android 13, οι εφαρμογές που εγκαθιστάτε χρειάζονται την άδειά σας για την αποστολή ειδοποιήσεων. Πατήστε για να αλλάξετε αυτήν την άδεια για υπάρχουσες εφαρμογές."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Υπενθύμιση αργότερα"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Παράβλεψη"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Σύστημα"</string>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index 4b55b70..aedac3e 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Do Not Disturb has changed"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tap to check what\'s blocked."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Review notification settings"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13, apps that you install need your permission to send notifications. Tap to change this permission for existing apps."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Remind me later"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Dismiss"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index 7ac8f01..88fedc9 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Do Not Disturb has changed"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tap to check what\'s blocked."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Review notification settings"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13, apps that you install need your permission to send notifications. Tap to change this permission for existing apps."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Remind me later"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Dismiss"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 5f3faeb..dd9de67 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Do Not Disturb has changed"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tap to check what\'s blocked."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Review notification settings"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13, apps that you install need your permission to send notifications. Tap to change this permission for existing apps."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Remind me later"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Dismiss"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index 9855d01..a953730 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Do Not Disturb has changed"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tap to check what\'s blocked."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Review notification settings"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13, apps that you install need your permission to send notifications. Tap to change this permission for existing apps."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Remind me later"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Dismiss"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index 05565ae..0aa8b28 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Do Not Disturb has changed"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tap to check what\'s blocked."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Review notification settings"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13, apps that you install need your permission to send notifications. Tap to change this permission for existing apps."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Remind me later"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Dismiss"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 3ed9950..62b2d76 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Se modificó la opción No interrumpir"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Presiona para consultar lo que está bloqueado."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Revisa la configuración de notificaciones"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"En Android 13, las apps que instales necesitarán tu permiso a fin de enviar notificaciones. Presiona para cambiar este permiso para las apps existentes."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Recordarme más tarde"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Descartar"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Se tradujo: <xliff:g id="MESSAGE">%1$s</xliff:g>."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Se tradujo el mensaje del <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> al <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Actividad en segundo plano"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Una app está agotando la batería."</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Hay una app que sigue activa"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> se está ejecutando en segundo plano. Presiona para administrar el uso de batería."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> podría afectar la duración de la batería. Presiona para revisar las apps activas."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Consulta las apps activas"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"No se puede acceder a la cámara del dispositivo desde tu <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 7be37cf..d31705d 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -213,7 +213,7 @@
<string name="power_dialog" product="tablet" msgid="8333207765671417261">"Opciones del tablet"</string>
<string name="power_dialog" product="tv" msgid="7792839006640933763">"Opciones de Android TV"</string>
<string name="power_dialog" product="default" msgid="1107775420270203046">"Opciones del teléfono"</string>
- <string name="silent_mode" msgid="8796112363642579333">"Modo silencio"</string>
+ <string name="silent_mode" msgid="8796112363642579333">"Modo Silencio"</string>
<string name="turn_on_radio" msgid="2961717788170634233">"Activar conexión inalámbrica"</string>
<string name="turn_off_radio" msgid="7222573978109933360">"Desactivar función inalámbrica"</string>
<string name="screen_lock" msgid="2072642720826409809">"Bloqueo de pantalla"</string>
@@ -233,8 +233,8 @@
<string name="shutdown_confirm" product="watch" msgid="2977299851200240146">"El reloj se apagará."</string>
<string name="shutdown_confirm" product="default" msgid="136816458966692315">"El teléfono se apagará."</string>
<string name="shutdown_confirm_question" msgid="796151167261608447">"¿Seguro que quieres apagar el teléfono?"</string>
- <string name="reboot_safemode_title" msgid="5853949122655346734">"Reiniciar en modo seguro"</string>
- <string name="reboot_safemode_confirm" msgid="1658357874737219624">"¿Quieres reiniciar el sistema en modo seguro? Se inhabilitarán todas las aplicaciones externas que hayas instalado. Esas aplicaciones se restaurarán la próxima vez que reinicies del sistema."</string>
+ <string name="reboot_safemode_title" msgid="5853949122655346734">"Reiniciar en modo Seguro"</string>
+ <string name="reboot_safemode_confirm" msgid="1658357874737219624">"¿Quieres reiniciar el sistema en modo Seguro? Se inhabilitarán todas las aplicaciones externas que hayas instalado. Esas aplicaciones se restaurarán la próxima vez que reinicies del sistema."</string>
<string name="recent_tasks_title" msgid="8183172372995396653">"Reciente"</string>
<string name="no_recent_tasks" msgid="9063946524312275906">"No hay aplicaciones recientes."</string>
<string name="global_actions" product="tablet" msgid="4412132498517933867">"Opciones del tablet"</string>
@@ -257,12 +257,12 @@
<string name="bugreport_countdown" msgid="6418620521782120755">"{count,plural, =1{La captura de pantalla para el informe de errores se hará en # segundo.}other{La captura de pantalla para el informe de errores se hará en # segundos.}}"</string>
<string name="bugreport_screenshot_success_toast" msgid="7986095104151473745">"Se ha hecho la captura de pantalla con el informe de errores"</string>
<string name="bugreport_screenshot_failure_toast" msgid="6736320861311294294">"No se ha podido hacer la captura de pantalla con el informe de errores"</string>
- <string name="global_action_toggle_silent_mode" msgid="8464352592860372188">"Modo silencio"</string>
+ <string name="global_action_toggle_silent_mode" msgid="8464352592860372188">"Modo Silencio"</string>
<string name="global_action_silent_mode_on_status" msgid="2371892537738632013">"El sonido está desactivado. Activar"</string>
<string name="global_action_silent_mode_off_status" msgid="6608006545950920042">"El sonido está activado. Desactivar"</string>
- <string name="global_actions_toggle_airplane_mode" msgid="6911684460146916206">"Modo avión"</string>
- <string name="global_actions_airplane_mode_on_status" msgid="5508025516695361936">"Modo avión activado. Desactivar"</string>
- <string name="global_actions_airplane_mode_off_status" msgid="8522219771500505475">"Modo avión desactivado. Activar"</string>
+ <string name="global_actions_toggle_airplane_mode" msgid="6911684460146916206">"Modo Avión"</string>
+ <string name="global_actions_airplane_mode_on_status" msgid="5508025516695361936">"Modo Avión activado. Desactivar"</string>
+ <string name="global_actions_airplane_mode_off_status" msgid="8522219771500505475">"Modo Avión desactivado. Activar"</string>
<string name="global_action_settings" msgid="4671878836947494217">"Ajustes"</string>
<string name="global_action_assist" msgid="2517047220311505805">"Asistencia"</string>
<string name="global_action_voice_assist" msgid="6655788068555086695">"Asistente voz"</string>
@@ -293,7 +293,7 @@
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplicaciones están usando la batería"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Toca para ver información detallada sobre el uso de datos y de la batería"</string>
<string name="foreground_service_multiple_separator" msgid="5002287361849863168">"<xliff:g id="LEFT_SIDE">%1$s</xliff:g>, <xliff:g id="RIGHT_SIDE">%2$s</xliff:g>"</string>
- <string name="safeMode" msgid="8974401416068943888">"Modo seguro"</string>
+ <string name="safeMode" msgid="8974401416068943888">"Modo Seguro"</string>
<string name="android_system_label" msgid="5974767339591067210">"Sistema Android"</string>
<string name="user_owner_label" msgid="8628726904184471211">"Cambiar al perfil personal"</string>
<string name="managed_profile_label" msgid="7316778766973512382">"Cambiar al perfil de trabajo"</string>
@@ -1696,7 +1696,7 @@
<string name="leave_accessibility_shortcut_on" msgid="6543362062336990814">"Utilizar acceso directo"</string>
<string name="color_inversion_feature_name" msgid="326050048927789012">"Inversión de color"</string>
<string name="color_correction_feature_name" msgid="3655077237805422597">"Corrección de color"</string>
- <string name="one_handed_mode_feature_name" msgid="2334330034828094891">"Modo una mano"</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="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>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Ha cambiado el modo No molestar"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Toca para consultar lo que se está bloqueando."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Consulta los ajustes de notificaciones"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"En Android 13, las aplicaciones que instales necesitan tu permiso para enviar notificaciones. Toca para cambiar este permiso en las aplicaciones que ya tengas."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Recordar más tarde"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Cerrar"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
@@ -2098,7 +2099,7 @@
<string name="mime_type_spreadsheet_ext" msgid="8720173181137254414">"Hoja de cálculo <xliff:g id="EXTENSION">%1$s</xliff:g>"</string>
<string name="mime_type_presentation" msgid="1145384236788242075">"Presentación"</string>
<string name="mime_type_presentation_ext" msgid="8761049335564371468">"Presentación <xliff:g id="EXTENSION">%1$s</xliff:g>"</string>
- <string name="bluetooth_airplane_mode_toast" msgid="2066399056595768554">"El Bluetooth seguirá activado en el modo avión"</string>
+ <string name="bluetooth_airplane_mode_toast" msgid="2066399056595768554">"El Bluetooth seguirá activado en el modo Avión"</string>
<string name="car_loading_profile" msgid="8219978381196748070">"Cargando"</string>
<string name="file_count" msgid="3220018595056126969">"{count,plural, =1{{file_name} y # archivo más}other{{file_name} y # archivos más}}"</string>
<string name="chooser_no_direct_share_targets" msgid="1511722103987329028">"No hay sugerencias de personas con las que compartir"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> traducido."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Mensaje traducido del <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> al <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Actividad en segundo plano"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Una aplicación está agotando la batería"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Una aplicación sigue activa"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> está funcionando en segundo plano. Toca para gestionar el uso de batería."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> podría afectar a la duración de la batería. Toca para ver las aplicaciones activas."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Consultar aplicaciones activas"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"No se puede acceder a la cámara del teléfono desde tu <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 6e6349f..abd3325 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Režiimi Mitte segada muudeti"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Puudutage, et kontrollida, mis on blokeeritud."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Vaadake üle märguandeseaded"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Operatsioonisüsteemis Android 13 vajavad installitavad rakendused märguannete saatmiseks teie luba. Puudutage, et muuta seda luba olemasolevate rakenduste jaoks."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Tuleta hiljem meelde"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Loobu"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Süsteem"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Sõnum „<xliff:g id="MESSAGE">%1$s</xliff:g>” on tõlgitud."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Sõnum on tõlgitud <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> keelest <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> keelde."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Tegevus taustal"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Rakendus kulutab akutoidet"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Rakendus on ikka aktiivne"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"Rakendus <xliff:g id="APP">%1$s</xliff:g> töötab taustal. Puudutage akukasutuse haldamiseks."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> võib aku tööiga mõjutada. Puudutage aktiivsete rakenduste ülevaatamiseks."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Vaadake aktiivseid rakendusi"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Teie seadmest <xliff:g id="DEVICE">%1$s</xliff:g> ei pääse telefoni kaamerale juurde"</string>
diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml
index 497df3a..9652c9a 100644
--- a/core/res/res/values-eu/strings.xml
+++ b/core/res/res/values-eu/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Ez molestatzeko modua aldatu da"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Sakatu zer dagoen blokeatuta ikusteko."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Berrikusi jakinarazpen-ezarpenak"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-n, jakinarazpenak bidaltzeko baimena eman behar diezu instalatzen dituzun aplikazioei. Sakatu hau lehendik dauden aplikazioen baimenak aldatzeko."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Gogorarazi geroago"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Baztertu"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index d1af2cd..8082401 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"«مزاحم نشوید» تغییر کرده است"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"برای بررسی موارد مسدودشده ضربه بزنید."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"مرور تنظیمات اعلان"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"در Android نسخه ۱۳، برنامههایی که نصب میکنید برای ارسال اعلان به اجازه شما نیاز دارند. برای تغییر دادن این اجازه برای برنامههای موجود، ضربه بزنید."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"بعداً یادآوری شود"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"رد شدن"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"سیستم"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> ترجمه شد."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"پیام از <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> به <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> ترجمه شد."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"فعالیت در پسزمینه"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"برنامهای شارژ باتری را خالی میکند"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"یکی از برنامهها همچنان فعال است"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> در پسزمینه درحال اجرا است. برای مدیریت مصرف باتری ضربه بزنید."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> ممکن است بر عمر باتری تأثیر بگذارد. برای مرور برنامههای فعال، ضربه بزنید."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"بررسی برنامههای فعال"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"نمیتوان از <xliff:g id="DEVICE">%1$s</xliff:g> شما به دوربین تلفن دسترسی داشت"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index adea5bf..52c1d26 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Älä häiritse ‑tila muuttui"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Napauta niin näet, mitä on estetty."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Tarkista ilmoitusasetukset"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Asentamasi sovellukset tarvitsevat sinulta luvan ilmoitusten lähettämiseen Android 13 ‑käyttöjärjestelmässä. Napauta muuttaaksesi aiempien sovellusten lupia."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Muistuta myöhemmin"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Ohita"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Järjestelmä"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> käännettiin."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Viesti käännettiin kielestä <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> kielelle <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Taustatoiminta"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Sovellus kuluttaa akkua"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Sovellus on edelleen aktiivinen"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> on käynnissä taustalla. Hallitse akun käyttöä napauttamalla."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> saattaa vaikuttaa akunkestoon. Tarkista aktiiviset sovellukset napauttamalla."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Tarkista aktiiviset sovellukset"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"<xliff:g id="DEVICE">%1$s</xliff:g> ei pääse puhelimen kameraan"</string>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index 71bd100..fc7fc07 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Les paramètres du mode Ne pas déranger ont changé"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Touchez l\'écran pour vérifier ce qui est bloqué."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Examiner les paramètres de notification"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Sous Android 13, les applications que vous installez ont besoin de votre autorisation pour envoyer des notifications. Touchez pour modifier cette autorisation pour les applications existantes."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Me rappeler plus tard"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Fermer"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Système"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Message <xliff:g id="MESSAGE">%1$s</xliff:g> traduit."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Message traduit : <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> vers <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Activité en arrière-plan"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Une application décharge votre pile"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Une application est toujours active"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> s\'exécute en arrière-plan. Touchez pour gérer l\'utilisation de la pile."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> peut avoir une incidence sur l\'autonomie de la pile. Touchez pour examiner les applications actives."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Vérifier les applications actives"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Impossible d\'accéder à l\'appareil photo du téléphone à partir de votre <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 0675e8c..a8082c6 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Le mode Ne pas déranger a été modifié"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Appuyez pour vérifier les contenus bloqués."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Consulter les paramètres de notification"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Sur Android 13, les applis que vous installez ont besoin de votre autorisation pour vous envoyer des notifications. Appuyez pour modifier cette autorisation pour les applis déjà installées."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Plus tard"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Fermer"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Système"</string>
diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml
index 6cadfa1..0393c4b 100644
--- a/core/res/res/values-gl/strings.xml
+++ b/core/res/res/values-gl/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"O modo Non molestar cambiou"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Toca para comprobar o contido bloqueado."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Consulta a configuración de notificacións"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"En Android 13, as aplicacións que instales necesitan o teu permiso para enviar notificacións. Toca para cambiar este permiso nas aplicacións que xa teñas."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Lembrarmo máis tarde"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Pechar"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Mensaxe <xliff:g id="MESSAGE">%1$s</xliff:g> traducida."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Mensaxe traducida do <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> ao <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Actividade en segundo plano"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Hai unha aplicación que está consumindo excesiva batería"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Hai unha aplicación que aínda está activa"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"Estase executando en segundo plano a aplicación <xliff:g id="APP">%1$s</xliff:g>. Toca para xestionar o uso da batería."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> podería estar minguando a duración da batería. Toca para revisar as aplicacións activas."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Comprobar aplicacións activas"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Non se puido acceder á cámara do teléfono desde o teu dispositivo (<xliff:g id="DEVICE">%1$s</xliff:g>)"</string>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index 43f21d4..033f7ee 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -2052,14 +2052,11 @@
<string name="zen_upgrade_notification_visd_content" msgid="3683314609114134946">"વધુ જાણવા અને બદલવા માટે ટૅપ કરો."</string>
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"ખલેલ પાડશો નહીંમાં ફેરફાર થયો છે"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"શું બ્લૉક કરેલ છે તે તપાસવા માટે ટૅપ કરો."</string>
- <!-- no translation found for review_notification_settings_title (5102557424459810820) -->
+ <string name="review_notification_settings_title" msgid="5102557424459810820">"નોટિફિકેશનના સેટિંગ રિવ્યૂ કરો"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
<skip />
- <!-- no translation found for review_notification_settings_text (5696497037817525074) -->
- <skip />
- <!-- no translation found for review_notification_settings_remind_me_action (1081081018678480907) -->
- <skip />
- <!-- no translation found for review_notification_settings_dismiss (4160916504616428294) -->
- <skip />
+ <string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"મને પછી યાદ અપાવજો"</string>
+ <string name="review_notification_settings_dismiss" msgid="4160916504616428294">"છોડી દો"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"સિસ્ટમ"</string>
<string name="notification_app_name_settings" msgid="9088548800899952531">"સેટિંગ"</string>
<string name="notification_appops_camera_active" msgid="8177643089272352083">"કૅમેરા"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index bef53d6..f029822 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -1926,7 +1926,7 @@
<string name="app_suspended_default_message" msgid="6451215678552004172">"फ़िलहाल <xliff:g id="APP_NAME_0">%1$s</xliff:g> उपलब्ध नहीं है. इसे <xliff:g id="APP_NAME_1">%2$s</xliff:g> के ज़रिए प्रबंधित किया जाता है."</string>
<string name="app_suspended_more_details" msgid="211260942831587014">"ज़्यादा जानें"</string>
<string name="app_suspended_unsuspend_message" msgid="1665438589450555459">"ऐप्लिकेशन पर लगी रोक हटाएं"</string>
- <string name="work_mode_off_title" msgid="961171256005852058">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन चालू करना चाहते हैं?"</string>
+ <string name="work_mode_off_title" msgid="961171256005852058">"ऑफ़िस के काम से जुड़े ऐप्लिकेशन चालू करने हैं?"</string>
<string name="work_mode_off_message" msgid="7319580997683623309">"अपने ऑफ़िस के काम से जुड़े ऐप्लिकेशन और सूचनाओं का ऐक्सेस पाएं"</string>
<string name="work_mode_turn_on" msgid="3662561662475962285">"चालू करें"</string>
<string name="app_blocked_title" msgid="7353262160455028160">"ऐप्लिकेशन उपलब्ध नहीं है"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"परेशान न करें की सुविधा बदल गई है"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"टैप करके देखें कि किन चीज़ों पर रोक लगाई गई है."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"सूचना सेटिंग देखें"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 में जो ऐप्लिकेशन इंस्टॉल किए जाएंगे, उन्हें आपको सूचनाएं भेजने के लिए अनुमति लेनी होगी. पहले से इंस्टॉल किए गए ऐप्लिकेशन को दी गई अनुमति बदलने के लिए टैप करें."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"बाद में याद दिलाएं"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"बंद करें"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"सिस्टम"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> का अनुवाद किया गया."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"मैसेज का <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> से <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> में अनुवाद किया गया."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"बैकग्राउंड में हो रही गतिविधि"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"कोई ऐप्लिकेशन, तेज़ी से बैटरी खर्च कर रहा है"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"कोई ऐप्लिकेशन अब भी चालू है"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> बैकग्राउंड में चल रहा है. \'बैटरी खर्च को मैनेज करें\' पर टैप करें."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> से, आपके डिवाइस की बैटरी लाइफ़ पर असर पड़ सकता है. चालू ऐप्लिकेशन देखने के लिए टैप करें."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"चालू ऐप्लिकेशन देखें"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"आपके <xliff:g id="DEVICE">%1$s</xliff:g> से फ़ोन के कैमरे को ऐक्सेस नहीं किया जा सकता"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 21bcd20..42adb5d 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -2054,7 +2054,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Promijenjena je postavka Ne uznemiravaj"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Dodirnite da biste provjerili što je blokirano."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Pregledajte postavke obavijesti"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"U Androidu 13 aplikacije koje instalirate trebaju vaše dopuštenje za slanje obavijesti. Dodirnite da biste promijenili to dopuštenje za postojeće aplikacije."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Podsjeti me kasnije"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Odbaci"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sustav"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 21c40ad..c02cff6 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Módosultak a Ne zavarjanak mód beállításai"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Koppintson a letiltott elemek megtekintéséhez."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Értesítési beállítások áttekintése"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-as rendszeren a telepített alkalmazásoknak engedélyre van szükségük értesítések küldéséhez. Koppintással módosíthatja ezt az engedélyt a meglévő alkalmazások esetében."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Emlékeztessen később"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Bezárás"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Rendszer"</string>
diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml
index 7c966b3..b983004 100644
--- a/core/res/res/values-hy/strings.xml
+++ b/core/res/res/values-hy/strings.xml
@@ -1927,7 +1927,7 @@
<string name="app_suspended_more_details" msgid="211260942831587014">"Մանրամասն"</string>
<string name="app_suspended_unsuspend_message" msgid="1665438589450555459">"Չեղարկել դադարեցումը"</string>
<string name="work_mode_off_title" msgid="961171256005852058">"Միացնե՞լ հավելվածները"</string>
- <string name="work_mode_off_message" msgid="7319580997683623309">"Միացրեք աշխատանքային հավելվածներն ու ծանուցումները"</string>
+ <string name="work_mode_off_message" msgid="7319580997683623309">"Ձեզ հասանելի կդառնան ձեր աշխատանքային հավելվածներն ու ծանուցումները"</string>
<string name="work_mode_turn_on" msgid="3662561662475962285">"Միացնել"</string>
<string name="app_blocked_title" msgid="7353262160455028160">"Հավելվածը հասանելի չէ"</string>
<string name="app_blocked_message" msgid="542972921087873023">"<xliff:g id="APP_NAME">%1$s</xliff:g> հավելվածն այս պահին հասանելի չէ։"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"«Չանհանգստացնել» ռեժիմի կարգավորումները փոխվել են"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Հպեք՝ տեսնելու, թե ինչ է արգելափակվել:"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Ստուգեք ծանուցումների կարգավորումները"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-ում ձեր տեղադրած հավելվածներին անհրաժեշտ է տրամադրել ծանուցումներ ուղարկելու թույլտվություն։ Հպեք և փոխեք այս թույլտվությունն արդեն տեղադրված հավելվածների համար։"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Հիշեցնել ավելի ուշ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Փակել"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Համակարգ"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 61104d3..0fb0f5b 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Jangan Ganggu telah berubah"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Ketuk untuk memeriksa item yang diblokir."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Tinjau setelan notifikasi"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Di Android 13, aplikasi yang Anda instal memerlukan izin untuk mengirim notifikasi. Ketuk guna mengubah izin ini untuk aplikasi yang sudah ada."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Ingatkan saya nanti"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Tutup"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> Diterjemahkan."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Pesan diterjemahkan dari bahasa <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> ke <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Aktivitas Latar Belakang"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Aplikasi menghabiskan daya baterai"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Aplikasi masih aktif"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> sedang berjalan di latar belakang. Ketuk untuk mengelola penggunaan baterai."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> mungkin memengaruhi masa pakai baterai. Ketuk untuk meninjau aplikasi aktif."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Periksa aplikasi aktif"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Tidak dapat mengakses kamera ponsel dari <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index 8b8a228..ce84af7 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"„Ónáðið ekki“ var breytt"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Ýttu til að skoða hvað lokað hefur verið á."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Yfirfara tilkynningastillingar"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Í Android 13 þurfa forrit sem þú setur upp heimild frá þér til að senda tilkynningar. Ýttu til að breyta þessari heimild fyrir forrit sem fyrir eru."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Minna mig á seinna"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Hunsa"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Kerfi"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> var þýtt."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Skilaboð þýdd úr <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> á <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Bakgrunnsvirkni"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Forrit notar mikið af rafhlöðunni"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Forrit er enn virkt"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> keyrir í bakgrunni. Ýttu til að stjórna rafhlöðunotkun."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> gæti haft áhrif á rafhlöðuendingu. Ýttu til að skoða virk forrit."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Skoða virk forrit"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Ekki er hægt að opna myndavél símans úr <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index bf591ec..1db6e66 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"L\'impostazione Non disturbare è cambiata"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tocca per controllare le notifiche bloccate."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Controlla le impostazioni di notifica"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13, le app che installi devono avere la tua autorizzazione per poter inviare notifiche. Tocca per cambiare questa autorizzazione per le app esistenti."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Ricordamelo dopo"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Ignora"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Messaggio <xliff:g id="MESSAGE">%1$s</xliff:g> tradotto."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Messaggio tradotto dalla lingua <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> alla lingua <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Attività in background"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Un\'app sta consumando la batteria"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"C\'è un\'app ancora attiva"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> è in esecuzione in background. Tocca per gestire l\'utilizzo della batteria."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> potrebbe influire sulla durata della batteria. Tocca per controllare le app attive."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Verifica le app attive"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Impossibile accedere alla fotocamera del telefono dal tuo <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index e1c696f..0449349 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"ההגדרה \'נא לא להפריע\' השתנתה"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"יש להקיש כדי לבדוק מה חסום."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"בדיקת הגדרת ההתראות"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"ב-Android 13, עליך לתת לאפליקציות שהתקנת הרשאה לשלוח התראות. אפשר להקיש כדי לשנות את ההרשאה הזו באפליקציות קיימות."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"תזכירו לי מאוחר יותר"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"סגירה"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"מערכת"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index dff29f9..1fe3736 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"サイレント モードが変わりました"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"タップしてブロック対象をご確認ください。"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"通知設定の確認"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 では、インストールするアプリに、通知を送信する権限を付与する必要があります。既存のアプリのこの権限を変更するには、タップしてください。"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"後で"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"閉じる"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"システム"</string>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index e98240e..7fb4833 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"„არ შემაწუხოთ“ რეჟიმი შეცვლილია"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"შეეხეთ იმის სანახავად, თუ რა არის დაბლოკილი."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"შეტყობინების პარამეტრების შემოწმება"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-ზე შეტყობინებების გასაგზავნად საჭიროა თქვენ მიერ დაინსტალირებული აპებისთვის ნებართვის მინიჭება. არსებული აპებისთვის ამ ნებართვის შესაცვლელად შეეხეთ."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"შემახსენე მოგვიან."</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"უარყოფა"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"სისტემა"</string>
diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml
index a21479f..4bd7c14 100644
--- a/core/res/res/values-kk/strings.xml
+++ b/core/res/res/values-kk/strings.xml
@@ -1933,36 +1933,21 @@
<string name="app_blocked_message" msgid="542972921087873023">"<xliff:g id="APP_NAME">%1$s</xliff:g> қазір қолжетімді емес."</string>
<string name="app_streaming_blocked_title" msgid="6090945835898766139">"<xliff:g id="ACTIVITY">%1$s</xliff:g> қолжетімсіз"</string>
<string name="app_streaming_blocked_title_for_permission_dialog" msgid="4483161748582966785">"Рұқсат қажет"</string>
- <!-- no translation found for app_streaming_blocked_title_for_camera_dialog (3935701653713853065) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_fingerprint_dialog (3516853717714141951) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_microphone_dialog (544822455127171206) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_settings_dialog (196994247017450357) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_settings_dialog (8222710146267948647) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_settings_dialog (6895719984375299791) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message (5024599278277957935) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message (7491114163056552686) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message (1245180131667647277) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_permission_dialog (6306583663205997979) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_permission_dialog (6545624942642129664) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_permission_dialog (8462740631707923000) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_fingerprint_dialog (3470977315395784567) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_fingerprint_dialog (698460091901465092) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_fingerprint_dialog (8552691971910603907) -->
- <skip />
+ <string name="app_streaming_blocked_title_for_camera_dialog" msgid="3935701653713853065">"Камера қолжетімді емес"</string>
+ <string name="app_streaming_blocked_title_for_fingerprint_dialog" msgid="3516853717714141951">"Телефоннан жалғастыру"</string>
+ <string name="app_streaming_blocked_title_for_microphone_dialog" msgid="544822455127171206">"Микрофон қолжетімді емес"</string>
+ <string name="app_streaming_blocked_title_for_settings_dialog" product="tv" msgid="196994247017450357">"Android TV параметрлері қолжетімді емес"</string>
+ <string name="app_streaming_blocked_title_for_settings_dialog" product="tablet" msgid="8222710146267948647">"Планшет параметрлері қолжетімді емес"</string>
+ <string name="app_streaming_blocked_title_for_settings_dialog" product="default" msgid="6895719984375299791">"Телефон параметрлері қолжетімді емес"</string>
+ <string name="app_streaming_blocked_message" product="tv" msgid="5024599278277957935">"Бұған <xliff:g id="DEVICE">%1$s</xliff:g> құрылғысынан кіру мүмкін емес. Оның орнына Android TV құрылғысын пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message" product="tablet" msgid="7491114163056552686">"Бұған <xliff:g id="DEVICE">%1$s</xliff:g> құрылғысынан кіру мүмкін емес. Оның орнына планшетті пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message" product="default" msgid="1245180131667647277">"Бұған <xliff:g id="DEVICE">%1$s</xliff:g> құрылғысынан кіру мүмкін емес. Оның орнына телефонды пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message_for_permission_dialog" product="tv" msgid="6306583663205997979">"Қазір бұған <xliff:g id="DEVICE">%1$s</xliff:g> құрылғысынан кіру мүмкін емес. Оның орнына Android TV құрылғысын пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message_for_permission_dialog" product="tablet" msgid="6545624942642129664">"Қазір бұған <xliff:g id="DEVICE">%1$s</xliff:g> құрылғысынан кіру мүмкін емес. Оның орнына планшетті пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message_for_permission_dialog" product="default" msgid="8462740631707923000">"Қазір бұған <xliff:g id="DEVICE">%1$s</xliff:g> құрылғысынан кіру мүмкін емес. Оның орнына телефонды пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tv" msgid="3470977315395784567">"Бұл қолданба үшін қосымша қауіпсіздік шарасы қажет. Оның орнына Android TV құрылғысын пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tablet" msgid="698460091901465092">"Бұл қолданба үшін қосымша қауіпсіздік шарасы қажет. Оның орнына планшетті пайдаланып көріңіз."</string>
+ <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="default" msgid="8552691971910603907">"Бұл қолданба үшін қосымша қауіпсіздік шарасы қажет. Оның орнына телефонды пайдаланып көріңіз."</string>
<string name="deprecated_target_sdk_message" msgid="5203207875657579953">"Қолданба Android жүйесінің ескі нұсқасына арналған және дұрыс жұмыс істемеуі мүмкін. Жаңартылған нұсқаны тексеріңіз немесе әзірлеушіге хабарласыңыз."</string>
<string name="deprecated_target_sdk_app_store" msgid="8456784048558808909">"Жаңарту бар-жоғын тексеру"</string>
<string name="new_sms_notification_title" msgid="6528758221319927107">"Сізде жаңа хабарлар бар"</string>
@@ -2068,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Мазаламау режимі өзгерді"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Түймені түртіп, неге тыйым салынатынын көріңіз."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Хабарландыру параметрлерін қарау"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 нұсқасында орнатылатын қолданбалар үшін хабарландырулар жіберу рұқсаты керек. Бұрынғы қолданбаларда осы рұқсатты өзгерту үшін түртіңіз."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Кейінірек еске салу"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Жабу"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Жүйе"</string>
@@ -2289,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"\"<xliff:g id="MESSAGE">%1$s</xliff:g>\" хабары аударылды."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Хабар мына тілге аударылды: <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>. Түпнұсқаның тілі: <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Фондық режимдегі әрекет"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Қолданба батареяны тез отырғызып жатыр"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Қолданба әлі белсенді"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> фондық режимде жұмыс істеп тұр. Батарея шығынын басқару үшін түртіңіз."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> қолданбасы батарея жұмысының ұзақтығына әсер етуі мүмкін. Белсенді қолданбаларды қарап шығу үшін түртіңіз."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Белсенді қолданбаларды тексеру"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"<xliff:g id="DEVICE">%1$s</xliff:g> құрылғысынан телефон камерасын пайдалану мүмкін емес."</string>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index bf0f8db..a344709 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"មុខងារកុំរំខានត្រូវបានប្ដូរ"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"សូមចុចដើម្បីមើលថាបានទប់ស្កាត់អ្វីខ្លះ។"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"ពិនិត្យមើលការកំណត់ការជូនដំណឹង"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"ក្នុង Android 13 កម្មវិធីដែលអ្នកដំឡើងត្រូវការការអនុញ្ញាតរបស់អ្នក ដើម្បីផ្ញើការជូនដំណឹង។ សូមចុចដើម្បីផ្លាស់ប្ដូរការអនុញ្ញាតនេះសម្រាប់កម្មវិធីដែលមានស្រាប់។"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"រំលឹកខ្ញុំពេលក្រោយ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ច្រានចោល"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ប្រព័ន្ធ"</string>
diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml
index d415d80..eb1baf0 100644
--- a/core/res/res/values-kn/strings.xml
+++ b/core/res/res/values-kn/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"ಅಡಚಣೆ ಮಾಡಬೇಡಿ ಬದಲಾಗಿದೆ"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"ಏನನ್ನು ನಿರ್ಬಂಧಿಸಲಾಗಿದೆ ಎಂಬುದನ್ನು ಪರೀಕ್ಷಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"ಅಧಿಸೂಚನೆ ಸೆಟ್ಟಿಂಗ್ಗಳನ್ನು ಪರಿಶೀಲಿಸಿ"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 ನಲ್ಲಿ, ನೀವು ಇನ್ಸ್ಟಾಲ್ ಮಾಡುವ ಆ್ಯಪ್ಗಳಿಗೆ, ಅಧಿಸೂಚನೆಗಳನ್ನು ಕಳುಹಿಸಲು ನಿಮ್ಮ ಅನುಮತಿಯ ಅಗತ್ಯವಿದೆ. ಅಸ್ತಿತ್ವದಲ್ಲಿರುವ ಆ್ಯಪ್ಗಳ ಅನುಮತಿಗಳನ್ನು ಬದಲಾಯಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"ನಂತರ ರಿಮೈಂಡ್ ಮಾಡಿ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ವಜಾಗೊಳಿಸಿ"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ಸಿಸ್ಟಂ"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index b34d17e..f8b9bdc 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"방해 금지 모드 변경"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"차단된 항목을 확인하려면 탭하세요."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"알림 설정 검토"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13에 설치된 앱에는 알림을 전송하기 위한 권한이 필요합니다. 기존 앱의 알림 전송 권한을 변경하려면 탭하세요."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"나중에 알림"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"닫기"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"시스템"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"다음 메시지가 번역되었습니다. <xliff:g id="MESSAGE">%1$s</xliff:g>"</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"메시지가 <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>에서 <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>로 번역되었습니다."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"백그라운드 활동"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"배터리 소모가 큰 앱이 있습니다"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"앱이 여전히 활성 상태임"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> 앱이 백그라운드에서 실행 중입니다. 배터리 사용량을 관리하려면 탭하세요."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> 앱은 배터리 수명에 영향을 미칠 수 있습니다. 활성 상태인 앱을 확인하려면 탭하세요."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"활성 상태의 앱 확인"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"사용자의 <xliff:g id="DEVICE">%1$s</xliff:g>에서 휴대전화 카메라에 액세스할 수 없습니다."</string>
diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml
index 7695657..663842f 100644
--- a/core/res/res/values-ky/strings.xml
+++ b/core/res/res/values-ky/strings.xml
@@ -1320,7 +1320,7 @@
<string name="sms_short_code_confirm_allow" msgid="920477594325526691">"Жөнөтүү"</string>
<string name="sms_short_code_confirm_deny" msgid="1356917469323768230">"Айнуу"</string>
<string name="sms_short_code_remember_choice" msgid="1374526438647744862">"Менин тандоомду эстеп кал"</string>
- <string name="sms_short_code_remember_undo_instruction" msgid="2620984439143080410">"Муну кийин Тууралоолор > Колдонмолордон өзгөртө аласыз"</string>
+ <string name="sms_short_code_remember_undo_instruction" msgid="2620984439143080410">"Муну кийин Тууралоо > Колдонмолордон өзгөртө аласыз"</string>
<string name="sms_short_code_confirm_always_allow" msgid="2223014893129755950">"Дайыма уруксат берүү"</string>
<string name="sms_short_code_confirm_never_allow" msgid="2688828813521652079">"Эч качан уруксат берилбесин"</string>
<string name="sim_removed_title" msgid="5387212933992546283">"SIM-карта өчүрүлдү"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\"Тынчымды алба\" режими өзгөрдү"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Бөгөттөлгөн нерселерди көрүү үчүн таптаңыз."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Билдирмелердин жөндөөлөрүн карап чыгуу"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 версиясында билдирмелерди жөнөтүү үчүн орноткон колдонмолоруңузга уруксат берүү керек. Учурдагы колдонмолор үчүн бул уруксатты өзгөртүү үчүн таптап коюңуз."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Кийинчерээк эскертүү"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Жабуу"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Тутум"</string>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index cb8a77d..9e8b119 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"ປ່ຽນໂໝດຫ້າມລົບກວນແລ້ວ"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"ແຕະເພື່ອກວດສອບວ່າມີຫຍັງຖືກບລັອກໄວ້ແດ່."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"ກວດສອບການຕັ້ງຄ່າການແຈ້ງເຕືອນ"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"ໃນ Android 13, ແອັບຕ່າງໆທີ່ທ່ານຕິດຕັ້ງຈະຕ້ອງໃຊ້ການອະນຸຍາດຂອງທ່ານເພື່ອສົ່ງການແຈ້ງເຕືອນ. ແຕະເພື່ອປ່ຽນການອະນຸຍາດນີ້ສຳລັບແອັບທີ່ມີຢູ່ກ່ອນແລ້ວ."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"ແຈ້ງເຕືອນຂ້ອຍພາຍຫຼັງ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ປິດໄວ້"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ລະບົບ"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"ແປ <xliff:g id="MESSAGE">%1$s</xliff:g> ແລ້ວ."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"ແປຂໍ້ຄວາມຈາກ <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> ເປັນ <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> ແລ້ວ."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"ການເຄື່ອນໄຫວໃນພື້ນຫຼັງ"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"ມີແອັບກຳລັງໃຊ້ແບັດເຕີຣີຫຼາຍ"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"ມີແອັບທີ່ຍັງຄົງນຳໃຊ້ຢູ່"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> ກຳລັງເອີ້ນໃຊ້ໃນພື້ນຫຼັງ. ແຕະເພື່ອຈັດການການໃຊ້ແບັດເຕີຣີ."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> ອາດສົ່ງຜົນກະທົບຕໍ່ອາຍຸແບັດເຕີຣີ. ແຕະເພື່ອກວດສອບແອັບທີ່ນຳໃຊ້ຢູ່."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"ກວດສອບແອັບທີ່ເຄື່ອນໄຫວ"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"ບໍ່ສາມາດເຂົ້າເຖິງກ້ອງຖ່າຍຮູບຂອງໂທລະສັບຈາກ <xliff:g id="DEVICE">%1$s</xliff:g> ຂອງທ່ານໄດ້"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index f2ce117..989d57c 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Netrukdymo režimas pakeistas"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Palieskite, kad patikrintumėte, kas blokuojama."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Peržiūrėkite pranešimų nustatymus"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"13 versijos „Android” jūsų įdiegtoms programoms reikia suteikti leidimą siųsti pranešimus. Palieskite, kad pakeistumėte šį leidimą esamoms programoms."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Priminti vėliau"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Atsisakyti"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
@@ -2276,11 +2277,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Pranešimas „<xliff:g id="MESSAGE">%1$s</xliff:g>“ išverstas."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Pranešimas išverstas iš <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> į <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Veikla fone"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Programa eikvoja akumuliatoriaus energiją"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Programa vis dar aktyvi"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"„<xliff:g id="APP">%1$s</xliff:g>“ veikia fone. Palieskite ir tvarkykite akumuliatoriaus energijos vartojimą."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"Programa „<xliff:g id="APP">%1$s</xliff:g>“ gali turėti įtakos akumuliatoriaus veikimo laikui. Palieskite ir peržiūrėkite aktyvias programas."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Peržiūrėkite aktyvias programas"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Nepavyko pasiekti telefono fotoaparato iš „<xliff:g id="DEVICE">%1$s</xliff:g>“"</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 12b4146..076900c 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -2054,7 +2054,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Režīms “Netraucēt” ir mainīts"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Pieskarieties, lai uzzinātu, kas tiek bloķēts."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Pārskatīt paziņojumu iestatījumus"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Operētājsistēmā Android 13 jūsu instalētajām lietotnēm ir nepieciešama jūsu atļauja, lai sūtītu paziņojumus. Pieskarieties, lai mainītu šo atļauju esošajām lietotnēm."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Atgādināt vēlāk"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Noraidīt"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistēma"</string>
@@ -2275,11 +2276,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Iztulkots: <xliff:g id="MESSAGE">%1$s</xliff:g>."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Ziņojums ir iztulkots no šādas valodas: <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> šādā valodā: <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Darbība fonā"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Lietotnes darbības dēļ notiek akumulatora izlāde"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Lietotne joprojām ir aktīva"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"Lietotne <xliff:g id="APP">%1$s</xliff:g> darbojas fonā. Pieskarieties, lai pārvaldītu akumulatora lietojumu."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"Lietotne <xliff:g id="APP">%1$s</xliff:g> var ietekmēt akumulatora darbības ilgumu. Pieskarieties, lai pārskatītu aktīvās lietotnes."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Pārbaudiet aktīvās lietotnes"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Nevar piekļūt tālruņa kamerai no jūsu ierīces (<xliff:g id="DEVICE">%1$s</xliff:g>)."</string>
diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml
index e287a7a..1c4b514 100644
--- a/core/res/res/values-mk/strings.xml
+++ b/core/res/res/values-mk/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Поставките за „Не вознемирувај“ се изменија"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Допрете за да проверите што е блокирано."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Прегледајте ги поставките за известувања"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Во Android 13, на апликациите што ги инсталирате им е потребна ваша дозвола за испраќање известувања. Допрете за да ја промените оваа дозвола за постојни апликации."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Потсети ме подоцна"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Отфрли"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Систем"</string>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index 23236e0..9169e97 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\'ശല്യപ്പെടുത്തരുത്\' മാറ്റി"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"എന്തിനെയാണ് ബ്ലോക്ക് ചെയ്തതെന്ന് പരിശോധിക്കാൻ ടാപ്പ് ചെയ്യുക."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"അറിയിപ്പ് ക്രമീകരണം അവലോകനം ചെയ്യുക"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-ൽ നിങ്ങൾ ഇൻസ്റ്റാൾ ചെയ്യുന്ന ആപ്പുകൾക്ക് അറിയിപ്പുകൾ അയയ്ക്കാൻ നിങ്ങളുടെ അനുമതി വേണം. നിലവിലുള്ള ആപ്പുകൾക്ക് ഈ അനുമതി മാറ്റാൻ ടാപ്പ് ചെയ്യുക."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"പിന്നീട് ഓർമ്മിപ്പിക്കൂ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ഡിസ്മിസ് ചെയ്യുക"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"സിസ്റ്റം"</string>
diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml
index 45ee754..9ee9ad1 100644
--- a/core/res/res/values-mn/strings.xml
+++ b/core/res/res/values-mn/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Бүү саад бол горимыг өөрчилсөн"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Блоклосон зүйлийг шалгахын тулд товшино уу."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Мэдэгдлийн тохиргоог шалгах"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13-т таны суулгасан аппууд мэдэгдэл илгээхийн тулд тэдгээрт таны зөвшөөрөл шаардлагатай. Одоо байгаа аппуудын уг зөвшөөрлийг өөрчлөхийн тулд товшино уу."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Надад дараа сануул"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Хаах"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Систем"</string>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index 408a3ae..637342d 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"व्यत्यय आणू नका बदलले आहे"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"काय ब्लॉक केले आहे हे तपासण्यासाठी टॅप करा."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"सूचना सेटिंग्जचे पुनरावलोकन करा"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 मध्ये, तुम्ही इंस्टॉल केलेल्या अॅप्सना सूचना पाठवण्यासाठी तुमच्या परवानगीची आवश्यकता असते. सध्याच्या अॅप्ससाठी ही परवानगी बदलण्याकरिता टॅप करा."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"मला आठवण करून द्या"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"डिसमिस करा"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"सिस्टम"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 3a95c94..487fc1d 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Jangan Ganggu telah berubah"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Ketik untuk menyemak item yang disekat."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Semak tetapan pemberitahuan"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Dalam Android 13, apl yang anda pasang memerlukan kebenaran anda untuk menghantar pemberitahuan. Ketik untuk menukar kebenaran ini bagi apl sedia ada."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Ingatkan saya nanti"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Ketepikan"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml
index b655345..78cdb62 100644
--- a/core/res/res/values-my/strings.xml
+++ b/core/res/res/values-my/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\'မနှောင့်ယှက်ရ\' ပြောင်းလဲသွားပါပြီ"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"ပိတ်ထားသည့်အရာများကို ကြည့်ရန် တို့ပါ။"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"အကြောင်းကြားချက် ဆက်တင်များ စိစစ်ရန်"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 တွင် သင်ထည့်သွင်းသော အက်ပ်များသည် အကြောင်းကြားချက်များပို့ရန် သင်၏ခွင့်ပြုချက် လိုအပ်ပါမည်။ ရှိပြီးသားအက်ပ်များအတွက် ဤခွင့်ပြုချက်ကိုပြောင်းရန် တို့ပါ။"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"နောက်မှ သတိပေးပါ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ပယ်ရန်"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"စနစ်"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 2f495b0..01bb155 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1887,7 +1887,7 @@
<string name="stk_cc_ss_to_ussd" msgid="8417905193112944760">"SS-forespørsel endret til USSD-forespørsel"</string>
<string name="stk_cc_ss_to_ss" msgid="132040645206514450">"Endret til ny SS-forespørsel"</string>
<string name="notification_phishing_alert_content_description" msgid="494227305355958790">"Varsel om nettfisking"</string>
- <string name="notification_work_profile_content_description" msgid="5296477955677725799">"Arbeidsprofil"</string>
+ <string name="notification_work_profile_content_description" msgid="5296477955677725799">"Jobbprofil"</string>
<string name="notification_alerted_content_description" msgid="6139691253611265992">"Varslet"</string>
<string name="notification_verified_content_description" msgid="6401483602782359391">"Bekreftet"</string>
<string name="expand_button_content_description_collapsed" msgid="3873368935659010279">"Vis"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Ikke forstyrr er endret"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Trykk for å sjekke hva som er blokkert."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Gjennomgå varslingsinnstillingene"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"I Android 13 må apper du installerer, få tillatelse til å sende varsler. Trykk for å endre denne tillatelsen for eksisterende apper."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Påminn meg senere"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Lukk"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> er oversatt."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Meldingen er oversatt fra <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> til <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Aktivitet i bakgrunnen"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"En app bruker batteri"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"En app er fremdeles aktiv"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> kjører i bakgrunnen. Trykk for å administrere batteribruken."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> kan påvirke batterilevetiden. Trykk for å gjennomgå aktive apper."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Sjekk aktive apper"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Det er ikke mulig å få tilgang til telefonkameraet fra <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index 1bcab4e..b12c5c0 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -1926,7 +1926,7 @@
<string name="app_suspended_default_message" msgid="6451215678552004172">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> अहिले उपलब्ध छैन। यो <xliff:g id="APP_NAME_1">%2$s</xliff:g> द्वारा व्यवस्थित छ।"</string>
<string name="app_suspended_more_details" msgid="211260942831587014">"थप जान्नुहोस्"</string>
<string name="app_suspended_unsuspend_message" msgid="1665438589450555459">"एपको पज हटाउनुहोस्"</string>
- <string name="work_mode_off_title" msgid="961171256005852058">"कामसम्बन्धी एपहरू सक्षम पार्ने हो?"</string>
+ <string name="work_mode_off_title" msgid="961171256005852058">"कामसम्बन्धी एपहरू अन गर्ने हो?"</string>
<string name="work_mode_off_message" msgid="7319580997683623309">"कामसम्बन्धी एप चलाउने र सूचना प्राप्त गर्ने सुविधा अन गर्नुहोस्"</string>
<string name="work_mode_turn_on" msgid="3662561662475962285">"अन गर्नुहोस्"</string>
<string name="app_blocked_title" msgid="7353262160455028160">"एप उपलब्ध छैन"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"बाधा नपुर्याउनुहोस् मोड परिवर्तन भएको छ"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"रोक लगाइएका कुराहरू जाँच गर्न ट्याप गर्नुहोस्।"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"सूचनाका सेटिङको समीक्षा गर्नुहोस्"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android १३ मा तपाईंले अनुमति दिनुभएका खण्डमा मात्र तपाईंले इन्स्टल गर्नुभएका एपले सूचना पठाउन सक्छन्। यसअघि इन्स्टल गरिसकिएका एपका हकमा यो अनुमति परिवर्तन गर्न ट्याप गर्नुहोस्।"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"मलाई पछि स्मरण गराइयोस्"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"हटाउनुहोस्"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"प्रणाली"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> अनुवाद गरिएको छ।"</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"म्यासेज <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> भाषाबाट <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> भाषामा अनुवाद गरिएको छ।"</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"ब्याकग्राउन्डमा गरिएको क्रियाकलाप"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"कुनै एपले ब्याट्री खपत गरिरहेको छ"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"कुनै एप अझै पनि चलिरहेको छ"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> ब्याकग्राउन्डमा चलिरहेको छ। कुन एपले कति ब्याट्री खपत गर्छ भन्ने कुरा व्यवस्थापन गर्न ट्याप गर्नुहोस्।"</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> ले ब्याट्रीको आयु घटाउन सक्छ। सक्रिय एपहरू हेर्न ट्याप गर्नुहोस्।"</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"कुन कुन एप सक्रिय छ भन्ने कुरा जाँच्नुहोस्"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"तपाईंको <xliff:g id="DEVICE">%1$s</xliff:g> मार्फत फोनको क्यामेरा प्रयोग गर्न मिल्दैन"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 93f9610..f544804 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\'Niet storen\' is gewijzigd"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tik om te controleren wat er is geblokkeerd."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Instellingen voor meldingen bekijken"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"In Android 13 hebben apps die je installeert je toestemming nodig om meldingen te sturen. Tik om deze toestemming voor bestaande apps te wijzigen."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Later herinneren"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Sluiten"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Systeem"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> vertaald."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Bericht vertaald vanuit het <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> naar het <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Achtergrondactiviteit"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Een app gebruikt de batterij overmatig"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Een app is nog actief"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> is op de achtergrond actief. Tik om het batterijgebruik te beheren."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> kan van invloed zijn op de batterijduur. Tik om actieve apps te bekijken."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Actieve apps checken"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Kan geen toegang tot de camera van de telefoon krijgen vanaf je <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml
index 6b58faf..a51d2f3 100644
--- a/core/res/res/values-or/strings.xml
+++ b/core/res/res/values-or/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"’ବିରକ୍ତ କରନ୍ତୁ ନାହିଁ’ ବଦଳିଯାଇଛି"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"କ’ଣ ଅବରୋଧ ହୋଇଛି ଯାଞ୍ଚ କରିବା ପାଇଁ ଟାପ୍ କରନ୍ତୁ।"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"ବିଜ୍ଞପ୍ତି ସେଟିଂସକୁ ସମୀକ୍ଷା କରନ୍ତୁ"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13ରେ, ଆପଣ ଇନଷ୍ଟଲ କରୁଥିବା ଆପ୍ସ ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକୁ ପଠାଇବା ପାଇଁ ଆପଣଙ୍କ ଅନୁମତି ଆବଶ୍ୟକ କରେ। ପୂର୍ବରୁ ଥିବା ଆପ୍ସ ପାଇଁ ଏହି ଅନୁମତିକୁ ପରିବର୍ତ୍ତନ କରିବାକୁ ଟାପ କରନ୍ତୁ।"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"ମୋତେ ପରେ ରିମାଇଣ୍ଡ କର"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ଖାରଜ କରନ୍ତୁ"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ସିଷ୍ଟମ୍"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> ଅନୁବାଦ କରାଯାଇଛି।"</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"ମେସେଜ୍, <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>ରୁ <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>କୁ ଅନୁବାଦ କରାଯାଇଛି।"</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"ପୃଷ୍ଠପଟ କାର୍ଯ୍ୟକଳାପ"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"ଏକ ଆପ ବ୍ୟାଟେରୀର ଚାର୍ଜ ଶୀଘ୍ର ସମାପ୍ତ କରୁଛି"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"ଏକ ଆପ ଏବେ ବି ସକ୍ରିୟ ଅଛି"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> ପୃଷ୍ଠପଟରେ ଚାଲୁଛି। ବ୍ୟାଟେରୀ ବ୍ୟବହାର ପରିଚାଳନା କରିବାକୁ ଟାପ କରନ୍ତୁ।"</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> ବ୍ୟାଟେରୀ ଲାଇଫକୁ ପ୍ରଭାବିତ କରିପାରେ। ସକ୍ରିୟ ଆପ୍ସକୁ ସମୀକ୍ଷା କରିବା ପାଇଁ ଟାପ କରନ୍ତୁ।"</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"ସକ୍ରିୟ ଆପଗୁଡ଼ିକୁ ଯାଞ୍ଚ କରନ୍ତୁ"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"ଆପଣଙ୍କ <xliff:g id="DEVICE">%1$s</xliff:g>ରୁ ଫୋନର କ୍ୟାମେରାକୁ ଆକ୍ସେସ କରାଯାଇପାରିବ ନାହିଁ"</string>
diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml
index c02e01d..2bc6da6 100644
--- a/core/res/res/values-pa/strings.xml
+++ b/core/res/res/values-pa/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\'ਪਰੇਸ਼ਾਨ ਨਾ ਕਰੋ\' ਵਿਕਲਪ ਬਦਲ ਗਿਆ ਹੈ"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"ਟੈਪ ਕਰਕੇ ਦੋਖੋ ਕਿ ਕਿਹੜੀਆਂ ਚੀਜ਼ਾਂ ਬਲਾਕ ਕੀਤੀਆਂ ਗਈਆਂ ਹਨ।"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"ਸੂਚਨਾ ਸੈਟਿੰਗਾਂ ਦੀ ਸਮੀਖਿਆ ਕਰੋ"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 ਵਿੱਚ, ਤੁਹਾਡੇ ਵੱਲੋਂ ਸਥਾਪਤ ਕੀਤੀਆਂ ਜਾਣ ਵਾਲੀਆਂ ਐਪਾਂ ਨੂੰ ਸੂਚਨਾਵਾਂ ਭੇਜਣ ਲਈ ਤੁਹਾਡੀ ਇਜਾਜ਼ਤ ਦੀ ਲੋੜ ਹੁੰਦੀ ਹੈ। ਮੌਜੂਦਾ ਐਪਾਂ ਲਈ ਇਸ ਇਜਾਜ਼ਤ ਨੂੰ ਬਦਲਣ ਵਾਸਤੇ ਟੈਪ ਕਰੋ।"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"ਬਾਅਦ ਵਿੱਚ ਯਾਦ ਕਰਵਾਓ"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ਖਾਰਜ ਕਰੋ"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ਸਿਸਟਮ"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 8e44bde..6c96e08 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Zmiany w trybie Nie przeszkadzać"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Kliknij, by sprawdzić, co jest zablokowane."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Sprawdź ustawienia powiadomień"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Na Androidzie 13 aplikacje, które zainstalujesz, będą potrzebowały zezwolenia na wysyłanie powiadomień. Kliknij, aby zmienić uprawnienia dla istniejących aplikacji."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Przypomnij później"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Odrzuć"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
@@ -2276,11 +2277,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"Przetłumaczono wiadomość: <xliff:g id="MESSAGE">%1$s</xliff:g>."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Wiadomość przetłumaczono z języka: <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> na język: <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Aktywność w tle"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Aplikacja zużywa baterię"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Aplikacja jest wciąż aktywna"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"Aplikacja <xliff:g id="APP">%1$s</xliff:g> działa w tle. Kliknij, by zarządzać wykorzystaniem baterii."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"Aplikacja <xliff:g id="APP">%1$s</xliff:g> może mieć wpływ na czas pracy na baterii. Kliknij, aby sprawdzić aktywne aplikacje."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Sprawdź aktywne aplikacje"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Nie można korzystać z aparatu telefonu na urządzeniu <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml
index 375e16d..dd51ad9 100644
--- a/core/res/res/values-pt-rBR/strings.xml
+++ b/core/res/res/values-pt-rBR/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"O modo \"Não perturbe\" foi alterado"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Toque para verificar o que está bloqueado."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Revise as configurações de notificação"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"No Android 13, os apps que você instala precisam da sua permissão para enviar notificações. Toque para mudar essa permissão para os apps já instalados."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Lembrar mais tarde"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Dispensar"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 47a6fe5..c51cf86 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"O modo Não incomodar foi alterado"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Toque para verificar o que está bloqueado."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Analise as definições de notificação"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"No Android 13, as apps que instalar precisam da sua autorização para enviar notificações. Toque para alterar esta autorização para as apps existentes."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Lembrar mais tarde"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Ignorar"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 375e16d..dd51ad9 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"O modo \"Não perturbe\" foi alterado"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Toque para verificar o que está bloqueado."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Revise as configurações de notificação"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"No Android 13, os apps que você instala precisam da sua permissão para enviar notificações. Toque para mudar essa permissão para os apps já instalados."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Lembrar mais tarde"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Dispensar"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistema"</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index 5b84189..c1e6d87 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -2054,7 +2054,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Funcția Nu deranja s-a schimbat"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Atingeți pentru a verifica ce este blocat."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Examinați setările pentru notificări"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Pe Android 13, aplicațiile pe care le instalați necesită permisiunea de a trimite notificări. Atingeți ca să modificați permisiunea pentru aplicațiile existente."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Mai târziu"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Închideți"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index b90c3c3..ce3cfe7 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Настройки режима \"Не беспокоить\" изменены"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Нажмите, чтобы проверить настройки."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Проверьте настройки уведомлений"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Если вы хотите получать уведомления от приложения в Android 13, после установки ему нужно предоставить надлежащее разрешение. Нажмите, чтобы настроить разрешения для установленных приложений."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Напомнить позже"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Закрыть"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Система"</string>
diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml
index 1cb81a9..8fdfeb7 100644
--- a/core/res/res/values-si/strings.xml
+++ b/core/res/res/values-si/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"බාධා නොකරන්න වෙනස් කර ඇත"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"අවහිර කර ඇති දේ පරීක්ෂා කිරීමට තට්ටු කරන්න."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"දැනුම්දීම් සැකසීම් සමාලෝචනය කරන්න"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 හි, ඔබ ස්ථාපනය කරන යෙදුම්වලට දැනුම්දීම් යැවීමට ඔබගේ අවසරය අවශ්ය වේ. තිබෙන යෙදුම් සඳහා මෙම අවසරය වෙනස් කිරීමට තට්ටු කරන්න."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"මට පසුව මතක් කරන්න"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ඉවත ලන්න"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"පද්ධතිය"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 70f6a51..01583c8 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Režim bez vyrušení sa zmenil"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Klepnutím skontrolujete, čo je blokované."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Kontrola nastavení upozornení"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"V Androide 13 vyžadujú nainštalované aplikácie povolenie, aby mohli odosielať upozornenia. Klepnutím môžete zmeniť toto povolenie pre existujúce aplikácie."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Pripomenúť neskôr"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Zavrieť"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Systém"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 751545676..f694428 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -2055,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Način »ne moti« je spremenjen"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Dotaknite se, da preverite, kaj je blokirano."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Preglejte nastavitve obvestil"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"V Androidu 13 bodo aplikacije, ki jih namestite, za pošiljanje obvestil potrebovale vaše dovoljenje. Dotaknite se, če želite spremeniti to dovoljenje za obstoječe aplikacije."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Opomni me pozneje"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Opusti"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml
index f247fa9..52fcea3 100644
--- a/core/res/res/values-sq/strings.xml
+++ b/core/res/res/values-sq/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\"Mos shqetëso\" ka ndryshuar"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Trokit për të shënuar atë që është bllokuar"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Rishiko cilësimet e njoftimeve"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Në Android 13, aplikacionet që instalon kanë nevojë për lejen tënde për të dërguar njoftime. Trokit për ta ndryshuar këtë leje për aplikacionet ekzistuese."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Më kujto më vonë"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Hiq"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistemi"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> i përkthyer."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Mesazhi u përkthye nga <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> në <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Aktiviteti në sfond"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Një aplikacion po shkarkon baterinë"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Një aplikacion është ende aktiv"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> po ekzekutohet në sfond. Trokit për të menaxhuar përdorimin e baterisë."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> mund të kenë ndikim në kohëzgjatjen e baterisë. Trokit për të rishikuar aplikacionet aktive."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Kontrollo aplikacionet aktive"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Nuk mund të qasesh në kamerën e telefonit tënd nga <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 3a5db52e..0dbef5a 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -2054,7 +2054,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Режим Не узнемиравај је промењен"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Додирните да бисте проверили шта је блокирано."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Прегледајте подешавања обавештења"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"У Android-у 13 апликације које инсталирате морају да имају дозволу за слање обавештења. Додирните да бисте променили ову дозволу за постојеће апликације."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Подсети ме касније"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Одбаци"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Систем"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 5cf929f..6223b0d 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Stör ej har ändrats"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Tryck om du vill se vad som blockeras."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Granska aviseringsinställningarna"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"I Android 13 behöver appar som du installerar behörighet att skicka aviseringar. Tryck om du vill ändra denna behörighet för befintliga appar."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Påminn mig senare"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Stäng"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> har översatts."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Meddelandet har översatts från <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> till<xliff:g id="TO_LANGUAGE">%2$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Bakgrundsaktivitet"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"En app laddar ur batteriet"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"En app är fortfarande aktiv"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> körs i bakgrunden. Tryck för att hantera batteriförbrukning."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> kan påverka batteritiden. Tryck för att granska de aktiva apparna."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Kontrollera aktiva appar"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Telefonens kamera kan inte användas från <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index cf70445..aded067 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Kipengele cha Usinisumbue kimebadilishwa"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Gusa ili uangalie kipengee ambacho kimezuiwa."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Kagua mipangilio ya arifa"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Kwenye Android toleo la 13, programu ambazo unasakinisha zitahitaji ruhusa yako ili zikutumie arifa. Gusa ili ubadilishe ruhusa hii kwa programu zilizopo."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Nikumbushe baadaye"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Ondoa"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Mfumo"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> Imetafsiriwa."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Ujumbe umetafsiriwa kwa <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> kutoka <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Shughuli za Chinichini"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Programu inamaliza chaji ya betri haraka"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Programu bado inatumika"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> inatumika chinichini. Gusa ili udhibiti matumizi ya betri."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> inaweza kuathiri muda wa matumizi ya betri. Gusa ili ukague programu zinazotumika."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Angalia programu zinazotumika"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Haiwezi kufikia kamera ya simu kutoka kwenye <xliff:g id="DEVICE">%1$s</xliff:g> yako"</string>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index 31d7029..b7dd387 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"தொந்தரவு செய்ய வேண்டாம் அமைப்புகள் மாற்றப்பட்டன"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"எவற்றையெல்லாம் தடுக்கிறது என்பதைப் பார்க்க, தட்டவும்."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"அறிவிப்பு அமைப்புகளை மதிப்பாய்வு செய்யுங்கள்"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13ல், நீங்கள் நிறுவுகின்ற ஆப்ஸ் உங்களுக்கு அறிவிப்புகளை அனுப்ப உங்கள் அனுமதி தேவை. ஏற்கெனவே உள்ள ஆப்ஸுக்கு இந்த அனுமதியை மாற்ற தட்டவும்."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"பின்னர் நினைவூட்டு"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"நிராகரி"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"சிஸ்டம்"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> மொழிபெயர்க்கப்பட்டது."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"<xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> மொழியிலிருந்து <xliff:g id="TO_LANGUAGE">%2$s</xliff:g> மொழிக்கு மெசேஜ் மொழிபெயர்க்கப்பட்டது."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"பின்னணிச் செயல்பாடு"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"ஓர் ஆப்ஸ் பேட்டரியை அதிகமாகப் பயன்படுத்துதல்"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"ஆப்ஸ் செயல்பாட்டில் உள்ளது"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"பின்னணியில் <xliff:g id="APP">%1$s</xliff:g> இயங்கிக் கொண்டிருக்கிறது. பேட்டரி உபயோகத்தை நிர்வகிக்க, தட்டவும்."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> பேட்டரியின் ஆயுளைப் பாதிக்கலாம். செயலிலுள்ள ஆப்ஸைப் பார்க்க தட்டவும்."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"செயலிலுள்ள ஆப்ஸைப் பாருங்கள்"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"உங்கள் <xliff:g id="DEVICE">%1$s</xliff:g> சாதனத்திலிருந்து மொபைலின் கேமராவை அணுக முடியாது"</string>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index 1c3d4fc..3b80741 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -1224,7 +1224,7 @@
<string name="unsupported_display_size_show" msgid="980129850974919375">"ఎల్లప్పుడూ చూపు"</string>
<string name="unsupported_compile_sdk_message" msgid="7326293500707890537">"Android OS యొక్క అననుకూల వెర్షన్ కోసం <xliff:g id="APP_NAME">%1$s</xliff:g> రూపొందించబడింది మరియు ఊహించని సమస్యలు తలెత్తవచ్చు. యాప్ యొక్క అప్డేట్ చేసిన వెర్షన్ అందుబాటులో ఉండవచ్చు."</string>
<string name="unsupported_compile_sdk_show" msgid="1601210057960312248">"ఎల్లప్పుడూ చూపు"</string>
- <string name="unsupported_compile_sdk_check_update" msgid="1103639989147664456">"అప్డేట్ కోసం తనిఖీ చేయి"</string>
+ <string name="unsupported_compile_sdk_check_update" msgid="1103639989147664456">"అప్డేట్ కోసం చెక్ చేయి"</string>
<string name="smv_application" msgid="3775183542777792638">"<xliff:g id="APPLICATION">%1$s</xliff:g> యాప్ (<xliff:g id="PROCESS">%2$s</xliff:g> ప్రాసెస్) అది స్వయంగా అమలు చేసే ఖచ్చితమైన మోడ్ విధానాన్ని ఉల్లంఘించింది."</string>
<string name="smv_process" msgid="1398801497130695446">"ప్రక్రియ <xliff:g id="PROCESS">%1$s</xliff:g> అది స్వయంగా అమలు చేసే ఖచ్చితమైన మోడ్ విధానాన్ని ఉల్లంఘించింది."</string>
<string name="android_upgrading_title" product="default" msgid="7279077384220829683">"ఫోన్ అప్డేట్ అవుతోంది…"</string>
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"అంతరాయం కలిగించవద్దు మార్చబడింది"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"బ్లాక్ చేయబడిన దాన్ని తనిఖీ చేయడానికి నొక్కండి."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"నోటిఫికేషన్ సెట్టింగ్లను రివ్యూ చేయండి"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13లో, మీరు ఇన్స్టాల్ చేసే యాప్లకు నోటిఫికేషన్లను పంపడానికి మీ అనుమతి అవసరం. ఇప్పటికే ఉన్న యాప్ల కోసం ఈ అనుమతిని మార్చడానికి ట్యాప్ చేయండి."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"తర్వాత గుర్తు చేయి"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"విస్మరించండి"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"సిస్టమ్"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> అనువదించబడింది."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"మెసేజ్ <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> నుండి <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>కు అనువదించబడింది."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"బ్యాక్గ్రౌండ్ యాక్టివిటీ"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"యాప్ బ్యాటరీని డ్రెయిన్ చేస్తోంది"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"యాప్ ఇప్పటికీ యాక్టివ్గా ఉంది"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> బ్యాక్గ్రౌండ్లో రన్ అవుతోంది. బ్యాటరీ వినియోగాన్ని మేనేజ్ చేయడానికి."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> బ్యాటరీ జీవితకాలాన్ని ప్రభావితం చేయవచ్చు. యాక్టివ్ యాప్లను రివ్యూ చేయడానికి ట్యాప్ చేయండి."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"యాక్టివ్గా ఉన్న యాప్లను చెక్ చేయండి"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"మీ <xliff:g id="DEVICE">%1$s</xliff:g> నుండి ఫోన్ కెమెరాను యాక్సెస్ చేయడం సాధ్యపడదు"</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index d524283..77e1ab1 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"เปลี่ยน \"ห้ามรบกวน\" แล้ว"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"แตะเพื่อดูรายการที่ถูกบล็อก"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"ตรวจสอบการตั้งค่าการแจ้งเตือน"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"ใน Android 13 แอปที่คุณติดตั้งจะต้องได้รับสิทธิ์จากคุณเพื่อส่งการแจ้งเตือน แตะเพื่อเปลี่ยนแปลงสิทธิ์นี้สำหรับแอปที่มีอยู่"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"เตือนภายหลัง"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"ปิด"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"ระบบ"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index d050474..bb071ad 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Binago ang Huwag Istorbohin"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"I-tap para tingnan kung ano ang naka-block."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Suriin ang mga setting ng notification"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Sa Android 13, kakailanganin ng mga app na na-install mo ng pahintulot para magpadala ng mga notification. I-tap para baguhin ang pahintulot na ito para sa mga kasalukuyang app."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Ipaalala mamaya"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"I-dismiss"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"System"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index fbfec60..add4cc3 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Rahatsız Etmeyin modu değişti"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Nelerin engellendiğini kontrol etmek için dokunun."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Bildirim ayarlarını inceleyin"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13\'te yüklediğiniz uygulamaların bildirim göndermek için izninize ihtiyacı vardır. Mevcut uygulamalarda bu izni değiştirmek için dokunun."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Sonra hatırlat"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Kapat"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Sistem"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> Çevrildi."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Mesajın, <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>-<xliff:g id="TO_LANGUAGE">%2$s</xliff:g> çevirisi yapıldı."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Arka Plan Etkinliği"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Bir uygulama, pili hızlı tüketiyor"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Hâlâ etkin olan bir uygulama var"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> arka planda çalışıyor. Pil kullanımını yönetmek için dokunun."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> uygulaması pil ömrünü etkileyebilir. Etkin uygulamaları incelemek için dokunun."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Etkin uygulamaları kontrol edin"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"<xliff:g id="DEVICE">%1$s</xliff:g> cihazınızdan telefonun kamerasına erişilemiyor"</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index ec4e52c..582dc57 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -1935,36 +1935,21 @@
<string name="app_blocked_message" msgid="542972921087873023">"Додаток <xliff:g id="APP_NAME">%1$s</xliff:g> зараз недоступний."</string>
<string name="app_streaming_blocked_title" msgid="6090945835898766139">"Недоступно: <xliff:g id="ACTIVITY">%1$s</xliff:g>"</string>
<string name="app_streaming_blocked_title_for_permission_dialog" msgid="4483161748582966785">"Потрібен дозвіл"</string>
- <!-- no translation found for app_streaming_blocked_title_for_camera_dialog (3935701653713853065) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_fingerprint_dialog (3516853717714141951) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_microphone_dialog (544822455127171206) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_settings_dialog (196994247017450357) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_settings_dialog (8222710146267948647) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_title_for_settings_dialog (6895719984375299791) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message (5024599278277957935) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message (7491114163056552686) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message (1245180131667647277) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_permission_dialog (6306583663205997979) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_permission_dialog (6545624942642129664) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_permission_dialog (8462740631707923000) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_fingerprint_dialog (3470977315395784567) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_fingerprint_dialog (698460091901465092) -->
- <skip />
- <!-- no translation found for app_streaming_blocked_message_for_fingerprint_dialog (8552691971910603907) -->
- <skip />
+ <string name="app_streaming_blocked_title_for_camera_dialog" msgid="3935701653713853065">"Камера недоступна"</string>
+ <string name="app_streaming_blocked_title_for_fingerprint_dialog" msgid="3516853717714141951">"Продовжте на телефоні"</string>
+ <string name="app_streaming_blocked_title_for_microphone_dialog" msgid="544822455127171206">"Мікрофон недоступний"</string>
+ <string name="app_streaming_blocked_title_for_settings_dialog" product="tv" msgid="196994247017450357">"Налаштування Android TV недоступні"</string>
+ <string name="app_streaming_blocked_title_for_settings_dialog" product="tablet" msgid="8222710146267948647">"Налаштування планшета недоступні"</string>
+ <string name="app_streaming_blocked_title_for_settings_dialog" product="default" msgid="6895719984375299791">"Налаштування телефона недоступні"</string>
+ <string name="app_streaming_blocked_message" product="tv" msgid="5024599278277957935">"Цей додаток недоступний на вашому пристрої (<xliff:g id="DEVICE">%1$s</xliff:g>). Спробуйте натомість скористатися пристроєм Android TV."</string>
+ <string name="app_streaming_blocked_message" product="tablet" msgid="7491114163056552686">"Цей додаток недоступний на вашому пристрої (<xliff:g id="DEVICE">%1$s</xliff:g>). Спробуйте натомість скористатися планшетом."</string>
+ <string name="app_streaming_blocked_message" product="default" msgid="1245180131667647277">"Цей додаток недоступний на вашому пристрої (<xliff:g id="DEVICE">%1$s</xliff:g>). Спробуйте натомість скористатися телефоном."</string>
+ <string name="app_streaming_blocked_message_for_permission_dialog" product="tv" msgid="6306583663205997979">"Цей додаток зараз недоступний на вашому пристрої (<xliff:g id="DEVICE">%1$s</xliff:g>). Спробуйте натомість скористатися пристроєм Android TV."</string>
+ <string name="app_streaming_blocked_message_for_permission_dialog" product="tablet" msgid="6545624942642129664">"Цей додаток зараз недоступний на вашому пристрої (<xliff:g id="DEVICE">%1$s</xliff:g>). Спробуйте натомість скористатися планшетом."</string>
+ <string name="app_streaming_blocked_message_for_permission_dialog" product="default" msgid="8462740631707923000">"Цей додаток зараз недоступний на вашому пристрої (<xliff:g id="DEVICE">%1$s</xliff:g>). Спробуйте натомість скористатися телефоном."</string>
+ <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tv" msgid="3470977315395784567">"Цьому додатку потрібен додатковий рівень безпеки. Спробуйте натомість скористатися пристроєм Android TV."</string>
+ <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="tablet" msgid="698460091901465092">"Цьому додатку потрібен додатковий рівень безпеки. Спробуйте натомість скористатися планшетом."</string>
+ <string name="app_streaming_blocked_message_for_fingerprint_dialog" product="default" msgid="8552691971910603907">"Цьому додатку потрібен додатковий рівень безпеки. Спробуйте натомість скористатися телефоном."</string>
<string name="deprecated_target_sdk_message" msgid="5203207875657579953">"Цей додаток створений для старішої версії Android і може працювати неналежним чином. Спробуйте знайти оновлення або зв’яжіться з розробником."</string>
<string name="deprecated_target_sdk_app_store" msgid="8456784048558808909">"Шукати оновлення"</string>
<string name="new_sms_notification_title" msgid="6528758221319927107">"У вас є нові повідомлення"</string>
@@ -2070,7 +2055,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Налаштування режиму \"Не турбувати\" змінено"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Торкніться, щоб перевірити, що заблоковано."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Перегляньте налаштування сповіщень"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"В ОС Android 13 встановленим додаткам потрібно надати дозвіл, щоб вони могли надсилати сповіщення. Натисніть, щоб змінити цей дозвіл для наявних додатків."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Нагадати пізніше"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Закрити"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Система"</string>
@@ -2291,11 +2277,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> (перекладене повідомлення)."</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"Повідомлення перекладено (мова оригіналу: <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>, мова перекладу: <xliff:g id="TO_LANGUAGE">%2$s</xliff:g>)."</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"Робота у фоновому режимі"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"Додаток швидко розряджає акумулятор"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"Додаток досі активний"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"Додаток <xliff:g id="APP">%1$s</xliff:g> працює у фоновому режимі. Натисніть, щоб керувати використанням заряду."</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"Додаток <xliff:g id="APP">%1$s</xliff:g> може вплинути на час роботи акумулятора. Натисніть, щоб переглянути активні додатки."</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"Перевірте активні додатки"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"Не вдається отримати доступ до камери телефона з пристрою <xliff:g id="DEVICE">%1$s</xliff:g>"</string>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index 80f8849..20c931e5 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"\'ڈسٹرب نہ کریں\' تبدیل ہو گيا ہے"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"مسدود کی گئی چیزوں کو چیک کرنے کے لیے تھپتھپائیں۔"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"اطلاع کی ترتیبات کا جائزہ لیں"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 میں، اطلاعات بھیجنے کے لیے آپ کے انسٹال کردہ ایپس کو آپ کی اجازت درکار ہوتی ہے۔ موجودہ ایپس کے لیے اس اجازت کو تبدیل کرنے کی خاطر تھپتھپائیں۔"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"بعد میں یاد دلائیں"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"برخاست کریں"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"سسٹم"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"<xliff:g id="MESSAGE">%1$s</xliff:g> کا ترجمہ کیا گیا۔"</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"پیغام کا ترجمہ <xliff:g id="FROM_LANGUAGE">%1$s</xliff:g> سے<xliff:g id="TO_LANGUAGE">%2$s</xliff:g> میں کیا گیا۔"</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"پس منظر کی سرگرمی"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"ایپ کی بیٹری ختم ہو رہی ہے"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"ایک ایپ اب بھی فعال ہے"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"<xliff:g id="APP">%1$s</xliff:g> پس منظر میں چل رہی ہے۔ بیٹری کے استعمال کا نظم کرنے کے لیے تھپتھپائیں۔"</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"<xliff:g id="APP">%1$s</xliff:g> ایپ بیٹری لائف کو متاثر کر سکتی ہے۔ فعال ایپس کا جائزہ لینے کے لیے تھپتھپائیں۔"</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"فعال ایپس چیک کریں"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"آپ کے <xliff:g id="DEVICE">%1$s</xliff:g> سے فون کے کیمرا تک رسائی حاصل نہیں کی جا سکتی"</string>
diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml
index e00860e..6905f90 100644
--- a/core/res/res/values-uz/strings.xml
+++ b/core/res/res/values-uz/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Bezovta qilinmasin rejimi sozlamalari o‘zgartirildi"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Nimalar bloklanganini tekshirish uchun bosing"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Bildirishnoma sozlamalarini tekshiring"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Android 13 versiyasida oʻrnatiladigan ilovalar bildirishnoma yuborishiga ruxsat talab etiladi. Mavjud ilovalar uchun bu ruxsatni oʻzgartirish uchun bosing."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Keyinroq eslatilsin"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Yopish"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Tizim"</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 944b02d..4ccbfad 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Cài đặt Không làm phiền đã thay đổi"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Nhấn để xem những thông báo bị chặn."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Xem lại chế độ cài đặt thông báo"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Trên Android 13, các ứng dụng mà bạn cài đặt sẽ cần bạn cấp quyền gửi thông báo. Hãy nhấn để thay đổi quyền này cho các ứng dụng hiện có."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Nhắc tôi sau"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Đóng"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Hệ thống"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 2053b6a..33c78c2 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"“勿扰”设置有变更"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"点按即可查看屏蔽内容。"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"查看通知设置"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"在 Android 13 中,您安装的应用需要您授予相应权限才能发送通知。点按即可为现有应用更改此权限。"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"稍后提醒我"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"关闭"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"系统"</string>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index eb07e30..2e891cf 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"請勿騷擾已變更"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"輕按即可查看封鎖內容。"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"查看通知設定"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"在 Android 13 中,您安裝的應用程式須獲得授權才能傳送通知。輕按即可變更現有應用程式的這項權限。"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"稍後提醒我"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"關閉"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"系統"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 44dba0b..5ec0a0c 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"「零打擾」設定已變更"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"輕觸即可查看遭封鎖的項目。"</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"查看通知設定"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"在 Android 13 中,你安裝的應用程式必須獲得授權,才能傳送通知。輕觸即可變更現有應用程式的這項權限。"</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"稍後提醒我"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"關閉"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"系統"</string>
@@ -2274,11 +2275,9 @@
<string name="ui_translation_accessibility_translated_text" msgid="3197547218178944544">"已翻譯<xliff:g id="MESSAGE">%1$s</xliff:g>。"</string>
<string name="ui_translation_accessibility_translation_finished" msgid="3057830947610088465">"訊息內容已從<xliff:g id="FROM_LANGUAGE">%1$s</xliff:g>翻成<xliff:g id="TO_LANGUAGE">%2$s</xliff:g>。"</string>
<string name="notification_channel_abusive_bg_apps" msgid="6092140213264920355">"背景活動"</string>
- <!-- no translation found for notification_title_abusive_bg_apps (994230770856147656) -->
- <skip />
+ <string name="notification_title_abusive_bg_apps" msgid="994230770856147656">"某個應用程式正在耗用大量電力"</string>
<string name="notification_title_long_running_fgs" msgid="8170284286477131587">"某個應用程式目前仍在運作"</string>
- <!-- no translation found for notification_content_abusive_bg_apps (5296898075922695259) -->
- <skip />
+ <string name="notification_content_abusive_bg_apps" msgid="5296898075922695259">"「<xliff:g id="APP">%1$s</xliff:g>」正在背景運作。輕觸即可管理電池用量。"</string>
<string name="notification_content_long_running_fgs" msgid="8258193410039977101">"「<xliff:g id="APP">%1$s</xliff:g>」應用程式可能會影響電池續航力。輕觸即可查看使用中的應用程式。"</string>
<string name="notification_action_check_bg_apps" msgid="4758877443365362532">"查看使用中的應用程式"</string>
<string name="vdm_camera_access_denied" product="default" msgid="6102378580971542473">"無法從 <xliff:g id="DEVICE">%1$s</xliff:g> 存取手機的相機"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 76c39ac..ee1711c 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -2053,7 +2053,8 @@
<string name="zen_upgrade_notification_title" msgid="8198167698095298717">"Ukungaphazamisi kushintshile"</string>
<string name="zen_upgrade_notification_content" msgid="5228458567180124005">"Thepha ukuze uhlole ukuthi yini evinjelwe."</string>
<string name="review_notification_settings_title" msgid="5102557424459810820">"Buyekeza amasethingi wesaziso"</string>
- <string name="review_notification_settings_text" msgid="5696497037817525074">"Ku-Android 13, ama-app owafakayo adinga imvume yakho yokuthumela izaziso. Thepha ukuze ushintshe le mvume yama-app akhona kakade."</string>
+ <!-- no translation found for review_notification_settings_text (5916244866751849279) -->
+ <skip />
<string name="review_notification_settings_remind_me_action" msgid="1081081018678480907">"Ngikhumbuze ngesinye isikhathi"</string>
<string name="review_notification_settings_dismiss" msgid="4160916504616428294">"Chitha"</string>
<string name="notification_app_name_system" msgid="3045196791746735601">"Isistimu"</string>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 757f409..19b72bf 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1864,6 +1864,11 @@
-->
<string name="config_defaultNetworkRecommendationProviderPackage" translatable="false"></string>
+ <!-- The package name of the default search selector app. Must be granted the POST_NOTIFICATIONS
+ permission.
+ -->
+ <string name="config_defaultSearchSelectorPackageName" translatable="false"></string>
+
<!-- Whether to enable geocoder overlay which allows geocoder to be replaced
by an app at run-time. When disabled, only the
config_geocoderProviderPackageName package will be searched for
@@ -2961,6 +2966,9 @@
config_preventImeStartupUnlessTextEditor. -->
<string-array name="config_nonPreemptibleInputMethods" translatable="false" />
+ <!-- Flag indicating that enhanced confirmation mode is enabled. -->
+ <bool name="config_enhancedConfirmationModeEnabled">true</bool>
+
<!-- The list of classes that should be added to the notification ranking pipeline.
See {@link com.android.server.notification.NotificationSignalExtractor}
If you add a new extractor to this list make sure to update
@@ -5770,4 +5778,7 @@
<string name="safety_protection_display_text"></string>
<!-- End safety protection resources to be overlaid -->
+
+ <!-- List of the labels of requestable device state config values -->
+ <string-array name="config_deviceStatesAvailableForAppRequests"/>
</resources>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index ff87ac0..824dd8b 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -876,19 +876,19 @@
<string name="permgroupdesc_sms">send and view SMS messages</string>
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_storage">Files & documents</string>
+ <string name="permgrouplab_storage">Files and documents</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgroupdesc_storage">access files and documents on your device</string>
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=40]-->
- <string name="permgrouplab_readMediaAural">Music & other audio</string>
+ <string name="permgrouplab_readMediaAural">Music and audio</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=NONE]-->
- <string name="permgroupdesc_readMediaAural">access audio files on your device</string>
+ <string name="permgroupdesc_readMediaAural">access music and audio on your device</string>
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=40]-->
- <string name="permgrouplab_readMediaVisual">Photos & videos</string>
+ <string name="permgrouplab_readMediaVisual">Photos and videos</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=NONE]-->
- <string name="permgroupdesc_readMediaVisual">access images and video files on your device</string>
+ <string name="permgroupdesc_readMediaVisual">access photos and videos on your device</string>
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgrouplab_microphone">Microphone</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 3334822..012030e 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2256,6 +2256,7 @@
<java-symbol type="bool" name="config_killableInputMethods" />
<java-symbol type="bool" name="config_preventImeStartupUnlessTextEditor" />
<java-symbol type="array" name="config_nonPreemptibleInputMethods" />
+ <java-symbol type="bool" name="config_enhancedConfirmationModeEnabled" />
<java-symbol type="layout" name="resolver_list" />
<java-symbol type="id" name="resolver_list" />
@@ -3413,6 +3414,9 @@
<!-- Network Recommendation -->
<java-symbol type="string" name="config_defaultNetworkRecommendationProviderPackage" />
+ <!-- Search Selector -->
+ <java-symbol type="string" name="config_defaultSearchSelectorPackageName" />
+
<!-- Optional IPsec algorithms -->
<java-symbol type="array" name="config_optionalIpSecAlgorithms" />
@@ -4770,6 +4774,7 @@
<java-symbol type="bool" name="config_bg_current_drain_high_threshold_by_bg_location" />
<java-symbol type="drawable" name="ic_swap_horiz" />
<java-symbol type="bool" name="config_notificationForceUserSetOnUpgrade" />
+ <java-symbol type="array" name="config_deviceStatesAvailableForAppRequests" />
<!-- For app language picker -->
<java-symbol type="string" name="system_locale_title" />
diff --git a/core/tests/coretests/src/android/content/pm/SigningDetailsTest.java b/core/tests/coretests/src/android/content/pm/SigningDetailsTest.java
index d522349..b331a24 100644
--- a/core/tests/coretests/src/android/content/pm/SigningDetailsTest.java
+++ b/core/tests/coretests/src/android/content/pm/SigningDetailsTest.java
@@ -15,6 +15,9 @@
*/
package android.content.pm;
+import static android.content.pm.SigningDetails.CapabilityMergeRule.MERGE_OTHER_CAPABILITY;
+import static android.content.pm.SigningDetails.CapabilityMergeRule.MERGE_RESTRICTED_CAPABILITY;
+import static android.content.pm.SigningDetails.CapabilityMergeRule.MERGE_SELF_CAPABILITY;
import static android.content.pm.SigningDetails.CertCapabilities.AUTH;
import static android.content.pm.SigningDetails.CertCapabilities.INSTALLED_DATA;
import static android.content.pm.SigningDetails.CertCapabilities.PERMISSION;
@@ -45,6 +48,7 @@
public class SigningDetailsTest {
private static final int DEFAULT_CAPABILITIES =
INSTALLED_DATA | SHARED_USER_ID | PERMISSION | AUTH;
+ private static final int CURRENT_SIGNER_CAPABILITIES = DEFAULT_CAPABILITIES | ROLLBACK;
// Some of the tests in this class require valid certificate encodings from which to pull the
// public key for the SigningDetails; the following are all DER encoded EC X.509 certificates.
@@ -368,10 +372,10 @@
}
@Test
- public void mergeLineageWith_sameLineageDifferentCaps_returnsLineageWithModifiedCaps()
+ public void mergeLineageWith_sameLineageDifferentCaps_returnsLineageWithProvidedCaps()
throws Exception {
// This test verifies when two lineages consist of the same signers but have different
- // capabilities the more restrictive capabilities are returned.
+ // capabilities, the capabilities of the provided lineage are returned.
SigningDetails defaultCapabilitiesDetails = createSigningDetailsWithLineage(FIRST_SIGNATURE,
SECOND_SIGNATURE, THIRD_SIGNATURE);
SigningDetails modifiedCapabilitiesDetails = createSigningDetailsWithLineageAndCapabilities(
@@ -384,68 +388,135 @@
defaultCapabilitiesDetails);
assertEquals(modifiedCapabilitiesDetails, result1);
- assertTrue(result2 == modifiedCapabilitiesDetails);
+ assertEquals(defaultCapabilitiesDetails, result2);
+ }
+
+ @Test
+ public void
+ mergeLineageWith_sameLineageDifferentCapsRestrictedRule_returnsLineageWithModifiedCaps()
+ throws Exception {
+ // This test verifies when two lineages consist of the same signers but have different
+ // capabilities, and the restricted merge rule is used, the more restrictive capabilities
+ // are returned.
+ SigningDetails defaultCapabilitiesDetails = createSigningDetailsWithLineage(FIRST_SIGNATURE,
+ SECOND_SIGNATURE, THIRD_SIGNATURE);
+ SigningDetails modifiedCapabilitiesDetails = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE},
+ new int[]{INSTALLED_DATA, INSTALLED_DATA, INSTALLED_DATA});
+
+ SigningDetails result1 = defaultCapabilitiesDetails.mergeLineageWith(
+ modifiedCapabilitiesDetails, MERGE_RESTRICTED_CAPABILITY);
+ SigningDetails result2 = modifiedCapabilitiesDetails.mergeLineageWith(
+ defaultCapabilitiesDetails, MERGE_RESTRICTED_CAPABILITY);
+
+ assertEquals(modifiedCapabilitiesDetails, result1);
+ assertEquals(modifiedCapabilitiesDetails, result2);
}
@Test
public void mergeLineageWith_overlappingLineageDiffCaps_returnsFullLineageWithModifiedCaps()
throws Exception {
- // This test verifies the following scenario:
- // - First lineage has signers A -> B with modified capabilities for A and B
- // - Second lineage has signers B -> C with modified capabilities for B and C
- // The merged lineage should be A -> B -> C with the most restrictive capabilities for B
- // since it is in both lineages.
+ // This test verifies the merge of two lineages with overlapping signers and modified caps
+ // returns the full lineage with expected capabilities based on the provided merge rule.
int[] firstCapabilities =
new int[]{INSTALLED_DATA | AUTH, INSTALLED_DATA | SHARED_USER_ID | PERMISSION};
int[] secondCapabilities = new int[]{INSTALLED_DATA | SHARED_USER_ID | AUTH,
INSTALLED_DATA | SHARED_USER_ID | AUTH};
- int[] expectedCapabilities =
+ int[] expectedRestrictedCapabilities =
new int[]{firstCapabilities[0], firstCapabilities[1] & secondCapabilities[0],
secondCapabilities[1]};
+ int[] expectedCapabilities1 =
+ new int[]{firstCapabilities[0], secondCapabilities[0], secondCapabilities[1]};
+ int[] expectedCapabilities2 =
+ new int[]{firstCapabilities[0], firstCapabilities[1], secondCapabilities[1]};
SigningDetails firstDetails = createSigningDetailsWithLineageAndCapabilities(
new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE}, firstCapabilities);
SigningDetails secondDetails = createSigningDetailsWithLineageAndCapabilities(
new String[]{SECOND_SIGNATURE, THIRD_SIGNATURE}, secondCapabilities);
- SigningDetails expectedDetails = createSigningDetailsWithLineageAndCapabilities(
+ SigningDetails expectedRestrictedDetails = createSigningDetailsWithLineageAndCapabilities(
new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE},
- expectedCapabilities);
+ expectedRestrictedCapabilities);
+ SigningDetails expectedDetails1 = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE},
+ expectedCapabilities1);
+ SigningDetails expectedDetails2 = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE},
+ expectedCapabilities2);
- SigningDetails result1 = firstDetails.mergeLineageWith(secondDetails);
- SigningDetails result2 = secondDetails.mergeLineageWith(firstDetails);
+ SigningDetails result1 = firstDetails.mergeLineageWith(secondDetails,
+ MERGE_OTHER_CAPABILITY);
+ SigningDetails result2 = secondDetails.mergeLineageWith(firstDetails,
+ MERGE_SELF_CAPABILITY);
+ SigningDetails result3 = firstDetails.mergeLineageWith(secondDetails,
+ MERGE_SELF_CAPABILITY);
+ SigningDetails result4 = secondDetails.mergeLineageWith(firstDetails,
+ MERGE_OTHER_CAPABILITY);
+ SigningDetails result5 = firstDetails.mergeLineageWith(secondDetails,
+ MERGE_RESTRICTED_CAPABILITY);
+ SigningDetails result6 = secondDetails.mergeLineageWith(firstDetails,
+ MERGE_RESTRICTED_CAPABILITY);
- assertEquals(expectedDetails, result1);
- assertEquals(expectedDetails, result2);
+ assertEquals(expectedDetails1, result1);
+ assertEquals(expectedDetails1, result2);
+ assertEquals(expectedDetails2, result3);
+ assertEquals(expectedDetails2, result4);
+ assertEquals(expectedRestrictedDetails, result5);
+ assertEquals(expectedRestrictedDetails, result6);
}
@Test
public void mergeLineageWith_subLineageModifiedCaps_returnsFullLineageWithModifiedCaps()
throws Exception {
- // This test verifies the following scenario:
- // - First lineage has signers B -> C with modified capabilities
- // - Second lineage has signers A -> B -> C -> D with modified capabilities
- // The merged lineage should be A -> B -> C -> D with the most restrictive capabilities for
- // B and C since they are in both lineages.
+ // This test verifies the merge of a full lineage and a subset of that lineage with
+ // modified caps returns the full lineage with expected capabilities based on the
+ // provided merge rule.
int[] subCapabilities = new int[]{INSTALLED_DATA | SHARED_USER_ID | PERMISSION,
DEFAULT_CAPABILITIES | ROLLBACK};
int[] fullCapabilities =
new int[]{0, SHARED_USER_ID, DEFAULT_CAPABILITIES, DEFAULT_CAPABILITIES};
- int[] expectedCapabilities =
+ int[] expectedRestrictedCapabilities =
new int[]{fullCapabilities[0], subCapabilities[0] & fullCapabilities[1],
subCapabilities[1] & fullCapabilities[2], fullCapabilities[3]};
+ int[] expectedCapabilities1 =
+ new int[]{fullCapabilities[0], fullCapabilities[1], fullCapabilities[2],
+ fullCapabilities[3]};
+ int[] expectedCapabilities2 =
+ new int[]{fullCapabilities[0], subCapabilities[0], subCapabilities[1],
+ fullCapabilities[3]};
SigningDetails subLineageDetails = createSigningDetailsWithLineageAndCapabilities(
new String[]{SECOND_SIGNATURE, THIRD_SIGNATURE}, subCapabilities);
SigningDetails fullLineageDetails = createSigningDetailsWithLineageAndCapabilities(
new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE, FOURTH_SIGNATURE},
fullCapabilities);
- SigningDetails expectedDetails = createSigningDetailsWithLineageAndCapabilities(
+ SigningDetails expectedRestrictedDetails = createSigningDetailsWithLineageAndCapabilities(
new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE, FOURTH_SIGNATURE},
- expectedCapabilities);
+ expectedRestrictedCapabilities);
+ SigningDetails expectedDetails1 = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE, FOURTH_SIGNATURE},
+ expectedCapabilities1);
+ SigningDetails expectedDetails2 = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE, THIRD_SIGNATURE, FOURTH_SIGNATURE},
+ expectedCapabilities2);
- SigningDetails result1 = subLineageDetails.mergeLineageWith(fullLineageDetails);
- SigningDetails result2 = fullLineageDetails.mergeLineageWith(subLineageDetails);
+ SigningDetails result1 = subLineageDetails.mergeLineageWith(fullLineageDetails,
+ MERGE_OTHER_CAPABILITY);
+ SigningDetails result2 = fullLineageDetails.mergeLineageWith(subLineageDetails,
+ MERGE_SELF_CAPABILITY);
+ SigningDetails result3 = subLineageDetails.mergeLineageWith(fullLineageDetails,
+ MERGE_SELF_CAPABILITY);
+ SigningDetails result4 = fullLineageDetails.mergeLineageWith(subLineageDetails,
+ MERGE_OTHER_CAPABILITY);
+ SigningDetails result5 = subLineageDetails.mergeLineageWith(fullLineageDetails,
+ MERGE_RESTRICTED_CAPABILITY);
+ SigningDetails result6 = fullLineageDetails.mergeLineageWith(subLineageDetails,
+ MERGE_RESTRICTED_CAPABILITY);
- assertEquals(expectedDetails, result1);
- assertEquals(expectedDetails, result2);
+ assertEquals(expectedDetails1, result1);
+ assertEquals(expectedDetails1, result2);
+ assertEquals(expectedDetails2, result3);
+ assertEquals(expectedDetails2, result4);
+ assertEquals(expectedRestrictedDetails, result5);
+ assertEquals(expectedRestrictedDetails, result6);
}
@Test
@@ -466,6 +537,39 @@
}
@Test
+ public void mergeLineageWith_modifiedCaps_returnsCapsFromProvidedLineage()
+ throws Exception {
+ // By default, when merging two lineage instances, the initial instance should represent a
+ // shared lineage while the provided lineage represents that of a newly installed / updated
+ // package. The shared lineage should contain any previous capability modifications from
+ // the default while the provided lineage has an opportunity to modify what was previously
+ // set. Initially, the most restrictive capabilities were always retained by the returned
+ // lineage, so apps had no mechanism to roll back a restriction to a previous signer. To
+ // allow this, a merge rule can be specified to indicate how differences in capabilities
+ // in common signers should be handled with the default using the capabilities from the
+ // provided lineage.
+ int[] firstCapabilities = new int[]{INSTALLED_DATA | PERMISSION | AUTH,
+ CURRENT_SIGNER_CAPABILITIES};
+ int[] secondCapabilities =
+ new int[]{DEFAULT_CAPABILITIES, CURRENT_SIGNER_CAPABILITIES};
+ SigningDetails firstDetails = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE}, firstCapabilities);
+ SigningDetails secondDetails = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE}, secondCapabilities);
+ // By default, the resulting capabilities should be that of the provided lineage.
+ SigningDetails expectedDetails1 = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE}, secondCapabilities);
+ SigningDetails expectedDetails2 = createSigningDetailsWithLineageAndCapabilities(
+ new String[]{FIRST_SIGNATURE, SECOND_SIGNATURE}, firstCapabilities);
+
+ SigningDetails result1 = firstDetails.mergeLineageWith(secondDetails);
+ SigningDetails result2 = secondDetails.mergeLineageWith(firstDetails);
+
+ assertEquals(expectedDetails1, result1);
+ assertEquals(expectedDetails2, result2);
+ }
+
+ @Test
public void hasCommonAncestor_noLineageSameSingleSigner_returnsTrue() throws Exception {
// If neither SigningDetails have a lineage but they have the same single signer then
// hasCommonAncestor should return true.
diff --git a/core/tests/coretests/src/android/view/DisplayCutoutTest.java b/core/tests/coretests/src/android/view/DisplayCutoutTest.java
index 4319b97..faeae2c 100644
--- a/core/tests/coretests/src/android/view/DisplayCutoutTest.java
+++ b/core/tests/coretests/src/android/view/DisplayCutoutTest.java
@@ -609,7 +609,8 @@
private static DisplayCutout.CutoutPathParserInfo createParserInfo(
@Surface.Rotation int rotation) {
return new DisplayCutout.CutoutPathParserInfo(
- 0 /* displayWidth */, 0 /* displayHeight */, 0f /* density */, "" /* cutoutSpec */,
- rotation, 0f /* scale */);
+ 0 /* displayWidth */, 0 /* displayHeight */, 0 /* displayWidth */,
+ 0 /* displayHeight */, 0f /* density */, "" /* cutoutSpec */,
+ rotation, 0f /* scale */, 0f /* displaySizeRatio */);
}
}
diff --git a/core/tests/coretests/src/android/widget/DateTimeViewTest.java b/core/tests/coretests/src/android/widget/DateTimeViewTest.java
index d0bd4b8..14b48ed 100644
--- a/core/tests/coretests/src/android/widget/DateTimeViewTest.java
+++ b/core/tests/coretests/src/android/widget/DateTimeViewTest.java
@@ -16,14 +16,20 @@
package android.widget;
+import android.view.View;
+import android.view.ViewGroup;
+
import androidx.test.InstrumentationRegistry;
import androidx.test.annotation.UiThreadTest;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.time.Duration;
+
@RunWith(AndroidJUnit4.class)
@SmallTest
public class DateTimeViewTest {
@@ -39,7 +45,33 @@
dateTimeView.detachedFromWindow();
}
+ @UiThreadTest
+ @Test
+ public void noChangeInRelativeText_doesNotTriggerRelayout() {
+ // Week in the future is chosen because it'll result in a stable string during this test
+ // run. This should be improved once the class is refactored to be more testable in
+ // respect of clock retrieval.
+ final long weekInTheFuture = System.currentTimeMillis() + Duration.ofDays(7).toMillis();
+ final TestDateTimeView dateTimeView = new TestDateTimeView();
+ dateTimeView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT));
+ dateTimeView.setShowRelativeTime(true);
+ dateTimeView.setTime(weekInTheFuture);
+ // View needs to be measured to request layout, skipping this would make this test pass
+ // always.
+ dateTimeView.measure(View.MeasureSpec.makeMeasureSpec(200, View.MeasureSpec.UNSPECIFIED),
+ View.MeasureSpec.makeMeasureSpec(100, View.MeasureSpec.UNSPECIFIED));
+ dateTimeView.reset();
+
+ // This should not change the text content and thus no relayout is expected.
+ dateTimeView.setTime(weekInTheFuture + 1000);
+
+ Assert.assertFalse(dateTimeView.wasLayoutRequested());
+ }
+
private static class TestDateTimeView extends DateTimeView {
+ private boolean mRequestedLayout = false;
+
TestDateTimeView() {
super(InstrumentationRegistry.getContext());
}
@@ -51,5 +83,18 @@
void detachedFromWindow() {
super.onDetachedFromWindow();
}
+
+ public void requestLayout() {
+ super.requestLayout();
+ mRequestedLayout = true;
+ }
+
+ public boolean wasLayoutRequested() {
+ return mRequestedLayout;
+ }
+
+ public void reset() {
+ mRequestedLayout = false;
+ }
}
}
diff --git a/core/tests/coretests/src/com/android/internal/app/AbstractResolverComparatorTest.java b/core/tests/coretests/src/com/android/internal/app/AbstractResolverComparatorTest.java
index 04b8886..3e640c1 100644
--- a/core/tests/coretests/src/com/android/internal/app/AbstractResolverComparatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/app/AbstractResolverComparatorTest.java
@@ -115,11 +115,6 @@
@Override
void handleResultMessage(Message message) {}
-
- @Override
- List<ComponentName> getTopComponentNames(int topK) {
- return null;
- }
};
return testComparator;
}
diff --git a/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java b/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java
index cf78646..b38e1c2 100644
--- a/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java
+++ b/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java
@@ -81,7 +81,6 @@
import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.service.chooser.ChooserTarget;
-import android.util.Log;
import android.view.View;
import androidx.annotation.CallSuper;
@@ -623,7 +622,7 @@
List<ResolvedComponentInfo> stableCopy =
createResolvedComponentsForTestWithOtherProfile(2, /* userId= */ 10);
waitForIdle();
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
onView(first(withText(stableCopy.get(1).getResolveInfoAt(0).activityInfo.name)))
.perform(click());
@@ -1437,7 +1436,7 @@
// Thread.sleep shouldn't be a thing in an integration test but it's
// necessary here because of the way the code is structured
// TODO: restructure the tests b/129870719
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
assertThat("Chooser should have 3 targets (2 apps, 1 direct)",
activity.getAdapter().getCount(), is(3));
@@ -1513,7 +1512,7 @@
// Thread.sleep shouldn't be a thing in an integration test but it's
// necessary here because of the way the code is structured
// TODO: restructure the tests b/129870719
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
assertThat("Chooser should have 3 targets (2 apps, 1 direct)",
activity.getAdapter().getCount(), is(3));
@@ -1595,7 +1594,7 @@
// Thread.sleep shouldn't be a thing in an integration test but it's
// necessary here because of the way the code is structured
// TODO: restructure the tests b/129870719
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
assertThat("Chooser should have 3 targets (2 apps, 1 direct)",
wrapper.getAdapter().getCount(), is(3));
@@ -1667,7 +1666,7 @@
// Thread.sleep shouldn't be a thing in an integration test but it's
// necessary here because of the way the code is structured
// TODO: restructure the tests b/129870719
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
assertThat("Chooser should have 4 targets (2 apps, 2 direct)",
wrapper.getAdapter().getCount(), is(4));
@@ -1754,7 +1753,7 @@
// Thread.sleep shouldn't be a thing in an integration test but it's
// necessary here because of the way the code is structured
// TODO: restructure the tests b/129870719
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
assertThat(
String.format("Chooser should have %d targets (%d apps, 1 direct, 15 A-Z)",
@@ -1879,12 +1878,13 @@
return true;
};
- mActivityRule.launchActivity(Intent.createChooser(sendIntent, "work tab test"));
+ final IChooserWrapper activity = (IChooserWrapper)
+ mActivityRule.launchActivity(Intent.createChooser(sendIntent, "work tab test"));
waitForIdle();
onView(withTextFromRuntimeResource("resolver_work_tab")).perform(click());
waitForIdle();
// wait for the share sheet to expand
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
onView(first(allOf(
withText(workResolvedComponentInfos.get(0)
@@ -2023,7 +2023,7 @@
.check(matches(isDisplayed()));
}
- @Test
+ @Test @Ignore("b/222124533")
public void testAppTargetLogging() throws InterruptedException {
Intent sendIntent = createSendTextIntent();
List<ResolvedComponentInfo> resolvedComponentInfos = createResolvedComponentsForTest(2);
@@ -2042,6 +2042,10 @@
mActivityRule.launchActivity(Intent.createChooser(sendIntent, null));
waitForIdle();
+ // TODO(b/222124533): other test cases use a timeout to make sure that the UI is fully
+ // populated; without one, this test flakes. Ideally we should address the need for a
+ // timeout everywhere instead of introducing one to fix this particular test.
+
assertThat(activity.getAdapter().getCount(), is(2));
onView(withIdFromRuntimeResource("profile_button")).check(doesNotExist());
@@ -2143,7 +2147,7 @@
// Thread.sleep shouldn't be a thing in an integration test but it's
// necessary here because of the way the code is structured
// TODO: restructure the tests b/129870719
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
+ Thread.sleep(((ChooserActivity) activity).mListViewUpdateDelayMs);
assertThat("Chooser should have 3 targets (2 apps, 1 direct)",
activity.getAdapter().getCount(), is(3));
@@ -2324,7 +2328,7 @@
assertThat(logger.numCalls(), is(6));
}
- @Test
+ @Test @Ignore("b/222124533")
public void testSwitchProfileLogging() throws InterruptedException {
// enable the work tab feature flag
ResolverActivity.ENABLE_TABBED_VIEW = true;
@@ -3069,8 +3073,15 @@
// framework code on the device is up-to-date.
// TODO: is there a better way to do this? (Other than abandoning inheritance-based DI wrapper?)
private int getRuntimeResourceId(String name, String defType) {
- int id = mActivityRule.getActivity().getResources().getIdentifier(name, defType, "android");
+ int id = -1;
+ if (ChooserActivityOverrideData.getInstance().resources != null) {
+ id = ChooserActivityOverrideData.getInstance().resources.getIdentifier(
+ name, defType, "android");
+ } else {
+ id = mActivityRule.getActivity().getResources().getIdentifier(name, defType, "android");
+ }
assertThat(id, greaterThan(0));
+
return id;
}
}
diff --git a/core/tests/coretests/src/com/android/internal/app/FakeResolverComparatorModel.java b/core/tests/coretests/src/com/android/internal/app/FakeResolverComparatorModel.java
new file mode 100644
index 0000000..fbbe57c
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/app/FakeResolverComparatorModel.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.app;
+
+import android.content.ComponentName;
+import android.content.pm.ResolveInfo;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * Basic {@link ResolverComparatorModel} implementation that sorts according to a pre-defined (or
+ * default) {@link java.util.Comparator}.
+ */
+public class FakeResolverComparatorModel implements ResolverComparatorModel {
+ private final Comparator<ResolveInfo> mComparator;
+
+ public static FakeResolverComparatorModel makeModelFromComparator(
+ Comparator<ResolveInfo> comparator) {
+ return new FakeResolverComparatorModel(comparator);
+ }
+
+ public static FakeResolverComparatorModel makeDefaultModel() {
+ return makeModelFromComparator(Comparator.comparing(ri -> ri.activityInfo.name));
+ }
+
+ @Override
+ public Comparator<ResolveInfo> getComparator() {
+ return mComparator;
+ }
+
+ @Override
+ public float getScore(ComponentName name) {
+ return 0.0f; // Models are not required to provide numerical scores.
+ }
+
+ @Override
+ public void notifyOnTargetSelected(ComponentName componentName) {
+ System.out.println(
+ "User selected " + componentName + " under model " + System.identityHashCode(this));
+ }
+
+ private FakeResolverComparatorModel(Comparator<ResolveInfo> comparator) {
+ mComparator = comparator;
+ }
+}
\ No newline at end of file
diff --git a/core/tests/coretests/src/com/android/internal/app/ResolverActivityTest.java b/core/tests/coretests/src/com/android/internal/app/ResolverActivityTest.java
index e7a23f2..43fba52 100644
--- a/core/tests/coretests/src/com/android/internal/app/ResolverActivityTest.java
+++ b/core/tests/coretests/src/com/android/internal/app/ResolverActivityTest.java
@@ -516,8 +516,6 @@
onView(withText(R.string.resolver_work_tab))
.perform(click());
waitForIdle();
- // wait for the share sheet to expand
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
onView(first(allOf(withText(workResolvedComponentInfos.get(0)
.getResolveInfoAt(0).activityInfo.applicationInfo.name), isCompletelyDisplayed())))
.perform(click());
@@ -616,8 +614,6 @@
onView(withText(R.string.resolver_work_tab))
.perform(click());
waitForIdle();
- // wait for the share sheet to expand
- Thread.sleep(ChooserActivity.LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS);
onView(first(allOf(
withText(workResolvedComponentInfos.get(0)
.getResolveInfoAt(0).activityInfo.applicationInfo.name),
diff --git a/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java b/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java
index 0f48465..09fc7ea 100644
--- a/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java
+++ b/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java
@@ -162,7 +162,8 @@
eq(0L) /* missedFrames */,
eq(5000000L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(0L) /* missedAppFramesCount */);
+ eq(0L) /* missedAppFramesCount */,
+ eq(0L) /* maxSuccessiveMissedFramesCount */);
}
@Test
@@ -196,7 +197,8 @@
eq(1L) /* missedFrames */,
eq(40000000L) /* maxFrameTimeNanos */,
eq(1L) /* missedSfFramesCount */,
- eq(0L) /* missedAppFramesCount */);
+ eq(0L) /* missedAppFramesCount */,
+ eq(1L) /* maxSuccessiveMissedFramesCount */);
}
@Test
@@ -230,7 +232,8 @@
eq(0L) /* missedFrames */,
eq(4000000L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(0L) /* missedAppFramesCount */);
+ eq(0L) /* missedAppFramesCount */,
+ eq(0L) /* maxSuccessiveMissedFramesCount */);
}
@Test
@@ -264,7 +267,8 @@
eq(1L) /* missedFrames */,
eq(40000000L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(1L) /* missedAppFramesCount */);
+ eq(1L) /* missedAppFramesCount */,
+ eq(1L) /* maxSuccessiveMissedFramesCount */);
}
@Test
@@ -301,7 +305,8 @@
eq(1L) /* missedFrames */,
eq(50000000L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(1L) /* missedAppFramesCount */);
+ eq(1L) /* missedAppFramesCount */,
+ eq(1L) /* maxSuccessiveMissedFramesCount */);
}
/**
@@ -340,7 +345,8 @@
eq(0L) /* missedFrames */,
eq(4000000L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(0L) /* missedAppFramesCount */);
+ eq(0L) /* missedAppFramesCount */,
+ eq(0L) /* maxSuccessiveMissedFramesCount */);
}
@Test
@@ -462,7 +468,8 @@
eq(1L) /* missedFrames */,
eq(0L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(1L) /* missedAppFramesCount */);
+ eq(1L) /* missedAppFramesCount */,
+ eq(1L) /* maxSuccessiveMissedFramesCount */);
}
@Test
@@ -496,7 +503,8 @@
eq(0L) /* missedFrames */,
eq(0L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(0L) /* missedAppFramesCount */);
+ eq(0L) /* missedAppFramesCount */,
+ eq(0L) /* maxSuccessiveMissedFramesCount */);
}
@Test
@@ -530,7 +538,37 @@
eq(0L) /* missedFrames */,
eq(0L) /* maxFrameTimeNanos */,
eq(0L) /* missedSfFramesCount */,
- eq(0L) /* missedAppFramesCount */);
+ eq(0L) /* missedAppFramesCount */,
+ eq(0L) /* maxSuccessiveMissedFramesCount */);
+ }
+
+ @Test
+ public void testMaxSuccessiveMissedFramesCount() {
+ FrameTracker tracker = spyFrameTracker(
+ CUJ_WALLPAPER_TRANSITION, CUJ_POSTFIX, /* surfaceOnly= */ true);
+ when(mChoreographer.getVsyncId()).thenReturn(100L);
+ tracker.begin();
+ verify(mSurfaceControlWrapper).addJankStatsListener(any(), any());
+ sendFrame(tracker, JANK_SURFACEFLINGER_DEADLINE_MISSED, 100L);
+ sendFrame(tracker, JANK_SURFACEFLINGER_DEADLINE_MISSED, 101L);
+ sendFrame(tracker, JANK_APP_DEADLINE_MISSED, 102L);
+ sendFrame(tracker, JANK_NONE, 103L);
+ sendFrame(tracker, JANK_APP_DEADLINE_MISSED, 104L);
+ sendFrame(tracker, JANK_APP_DEADLINE_MISSED, 105L);
+ when(mChoreographer.getVsyncId()).thenReturn(106L);
+ tracker.end(FrameTracker.REASON_END_NORMAL);
+ sendFrame(tracker, JANK_SURFACEFLINGER_DEADLINE_MISSED, 106L);
+ sendFrame(tracker, JANK_SURFACEFLINGER_DEADLINE_MISSED, 107L);
+ verify(mSurfaceControlWrapper).removeJankStatsListener(any());
+ verify(tracker).triggerPerfetto();
+ verify(mStatsLog).write(eq(UI_INTERACTION_FRAME_INFO_REPORTED),
+ eq(CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_WALLPAPER_TRANSITION]),
+ eq(6L) /* totalFrames */,
+ eq(5L) /* missedFrames */,
+ eq(0L) /* maxFrameTimeNanos */,
+ eq(2L) /* missedSfFramesCount */,
+ eq(3L) /* missedAppFramesCount */,
+ eq(3L) /* maxSuccessiveMissedFramesCount */);
}
private void sendFirstWindowFrame(FrameTracker tracker, long durationMillis,
diff --git a/core/tests/coretests/src/com/android/internal/widget/LocalImageResolverTest.java b/core/tests/coretests/src/com/android/internal/widget/LocalImageResolverTest.java
index 033c3ca..c63d18b 100644
--- a/core/tests/coretests/src/com/android/internal/widget/LocalImageResolverTest.java
+++ b/core/tests/coretests/src/com/android/internal/widget/LocalImageResolverTest.java
@@ -195,6 +195,17 @@
}
@Test
+ public void resolveImage_smallBitmapIcon_passedSmallerSize_dontResize() {
+ Icon icon = Icon.createWithResource(mContext.getResources(), R.drawable.test32x24);
+ Drawable d = LocalImageResolver.resolveImage(icon, mContext, 600, 450);
+
+ assertThat(d).isInstanceOf(BitmapDrawable.class);
+ BitmapDrawable bd = (BitmapDrawable) d;
+ assertThat(bd.getBitmap().getWidth()).isEqualTo(32);
+ assertThat(bd.getBitmap().getHeight()).isEqualTo(24);
+ }
+
+ @Test
public void resolveImage_largeBitmapIcon_passedSize_resizeToDefinedSize() {
Icon icon = Icon.createWithBitmap(
BitmapFactory.decodeResource(mContext.getResources(), R.drawable.big_a));
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index 9b09616..891c82d 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -3031,6 +3031,12 @@
"group": "WM_DEBUG_FOCUS_LIGHT",
"at": "com\/android\/server\/wm\/DisplayContent.java"
},
+ "873160948": {
+ "message": "Activity=%s reparent to taskId=%d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_WINDOW_ORGANIZER",
+ "at": "com\/android\/server\/wm\/TaskFragmentOrganizerController.java"
+ },
"873914452": {
"message": "goodToGo()",
"level": "DEBUG",
diff --git a/graphics/TEST_MAPPING b/graphics/TEST_MAPPING
index 10bd0ee..abeaf19 100644
--- a/graphics/TEST_MAPPING
+++ b/graphics/TEST_MAPPING
@@ -1,7 +1,12 @@
{
"presubmit": [
{
- "name": "CtsGraphicsTestCases"
+ "name": "CtsGraphicsTestCases",
+ "options": [
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ }
+ ]
}
]
}
diff --git a/keystore/java/android/security/GenerateRkpKey.java b/keystore/java/android/security/GenerateRkpKey.java
index 2e54e63..6981332 100644
--- a/keystore/java/android/security/GenerateRkpKey.java
+++ b/keystore/java/android/security/GenerateRkpKey.java
@@ -16,6 +16,8 @@
package android.security;
+import android.annotation.CheckResult;
+import android.annotation.IntDef;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -24,6 +26,8 @@
import android.os.RemoteException;
import android.util.Log;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@@ -57,6 +61,21 @@
private Context mContext;
private CountDownLatch mCountDownLatch;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(flag = true, value = {
+ IGenerateRkpKeyService.Status.OK,
+ IGenerateRkpKeyService.Status.NO_NETWORK_CONNECTIVITY,
+ IGenerateRkpKeyService.Status.NETWORK_COMMUNICATION_ERROR,
+ IGenerateRkpKeyService.Status.DEVICE_NOT_REGISTERED,
+ IGenerateRkpKeyService.Status.HTTP_CLIENT_ERROR,
+ IGenerateRkpKeyService.Status.HTTP_SERVER_ERROR,
+ IGenerateRkpKeyService.Status.HTTP_UNKNOWN_ERROR,
+ IGenerateRkpKeyService.Status.INTERNAL_ERROR,
+ })
+ public @interface Status {
+ }
+
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
@@ -81,12 +100,14 @@
mContext = context;
}
- private void bindAndSendCommand(int command, int securityLevel) throws RemoteException {
+ @Status
+ private int bindAndSendCommand(int command, int securityLevel) throws RemoteException {
Intent intent = new Intent(IGenerateRkpKeyService.class.getName());
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
+ int returnCode = IGenerateRkpKeyService.Status.OK;
if (comp == null) {
// On a system that does not use RKP, the RemoteProvisioner app won't be installed.
- return;
+ return returnCode;
}
intent.setComponent(comp);
mCountDownLatch = new CountDownLatch(1);
@@ -102,7 +123,7 @@
if (mBinder != null) {
switch (command) {
case NOTIFY_EMPTY:
- mBinder.generateKey(securityLevel);
+ returnCode = mBinder.generateKey(securityLevel);
break;
case NOTIFY_KEY_GENERATED:
mBinder.notifyKeyGenerated(securityLevel);
@@ -112,16 +133,21 @@
}
} else {
Log.e(TAG, "Binder object is null; failed to bind to GenerateRkpKeyService.");
+ returnCode = IGenerateRkpKeyService.Status.INTERNAL_ERROR;
}
mContext.unbindService(mConnection);
+ return returnCode;
}
/**
* Fulfills the use case of (2) described in the class documentation. Blocks until the
* RemoteProvisioner application can get new attestation keys signed by the server.
+ * @return the status of the key generation
*/
- public void notifyEmpty(int securityLevel) throws RemoteException {
- bindAndSendCommand(NOTIFY_EMPTY, securityLevel);
+ @CheckResult
+ @Status
+ public int notifyEmpty(int securityLevel) throws RemoteException {
+ return bindAndSendCommand(NOTIFY_EMPTY, securityLevel);
}
/**
diff --git a/keystore/java/android/security/IGenerateRkpKeyService.aidl b/keystore/java/android/security/IGenerateRkpKeyService.aidl
index 5f1d669..eeaeb27 100644
--- a/keystore/java/android/security/IGenerateRkpKeyService.aidl
+++ b/keystore/java/android/security/IGenerateRkpKeyService.aidl
@@ -26,11 +26,35 @@
* @hide
*/
interface IGenerateRkpKeyService {
+ @JavaDerive(toString=true)
+ @Backing(type="int")
+ enum Status {
+ /** No error(s) occurred */
+ OK = 0,
+ /** Unable to provision keys due to a lack of internet connectivity. */
+ NO_NETWORK_CONNECTIVITY = 1,
+ /** An error occurred while communicating with the RKP server. */
+ NETWORK_COMMUNICATION_ERROR = 2,
+ /** The given device was not registered with the RKP backend. */
+ DEVICE_NOT_REGISTERED = 4,
+ /** The RKP server returned an HTTP client error, indicating a misbehaving client. */
+ HTTP_CLIENT_ERROR = 5,
+ /** The RKP server returned an HTTP server error, indicating something went wrong on the server. */
+ HTTP_SERVER_ERROR = 6,
+ /** The RKP server returned an HTTP status that is unknown. This should never happen. */
+ HTTP_UNKNOWN_ERROR = 7,
+ /** An unexpected internal error occurred. This should never happen. */
+ INTERNAL_ERROR = 8,
+ }
+
/**
* Ping the provisioner service to let it know an app generated a key. This may or may not have
* consumed a remotely provisioned attestation key, so the RemoteProvisioner app should check.
*/
oneway void notifyKeyGenerated(in int securityLevel);
- /** Ping the provisioner service to indicate there are no remaining attestation keys left. */
- void generateKey(in int securityLevel);
+
+ /**
+ * Ping the provisioner service to indicate there are no remaining attestation keys left.
+ */
+ Status generateKey(in int securityLevel);
}
diff --git a/keystore/java/android/security/KeyStore2.java b/keystore/java/android/security/KeyStore2.java
index 3d53cfb..c2cd6ff 100644
--- a/keystore/java/android/security/KeyStore2.java
+++ b/keystore/java/android/security/KeyStore2.java
@@ -345,6 +345,12 @@
case ResponseCode.KEY_PERMANENTLY_INVALIDATED:
return new KeyStoreException(errorCode, "Key permanently invalidated",
serviceErrorMessage);
+ case ResponseCode.OUT_OF_KEYS:
+ // Getting a more specific RKP status requires the security level, which we
+ // don't have here. Higher layers of the stack can interpret this exception
+ // and add more flavor.
+ return new KeyStoreException(errorCode, serviceErrorMessage,
+ KeyStoreException.RKP_TEMPORARILY_UNAVAILABLE);
default:
return new KeyStoreException(errorCode, String.valueOf(errorCode),
serviceErrorMessage);
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
index 5950b5b..40659f5 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
@@ -28,6 +28,7 @@
import android.os.Build;
import android.os.RemoteException;
import android.security.GenerateRkpKey;
+import android.security.IGenerateRkpKeyService;
import android.security.KeyPairGeneratorSpec;
import android.security.KeyStore2;
import android.security.KeyStoreException;
@@ -624,7 +625,7 @@
* GenerateRkpKey.notifyEmpty() will delay for a while before returning.
*/
result = generateKeyPairHelper();
- if (result.rkpStatus == KeyStoreException.RKP_SUCCESS) {
+ if (result.rkpStatus == KeyStoreException.RKP_SUCCESS && result.keyPair != null) {
return result.keyPair;
}
}
@@ -706,27 +707,12 @@
success = true;
KeyPair kp = new KeyPair(publicKey, publicKey.getPrivateKey());
return new GenerateKeyPairHelperResult(0, kp);
- } catch (android.security.KeyStoreException e) {
+ } catch (KeyStoreException e) {
switch (e.getErrorCode()) {
case KeymasterDefs.KM_ERROR_HARDWARE_TYPE_UNAVAILABLE:
throw new StrongBoxUnavailableException("Failed to generated key pair.", e);
case ResponseCode.OUT_OF_KEYS:
- GenerateRkpKey keyGen = new GenerateRkpKey(ActivityThread
- .currentApplication());
- try {
- //TODO: When detailed error information is available from the remote
- //provisioner, propagate it up.
- keyGen.notifyEmpty(securityLevel);
- } catch (RemoteException f) {
- KeyStoreException ksException = new KeyStoreException(
- ResponseCode.OUT_OF_KEYS,
- "Remote exception: " + f.getMessage(),
- KeyStoreException.RKP_TEMPORARILY_UNAVAILABLE);
- throw new ProviderException("Failed to talk to RemoteProvisioner",
- ksException);
- }
- return new GenerateKeyPairHelperResult(
- KeyStoreException.RKP_TEMPORARILY_UNAVAILABLE, null);
+ throw makeOutOfKeysException(e, securityLevel);
default:
ProviderException p = new ProviderException("Failed to generate key pair.", e);
if ((mSpec.getPurposes() & KeyProperties.PURPOSE_WRAP_KEY) != 0) {
@@ -752,6 +738,52 @@
}
}
+ // In case keystore reports OUT_OF_KEYS, call this handler in an attempt to remotely provision
+ // some keys.
+ private ProviderException makeOutOfKeysException(KeyStoreException e, int securityLevel) {
+ GenerateRkpKey keyGen = new GenerateRkpKey(ActivityThread
+ .currentApplication());
+ KeyStoreException ksException;
+ try {
+ final int keyGenStatus = keyGen.notifyEmpty(securityLevel);
+ // Default stance: temporary error. This is a hint to the caller to try again with
+ // exponential back-off.
+ int rkpStatus;
+ switch (keyGenStatus) {
+ case IGenerateRkpKeyService.Status.NO_NETWORK_CONNECTIVITY:
+ rkpStatus = KeyStoreException.RKP_FETCHING_PENDING_CONNECTIVITY;
+ break;
+ case IGenerateRkpKeyService.Status.DEVICE_NOT_REGISTERED:
+ rkpStatus = KeyStoreException.RKP_SERVER_REFUSED_ISSUANCE;
+ break;
+ case IGenerateRkpKeyService.Status.OK:
+ // This will actually retry once immediately, so on "OK" go ahead and return
+ // "temporarily unavailable". @see generateKeyPair
+ case IGenerateRkpKeyService.Status.NETWORK_COMMUNICATION_ERROR:
+ case IGenerateRkpKeyService.Status.HTTP_CLIENT_ERROR:
+ case IGenerateRkpKeyService.Status.HTTP_SERVER_ERROR:
+ case IGenerateRkpKeyService.Status.HTTP_UNKNOWN_ERROR:
+ case IGenerateRkpKeyService.Status.INTERNAL_ERROR:
+ default:
+ // These errors really should never happen. The best we can do is assume they
+ // are transient and hint to the caller to retry with back-off.
+ rkpStatus = KeyStoreException.RKP_TEMPORARILY_UNAVAILABLE;
+ break;
+ }
+ ksException = new KeyStoreException(
+ ResponseCode.OUT_OF_KEYS,
+ "Out of RKP keys due to IGenerateRkpKeyService status: " + keyGenStatus,
+ rkpStatus);
+ } catch (RemoteException f) {
+ ksException = new KeyStoreException(
+ ResponseCode.OUT_OF_KEYS,
+ "Remote exception: " + f.getMessage(),
+ KeyStoreException.RKP_TEMPORARILY_UNAVAILABLE);
+ }
+ ksException.initCause(e);
+ return new ProviderException("Failed to talk to RemoteProvisioner", ksException);
+ }
+
private void addAttestationParameters(@NonNull List<KeyParameter> params)
throws ProviderException, IllegalArgumentException, DeviceIdAttestationException {
byte[] challenge = mSpec.getAttestationChallenge();
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java
index f4e91ba..e50b9a1 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java
@@ -70,6 +70,8 @@
void onTaskFragmentVanished(@NonNull TaskFragmentInfo taskFragmentInfo);
void onTaskFragmentParentInfoChanged(@NonNull IBinder fragmentToken,
@NonNull Configuration parentConfig);
+ void onActivityReparentToTask(int taskId, @NonNull Intent activityIntent,
+ @NonNull IBinder activityToken);
}
/**
@@ -300,4 +302,12 @@
mCallback.onTaskFragmentParentInfoChanged(fragmentToken, parentConfig);
}
}
+
+ @Override
+ public void onActivityReparentToTask(int taskId, @NonNull Intent activityIntent,
+ @NonNull IBinder activityToken) {
+ if (mCallback != null) {
+ mCallback.onActivityReparentToTask(taskId, activityIntent, activityToken);
+ }
+ }
}
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 e20cef2..9f33cbc 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
@@ -40,6 +40,7 @@
import android.os.IBinder;
import android.os.Looper;
import android.util.ArraySet;
+import android.util.Log;
import android.util.SparseArray;
import android.window.TaskFragmentInfo;
import android.window.WindowContainerTransaction;
@@ -59,6 +60,7 @@
*/
public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmentCallback,
ActivityEmbeddingComponent {
+ private static final String TAG = "SplitController";
@VisibleForTesting
final SplitPresenter mPresenter;
@@ -220,6 +222,19 @@
}
}
+ @Override
+ public void onActivityReparentToTask(int taskId, @NonNull Intent activityIntent,
+ @NonNull IBinder activityToken) {
+ // If the activity belongs to the current app process, we treat it as a new activity launch.
+ final Activity activity = ActivityThread.currentActivityThread().getActivity(activityToken);
+ if (activity != null) {
+ onActivityCreated(activity);
+ updateCallbackIfNecessary();
+ return;
+ }
+ // TODO: handle for activity in other process.
+ }
+
/** Called on receiving {@link #onTaskFragmentVanished(TaskFragmentInfo)} for cleanup. */
private void cleanupTaskFragment(@NonNull IBinder taskFragmentToken) {
for (int i = mTaskContainers.size() - 1; i >= 0; i--) {
@@ -229,8 +244,8 @@
}
if (taskContainer.isEmpty()) {
// Cleanup the TaskContainer if it becomes empty.
- mPresenter.stopOverrideSplitAnimation(taskContainer.mTaskId);
- mTaskContainers.remove(taskContainer.mTaskId);
+ mPresenter.stopOverrideSplitAnimation(taskContainer.getTaskId());
+ mTaskContainers.remove(taskContainer.getTaskId());
}
return;
}
@@ -241,13 +256,13 @@
if (taskContainer == null) {
return;
}
- final boolean wasInPip = isInPictureInPicture(taskContainer.mConfiguration);
+ final boolean wasInPip = isInPictureInPicture(taskContainer.getConfiguration());
final boolean isInPIp = isInPictureInPicture(config);
- taskContainer.mConfiguration = config;
+ taskContainer.setConfiguration(config);
// We need to check the animation override when enter/exit PIP or has bounds changed.
boolean shouldUpdateAnimationOverride = wasInPip != isInPIp;
- if (onTaskBoundsMayChange(taskContainer, config.windowConfiguration.getBounds())
+ if (taskContainer.setTaskBounds(config.windowConfiguration.getBounds())
&& !isInPIp) {
// We don't care the bounds change when it has already entered PIP.
shouldUpdateAnimationOverride = true;
@@ -257,16 +272,6 @@
}
}
- /** Returns {@code true} if the bounds is changed. */
- private boolean onTaskBoundsMayChange(@NonNull TaskContainer taskContainer,
- @NonNull Rect taskBounds) {
- if (!taskBounds.isEmpty() && !taskContainer.mTaskBounds.equals(taskBounds)) {
- taskContainer.mTaskBounds.set(taskBounds);
- return true;
- }
- return false;
- }
-
/**
* Updates if we should override transition animation. We only want to override if the Task
* bounds is large enough for at least one split rule.
@@ -279,15 +284,15 @@
// We only want to override if it supports split.
if (supportSplit(taskContainer)) {
- mPresenter.startOverrideSplitAnimation(taskContainer.mTaskId);
+ mPresenter.startOverrideSplitAnimation(taskContainer.getTaskId());
} else {
- mPresenter.stopOverrideSplitAnimation(taskContainer.mTaskId);
+ mPresenter.stopOverrideSplitAnimation(taskContainer.getTaskId());
}
}
private boolean supportSplit(@NonNull TaskContainer taskContainer) {
// No split inside PIP.
- if (isInPictureInPicture(taskContainer.mConfiguration)) {
+ if (isInPictureInPicture(taskContainer.getConfiguration())) {
return false;
}
// Check if the parent container bounds can support any split rule.
@@ -295,7 +300,7 @@
if (!(rule instanceof SplitRule)) {
continue;
}
- if (mPresenter.shouldShowSideBySide(taskContainer.mTaskBounds, (SplitRule) rule)) {
+ if (mPresenter.shouldShowSideBySide(taskContainer.getTaskBounds(), (SplitRule) rule)) {
return true;
}
}
@@ -425,21 +430,36 @@
return null;
}
+ TaskFragmentContainer newContainer(@NonNull Activity activity, int taskId) {
+ return newContainer(activity, activity, taskId);
+ }
+
/**
* Creates and registers a new organized container with an optional activity that will be
* re-parented to it in a WCT.
+ *
+ * @param activity the activity that will be reparented to the TaskFragment.
+ * @param activityInTask activity in the same Task so that we can get the Task bounds if
+ * needed.
+ * @param taskId parent Task of the new TaskFragment.
*/
- TaskFragmentContainer newContainer(@Nullable Activity activity, int taskId) {
+ TaskFragmentContainer newContainer(@Nullable Activity activity,
+ @NonNull Activity activityInTask, int taskId) {
+ if (activityInTask == null) {
+ throw new IllegalArgumentException("activityInTask must not be null,");
+ }
final TaskFragmentContainer container = new TaskFragmentContainer(activity, taskId);
if (!mTaskContainers.contains(taskId)) {
mTaskContainers.put(taskId, new TaskContainer(taskId));
}
final TaskContainer taskContainer = mTaskContainers.get(taskId);
taskContainer.mContainers.add(container);
- if (activity != null && !taskContainer.isTaskBoundsInitialized()
- && onTaskBoundsMayChange(taskContainer,
- SplitPresenter.getTaskBoundsFromActivity(activity))) {
- // Initial check before any TaskFragment has appeared.
+ if (!taskContainer.isTaskBoundsInitialized()) {
+ // Get the initial bounds before the TaskFragment has appeared.
+ final Rect taskBounds = SplitPresenter.getTaskBoundsFromActivity(activityInTask);
+ if (!taskContainer.setTaskBounds(taskBounds)) {
+ Log.w(TAG, "Can't find bounds from activity=" + activityInTask);
+ }
updateAnimationOverride(taskContainer);
}
return container;
@@ -887,6 +907,11 @@
return null;
}
+ @Nullable
+ TaskContainer getTaskContainer(int taskId) {
+ return mTaskContainers.get(taskId);
+ }
+
/**
* Returns {@code true} if an Activity with the provided component name should always be
* expanded to occupy full task bounds. Such activity must not be put in a split.
@@ -1211,37 +1236,4 @@
return configuration != null
&& configuration.windowConfiguration.getWindowingMode() == WINDOWING_MODE_PINNED;
}
-
- /** Represents TaskFragments and split pairs below a Task. */
- @VisibleForTesting
- static class TaskContainer {
- /** The unique task id. */
- final int mTaskId;
- /** Active TaskFragments in this Task. */
- final List<TaskFragmentContainer> mContainers = new ArrayList<>();
- /** Active split pairs in this Task. */
- final List<SplitContainer> mSplitContainers = new ArrayList<>();
- /**
- * TaskFragments that the organizer has requested to be closed. They should be removed when
- * the organizer receives {@link #onTaskFragmentVanished(TaskFragmentInfo)} event for them.
- */
- final Set<IBinder> mFinishedContainer = new ArraySet<>();
- /** Available window bounds of this Task. */
- final Rect mTaskBounds = new Rect();
- /** Configuration of the Task. */
- @Nullable
- Configuration mConfiguration;
-
- TaskContainer(int taskId) {
- mTaskId = taskId;
- }
-
- boolean isEmpty() {
- return mContainers.isEmpty() && mFinishedContainer.isEmpty();
- }
-
- boolean isTaskBoundsInitialized() {
- return !mTaskBounds.isEmpty();
- }
- }
}
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 1b49585..716a087 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java
@@ -19,9 +19,9 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import android.app.Activity;
+import android.app.WindowConfiguration;
import android.content.Context;
import android.content.Intent;
-import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.IBinder;
@@ -111,8 +111,8 @@
primaryActivity, primaryRectBounds, null);
// Create new empty task fragment
- final TaskFragmentContainer secondaryContainer = mController.newContainer(null,
- primaryContainer.getTaskId());
+ final TaskFragmentContainer secondaryContainer = mController.newContainer(
+ null /* activity */, primaryActivity, primaryContainer.getTaskId());
final Rect secondaryRectBounds = getBoundsForPosition(POSITION_END, parentBounds,
rule, isLtr(primaryActivity, rule));
createTaskFragment(wct, secondaryContainer.getTaskFragmentToken(),
@@ -168,8 +168,8 @@
* Creates a new expanded container.
*/
TaskFragmentContainer createNewExpandedContainer(@NonNull Activity launchingActivity) {
- final TaskFragmentContainer newContainer = mController.newContainer(null,
- launchingActivity.getTaskId());
+ final TaskFragmentContainer newContainer = mController.newContainer(null /* activity */,
+ launchingActivity, launchingActivity.getTaskId());
final WindowContainerTransaction wct = new WindowContainerTransaction();
createTaskFragment(wct, newContainer.getTaskFragmentToken(),
@@ -236,8 +236,8 @@
launchingActivity.getTaskId());
}
- TaskFragmentContainer secondaryContainer = mController.newContainer(null,
- primaryContainer.getTaskId());
+ TaskFragmentContainer secondaryContainer = mController.newContainer(null /* activity */,
+ launchingActivity, primaryContainer.getTaskId());
final WindowContainerTransaction wct = new WindowContainerTransaction();
mController.registerSplit(wct, primaryContainer, launchingActivity, secondaryContainer,
rule);
@@ -398,20 +398,12 @@
@NonNull
Rect getParentContainerBounds(@NonNull TaskFragmentContainer container) {
- final Configuration parentConfig = mFragmentParentConfigs.get(
- container.getTaskFragmentToken());
- if (parentConfig != null) {
- return parentConfig.windowConfiguration.getBounds();
+ final int taskId = container.getTaskId();
+ final TaskContainer taskContainer = mController.getTaskContainer(taskId);
+ if (taskContainer == null) {
+ throw new IllegalStateException("Can't find TaskContainer taskId=" + taskId);
}
-
- // If there is no parent yet - then assuming that activities are running in full task bounds
- final Activity topActivity = container.getTopNonFinishingActivity();
- final Rect bounds = topActivity != null ? getParentContainerBounds(topActivity) : null;
-
- if (bounds == null) {
- throw new IllegalStateException("Unknown parent bounds");
- }
- return bounds;
+ return taskContainer.getTaskBounds();
}
@NonNull
@@ -419,22 +411,19 @@
final TaskFragmentContainer container = mController.getContainerWithActivity(
activity.getActivityToken());
if (container != null) {
- final Configuration parentConfig = mFragmentParentConfigs.get(
- container.getTaskFragmentToken());
- if (parentConfig != null) {
- return parentConfig.windowConfiguration.getBounds();
- }
+ return getParentContainerBounds(container);
}
-
return getTaskBoundsFromActivity(activity);
}
@NonNull
static Rect getTaskBoundsFromActivity(@NonNull Activity activity) {
+ final WindowConfiguration windowConfiguration =
+ activity.getResources().getConfiguration().windowConfiguration;
if (!activity.isInMultiWindowMode()) {
// In fullscreen mode the max bounds should correspond to the task bounds.
- return activity.getResources().getConfiguration().windowConfiguration.getMaxBounds();
+ return windowConfiguration.getMaxBounds();
}
- return activity.getResources().getConfiguration().windowConfiguration.getBounds();
+ return windowConfiguration.getBounds();
}
}
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskContainer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskContainer.java
new file mode 100644
index 0000000..be79301
--- /dev/null
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskContainer.java
@@ -0,0 +1,97 @@
+/*
+ * 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 androidx.window.extensions.embedding;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.res.Configuration;
+import android.graphics.Rect;
+import android.os.IBinder;
+import android.util.ArraySet;
+import android.window.TaskFragmentInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/** Represents TaskFragments and split pairs below a Task. */
+class TaskContainer {
+
+ /** The unique task id. */
+ private final int mTaskId;
+
+ /** Available window bounds of this Task. */
+ private final Rect mTaskBounds = new Rect();
+
+ /** Configuration of the Task. */
+ @Nullable
+ private Configuration mConfiguration;
+
+ /** Active TaskFragments in this Task. */
+ final List<TaskFragmentContainer> mContainers = new ArrayList<>();
+
+ /** Active split pairs in this Task. */
+ final List<SplitContainer> mSplitContainers = new ArrayList<>();
+
+ /**
+ * TaskFragments that the organizer has requested to be closed. They should be removed when
+ * the organizer receives {@link SplitController#onTaskFragmentVanished(TaskFragmentInfo)} event
+ * for them.
+ */
+ final Set<IBinder> mFinishedContainer = new ArraySet<>();
+
+ TaskContainer(int taskId) {
+ mTaskId = taskId;
+ }
+
+ int getTaskId() {
+ return mTaskId;
+ }
+
+ @NonNull
+ Rect getTaskBounds() {
+ return mTaskBounds;
+ }
+
+ /** Returns {@code true} if the bounds is changed. */
+ boolean setTaskBounds(@NonNull Rect taskBounds) {
+ if (!taskBounds.isEmpty() && !mTaskBounds.equals(taskBounds)) {
+ mTaskBounds.set(taskBounds);
+ return true;
+ }
+ return false;
+ }
+
+ /** Whether the Task bounds has been initialized. */
+ boolean isTaskBoundsInitialized() {
+ return !mTaskBounds.isEmpty();
+ }
+
+ @Nullable
+ Configuration getConfiguration() {
+ return mConfiguration;
+ }
+
+ void setConfiguration(@Nullable Configuration configuration) {
+ mConfiguration = configuration;
+ }
+
+ /** Whether there is any {@link TaskFragmentContainer} below this Task. */
+ boolean isEmpty() {
+ return mContainers.isEmpty() && mFinishedContainer.isEmpty();
+ }
+}
diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java
index 72519dc..e0fda58 100644
--- a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java
+++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java
@@ -21,6 +21,9 @@
import static com.google.common.truth.Truth.assertWithMessage;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
@@ -29,12 +32,12 @@
import android.app.Activity;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
import android.window.TaskFragmentInfo;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
-import androidx.window.extensions.embedding.SplitController.TaskContainer;
import org.junit.Before;
import org.junit.Test;
@@ -53,6 +56,7 @@
@RunWith(AndroidJUnit4.class)
public class SplitControllerTest {
private static final int TASK_ID = 10;
+ private static final Rect TASK_BOUNDS = new Rect(0, 0, 600, 1200);
@Mock
private Activity mActivity;
@@ -70,8 +74,11 @@
mSplitPresenter = mSplitController.mPresenter;
spyOn(mSplitController);
spyOn(mSplitPresenter);
+ final Configuration activityConfig = new Configuration();
+ activityConfig.windowConfiguration.setBounds(TASK_BOUNDS);
+ activityConfig.windowConfiguration.setMaxBounds(TASK_BOUNDS);
doReturn(mActivityResources).when(mActivity).getResources();
- doReturn(new Configuration()).when(mActivityResources).getConfiguration();
+ doReturn(activityConfig).when(mActivityResources).getConfiguration();
}
@Test
@@ -117,4 +124,20 @@
verify(mSplitController).removeContainer(tf);
verify(mActivity, never()).finish();
}
+
+ @Test
+ public void testNewContainer() {
+ // Must pass in a valid activity.
+ assertThrows(IllegalArgumentException.class, () ->
+ mSplitController.newContainer(null /* activity */, TASK_ID));
+ assertThrows(IllegalArgumentException.class, () ->
+ mSplitController.newContainer(mActivity, null /* launchingActivity */, TASK_ID));
+
+ final TaskFragmentContainer tf = mSplitController.newContainer(null, mActivity, TASK_ID);
+ final TaskContainer taskContainer = mSplitController.getTaskContainer(TASK_ID);
+
+ assertNotNull(tf);
+ assertNotNull(taskContainer);
+ assertEquals(TASK_BOUNDS, taskContainer.getTaskBounds());
+ }
}
diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/TaskContainerTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/TaskContainerTest.java
new file mode 100644
index 0000000..9fb08df
--- /dev/null
+++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/TaskContainerTest.java
@@ -0,0 +1,82 @@
+/*
+ * 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 androidx.window.extensions.embedding;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Test class for {@link TaskContainer}.
+ *
+ * Build/Install/Run:
+ * atest WMJetpackUnitTests:TaskContainerTest
+ */
+@Presubmit
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class TaskContainerTest {
+ private static final int TASK_ID = 10;
+ private static final Rect TASK_BOUNDS = new Rect(0, 0, 600, 1200);
+
+ @Test
+ public void testIsTaskBoundsInitialized() {
+ final TaskContainer taskContainer = new TaskContainer(TASK_ID);
+
+ assertFalse(taskContainer.isTaskBoundsInitialized());
+
+ taskContainer.setTaskBounds(TASK_BOUNDS);
+
+ assertTrue(taskContainer.isTaskBoundsInitialized());
+ }
+
+ @Test
+ public void testSetTaskBounds() {
+ final TaskContainer taskContainer = new TaskContainer(TASK_ID);
+
+ assertFalse(taskContainer.setTaskBounds(new Rect()));
+
+ assertTrue(taskContainer.setTaskBounds(TASK_BOUNDS));
+
+ assertFalse(taskContainer.setTaskBounds(TASK_BOUNDS));
+ }
+
+ @Test
+ public void testIsEmpty() {
+ final TaskContainer taskContainer = new TaskContainer(TASK_ID);
+
+ assertTrue(taskContainer.isEmpty());
+
+ final TaskFragmentContainer tf = new TaskFragmentContainer(null, TASK_ID);
+ taskContainer.mContainers.add(tf);
+
+ assertFalse(taskContainer.isEmpty());
+
+ taskContainer.mFinishedContainer.add(tf.getTaskFragmentToken());
+ taskContainer.mContainers.clear();
+
+ assertFalse(taskContainer.isEmpty());
+ }
+}
diff --git a/libs/WindowManager/Shell/res/drawable/pip_custom_close_bg.xml b/libs/WindowManager/Shell/res/drawable/pip_custom_close_bg.xml
new file mode 100644
index 0000000..39c3fe6
--- /dev/null
+++ b/libs/WindowManager/Shell/res/drawable/pip_custom_close_bg.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid
+ android:color="@color/pip_custom_close_bg" />
+ <size
+ android:width="@dimen/pip_custom_close_bg_size"
+ android:height="@dimen/pip_custom_close_bg_size" />
+</shape>
diff --git a/libs/WindowManager/Shell/res/layout/pip_menu_action.xml b/libs/WindowManager/Shell/res/layout/pip_menu_action.xml
index a733b31..b51dd6a 100644
--- a/libs/WindowManager/Shell/res/layout/pip_menu_action.xml
+++ b/libs/WindowManager/Shell/res/layout/pip_menu_action.xml
@@ -22,6 +22,14 @@
android:forceHasOverlappingRendering="false">
<ImageView
+ android:id="@+id/custom_close_bg"
+ android:layout_width="@dimen/pip_custom_close_bg_size"
+ android:layout_height="@dimen/pip_custom_close_bg_size"
+ android:layout_gravity="center"
+ android:src="@drawable/pip_custom_close_bg"
+ android:visibility="gone"/>
+
+ <ImageView
android:id="@+id/image"
android:layout_width="@dimen/pip_action_inner_size"
android:layout_height="@dimen/pip_action_inner_size"
diff --git a/libs/WindowManager/Shell/res/layout/split_decor.xml b/libs/WindowManager/Shell/res/layout/split_decor.xml
index 9ffa5e8..dfb90af 100644
--- a/libs/WindowManager/Shell/res/layout/split_decor.xml
+++ b/libs/WindowManager/Shell/res/layout/split_decor.xml
@@ -20,9 +20,10 @@
android:layout_width="match_parent">
<ImageView android:id="@+id/split_resizing_icon"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
+ android:layout_height="@*android:dimen/starting_surface_icon_size"
+ android:layout_width="@*android:dimen/starting_surface_icon_size"
android:layout_gravity="center"
+ android:scaleType="fitCenter"
android:padding="0dp"
android:visibility="gone"
android:background="@null"/>
diff --git a/libs/WindowManager/Shell/res/values-es/strings.xml b/libs/WindowManager/Shell/res/values-es/strings.xml
index 9749607..6f38eca 100644
--- a/libs/WindowManager/Shell/res/values-es/strings.xml
+++ b/libs/WindowManager/Shell/res/values-es/strings.xml
@@ -46,10 +46,10 @@
<string name="accessibility_action_divider_top_50" msgid="8649582798829048946">"Superior 50%"</string>
<string name="accessibility_action_divider_top_30" msgid="3572788224908570257">"Superior 30%"</string>
<string name="accessibility_action_divider_bottom_full" msgid="2831868345092314060">"Pantalla inferior completa"</string>
- <string name="one_handed_tutorial_title" msgid="4583241688067426350">"Usar Modo una mano"</string>
+ <string name="one_handed_tutorial_title" msgid="4583241688067426350">"Usar modo Una mano"</string>
<string name="one_handed_tutorial_description" msgid="3486582858591353067">"Para salir, desliza el dedo hacia arriba desde la parte inferior de la pantalla o toca cualquier zona que haya encima de la aplicación"</string>
- <string name="accessibility_action_start_one_handed" msgid="5070337354072861426">"Iniciar Modo una mano"</string>
- <string name="accessibility_action_stop_one_handed" msgid="1369940261782179442">"Salir del Modo una mano"</string>
+ <string name="accessibility_action_start_one_handed" msgid="5070337354072861426">"Iniciar modo Una mano"</string>
+ <string name="accessibility_action_stop_one_handed" msgid="1369940261782179442">"Salir del modo Una mano"</string>
<string name="bubbles_settings_button_description" msgid="1301286017420516912">"Ajustes de las burbujas de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="bubble_overflow_button_content_description" msgid="8160974472718594382">"Menú adicional"</string>
<string name="bubble_accessibility_action_add_back" msgid="1830101076853540953">"Volver a añadir a la pila"</string>
diff --git a/libs/WindowManager/Shell/res/values/colors.xml b/libs/WindowManager/Shell/res/values/colors.xml
index 4606d24..6e750a3 100644
--- a/libs/WindowManager/Shell/res/values/colors.xml
+++ b/libs/WindowManager/Shell/res/values/colors.xml
@@ -30,6 +30,9 @@
<color name="bubbles_dark">@color/GM2_grey_800</color>
<color name="bubbles_icon_tint">@color/GM2_grey_700</color>
+ <!-- PiP -->
+ <color name="pip_custom_close_bg">#D93025</color>
+
<!-- Compat controls UI -->
<color name="compat_controls_background">@android:color/system_neutral1_800</color>
<color name="compat_controls_text">@android:color/system_neutral1_50</color>
@@ -47,4 +50,4 @@
<color name="splash_screen_bg_light">#FFFFFF</color>
<color name="splash_screen_bg_dark">#000000</color>
<color name="splash_window_background_default">@color/splash_screen_bg_light</color>
-</resources>
\ No newline at end of file
+</resources>
diff --git a/libs/WindowManager/Shell/res/values/config.xml b/libs/WindowManager/Shell/res/values/config.xml
index d416c06..8ba41ab 100644
--- a/libs/WindowManager/Shell/res/values/config.xml
+++ b/libs/WindowManager/Shell/res/values/config.xml
@@ -46,6 +46,10 @@
<!-- Show PiP enter split icon, which allows apps to directly enter splitscreen from PiP. -->
<bool name="config_pipEnableEnterSplitButton">false</bool>
+ <!-- Time (duration in milliseconds) that the shell waits for an app to close the PiP by itself
+ if a custom action is present before closing it. -->
+ <integer name="config_pipForceCloseDelay">1000</integer>
+
<!-- Animation duration when using long press on recents to dock -->
<integer name="long_press_dock_anim_duration">250</integer>
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index a2f9e88..c21381d 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -78,6 +78,9 @@
WindowConfiguration#PINNED_WINDOWING_MODE_ELEVATION_IN_DIP -->
<dimen name="pip_shadow_radius">5dp</dimen>
+ <!-- The width and height of the background for custom action in PiP menu. -->
+ <dimen name="pip_custom_close_bg_size">32dp</dimen>
+
<dimen name="dismiss_target_x_size">24dp</dimen>
<dimen name="floating_dismiss_bottom_margin">50dp</dimen>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt
index 4b7950e..255e4d2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt
@@ -19,6 +19,7 @@
import android.util.ArrayMap
import android.util.Log
import android.view.View
+import androidx.dynamicanimation.animation.AnimationHandler
import androidx.dynamicanimation.animation.DynamicAnimation
import androidx.dynamicanimation.animation.FlingAnimation
import androidx.dynamicanimation.animation.FloatPropertyCompat
@@ -123,6 +124,12 @@
private var defaultFling: FlingConfig = globalDefaultFling
/**
+ * AnimationHandler to use if it need custom AnimationHandler, if this is null, it will use
+ * the default AnimationHandler in the DynamicAnimation.
+ */
+ private var customAnimationHandler: AnimationHandler? = null
+
+ /**
* Internal listeners that respond to DynamicAnimations updating and ending, and dispatch to
* the listeners provided via [addUpdateListener] and [addEndListener]. This allows us to add
* just one permanent update and end listener to the DynamicAnimations.
@@ -446,6 +453,14 @@
this.defaultFling = defaultFling
}
+ /**
+ * Set the custom AnimationHandler for all aniatmion in this animator. Set this with null for
+ * restoring to default AnimationHandler.
+ */
+ fun setCustomAnimationHandler(handler: AnimationHandler) {
+ this.customAnimationHandler = handler
+ }
+
/** Starts the animations! */
fun start() {
startAction()
@@ -495,10 +510,13 @@
// springs) on this property before flinging.
cancel(animatedProperty)
+ // Apply the custom animation handler if it not null
+ val flingAnim = getFlingAnimation(animatedProperty, target)
+ flingAnim.animationHandler =
+ customAnimationHandler ?: flingAnim.animationHandler
+
// Apply the configuration and start the animation.
- getFlingAnimation(animatedProperty, target)
- .also { flingConfig.applyToAnimation(it) }
- .start()
+ flingAnim.also { flingConfig.applyToAnimation(it) }.start()
}
}
@@ -510,6 +528,21 @@
if (flingConfig == null) {
// Apply the configuration and start the animation.
val springAnim = getSpringAnimation(animatedProperty, target)
+
+ // If customAnimationHander is exist and has not been set to the animation,
+ // it should set here.
+ if (customAnimationHandler != null &&
+ springAnim.animationHandler != customAnimationHandler) {
+ // Cancel the animation before set animation handler
+ if (springAnim.isRunning) {
+ cancel(animatedProperty)
+ }
+ // Apply the custom animation handler if it not null
+ springAnim.animationHandler =
+ customAnimationHandler ?: springAnim.animationHandler
+ }
+
+ // Apply the configuration and start the animation.
springConfig.applyToAnimation(springAnim)
animationStartActions.add(springAnim::start)
} else {
@@ -564,10 +597,13 @@
}
}
+ // Apply the custom animation handler if it not null
+ val springAnim = getSpringAnimation(animatedProperty, target)
+ springAnim.animationHandler =
+ customAnimationHandler ?: springAnim.animationHandler
+
// Apply the configuration and start the spring animation.
- getSpringAnimation(animatedProperty, target)
- .also { springConfig.applyToAnimation(it) }
- .start()
+ springAnim.also { springConfig.applyToAnimation(it) }.start()
}
}
})
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
index 5ef2413..806c395 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
@@ -96,6 +96,7 @@
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.TaskStackListenerCallback;
import com.android.wm.shell.common.TaskStackListenerImpl;
+import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.onehanded.OneHandedTransitionCallback;
import com.android.wm.shell.pip.PinnedStackListenerForwarder;
@@ -214,6 +215,8 @@
/** One handed mode controller to register transition listener. */
private Optional<OneHandedController> mOneHandedOptional;
+ /** Drag and drop controller to register listener for onDragStarted. */
+ private DragAndDropController mDragAndDropController;
/**
* Creates an instance of the BubbleController.
@@ -230,6 +233,7 @@
ShellTaskOrganizer organizer,
DisplayController displayController,
Optional<OneHandedController> oneHandedOptional,
+ DragAndDropController dragAndDropController,
ShellExecutor mainExecutor,
Handler mainHandler,
TaskViewTransitions taskViewTransitions,
@@ -241,8 +245,8 @@
new BubbleDataRepository(context, launcherApps, mainExecutor),
statusBarService, windowManager, windowManagerShellWrapper, launcherApps,
logger, taskStackListener, organizer, positioner, displayController,
- oneHandedOptional, mainExecutor, mainHandler, taskViewTransitions,
- syncQueue);
+ oneHandedOptional, dragAndDropController, mainExecutor, mainHandler,
+ taskViewTransitions, syncQueue);
}
/**
@@ -264,6 +268,7 @@
BubblePositioner positioner,
DisplayController displayController,
Optional<OneHandedController> oneHandedOptional,
+ DragAndDropController dragAndDropController,
ShellExecutor mainExecutor,
Handler mainHandler,
TaskViewTransitions taskViewTransitions,
@@ -293,6 +298,7 @@
mDisplayController = displayController;
mTaskViewTransitions = taskViewTransitions;
mOneHandedOptional = oneHandedOptional;
+ mDragAndDropController = dragAndDropController;
mSyncQueue = syncQueue;
}
@@ -433,6 +439,7 @@
});
mOneHandedOptional.ifPresent(this::registerOneHandedState);
+ mDragAndDropController.addListener(this::collapseStack);
}
@VisibleForTesting
@@ -884,7 +891,6 @@
return mBubbleData.isExpanded();
}
- @VisibleForTesting
public void collapseStack() {
mBubbleData.setExpanded(false /* expanded */);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java
index 79d795e..fedb998 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java
@@ -423,8 +423,9 @@
}
final DisplayCutout.CutoutPathParserInfo info = cutout.getCutoutPathParserInfo();
final DisplayCutout.CutoutPathParserInfo newInfo = new DisplayCutout.CutoutPathParserInfo(
- info.getDisplayWidth(), info.getDisplayHeight(), info.getDensity(),
- info.getCutoutSpec(), rotation, info.getScale());
+ info.getDisplayWidth(), info.getDisplayHeight(), info.getStableDisplayWidth(),
+ info.getStableDisplayHeight(), info.getDensity(), info.getCutoutSpec(), rotation,
+ info.getScale(), info.getPhysicalPixelDisplaySizeRatio());
return computeSafeInsets(
DisplayCutout.constructDisplayCutout(newBounds, waterfallInsets, newInfo),
rotated ? displayHeight : displayWidth,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/InteractionJankMonitorUtils.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/InteractionJankMonitorUtils.java
new file mode 100644
index 0000000..fd3aa05
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/InteractionJankMonitorUtils.java
@@ -0,0 +1,63 @@
+/*
+ * 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.wm.shell.common;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.text.TextUtils;
+import android.view.View;
+
+import com.android.internal.jank.InteractionJankMonitor;
+
+/** Utils class for simplfy InteractionJank trancing call */
+public class InteractionJankMonitorUtils {
+
+ /**
+ * Begin a trace session.
+ *
+ * @param cujType the specific {@link InteractionJankMonitor.CujType}.
+ * @param view the view to trace
+ * @param tag the tag to distinguish different flow of same type CUJ.
+ */
+ public static void beginTracing(@InteractionJankMonitor.CujType int cujType,
+ @NonNull View view, @Nullable String tag) {
+ final InteractionJankMonitor.Configuration.Builder builder =
+ InteractionJankMonitor.Configuration.Builder.withView(cujType, view);
+ if (!TextUtils.isEmpty(tag)) {
+ builder.setTag(tag);
+ }
+ InteractionJankMonitor.getInstance().begin(builder);
+ }
+
+ /**
+ * End a trace session.
+ *
+ * @param cujType the specific {@link InteractionJankMonitor.CujType}.
+ */
+ public static void endTracing(@InteractionJankMonitor.CujType int cujType) {
+ InteractionJankMonitor.getInstance().end(cujType);
+ }
+
+ /**
+ * Cancel the trace session.
+ *
+ * @param cujType the specific {@link InteractionJankMonitor.CujType}.
+ */
+ public static void cancelTracing(@InteractionJankMonitor.CujType int cujType) {
+ InteractionJankMonitor.getInstance().cancel(cujType);
+ }
+}
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 e270edb..d5875c0 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
@@ -221,7 +221,8 @@
}
final Display display = mDisplayController.getDisplay(mDisplayId);
SurfaceControlViewHost viewRoot =
- new SurfaceControlViewHost(view.getContext(), display, wwm);
+ new SurfaceControlViewHost(
+ view.getContext(), display, wwm, true /* useSfChoreographer */);
attrs.flags |= FLAG_HARDWARE_ACCELERATED;
viewRoot.setView(view, attrs);
mViewRoots.put(view, viewRoot);
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 ec81d23..0b8e631 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
@@ -55,6 +55,7 @@
import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.jank.InteractionJankMonitor;
import com.android.internal.policy.DividerSnapAlgorithm;
import com.android.internal.policy.DockedDividerUtils;
import com.android.wm.shell.R;
@@ -62,6 +63,7 @@
import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.common.DisplayImeController;
import com.android.wm.shell.common.DisplayInsetsController;
+import com.android.wm.shell.common.InteractionJankMonitorUtils;
import com.android.wm.shell.common.split.SplitScreenConstants.SplitPosition;
import java.io.PrintWriter;
@@ -434,6 +436,8 @@
mSplitLayoutHandler.onLayoutSizeChanged(this);
return;
}
+ InteractionJankMonitorUtils.beginTracing(InteractionJankMonitor.CUJ_SPLIT_SCREEN_RESIZE,
+ mSplitWindowManager.getDividerView(), "Divider fling");
ValueAnimator animator = ValueAnimator
.ofInt(from, to)
.setDuration(250);
@@ -446,6 +450,8 @@
if (flingFinishedCallback != null) {
flingFinishedCallback.run();
}
+ InteractionJankMonitorUtils.endTracing(
+ InteractionJankMonitor.CUJ_SPLIT_SCREEN_RESIZE);
}
@Override
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 833d9d5..864b9a7 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
@@ -37,6 +37,7 @@
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
import android.view.SurfaceSession;
+import android.view.View;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;
@@ -170,6 +171,10 @@
mDividerView.setInteractive(interactive);
}
+ View getDividerView() {
+ return mDividerView;
+ }
+
/**
* Gets {@link SurfaceControl} of the surface holding divider view. @return {@code null} if not
* feasible.
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java
index 5a94fb6..8f9636c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java
@@ -19,6 +19,7 @@
import static android.os.Process.THREAD_PRIORITY_DISPLAY;
import static android.os.Process.THREAD_PRIORITY_TOP_APP_BOOST;
+import android.animation.AnimationHandler;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
@@ -28,9 +29,11 @@
import androidx.annotation.Nullable;
+import com.android.internal.graphics.SfVsyncFrameCallbackProvider;
import com.android.wm.shell.R;
import com.android.wm.shell.common.HandlerExecutor;
import com.android.wm.shell.common.ShellExecutor;
+import com.android.wm.shell.common.annotations.ChoreographerSfVsync;
import com.android.wm.shell.common.annotations.ExternalMainThread;
import com.android.wm.shell.common.annotations.ShellAnimationThread;
import com.android.wm.shell.common.annotations.ShellMainThread;
@@ -168,4 +171,28 @@
shellSplashscreenThread.start();
return new HandlerExecutor(shellSplashscreenThread.getThreadHandler());
}
+
+ /**
+ * Provide a Shell main-thread AnimationHandler. The AnimationHandler can be set on
+ * {@link android.animation.ValueAnimator}s and will ensure that the animation will run on
+ * the Shell main-thread with the SF vsync.
+ */
+ @WMSingleton
+ @Provides
+ @ChoreographerSfVsync
+ public static AnimationHandler provideShellMainExecutorSfVsyncAnimationHandler(
+ @ShellMainThread ShellExecutor mainExecutor) {
+ try {
+ AnimationHandler handler = new AnimationHandler();
+ mainExecutor.executeBlocking(() -> {
+ // This is called on the animation thread since it calls
+ // Choreographer.getSfInstance() which returns a thread-local Choreographer instance
+ // that uses the SF vsync
+ handler.setProvider(new SfVsyncFrameCallbackProvider());
+ });
+ return handler;
+ } catch (InterruptedException e) {
+ throw new RuntimeException("Failed to initialize SfVsync animation handler in 1s", e);
+ }
+ }
}
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 965bd26..e43f4fc 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
@@ -16,6 +16,7 @@
package com.android.wm.shell.dagger;
+import android.animation.AnimationHandler;
import android.content.Context;
import android.content.pm.LauncherApps;
import android.os.Handler;
@@ -41,7 +42,9 @@
import com.android.wm.shell.common.SystemWindows;
import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.common.TransactionPool;
+import com.android.wm.shell.common.annotations.ChoreographerSfVsync;
import com.android.wm.shell.common.annotations.ShellMainThread;
+import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.freeform.FreeformTaskListener;
import com.android.wm.shell.fullscreen.FullscreenUnfoldController;
import com.android.wm.shell.legacysplitscreen.LegacySplitScreenController;
@@ -108,6 +111,7 @@
ShellTaskOrganizer organizer,
DisplayController displayController,
@DynamicOverride Optional<OneHandedController> oneHandedOptional,
+ DragAndDropController dragAndDropController,
@ShellMainThread ShellExecutor mainExecutor,
@ShellMainThread Handler mainHandler,
TaskViewTransitions taskViewTransitions,
@@ -116,7 +120,7 @@
floatingContentCoordinator, statusBarService, windowManager,
windowManagerShellWrapper, launcherApps, taskStackListener,
uiEventLogger, organizer, displayController, oneHandedOptional,
- mainExecutor, mainHandler, taskViewTransitions, syncQueue);
+ dragAndDropController, mainExecutor, mainHandler, taskViewTransitions, syncQueue);
}
//
@@ -180,10 +184,11 @@
DisplayImeController displayImeController, TransactionPool transactionPool,
ShellTaskOrganizer shellTaskOrganizer, SyncTransactionQueue syncQueue,
TaskStackListenerImpl taskStackListener, Transitions transitions,
- @ShellMainThread ShellExecutor mainExecutor) {
+ @ShellMainThread ShellExecutor mainExecutor,
+ @ChoreographerSfVsync AnimationHandler sfVsyncAnimationHandler) {
return new LegacySplitScreenController(context, displayController, systemWindows,
displayImeController, transactionPool, shellTaskOrganizer, syncQueue,
- taskStackListener, transitions, mainExecutor);
+ taskStackListener, transitions, mainExecutor, sfVsyncAnimationHandler);
}
@WMSingleton
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java
index 11ecc91..95de2dc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java
@@ -35,9 +35,6 @@
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.ValueAnimator;
import android.content.ClipDescription;
import android.content.Context;
import android.content.res.Configuration;
@@ -52,17 +49,19 @@
import android.view.WindowManager;
import android.widget.FrameLayout;
+import androidx.annotation.VisibleForTesting;
+
import com.android.internal.logging.InstanceId;
import com.android.internal.logging.UiEventLogger;
import com.android.internal.protolog.common.ProtoLog;
import com.android.launcher3.icons.IconProvider;
import com.android.wm.shell.R;
-import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.splitscreen.SplitScreenController;
+import java.util.ArrayList;
import java.util.Optional;
/**
@@ -80,10 +79,19 @@
private SplitScreenController mSplitScreen;
private ShellExecutor mMainExecutor;
private DragAndDropImpl mImpl;
+ private ArrayList<DragAndDropListener> mListeners = new ArrayList<>();
private final SparseArray<PerDisplay> mDisplayDropTargets = new SparseArray<>();
private final SurfaceControl.Transaction mTransaction = new SurfaceControl.Transaction();
+ /**
+ * Listener called during drag events, currently just onDragStarted.
+ */
+ public interface DragAndDropListener {
+ /** Called when a drag has started. */
+ void onDragStarted();
+ }
+
public DragAndDropController(Context context, DisplayController displayController,
UiEventLogger uiEventLogger, IconProvider iconProvider, ShellExecutor mainExecutor) {
mContext = context;
@@ -103,6 +111,22 @@
mDisplayController.addDisplayWindowListener(this);
}
+ /** Adds a listener to be notified of drag and drop events. */
+ public void addListener(DragAndDropListener listener) {
+ mListeners.add(listener);
+ }
+
+ /** Removes a drag and drop listener. */
+ public void removeListener(DragAndDropListener listener) {
+ mListeners.remove(listener);
+ }
+
+ private void notifyListeners() {
+ for (int i = 0; i < mListeners.size(); i++) {
+ mListeners.get(i).onDragStarted();
+ }
+ }
+
@Override
public void onDisplayAdded(int displayId) {
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_DRAG_AND_DROP, "Display added: %d", displayId);
@@ -137,13 +161,19 @@
new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
try {
wm.addView(rootView, layoutParams);
- mDisplayDropTargets.put(displayId,
- new PerDisplay(displayId, context, wm, rootView, dragLayout));
+ addDisplayDropTarget(displayId, context, wm, rootView, dragLayout);
} catch (WindowManager.InvalidDisplayException e) {
Slog.w(TAG, "Unable to add view for display id: " + displayId);
}
}
+ @VisibleForTesting
+ void addDisplayDropTarget(int displayId, Context context, WindowManager wm,
+ FrameLayout rootView, DragLayout dragLayout) {
+ mDisplayDropTargets.put(displayId,
+ new PerDisplay(displayId, context, wm, rootView, dragLayout));
+ }
+
@Override
public void onDisplayConfigurationChanged(int displayId, Configuration newConfig) {
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_DRAG_AND_DROP, "Display changed: %d", displayId);
@@ -206,6 +236,7 @@
pd.dragLayout.prepare(mDisplayController.getDisplayLayout(displayId),
event.getClipData(), loggerSessionId);
setDropTargetWindowVisibility(pd, View.VISIBLE);
+ notifyListeners();
break;
case ACTION_DRAG_ENTERED:
pd.dragLayout.show();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DropZoneView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DropZoneView.java
index 38870bc..0cea36e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DropZoneView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DropZoneView.java
@@ -28,6 +28,7 @@
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.FloatProperty;
+import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -110,10 +111,12 @@
mColorDrawable = new ColorDrawable();
setBackgroundDrawable(mColorDrawable);
+ final int iconSize = context.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.starting_surface_icon_size);
mSplashScreenView = new ImageView(context);
- mSplashScreenView.setScaleType(ImageView.ScaleType.CENTER);
- addView(mSplashScreenView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
+ mSplashScreenView.setScaleType(ImageView.ScaleType.FIT_CENTER);
+ addView(mSplashScreenView,
+ new FrameLayout.LayoutParams(iconSize, iconSize, Gravity.CENTER));
mSplashScreenView.setAlpha(0f);
mMarginView = new MarginView(context);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizer.java
index 4bb5805..2868152 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizer.java
@@ -225,6 +225,10 @@
@VisibleForTesting
void enable() {
+ // Needed since many Kids apps aren't optimised to support both orientations and it will be
+ // hard for kids to understand the app compat mode.
+ // TODO(229961548): Remove ignoreOrientationRequest exception for Kids Mode once possible.
+ setIsIgnoreOrientationRequestDisabled(true);
final DisplayLayout displayLayout = mDisplayController.getDisplayLayout(DEFAULT_DISPLAY);
if (displayLayout != null) {
mDisplayWidth = displayLayout.width();
@@ -245,6 +249,7 @@
@VisibleForTesting
void disable() {
+ setIsIgnoreOrientationRequestDisabled(false);
mDisplayInsetsController.removeInsetsChangedListener(DEFAULT_DISPLAY,
mOnInsetsChangedListener);
mDisplayController.removeDisplayWindowListener(mOnDisplaysChangedListener);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java
index 9754a03..73be283 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java
@@ -25,6 +25,7 @@
import static com.android.wm.shell.common.split.DividerView.TOUCH_ANIMATION_DURATION;
import static com.android.wm.shell.common.split.DividerView.TOUCH_RELEASE_ANIMATION_DURATION;
+import android.animation.AnimationHandler;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
@@ -140,6 +141,7 @@
private DividerImeController mImeController;
private DividerCallbacks mCallback;
+ private AnimationHandler mSfVsyncAnimationHandler;
private ValueAnimator mCurrentAnimator;
private boolean mEntranceAnimationRunning;
private boolean mExitAnimationRunning;
@@ -260,6 +262,10 @@
mDefaultDisplay = displayManager.getDisplay(Display.DEFAULT_DISPLAY);
}
+ public void setAnimationHandler(AnimationHandler sfVsyncAnimationHandler) {
+ mSfVsyncAnimationHandler = sfVsyncAnimationHandler;
+ }
+
@Override
protected void onFinishInflate() {
super.onFinishInflate();
@@ -651,6 +657,7 @@
}
});
mCurrentAnimator = anim;
+ mCurrentAnimator.setAnimationHandler(mSfVsyncAnimationHandler);
return anim;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java
index 8b66792..67e487d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java
@@ -25,6 +25,7 @@
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.view.Display.DEFAULT_DISPLAY;
+import android.animation.AnimationHandler;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityTaskManager;
@@ -81,6 +82,7 @@
private final DividerState mDividerState = new DividerState();
private final ForcedResizableInfoActivityController mForcedResizableController;
private final ShellExecutor mMainExecutor;
+ private final AnimationHandler mSfVsyncAnimationHandler;
private final LegacySplitScreenTaskListener mSplits;
private final SystemWindows mSystemWindows;
final TransactionPool mTransactionPool;
@@ -116,12 +118,13 @@
DisplayImeController imeController, TransactionPool transactionPool,
ShellTaskOrganizer shellTaskOrganizer, SyncTransactionQueue syncQueue,
TaskStackListenerImpl taskStackListener, Transitions transitions,
- ShellExecutor mainExecutor) {
+ ShellExecutor mainExecutor, AnimationHandler sfVsyncAnimationHandler) {
mContext = context;
mDisplayController = displayController;
mSystemWindows = systemWindows;
mImeController = imeController;
mMainExecutor = mainExecutor;
+ mSfVsyncAnimationHandler = sfVsyncAnimationHandler;
mForcedResizableController = new ForcedResizableInfoActivityController(context, this,
mainExecutor);
mTransactionPool = transactionPool;
@@ -311,6 +314,7 @@
Context dctx = mDisplayController.getDisplayContext(mContext.getDisplayId());
mView = (DividerView)
LayoutInflater.from(dctx).inflate(R.layout.docked_stack_divider, null);
+ mView.setAnimationHandler(mSfVsyncAnimationHandler);
DisplayLayout displayLayout = mDisplayController.getDisplayLayout(mContext.getDisplayId());
mView.injectDependencies(this, mWindowManager, mDividerState, mForcedResizableController,
mSplits, mSplitLayout, mImePositionProcessor, mWindowManagerProxy);
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 95bb65c..d357655 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
@@ -30,6 +30,7 @@
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Rect;
+import android.view.Choreographer;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
@@ -270,15 +271,14 @@
mEndValue = endValue;
addListener(this);
addUpdateListener(this);
- mSurfaceControlTransactionFactory =
- new PipSurfaceTransactionHelper.VsyncSurfaceControlTransactionFactory();
+ mSurfaceControlTransactionFactory = SurfaceControl.Transaction::new;
mTransitionDirection = TRANSITION_DIRECTION_NONE;
}
@Override
public void onAnimationStart(Animator animation) {
mCurrentValue = mStartValue;
- onStartTransaction(mLeash, mSurfaceControlTransactionFactory.getTransaction());
+ onStartTransaction(mLeash, newSurfaceControlTransaction());
if (mPipAnimationCallback != null) {
mPipAnimationCallback.onPipAnimationStart(mTaskInfo, this);
}
@@ -286,16 +286,14 @@
@Override
public void onAnimationUpdate(ValueAnimator animation) {
- applySurfaceControlTransaction(mLeash,
- mSurfaceControlTransactionFactory.getTransaction(),
+ applySurfaceControlTransaction(mLeash, newSurfaceControlTransaction(),
animation.getAnimatedFraction());
}
@Override
public void onAnimationEnd(Animator animation) {
mCurrentValue = mEndValue;
- final SurfaceControl.Transaction tx =
- mSurfaceControlTransactionFactory.getTransaction();
+ final SurfaceControl.Transaction tx = newSurfaceControlTransaction();
onEndTransaction(mLeash, tx, mTransitionDirection);
if (mPipAnimationCallback != null) {
mPipAnimationCallback.onPipAnimationEnd(mTaskInfo, tx, this);
@@ -342,8 +340,7 @@
}
PipTransitionAnimator<T> setUseContentOverlay(Context context) {
- final SurfaceControl.Transaction tx =
- mSurfaceControlTransactionFactory.getTransaction();
+ final SurfaceControl.Transaction tx = newSurfaceControlTransaction();
if (mContentOverlay != null) {
// remove existing content overlay if there is any.
tx.remove(mContentOverlay);
@@ -418,7 +415,7 @@
void setDestinationBounds(Rect destinationBounds) {
mDestinationBounds.set(destinationBounds);
if (mAnimationType == ANIM_TYPE_ALPHA) {
- onStartTransaction(mLeash, mSurfaceControlTransactionFactory.getTransaction());
+ onStartTransaction(mLeash, newSurfaceControlTransaction());
}
}
@@ -453,6 +450,16 @@
mEndValue = endValue;
}
+ /**
+ * @return {@link SurfaceControl.Transaction} instance with vsync-id.
+ */
+ protected SurfaceControl.Transaction newSurfaceControlTransaction() {
+ final SurfaceControl.Transaction tx =
+ mSurfaceControlTransactionFactory.getTransaction();
+ tx.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
+ return tx;
+ }
+
@VisibleForTesting
public void setSurfaceControlTransactionFactory(
PipSurfaceTransactionHelper.SurfaceControlTransactionFactory factory) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java
index b349010..c6e48f5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java
@@ -20,7 +20,6 @@
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
-import android.view.Choreographer;
import android.view.SurfaceControl;
import com.android.wm.shell.R;
@@ -225,18 +224,4 @@
public interface SurfaceControlTransactionFactory {
SurfaceControl.Transaction getTransaction();
}
-
- /**
- * Implementation of {@link SurfaceControlTransactionFactory} that returns
- * {@link SurfaceControl.Transaction} with VsyncId being set.
- */
- public static class VsyncSurfaceControlTransactionFactory
- implements SurfaceControlTransactionFactory {
- @Override
- public SurfaceControl.Transaction getTransaction() {
- final SurfaceControl.Transaction tx = new SurfaceControl.Transaction();
- tx.setFrameTimelineVsync(Choreographer.getInstance().getVsyncId());
- return tx;
- }
- }
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
index 9dc861c..fbdf6f0 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
@@ -280,8 +280,7 @@
mSurfaceTransactionHelper = surfaceTransactionHelper;
mPipAnimationController = pipAnimationController;
mPipUiEventLoggerLogger = pipUiEventLogger;
- mSurfaceControlTransactionFactory =
- new PipSurfaceTransactionHelper.VsyncSurfaceControlTransactionFactory();
+ mSurfaceControlTransactionFactory = SurfaceControl.Transaction::new;
mSplitScreenOptional = splitScreenOptional;
mTaskOrganizer = shellTaskOrganizer;
mMainExecutor = mainExecutor;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipUiEventLogger.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipUiEventLogger.java
index 9c23a32..513ebba 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipUiEventLogger.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipUiEventLogger.java
@@ -110,7 +110,10 @@
PICTURE_IN_PICTURE_STASH_RIGHT(711),
@UiEvent(doc = "User taps on the settings button in PiP menu")
- PICTURE_IN_PICTURE_SHOW_SETTINGS(933);
+ PICTURE_IN_PICTURE_SHOW_SETTINGS(933),
+
+ @UiEvent(doc = "Closes PiP with app-provided close action")
+ PICTURE_IN_PICTURE_CUSTOM_CLOSE(1058);
private final int mId;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
index f73b81e..bbec4ec 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
@@ -121,6 +121,7 @@
private final Optional<SplitScreenController> mSplitScreenController;
private final PipUiEventLogger mPipUiEventLogger;
private ParceledListSlice<RemoteAction> mAppActions;
+ private RemoteAction mCloseAction;
private ParceledListSlice<RemoteAction> mMediaActions;
private SyncRtSurfaceTransactionApplier mApplier;
private int mMenuState;
@@ -171,7 +172,7 @@
detachPipMenuView();
}
- private void attachPipMenuView() {
+ void attachPipMenuView() {
// In case detach was not called (e.g. PIP unexpectedly closed)
if (mPipMenuView != null) {
detachPipMenuView();
@@ -459,6 +460,7 @@
public void setAppActions(ParceledListSlice<RemoteAction> appActions,
RemoteAction closeAction) {
mAppActions = appActions;
+ mCloseAction = closeAction;
updateMenuActions();
}
@@ -490,9 +492,8 @@
private void updateMenuActions() {
if (mPipMenuView != null) {
final ParceledListSlice<RemoteAction> menuActions = resolveMenuActions();
- if (menuActions != null) {
- mPipMenuView.setActions(mPipBoundsState.getBounds(), menuActions.getList());
- }
+ mPipMenuView.setActions(mPipBoundsState.getBounds(),
+ menuActions == null ? null : menuActions.getList(), mCloseAction);
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
index 175a244..272331b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
@@ -521,6 +521,7 @@
};
if (mPipTaskOrganizer.isInPip() && saveRestoreSnapFraction) {
+ mMenuController.attachPipMenuView();
// Calculate the snap fraction of the current stack along the old movement bounds
final PipSnapAlgorithm pipSnapAlgorithm = mPipBoundsAlgorithm.getSnapAlgorithm();
final Rect postChangeStackBounds = new Rect(mPipBoundsState.getBounds());
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java
index 11633a9..a0e2201 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java
@@ -220,10 +220,16 @@
return;
}
+ final SurfaceControl targetViewLeash =
+ mTargetViewContainer.getViewRootImpl().getSurfaceControl();
+ if (!targetViewLeash.isValid()) {
+ // The surface of mTargetViewContainer is somehow not ready, bail early
+ return;
+ }
+
// Put the dismiss target behind the task
SurfaceControl.Transaction t = new SurfaceControl.Transaction();
- t.setRelativeLayer(mTargetViewContainer.getViewRootImpl().getSurfaceControl(),
- mTaskLeash, -1);
+ t.setRelativeLayer(targetViewLeash, mTaskLeash, -1);
t.apply();
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipInputConsumer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipInputConsumer.java
index 5ddb534..0f3ff36 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipInputConsumer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipInputConsumer.java
@@ -146,10 +146,11 @@
"%s: Failed to create input consumer, %s", TAG, e);
}
mMainExecutor.execute(() -> {
- // Choreographer.getInstance() must be called on the thread that the input event
+ // Choreographer.getSfInstance() must be called on the thread that the input event
// receiver should be receiving events
+ // TODO(b/222697646): remove getSfInstance usage and use vsyncId for transactions
mInputEventReceiver = new InputEventReceiver(inputChannel,
- Looper.myLooper(), Choreographer.getInstance());
+ Looper.myLooper(), Choreographer.getSfInstance());
if (mRegistrationListener != null) {
mRegistrationListener.onRegistrationChanged(true /* isRegistered */);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActionView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActionView.java
index f11ae42..7f84500 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActionView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuActionView.java
@@ -19,6 +19,7 @@
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -30,6 +31,7 @@
*/
public class PipMenuActionView extends FrameLayout {
private ImageView mImageView;
+ private View mCustomCloseBackground;
public PipMenuActionView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -39,10 +41,16 @@
protected void onFinishInflate() {
super.onFinishInflate();
mImageView = findViewById(R.id.image);
+ mCustomCloseBackground = findViewById(R.id.custom_close_bg);
}
/** pass through to internal {@link #mImageView} */
public void setImageDrawable(Drawable drawable) {
mImageView.setImageDrawable(drawable);
}
+
+ /** pass through to internal {@link #mCustomCloseBackground} */
+ public void setCustomCloseBackgroundVisibility(@View.Visibility int visibility) {
+ mCustomCloseBackground.setVisibility(visibility);
+ }
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
index c0fa8c0..6390c89 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
@@ -33,8 +33,10 @@
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.app.ActivityManager;
-import android.app.PendingIntent.CanceledException;
+import android.app.PendingIntent;
import android.app.RemoteAction;
import android.app.WindowConfiguration;
import android.content.ComponentName;
@@ -72,6 +74,7 @@
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import java.util.Optional;
/**
@@ -113,6 +116,7 @@
private boolean mFocusedTaskAllowSplitScreen;
private final List<RemoteAction> mActions = new ArrayList<>();
+ private RemoteAction mCloseAction;
private AccessibilityManager mAccessibilityManager;
private Drawable mBackgroundDrawable;
@@ -151,6 +155,9 @@
protected View mTopEndContainer;
protected PipMenuIconsAlgorithm mPipMenuIconsAlgorithm;
+ // How long the shell will wait for the app to close the PiP if a custom action is set.
+ private final int mPipForceCloseDelay;
+
public PipMenuView(Context context, PhonePipMenuController controller,
ShellExecutor mainExecutor, Handler mainHandler,
Optional<SplitScreenController> splitScreenController,
@@ -166,6 +173,9 @@
mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
inflate(context, R.layout.pip_menu, this);
+ mPipForceCloseDelay = context.getResources().getInteger(
+ R.integer.config_pipForceCloseDelay);
+
mBackgroundDrawable = mContext.getDrawable(R.drawable.pip_menu_background);
mBackgroundDrawable.setAlpha(0);
mViewRoot = findViewById(R.id.background);
@@ -437,9 +447,13 @@
return new Size(width, height);
}
- void setActions(Rect stackBounds, List<RemoteAction> actions) {
+ void setActions(Rect stackBounds, @Nullable List<RemoteAction> actions,
+ @Nullable RemoteAction closeAction) {
mActions.clear();
- mActions.addAll(actions);
+ if (actions != null && !actions.isEmpty()) {
+ mActions.addAll(actions);
+ }
+ mCloseAction = closeAction;
if (mMenuState == MENU_STATE_FULL) {
updateActionViews(mMenuState, stackBounds);
}
@@ -492,6 +506,8 @@
final RemoteAction action = mActions.get(i);
final PipMenuActionView actionView =
(PipMenuActionView) mActionsGroup.getChildAt(i);
+ final boolean isCloseAction = mCloseAction != null && Objects.equals(
+ mCloseAction.getActionIntent(), action.getActionIntent());
// TODO: Check if the action drawable has changed before we reload it
action.getIcon().loadDrawableAsync(mContext, d -> {
@@ -500,16 +516,12 @@
actionView.setImageDrawable(d);
}
}, mMainHandler);
+ actionView.setCustomCloseBackgroundVisibility(
+ isCloseAction ? View.VISIBLE : View.GONE);
actionView.setContentDescription(action.getContentDescription());
if (action.isEnabled()) {
- actionView.setOnClickListener(v -> {
- try {
- action.getActionIntent().send();
- } catch (CanceledException e) {
- ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
- "%s: Failed to send action, %s", TAG, e);
- }
- });
+ actionView.setOnClickListener(
+ v -> onActionViewClicked(action.getActionIntent(), isCloseAction));
}
actionView.setEnabled(action.isEnabled());
actionView.setAlpha(action.isEnabled() ? 1f : DISABLED_ACTION_ALPHA);
@@ -559,6 +571,32 @@
}
}
+ /**
+ * Execute the {@link PendingIntent} attached to the {@link PipMenuActionView}.
+ * If the given {@link PendingIntent} matches {@link #mCloseAction}, we need to make sure
+ * the PiP is removed after a certain timeout in case the app does not respond in a
+ * timely manner.
+ */
+ private void onActionViewClicked(@NonNull PendingIntent intent, boolean isCloseAction) {
+ try {
+ intent.send();
+ } catch (PendingIntent.CanceledException e) {
+ ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
+ "%s: Failed to send action, %s", TAG, e);
+ }
+ if (isCloseAction) {
+ mPipUiEventLogger.log(PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_CUSTOM_CLOSE);
+ mAllowTouches = false;
+ mMainExecutor.executeDelayed(() -> {
+ hideMenu();
+ // TODO: it's unsafe to call onPipDismiss with a delay here since
+ // we may have a different PiP by the time this runnable is executed.
+ mController.onPipDismiss();
+ mAllowTouches = true;
+ }, mPipForceCloseDelay);
+ }
+ }
+
private void enterSplit() {
// Do not notify menu visibility when hiding the menu, the controller will do this when it
// handles the message
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
index 7028f9a..fa0f092 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
@@ -33,6 +33,11 @@
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Debug;
+import android.os.Looper;
+import android.view.Choreographer;
+
+import androidx.dynamicanimation.animation.AnimationHandler;
+import androidx.dynamicanimation.animation.AnimationHandler.FrameCallbackScheduler;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.R;
@@ -84,6 +89,26 @@
/** Coordinator instance for resolving conflicts with other floating content. */
private FloatingContentCoordinator mFloatingContentCoordinator;
+ private ThreadLocal<AnimationHandler> mSfAnimationHandlerThreadLocal =
+ ThreadLocal.withInitial(() -> {
+ final Looper initialLooper = Looper.myLooper();
+ final FrameCallbackScheduler scheduler = new FrameCallbackScheduler() {
+ @Override
+ public void postFrameCallback(@androidx.annotation.NonNull Runnable runnable) {
+ // TODO(b/222697646): remove getSfInstance usage and use vsyncId for
+ // transactions
+ Choreographer.getSfInstance().postFrameCallback(t -> runnable.run());
+ }
+
+ @Override
+ public boolean isCurrentThread() {
+ return Looper.myLooper() == initialLooper;
+ }
+ };
+ AnimationHandler handler = new AnimationHandler(scheduler);
+ return handler;
+ });
+
/**
* PhysicsAnimator instance for animating {@link PipBoundsState#getMotionBoundsState()}
* using physics animations.
@@ -186,8 +211,11 @@
}
public void init() {
+ // Note: Needs to get the shell main thread sf vsync animation handler
mTemporaryBoundsPhysicsAnimator = PhysicsAnimator.getInstance(
mPipBoundsState.getMotionBoundsState().getBoundsInMotion());
+ mTemporaryBoundsPhysicsAnimator.setCustomAnimationHandler(
+ mSfAnimationHandlerThreadLocal.get());
}
@NonNull
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
index 89d85e4..abf1a95 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
@@ -625,7 +625,8 @@
class PipResizeInputEventReceiver extends BatchedInputEventReceiver {
PipResizeInputEventReceiver(InputChannel channel, Looper looper) {
- super(channel, looper, Choreographer.getInstance());
+ // TODO(b/222697646): remove getSfInstance usage and use vsyncId for transactions
+ super(channel, looper, Choreographer.getSfInstance());
}
public void onInputEvent(InputEvent event) {
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTest.kt
index 8da6224..37e93443 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTest.kt
@@ -25,6 +25,8 @@
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group3
import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
+import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -81,9 +83,19 @@
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
/** {@inheritDoc} */
+ @FlakyTest(bugId = 197726610)
+ @Test
+ override fun pipLayerExpands() {
+ Assume.assumeFalse(isShellTransitionsEnabled)
+ super.pipLayerExpands()
+ }
+
@Presubmit
@Test
- override fun pipLayerExpands() = super.pipLayerExpands()
+ fun pipLayerExpands_ShellTransit() {
+ Assume.assumeTrue(isShellTransitionsEnabled)
+ super.pipLayerExpands()
+ }
companion object {
/**
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java
index 9f74520..aaeebef 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java
@@ -16,15 +16,28 @@
package com.android.wm.shell.draganddrop;
+import static android.content.ClipDescription.MIMETYPE_APPLICATION_SHORTCUT;
+import static android.view.Display.DEFAULT_DISPLAY;
+import static android.view.DragEvent.ACTION_DRAG_STARTED;
+
import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import android.content.ClipData;
+import android.content.ClipDescription;
import android.content.Context;
+import android.content.Intent;
import android.os.RemoteException;
import android.view.Display;
import android.view.DragEvent;
import android.view.View;
+import android.view.WindowManager;
+import android.widget.FrameLayout;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -33,6 +46,7 @@
import com.android.launcher3.icons.IconProvider;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.ShellExecutor;
+import com.android.wm.shell.splitscreen.SplitScreenController;
import org.junit.Before;
import org.junit.Test;
@@ -40,6 +54,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.Optional;
+
/**
* Tests for the drag and drop controller.
*/
@@ -56,6 +72,9 @@
@Mock
private UiEventLogger mUiEventLogger;
+ @Mock
+ private DragAndDropController.DragAndDropListener mDragAndDropListener;
+
private DragAndDropController mController;
@Before
@@ -63,6 +82,7 @@
MockitoAnnotations.initMocks(this);
mController = new DragAndDropController(mContext, mDisplayController, mUiEventLogger,
mock(IconProvider.class), mock(ShellExecutor.class));
+ mController.initialize(Optional.of(mock(SplitScreenController.class)));
}
@Test
@@ -77,4 +97,45 @@
mController.onDisplayAdded(nonDefaultDisplayId);
assertFalse(mController.onDrag(dragLayout, mock(DragEvent.class)));
}
+
+ @Test
+ public void testListenerOnDragStarted() {
+ final View dragLayout = mock(View.class);
+ final Display display = mock(Display.class);
+ doReturn(display).when(dragLayout).getDisplay();
+ doReturn(DEFAULT_DISPLAY).when(display).getDisplayId();
+
+ final ClipData clipData = createClipData();
+ final DragEvent event = mock(DragEvent.class);
+ doReturn(ACTION_DRAG_STARTED).when(event).getAction();
+ doReturn(clipData).when(event).getClipData();
+ doReturn(clipData.getDescription()).when(event).getClipDescription();
+
+ mController.addListener(mDragAndDropListener);
+
+ // Ensure there's a target so that onDrag will execute
+ mController.addDisplayDropTarget(0, mContext, mock(WindowManager.class),
+ mock(FrameLayout.class), mock(DragLayout.class));
+
+ // Verify the listener is called on a valid drag action.
+ mController.onDrag(dragLayout, event);
+ verify(mDragAndDropListener, times(1)).onDragStarted();
+
+ // Verify the listener isn't called after removal.
+ reset(mDragAndDropListener);
+ mController.removeListener(mDragAndDropListener);
+ mController.onDrag(dragLayout, event);
+ verify(mDragAndDropListener, never()).onDragStarted();
+ }
+
+ private ClipData createClipData() {
+ ClipDescription clipDescription = new ClipDescription(MIMETYPE_APPLICATION_SHORTCUT,
+ new String[] { MIMETYPE_APPLICATION_SHORTCUT });
+ Intent i = new Intent();
+ i.putExtra(Intent.EXTRA_PACKAGE_NAME, "pkg");
+ i.putExtra(Intent.EXTRA_SHORTCUT_ID, "shortcutId");
+ i.putExtra(Intent.EXTRA_USER, android.os.Process.myUserHandle());
+ ClipData.Item item = new ClipData.Item(i);
+ return new ClipData(clipDescription, item);
+ }
}
diff --git a/libs/hwui/utils/Color.cpp b/libs/hwui/utils/Color.cpp
index 28f5477..3afb419 100644
--- a/libs/hwui/utils/Color.cpp
+++ b/libs/hwui/utils/Color.cpp
@@ -399,10 +399,12 @@
// Skia skcms' default HLG maps encoded [0, 1] to linear [1, 12] in order to follow ARIB
// but LinearEffect expects a decoded [0, 1] range instead to follow Rec 2100.
std::optional<skcms_TransferFunction> GetHLGScaleTransferFunction() {
- std::optional<skcms_TransferFunction> hlgFn = {};
- skcms_TransferFunction_makeScaledHLGish(&hlgFn.value(), 1.f / 12.f, 2.f, 2.f, 1.f / 0.17883277f,
- 0.28466892f, 0.55991073f);
- return hlgFn;
+ skcms_TransferFunction hlgFn;
+ if (skcms_TransferFunction_makeScaledHLGish(&hlgFn, 1.f / 12.f, 2.f, 2.f, 1.f / 0.17883277f,
+ 0.28466892f, 0.55991073f)) {
+ return std::make_optional<skcms_TransferFunction>(hlgFn);
+ }
+ return {};
}
} // namespace uirenderer
diff --git a/media/Android.bp b/media/Android.bp
index 3516d25..b45d694 100644
--- a/media/Android.bp
+++ b/media/Android.bp
@@ -120,6 +120,13 @@
],
},
},
+ versions_with_info: [
+ {
+ version: "1",
+ imports: [],
+ },
+ ],
+
}
aidl_interface {
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index 5e300c8..75fd64a 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -3653,6 +3653,7 @@
.parseIntRange(info.getString("quality-range"), mQualityRange);
}
if (info.containsKey("feature-bitrate-modes")) {
+ mBitControl = 0;
for (String mode: info.getString("feature-bitrate-modes").split(",")) {
mBitControl |= (1 << parseBitrateMode(mode));
}
diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java
index 9dea5b9..32fff1e 100644
--- a/media/java/android/media/MediaFormat.java
+++ b/media/java/android/media/MediaFormat.java
@@ -1247,7 +1247,7 @@
* A key describing the per-frame average block QP (Quantization Parameter).
* This is a part of a video 'Encoding Statistics' export feature.
* This value is emitted from video encoder for a video frame.
- * The average value is rounded down (using floor()) to integer value.
+ * The average value is rounded to the nearest integer value.
*
* The associated value is an integer.
*/
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
index 65428de..d627984 100644
--- a/native/android/performance_hint.cpp
+++ b/native/android/performance_hint.cpp
@@ -184,13 +184,13 @@
mTimestampsNanos.push_back(now);
/**
- * Use current sample to determine the rate limit. We can pick a shorter rate limit
- * if any sample underperformed, however, it could be the lower level system is slow
- * to react. So here we explicitly choose the rate limit with the latest sample.
+ * Cache the hint if the hint is not overtime and the mLastUpdateTimestamp is
+ * still in the mPreferredRateNanos duration.
*/
- int64_t rateLimit = actualDurationNanos > mTargetDurationNanos ? mPreferredRateNanos
- : 10 * mPreferredRateNanos;
- if (now - mLastUpdateTimestamp <= rateLimit) return 0;
+ if (actualDurationNanos < mTargetDurationNanos &&
+ now - mLastUpdateTimestamp <= mPreferredRateNanos) {
+ return 0;
+ }
binder::Status ret =
mHintSession->reportActualWorkDuration(mActualDurationsNanos, mTimestampsNanos);
diff --git a/omapi/aidl/Android.bp b/omapi/aidl/Android.bp
index d80317b..58bcd1d 100644
--- a/omapi/aidl/Android.bp
+++ b/omapi/aidl/Android.bp
@@ -29,4 +29,11 @@
enabled: true,
},
},
+ versions_with_info: [
+ {
+ version: "1",
+ imports: [],
+ },
+ ],
+
}
diff --git a/omapi/aidl/aidl_api/android.se.omapi/1/.hash b/omapi/aidl/aidl_api/android.se.omapi/1/.hash
new file mode 100644
index 0000000..f77182a
--- /dev/null
+++ b/omapi/aidl/aidl_api/android.se.omapi/1/.hash
@@ -0,0 +1 @@
+894069bcfe4f35ceb2088278ddf87c83adee8014
diff --git a/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementChannel.aidl b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementChannel.aidl
new file mode 100644
index 0000000..87fdac0
--- /dev/null
+++ b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementChannel.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Contributed by: Giesecke & Devrient GmbH.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.se.omapi;
+/* @hide */
+@VintfStability
+interface ISecureElementChannel {
+ void close();
+ boolean isClosed();
+ boolean isBasicChannel();
+ byte[] getSelectResponse();
+ byte[] transmit(in byte[] command);
+ boolean selectNext();
+}
diff --git a/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementListener.aidl b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementListener.aidl
new file mode 100644
index 0000000..77e1c53f
--- /dev/null
+++ b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementListener.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Contributed by: Giesecke & Devrient GmbH.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.se.omapi;
+/* @hide */
+@VintfStability
+interface ISecureElementListener {
+}
diff --git a/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementReader.aidl b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementReader.aidl
new file mode 100644
index 0000000..2b10c47
--- /dev/null
+++ b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementReader.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Contributed by: Giesecke & Devrient GmbH.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.se.omapi;
+/* @hide */
+@VintfStability
+interface ISecureElementReader {
+ boolean isSecureElementPresent();
+ android.se.omapi.ISecureElementSession openSession();
+ void closeSessions();
+ boolean reset();
+}
diff --git a/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementService.aidl b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementService.aidl
new file mode 100644
index 0000000..0c8e431
--- /dev/null
+++ b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementService.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Copyright (c) 2015-2017, The Linux Foundation.
+ *//*
+ * Contributed by: Giesecke & Devrient GmbH.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.se.omapi;
+/* @hide */
+@VintfStability
+interface ISecureElementService {
+ String[] getReaders();
+ android.se.omapi.ISecureElementReader getReader(in String reader);
+ boolean[] isNfcEventAllowed(in String reader, in byte[] aid, in String[] packageNames, in int userId);
+}
diff --git a/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementSession.aidl b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementSession.aidl
new file mode 100644
index 0000000..06287c5
--- /dev/null
+++ b/omapi/aidl/aidl_api/android.se.omapi/1/android/se/omapi/ISecureElementSession.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+ * Copyright (c) 2015-2017, The Linux Foundation.
+ *//*
+ * Contributed by: Giesecke & Devrient GmbH.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.se.omapi;
+/* @hide */
+@VintfStability
+interface ISecureElementSession {
+ byte[] getAtr();
+ void close();
+ void closeChannels();
+ boolean isClosed();
+ android.se.omapi.ISecureElementChannel openBasicChannel(in byte[] aid, in byte p2, in android.se.omapi.ISecureElementListener listener);
+ android.se.omapi.ISecureElementChannel openLogicalChannel(in byte[] aid, in byte p2, in android.se.omapi.ISecureElementListener listener);
+}
diff --git a/packages/CompanionDeviceManager/res/values-el/strings.xml b/packages/CompanionDeviceManager/res/values-el/strings.xml
index 4713c5d..9bf0b78 100644
--- a/packages/CompanionDeviceManager/res/values-el/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-el/strings.xml
@@ -24,7 +24,7 @@
<string name="summary_watch" product="tablet" msgid="7113724443198337683">"Η εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g> θα επιτρέπεται να αλληλεπιδρά με τις ειδοποιήσεις σας και να έχει πρόσβαση στις άδειες Τηλεφώνου, SMS, Επαφών και Ημερολογίου."</string>
<string name="permission_apps" msgid="6142133265286656158">"Εφαρμογές"</string>
<string name="permission_apps_summary" msgid="798718816711515431">"Μεταδώστε σε ροή τις εφαρμογές του τηλεφώνου σας"</string>
- <string name="title_app_streaming" msgid="2270331024626446950">"Να επιτρέπεται στην εφαρμογή <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> η πρόσβαση σε αυτές τις πληροφορίες από το τηλέφωνό σας."</string>
+ <string name="title_app_streaming" msgid="2270331024626446950">"Να επιτρέπεται στο <strong><xliff:g id="APP_NAME">%1$s</xliff:g></strong> η πρόσβαση σε αυτές τις πληροφορίες από το τηλέφωνό σας."</string>
<string name="helper_title_app_streaming" msgid="4151687003439969765">"Υπηρεσίες πολλών συσκευών"</string>
<string name="helper_summary_app_streaming" msgid="7380294597268573523">"Η εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g> ζητά εκ μέρους της συσκευής σας <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> άδεια για πρόσβαση στις φωτογραφίες, τα αρχεία μέσων και τις ειδοποιήσεις του τηλεφώνου σας"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
index ce58ff6..4c313b2 100644
--- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
+++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
@@ -61,6 +61,7 @@
import java.io.PrintWriter;
import java.util.Collections;
import java.util.List;
+import java.util.Locale;
import java.util.Objects;
import java.util.UUID;
@@ -318,13 +319,19 @@
}
// Block Download folder from tree
- if (TextUtils.equals(Environment.DIRECTORY_DOWNLOADS.toLowerCase(),
- path.toLowerCase())) {
+ if (TextUtils.equals(Environment.DIRECTORY_DOWNLOADS.toLowerCase(Locale.ROOT),
+ path.toLowerCase(Locale.ROOT))) {
return true;
}
- if (TextUtils.equals(Environment.DIRECTORY_ANDROID.toLowerCase(),
- path.toLowerCase())) {
+ // Block /Android
+ if (TextUtils.equals(Environment.DIRECTORY_ANDROID.toLowerCase(Locale.ROOT),
+ path.toLowerCase(Locale.ROOT))) {
+ return true;
+ }
+
+ // Block /Android/data, /Android/obb, /Android/sandbox and sub dirs
+ if (shouldHide(dir)) {
return true;
}
@@ -420,19 +427,21 @@
}
@VisibleForTesting
- static String getPathFromDocId(String docId) {
+ static String getPathFromDocId(String docId) throws IOException {
final int splitIndex = docId.indexOf(':', 1);
- final String path = docId.substring(splitIndex + 1);
+ final String docIdPath = docId.substring(splitIndex + 1);
+ // Get CanonicalPath and remove the first "/"
+ final String canonicalPath = new File(docIdPath).getCanonicalPath().substring(1);
- if (path.isEmpty()) {
- return path;
+ if (canonicalPath.isEmpty()) {
+ return canonicalPath;
}
// remove trailing "/"
- if (path.charAt(path.length() - 1) == '/') {
- return path.substring(0, path.length() - 1);
+ if (canonicalPath.charAt(canonicalPath.length() - 1) == '/') {
+ return canonicalPath.substring(0, canonicalPath.length() - 1);
} else {
- return path;
+ return canonicalPath;
}
}
@@ -463,7 +472,12 @@
if (!target.exists()) {
target.mkdirs();
}
- target = new File(target, path);
+ try {
+ target = new File(target, path).getCanonicalFile();
+ } catch (IOException e) {
+ throw new FileNotFoundException("Failed to canonicalize path " + path);
+ }
+
if (mustExist && !target.exists()) {
throw new FileNotFoundException("Missing file for " + docId + " at " + target);
}
diff --git a/packages/ExternalStorageProvider/tests/src/com/android/externalstorage/ExternalStorageProviderTest.java b/packages/ExternalStorageProvider/tests/src/com/android/externalstorage/ExternalStorageProviderTest.java
index ed8320f..18a8edc 100644
--- a/packages/ExternalStorageProvider/tests/src/com/android/externalstorage/ExternalStorageProviderTest.java
+++ b/packages/ExternalStorageProvider/tests/src/com/android/externalstorage/ExternalStorageProviderTest.java
@@ -67,5 +67,16 @@
docId = root + ":";
assertTrue(getPathFromDocId(docId).isEmpty());
+
+ docId = root + ":./" + path;
+ assertEquals(getPathFromDocId(docId), path);
+
+ final String dotPath = "abc/./def/ghi";
+ docId = root + ":" + dotPath;
+ assertEquals(getPathFromDocId(docId), path);
+
+ final String twoDotPath = "abc/../abc/def/ghi";
+ docId = root + ":" + twoDotPath;
+ assertEquals(getPathFromDocId(docId), path);
}
}
diff --git a/packages/PrintSpooler/res/values-b+sr+Latn/strings.xml b/packages/PrintSpooler/res/values-b+sr+Latn/strings.xml
index 5f0322f..07615ae 100644
--- a/packages/PrintSpooler/res/values-b+sr+Latn/strings.xml
+++ b/packages/PrintSpooler/res/values-b+sr+Latn/strings.xml
@@ -66,7 +66,7 @@
<string name="notification_channel_failure" msgid="9042250774797916414">"Neuspeli zadaci štampanja"</string>
<string name="could_not_create_file" msgid="3425025039427448443">"Pravljenje datoteke nije uspelo"</string>
<string name="print_services_disabled_toast" msgid="9089060734685174685">"Neke usluge štampanja su onemogućene"</string>
- <string name="print_searching_for_printers" msgid="6550424555079932867">"Pretraga štampača"</string>
+ <string name="print_searching_for_printers" msgid="6550424555079932867">"Traženje štampača"</string>
<string name="print_no_print_services" msgid="8561247706423327966">"Nijedna usluga štampanja nije omogućena"</string>
<string name="print_no_printers" msgid="4869403323900054866">"Nije pronađen nijedan štampač"</string>
<string name="cannot_add_printer" msgid="7840348733668023106">"Nije moguće dodati štampače"</string>
diff --git a/packages/PrintSpooler/res/values-sr/strings.xml b/packages/PrintSpooler/res/values-sr/strings.xml
index c2f99d9..bc29999 100644
--- a/packages/PrintSpooler/res/values-sr/strings.xml
+++ b/packages/PrintSpooler/res/values-sr/strings.xml
@@ -66,7 +66,7 @@
<string name="notification_channel_failure" msgid="9042250774797916414">"Неуспели задаци штампања"</string>
<string name="could_not_create_file" msgid="3425025039427448443">"Прављење датотеке није успело"</string>
<string name="print_services_disabled_toast" msgid="9089060734685174685">"Неке услуге штампања су онемогућене"</string>
- <string name="print_searching_for_printers" msgid="6550424555079932867">"Претрага штампача"</string>
+ <string name="print_searching_for_printers" msgid="6550424555079932867">"Тражење штампача"</string>
<string name="print_no_print_services" msgid="8561247706423327966">"Ниједна услуга штампања није омогућена"</string>
<string name="print_no_printers" msgid="4869403323900054866">"Није пронађен ниједан штампач"</string>
<string name="cannot_add_printer" msgid="7840348733668023106">"Није могуће додати штампаче"</string>
diff --git a/packages/SettingsLib/Utils/src/com/android/settingslib/utils/WorkPolicyUtils.java b/packages/SettingsLib/Utils/src/com/android/settingslib/utils/WorkPolicyUtils.java
new file mode 100644
index 0000000..b038d59
--- /dev/null
+++ b/packages/SettingsLib/Utils/src/com/android/settingslib/utils/WorkPolicyUtils.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.utils;
+
+
+import android.app.admin.DevicePolicyManager;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.provider.Settings;
+
+import java.util.List;
+
+/**
+ * Utility class for find out when to show WorkPolicyInfo
+ */
+public class WorkPolicyUtils {
+
+ Context mContext;
+ PackageManager mPackageManager;
+ UserManager mUserManager;
+ DevicePolicyManager mDevicePolicyManager;
+
+ private static final int USER_NULL = -10000;
+
+ public WorkPolicyUtils(
+ Context applicationContext,
+ PackageManager mPm,
+ UserManager mUm,
+ DevicePolicyManager mDpm
+ ) {
+ mContext = applicationContext;
+ mPackageManager = mPm;
+ mUserManager = mUm;
+ mDevicePolicyManager = mDpm;
+ }
+
+ /**
+ * Returns {@code true} if it is possilbe to resolve an Intent to launch the "Your work policy
+ * info" page provided by the active Device Owner or Profile Owner app if it exists, {@code
+ * false} otherwise.
+ */
+ public boolean hasWorkPolicy() {
+ return getWorkPolicyInfoIntentDO() != null || getWorkPolicyInfoIntentPO() != null;
+ }
+
+ /**
+ * Launches the Device Owner or Profile Owner's activity that displays the "Your work policy
+ * info" page. Returns {@code true} if the activity has indeed been launched.
+ */
+ public boolean showWorkPolicyInfo(Context activityContext) {
+ Intent intent = getWorkPolicyInfoIntentDO();
+ if (intent != null) {
+ activityContext.startActivity(intent);
+ return true;
+ }
+
+ intent = getWorkPolicyInfoIntentPO();
+ final int userId = getManagedProfileUserId();
+ if (intent != null && userId != USER_NULL) {
+ activityContext.startActivityAsUser(intent, UserHandle.of(userId));
+ return true;
+ }
+
+ return false;
+ }
+
+ private Intent getWorkPolicyInfoIntentDO() {
+ final ComponentName ownerComponent = getDeviceOwnerComponent();
+ if (ownerComponent == null) {
+ return null;
+ }
+
+ // Only search for the required action in the Device Owner's package
+ final Intent intent =
+ new Intent(Settings.ACTION_SHOW_WORK_POLICY_INFO)
+ .setPackage(ownerComponent.getPackageName());
+ final List<ResolveInfo> activities = mPackageManager.queryIntentActivities(intent, 0);
+ if (activities.size() != 0) {
+ return intent;
+ }
+
+ return null;
+ }
+
+ private Intent getWorkPolicyInfoIntentPO() {
+ try {
+ final int managedUserId = getManagedProfileUserId();
+ if (managedUserId == USER_NULL) {
+ return null;
+ }
+
+ Context managedProfileContext =
+ mContext.createPackageContextAsUser(
+ mContext.getPackageName(), 0, UserHandle.of(managedUserId)
+ );
+
+ DevicePolicyManager managedProfileDevicePolicyManager =
+ (DevicePolicyManager)
+ managedProfileContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
+ ComponentName ownerComponent = managedProfileDevicePolicyManager.getProfileOwner();
+ if (ownerComponent == null) {
+ return null;
+ }
+
+ // Only search for the required action in the Profile Owner's package
+ final Intent intent =
+ new Intent(Settings.ACTION_SHOW_WORK_POLICY_INFO)
+ .setPackage(ownerComponent.getPackageName());
+ final List<ResolveInfo> activities =
+ mPackageManager.queryIntentActivitiesAsUser(
+ intent, 0, UserHandle.of(managedUserId));
+ if (activities.size() != 0) {
+ return intent;
+ }
+
+ return null;
+ } catch (PackageManager.NameNotFoundException e) {
+ return null;
+ }
+ }
+
+ private ComponentName getDeviceOwnerComponent() {
+ if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_DEVICE_ADMIN)) {
+ return null;
+ }
+ return mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser();
+ }
+
+ private int getManagedProfileUserId() {
+ List<UserHandle> allProfiles = mUserManager.getAllProfiles();
+ for (UserHandle uh : allProfiles) {
+ int id = uh.getIdentifier();
+ if (mUserManager.isManagedProfile(id)) {
+ return id;
+ }
+ }
+ return USER_NULL;
+ }
+
+}
diff --git a/packages/SettingsLib/res/values-as/strings.xml b/packages/SettingsLib/res/values-as/strings.xml
index b3bba95..e4a6118 100644
--- a/packages/SettingsLib/res/values-as/strings.xml
+++ b/packages/SettingsLib/res/values-as/strings.xml
@@ -400,9 +400,9 @@
<string name="app_process_limit_title" msgid="8361367869453043007">"নেপথ্যত চলা প্ৰক্ৰিয়াৰ সীমা"</string>
<string name="show_all_anrs" msgid="9160563836616468726">"নেপথ্য এএনআৰবোৰ দেখুৱাওক"</string>
<string name="show_all_anrs_summary" msgid="8562788834431971392">"নেপথ্য এপসমূহৰ বাবে এপে সঁহাৰি দিয়া নাই ডায়ল\'গ প্ৰদৰ্শন কৰক"</string>
- <string name="show_notification_channel_warnings" msgid="3448282400127597331">"জাননী চ্চেনেলৰ সকীয়নিসমূহ দেখুৱাওক"</string>
+ <string name="show_notification_channel_warnings" msgid="3448282400127597331">"জাননী চেনেলৰ সকীয়নিবোৰ দেখুৱাওক"</string>
<string name="show_notification_channel_warnings_summary" msgid="68031143745094339">"কোনো এপে বৈধ চেনেল নোহোৱাকৈ কোনো জাননী প\'ষ্ট কৰিলে স্ক্ৰীনত সকীয়নি প্ৰদৰ্শন হয়"</string>
- <string name="force_allow_on_external" msgid="9187902444231637880">"বাহ্যিক সঞ্চয়াগাৰত এপক বলেৰে অনুমতি দিয়ক"</string>
+ <string name="force_allow_on_external" msgid="9187902444231637880">"বাহ্যিক ষ্ট\'ৰেজত এপক বলেৰে অনুমতি দিয়ক"</string>
<string name="force_allow_on_external_summary" msgid="8525425782530728238">"মেনিফেষ্টৰ মান যিয়েই নহওক, বাহ্যিক ষ্ট’ৰেজত লিখিবলৈ যিকোনো এপক উপযুক্ত কৰি তোলে"</string>
<string name="force_resizable_activities" msgid="7143612144399959606">"বলেৰে কাৰ্যকলাপসমূহৰ আকাৰ সলনি কৰিব পৰা কৰক"</string>
<string name="force_resizable_activities_summary" msgid="2490382056981583062">"মেনিফেষ্টৰ মান যিয়েই নহওক, মাল্টি-ৱিণ্ডৰ বাবে আটাইবোৰ কাৰ্যকলাপৰ আকাৰ সলনি কৰিব পৰা কৰক।"</string>
@@ -590,7 +590,7 @@
<string name="add_guest_failed" msgid="8074548434469843443">"নতুন অতিথি সৃষ্টি কৰিব পৰা নগ’ল"</string>
<string name="user_nickname" msgid="262624187455825083">"উপনাম"</string>
<string name="user_add_user" msgid="7876449291500212468">"ব্যৱহাৰকাৰী যোগ দিয়ক"</string>
- <string name="guest_new_guest" msgid="3482026122932643557">"অতিথি যোগ কৰক"</string>
+ <string name="guest_new_guest" msgid="3482026122932643557">"অতিথি যোগ দিয়ক"</string>
<string name="guest_exit_guest" msgid="5908239569510734136">"অতিথি আঁতৰাওক"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"অতিথিৰ ছেশ্বন ৰিছেট কৰক"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"অতিথিৰ ছেশ্বন ৰিছেট কৰিবনে?"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index f35ed0e..5b6d982 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -568,7 +568,7 @@
<string name="user_add_profile_item_summary" msgid="5418602404308968028">"Можете да ограничите достъпа до приложенията и съдържанието от профила си"</string>
<string name="user_add_user_item_title" msgid="2394272381086965029">"Потребител"</string>
<string name="user_add_profile_item_title" msgid="3111051717414643029">"Ограничен потр. профил"</string>
- <string name="user_add_user_title" msgid="5457079143694924885">"Да се добави ли нов потреб.?"</string>
+ <string name="user_add_user_title" msgid="5457079143694924885">"Добавяне на нов потребител?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"Можете да споделите това устройство с други хора, като създадете допълнителни потребители. Всеки от тях има собствено работно пространство, което може да персонализира с приложения, тапет и др. Потребителите могат също да коригират настройки на устройството, които засягат всички – например за Wi‑Fi.\n\nКогато добавите нов потребител, той трябва да настрои работното си пространство.\n\nВсеки потребител може да актуализира приложенията за всички останали потребители. Настройките и услугите за достъпност може да не се прехвърлят за новия потребител."</string>
<string name="user_add_user_message_short" msgid="3295959985795716166">"Когато добавите нов потребител, той трябва да настрои работното си пространство.\n\nВсеки потребител може да актуализира приложенията за всички останали потребители."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"Настройване на потребителя?"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index 7d42081..bd81285 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"ডিসকানেক্ট হচ্ছে..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"কানেক্ট হচ্ছে..."</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"কানেক্ট করা আছে<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"চেনানো হচ্ছে..."</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"যুক্ত করা হচ্ছে..."</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"কানেক্ট করা আছে (ফোনের অডিও ছাড়া)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"কানেক্ট করা আছে (মিডিয়ার অডিও ছাড়া)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"কানেক্ট করা আছে (মেসেজে অ্যাকসেস নেই)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"সীমাবদ্ধ প্রোফাইল"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"নতুন ব্যবহারকারী জুড়বেন?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"আপনি একাধিক ব্যবহারকারীর আইডি তৈরি করে অন্যদের সাথে এই ডিভাইসটি শেয়ার করতে পারেন। ডিভাইসের স্টোরেজে প্রত্যেক ব্যবহারকারী তার নিজস্ব জায়গা পাবেন যা তিনি অ্যাপ, ওয়ালপেপার এবং আরও অনেক কিছু দিয়ে কাস্টমাইজ করতে পারেন। ওয়াই-ফাই এর মতো ডিভাইস সেটিংস, যেগুলি সকলের ক্ষেত্রে প্রযোজ্য হয়, সেগুলি ব্যবহারকারীরা পরিবর্তন করতে পারবেন।\n\nনতুন ব্যবহারকারীর আইডি যোগ করলে সেই ব্যক্তিকে স্টোরেজে তার নিজের জায়গা সেট-আপ করতে হবে।\n\nঅন্যান্য ব্যবহারকারীদের হয়ে যে কোনও ব্যবহারকারী অ্যাপ আপডেট করতে পারবেন। তবে ব্যবহারযোগ্যতার সেটিংস এবং পরিষেবা নতুন ব্যবহারকারীর ক্ষেত্রে প্রযোজ্য নাও হতে পারে।"</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"আপনি একজন নতুন ব্যবহারকারী জুড়লে তাকে তার জায়গা সেট-আপ করে নিতে হবে।\n\nযেকোনো ব্যবহারকারী অন্য সব ব্যবহারকারীর জন্য অ্যাপ্লিকেশান আপডেট করতে পারবেন।"</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"আপনি একজন নতুন ব্যবহারকারী যোগ করলে তাকে তার জায়গা সেট-আপ করে নিতে হবে৷\n\nযেকোনও ব্যবহারকারী অন্য সব ব্যবহারকারীর জন্য অ্যাপ আপডেট করতে পারবেন৷"</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"এখন ব্যবহারকারী সেট-আপ করবেন?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"নিশ্চিত করুন, যে ব্যক্তিটি ডিভাইসটি নেওয়ার জন্য এবং তার জায়গা সেট-আপ করার জন্য উপলব্ধ আছেন"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"এখনই প্রোফাইল সেট-আপ করবেন?"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index 9394121..eb03466 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -589,8 +589,8 @@
<string name="add_user_failed" msgid="4809887794313944872">"Kreiranje novog korisnika nije uspjelo"</string>
<string name="add_guest_failed" msgid="8074548434469843443">"Kreiranje novog gosta nije uspjelo"</string>
<string name="user_nickname" msgid="262624187455825083">"Nadimak"</string>
- <string name="user_add_user" msgid="7876449291500212468">"Dodaj korisnika"</string>
- <string name="guest_new_guest" msgid="3482026122932643557">"Dodaj gosta"</string>
+ <string name="user_add_user" msgid="7876449291500212468">"Dodajte korisnika"</string>
+ <string name="guest_new_guest" msgid="3482026122932643557">"Dodajte gosta"</string>
<string name="guest_exit_guest" msgid="5908239569510734136">"Ukloni gosta"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Poništi sesiju gosta"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"Poništiti sesiju gosta?"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index 0f04846..ef0f800 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -151,7 +151,7 @@
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"Ακύρωση"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"Η σύζευξη παρέχει πρόσβαση στις επαφές σας και το ιστορικό κλήσεων όταν συνδεθείτε."</string>
<string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"Δεν ήταν δυνατή η σύζευξη με τη συσκευή <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
- <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"Δεν ήταν δυνατή η σύζευξη με τη συσκευή <xliff:g id="DEVICE_NAME">%1$s</xliff:g> λόγω εσφαλμένου αριθμού PIN ή κλειδιού πρόσβασης."</string>
+ <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"Δεν ήταν δυνατή η σύζευξη με το <xliff:g id="DEVICE_NAME">%1$s</xliff:g> λόγω εσφαλμένου PIN ή κλειδιού πρόσβασης."</string>
<string name="bluetooth_pairing_device_down_error_message" msgid="2554424863101358857">"Δεν είναι δυνατή η σύνδεση με τη συσκευή <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
<string name="bluetooth_pairing_rejected_error_message" msgid="5943444352777314442">"Η ζεύξη απορρίφθηκε από τη συσκευή <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
<string name="bluetooth_talkback_computer" msgid="3736623135703893773">"Υπολογιστής"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index f9c6121..f7a0404 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Desconectando…"</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Estableciendo conexión…"</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"Conectado<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"Vinculando…"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"Emparejando…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"Conectado a <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> (sin audio de teléfono)"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"Conectado (sin audio multimedia) a <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"Conectado a <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> (sin acceso a mensajes)"</string>
@@ -507,7 +507,7 @@
<string name="screen_zoom_summary_extremely_large" msgid="1438045624562358554">"Lo más grande posible"</string>
<string name="screen_zoom_summary_custom" msgid="3468154096832912210">"Personalizado (<xliff:g id="DENSITYDPI">%d</xliff:g>)"</string>
<string name="content_description_menu_button" msgid="6254844309171779931">"Menú"</string>
- <string name="retail_demo_reset_message" msgid="5392824901108195463">"Escribe una contraseña para restablecer estado de fábrica en modo demostración"</string>
+ <string name="retail_demo_reset_message" msgid="5392824901108195463">"Escribe una contraseña para restablecer estado de fábrica en modo Demo"</string>
<string name="retail_demo_reset_next" msgid="3688129033843885362">"Siguiente"</string>
<string name="retail_demo_reset_title" msgid="1866911701095959800">"Contraseña obligatoria"</string>
<string name="active_input_method_subtypes" msgid="4232680535471633046">"Métodos de introducción de texto activos"</string>
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"Perfil restringido"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"¿Añadir nuevo usuario?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"Puedes compartir este dispositivo si creas más usuarios. Cada uno tendrá su propio espacio y podrá personalizarlo con aplicaciones, un fondo de pantalla y mucho más. Los usuarios también pueden ajustar opciones del dispositivo, como la conexión Wi‑Fi, que afectan a todos los usuarios.\n\nCuando añadas un usuario, tendrá que configurar su espacio.\n\nCualquier usuario puede actualizar aplicaciones de todos los usuarios. Es posible que no se transfieran los servicios y opciones de accesibilidad al nuevo usuario."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"Al añadir un usuario nuevo, este debe configurar su espacio.\n\nCualquier usuario puede actualizar las aplicaciones del resto de usuarios."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"Al añadir un usuario nuevo, debe configurar su espacio.\n\nCualquier usuario puede actualizar las aplicaciones del resto de usuarios."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"¿Configurar usuario ahora?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"Asegúrate de que la persona está disponible en este momento para usar el dispositivo y configurar su espacio."</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"¿Quieres configurar un perfil ahora?"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index 29376f3..37a6db2 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -589,7 +589,7 @@
<string name="add_user_failed" msgid="4809887794313944872">"Uue kasutaja loomine ebaõnnestus"</string>
<string name="add_guest_failed" msgid="8074548434469843443">"Uue külalise loomine ei õnnestunud"</string>
<string name="user_nickname" msgid="262624187455825083">"Hüüdnimi"</string>
- <string name="user_add_user" msgid="7876449291500212468">"Kasutaja lisamine"</string>
+ <string name="user_add_user" msgid="7876449291500212468">"Lisa kasutaja"</string>
<string name="guest_new_guest" msgid="3482026122932643557">"Lisa külaline"</string>
<string name="guest_exit_guest" msgid="5908239569510734136">"Eemalda külaline"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Lähtesta külastajaseanss"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index 5386c35..3de56b9 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -590,7 +590,7 @@
<string name="add_guest_failed" msgid="8074548434469843443">"Ezin izan da sortu beste gonbidatu bat"</string>
<string name="user_nickname" msgid="262624187455825083">"Goitizena"</string>
<string name="user_add_user" msgid="7876449291500212468">"Gehitu erabiltzaile bat"</string>
- <string name="guest_new_guest" msgid="3482026122932643557">"Gehitu gonbidatua"</string>
+ <string name="guest_new_guest" msgid="3482026122932643557">"Gehitu gonbidatu bat"</string>
<string name="guest_exit_guest" msgid="5908239569510734136">"Kendu gonbidatua"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Berrezarri gonbidatuentzako saioa"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"Gonbidatuentzako saioa berrezarri nahi duzu?"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index a9c4b69..393d6ff 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -146,7 +146,7 @@
<string name="bluetooth_hid_profile_summary_use_for" msgid="4289460627406490952">"ઇનપુટ માટે ઉપયોગ કરો"</string>
<string name="bluetooth_hearing_aid_profile_summary_use_for" msgid="7689393730163320483">"શ્રવણ યંત્રો માટે ઉપયોગ કરો"</string>
<string name="bluetooth_le_audio_profile_summary_use_for" msgid="2778318636027348572">"LE_AUDIO માટે ઉપયોગ કરો"</string>
- <string name="bluetooth_pairing_accept" msgid="2054232610815498004">"જોડી"</string>
+ <string name="bluetooth_pairing_accept" msgid="2054232610815498004">"જોડી કરો"</string>
<string name="bluetooth_pairing_accept_all_caps" msgid="2734383073450506220">"જોડી કરો"</string>
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"રદ કરો"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"એ કનેક્ટ કરેલ હોય ત્યારે જોડાણ બનાવવાથી તમારા સંપર્કો અને કૉલ ઇતિહાસનો અૅક્સેસ મળે છે."</string>
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"પ્રતિબંધિત પ્રોફાઇલ"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"નવા વપરાશકર્તાને ઉમેરીએ?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"તમે વધારાના વપરાશકર્તાઓ બનાવીને અન્ય લોકો સાથે આ ડિવાઇસને શેર કરી શકો છો. દરેક વપરાશકર્તા પાસે તેમની પોતાની સ્પેસ છે, જેને તેઓ ઍપ, વૉલપેપર, વગેરે સાથે કસ્ટમાઇઝ કરી શકે છે. વપરાશકર્તાઓ પ્રત્યેક વ્યક્તિને અસર કરતી હોય તેવી ડિવાઇસ સેટિંગ જેમ કે વાઇ-ફાઇને પણ સમાયોજિત કરી શકે છે.\n\nજ્યારે તમે કોઈ નવા વપરાશકર્તાને ઉમેરો છો, ત્યારે તે વ્યક્તિને તેમની સ્પેસ સેટ કરવાની જરૂર પડે છે.\n\nકોઈપણ વપરાશકર્તા અન્ય બધા વપરાશકર્તાઓ માટે ઍપને અપડેટ કરી શકે છે. નવા વપરાશકર્તાને ઍક્સેસિબિલિટી સેટિંગ અને સેવાઓ ટ્રાન્સફર ન પણ થાય."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"જ્યારે તમે કોઈ નવા વપરાશકર્તાને ઉમેરો છો, ત્યારે તે વ્યક્તિને તેમનું સ્થાન સેટ અપ કરવાની જરૂર પડે છે.\n\nકોઈપણ વપરાશકર્તા બધા અન્ય વપરાશકર્તાઓ માટે એપ્લિકેશન્સને અપડેટ કરી શકે છે."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"જ્યારે તમે કોઈ નવા વપરાશકર્તાને ઉમેરો છો, ત્યારે તે વ્યક્તિને તેમનું સ્થાન સેટ અપ કરવાની જરૂર પડે છે.\n\nકોઈપણ વપરાશકર્તા બધા અન્ય વપરાશકર્તાઓ માટે ઍપને અપડેટ કરી શકે છે."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"અત્યારે જ વપરાશકર્તાને સેટ અપ કરીએ?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"ખાતરી કરો કે વ્યક્તિ ડિવાઇસ લેવા અને તેમના સ્થાનનું સેટ અપ કરવા માટે ઉપલબ્ધ છે"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"હવે પ્રોફાઇલ સેટ કરીએ?"</string>
diff --git a/packages/SettingsLib/res/values-hi/arrays.xml b/packages/SettingsLib/res/values-hi/arrays.xml
index a449773..61a8f92 100644
--- a/packages/SettingsLib/res/values-hi/arrays.xml
+++ b/packages/SettingsLib/res/values-hi/arrays.xml
@@ -265,7 +265,7 @@
<item msgid="910925519184248772">"PTP (पिक्चर ट्रांसफर प्रोटोकॉल)"</item>
<item msgid="3825132913289380004">"RNDIS (USB ईथरनेट)"</item>
<item msgid="8828567335701536560">"ऑडियो स्रोत"</item>
- <item msgid="8688681727755534982">"MIDI"</item>
+ <item msgid="8688681727755534982">"एमआईडीआई"</item>
</string-array>
<string-array name="avatar_image_descriptions">
</string-array>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index 02b78c1..c1c23a5 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"डिस्कनेक्ट हो रहा है..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"कनेक्ट हो रहा है..."</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> से जुड़ गया"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"युग्मित कर रहा है…"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"जोड़ा जा रहा है…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"जुड़ गया (फ़ोन के ऑडियो को छोड़कर)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"जुड़ गया (मीडिया ऑडियो को छोड़कर)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"जुड़ गया (मैसेज का ऐक्सेस नहीं)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"प्रतिबंधित प्रोफ़ाइल"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"नया उपयोगकर्ता जोड़ें?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"आप और ज़्यादा उपयोगकर्ता बनाकर इस डिवाइस को दूसरे लोगों के साथ शेयर कर सकते हैं. हर उपयोगकर्ता के पास अपनी जगह होती है, जिसमें वह मनपसंद तरीके से ऐप्लिकेशन, वॉलपेपर और दूसरी चीज़ों में बदलाव कर सकते हैं. उपयोगकर्ता वाई-फ़ाई जैसी डिवाइस सेटिंग में भी बदलाव कर सकते हैं, जिसका असर हर किसी पर पड़ेगा.\n\nजब आप कोई नया उपयोगकर्ता जोड़ते हैं तो उन्हें अपनी जगह सेट करनी होगी.\n\nकोई भी उपयोगकर्ता दूसरे सभी उपयोगकर्ताओं के लिए ऐप्लिकेशन अपडेट कर सकता है. ऐसा भी हो सकता है कि सुलभता सेटिंग और सेवाएं नए उपयोगकर्ता को ट्रांसफ़र न हो पाएं."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"जब आप कोई नया उपयोगकर्ता जोड़ते हैं, तो उसे अपनी जगह सेट करनी होती है.\n\nकोई भी उपयोगकर्ता बाकी सभी उपयोगकर्ताओं के लिए ऐप्लिकेशन अपडेट कर सकता है."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"कोई नया उपयोगकर्ता जोड़ने पर, उसे अपनी जगह सेट करनी होती है.\n\nकोई भी उपयोगकर्ता बाकी सभी उपयोगकर्ताओं के लिए ऐप्लिकेशन अपडेट कर सकता है."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"उपयोगकर्ता को अभी सेट करें?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"पक्का करें कि व्यक्ति डिवाइस का इस्तेमाल करने और अपनी जगह सेट करने के लिए मौजूद है"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"प्रोफ़ाइल अभी सेट करें?"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index fdf14b3..4bcebd6 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -365,11 +365,11 @@
<string name="show_touches" msgid="8437666942161289025">"Prikaži dodire"</string>
<string name="show_touches_summary" msgid="3692861665994502193">"Prikaži vizualne povratne informacije za dodire"</string>
<string name="show_screen_updates" msgid="2078782895825535494">"Prikaži ažur. površine"</string>
- <string name="show_screen_updates_summary" msgid="2126932969682087406">"Površina prozora bljeska pri ažuriranju."</string>
- <string name="show_hw_screen_updates" msgid="2021286231267747506">"Pokaži ažuriranja prikaza"</string>
+ <string name="show_screen_updates_summary" msgid="2126932969682087406">"Površina prozora bljeska pri ažuriranju"</string>
+ <string name="show_hw_screen_updates" msgid="2021286231267747506">"Prikaži ažuriranja prikaza"</string>
<string name="show_hw_screen_updates_summary" msgid="3539770072741435691">"Bljeskanje prikaza u prozorima pri crtanju"</string>
<string name="show_hw_layers_updates" msgid="5268370750002509767">"Prikaži ažuriranja hardverskih slojeva"</string>
- <string name="show_hw_layers_updates_summary" msgid="5850955890493054618">"Hardverski slojevi bljeskaju zeleno pri ažuriranju."</string>
+ <string name="show_hw_layers_updates_summary" msgid="5850955890493054618">"Hardverski slojevi bljeskaju zeleno pri ažuriranju"</string>
<string name="debug_hw_overdraw" msgid="8944851091008756796">"Rješavanje GPU preklapanja"</string>
<string name="disable_overlays" msgid="4206590799671557143">"Onemogući dijeljenje mem."</string>
<string name="disable_overlays_summary" msgid="1954852414363338166">"Uvijek koristi GPU za slaganje zaslona"</string>
@@ -378,7 +378,7 @@
<string name="usb_audio_disable_routing" msgid="3367656923544254975">"Onemogući USB audiousmj."</string>
<string name="usb_audio_disable_routing_summary" msgid="8768242894849534699">"Onemogući aut. usmjeravanje na USB audioperiferiju"</string>
<string name="debug_layout" msgid="1659216803043339741">"Prikaži okvir prikaza"</string>
- <string name="debug_layout_summary" msgid="8825829038287321978">"Prikazuju se obrubi, margine itd. isječaka."</string>
+ <string name="debug_layout_summary" msgid="8825829038287321978">"Prikazuju se obrubi, margine itd. isječaka"</string>
<string name="force_rtl_layout_all_locales" msgid="8690762598501599796">"Nametni zdesna ulijevo"</string>
<string name="force_rtl_layout_all_locales_summary" msgid="6663016859517239880">"Nametni smjer zdesna ulijevo za sve zemlje/jezike"</string>
<string name="window_blurs" msgid="6831008984828425106">"Dopusti zamućenja na razini prozora"</string>
@@ -594,7 +594,7 @@
<string name="guest_exit_guest" msgid="5908239569510734136">"Uklanjanje gosta"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Poništi gostujuću sesiju"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"Poništiti gostujuću sesiju?"</string>
- <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"Ukloniti gosta?"</string>
+ <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"Želite li ukloniti gosta?"</string>
<string name="guest_reset_guest_confirm_button" msgid="2989915693215617237">"Poništi"</string>
<string name="guest_remove_guest_confirm_button" msgid="7858123434954143879">"Ukloni"</string>
<string name="guest_resetting" msgid="7822120170191509566">"Poništavanje gostujuće sesije…"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index 2cd9352..f48af46 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -151,7 +151,7 @@
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"Չեղարկել"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"Զուգակցում է մուտքի թույլտվությունը դեպի ձեր կոնտակտները և զանգերի պատմությունը, երբ միացված է:"</string>
<string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"Չհաջողվեց զուգակցել <xliff:g id="DEVICE_NAME">%1$s</xliff:g>-ի հետ:"</string>
- <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"Հնարավոր չեղավ զուգակցվել <xliff:g id="DEVICE_NAME">%1$s</xliff:g>-ի հետ սխալ PIN-ի կամ անցաբառի պատճառով:."</string>
+ <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"Չհաջողվեց զուգակցել <xliff:g id="DEVICE_NAME">%1$s</xliff:g>-ի հետ սխալ PIN-ի կամ անցաբառի պատճառով:"</string>
<string name="bluetooth_pairing_device_down_error_message" msgid="2554424863101358857">"Հնարավոր չէ կապ հաստատել <xliff:g id="DEVICE_NAME">%1$s</xliff:g>-ի հետ:"</string>
<string name="bluetooth_pairing_rejected_error_message" msgid="5943444352777314442">"Զուգավորումը մերժվեց <xliff:g id="DEVICE_NAME">%1$s</xliff:g>-ի կողմից:"</string>
<string name="bluetooth_talkback_computer" msgid="3736623135703893773">"Համակարգիչ"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index da3c3e6..1a1268c 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Memutus sambungan..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Menghubungkan…"</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"Terhubung<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"Menyandingkan..."</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"Menyambungkan..."</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"Terhubung (tanpa ponsel)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"Terhubung (tanpa media)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"Terhubung (tanpa akses pesan)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -150,8 +150,8 @@
<string name="bluetooth_pairing_accept_all_caps" msgid="2734383073450506220">"SAMBUNGKAN"</string>
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"Batal"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"Penyandingan memberi akses ke kontak dan histori panggilan saat terhubung"</string>
- <string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"Tidak dapat menyambungkan ke <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
- <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"Tidak dapat menyambungkan ke <xliff:g id="DEVICE_NAME">%1$s</xliff:g> karena PIN atau kode sandi salah."</string>
+ <string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"Tidak dapat menyambungkan dengan <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
+ <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"Tidak dapat menyambungkan dengan <xliff:g id="DEVICE_NAME">%1$s</xliff:g> karena PIN atau kode sandi salah."</string>
<string name="bluetooth_pairing_device_down_error_message" msgid="2554424863101358857">"Tidak dapat berkomunikasi dengan <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
<string name="bluetooth_pairing_rejected_error_message" msgid="5943444352777314442">"Penyandingan ditolak oleh <xliff:g id="DEVICE_NAME">%1$s</xliff:g>."</string>
<string name="bluetooth_talkback_computer" msgid="3736623135703893773">"Komputer"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index 66c7273..6e39fde 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"Profilo con limitazioni"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"Aggiungere un nuovo utente?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"Puoi condividere il dispositivo con altre persone creando altri utenti. Ogni utente ha un proprio spazio personalizzabile con app, sfondo e così via. Gli utenti possono anche regolare le impostazioni del dispositivo, come il Wi‑Fi, che riguardano tutti.\n\nQuando crei un nuovo utente, la persona in questione deve configurare il proprio spazio.\n\nQualsiasi utente può aggiornare le app per tutti gli altri utenti. I servizi e le impostazioni di accessibilità non potranno essere trasferiti al nuovo utente."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"Il nuovo utente, una volta aggiunto, deve impostare il proprio spazio.\n\nQualsiasi utente può aggiornare le app per tutti gli altri."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"Il nuovo utente, una volta aggiunto, deve configurare il proprio spazio.\n\nQualsiasi utente può aggiornare le app per tutti gli altri."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"Configurare l\'utente ora?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"Assicurati che la persona sia disponibile a prendere il dispositivo e configurare il suo spazio"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"Configurare il profilo ora?"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 2196c75..c50b180 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -594,7 +594,7 @@
<string name="guest_exit_guest" msgid="5908239569510734136">"הסרת אורח"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"איפוס הגלישה כאורח"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"לאפס את הגלישה כאורח?"</string>
- <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"להסיר את האורח/ת?"</string>
+ <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"להסיר את האורח?"</string>
<string name="guest_reset_guest_confirm_button" msgid="2989915693215617237">"איפוס"</string>
<string name="guest_remove_guest_confirm_button" msgid="7858123434954143879">"הסרה"</string>
<string name="guest_resetting" msgid="7822120170191509566">"מתבצע איפוס של הגלישה כאורח…"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index f5559d2..d070c37 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -151,7 +151,7 @@
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"Бас тарту"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"Жұптасқан кезде, контактілеріңіз бен қоңыраулар тарихын көру мүмкіндігі беріледі."</string>
<string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> жұпталу орындалмады."</string>
- <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> құрылғысымен жұптаса алмады, себебі PIN немесе құпия сөз дұрыс емес."</string>
+ <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> құрылғысымен жұптаса алмады, себебі PIN немесе рұқсат кілті дұрыс емес."</string>
<string name="bluetooth_pairing_device_down_error_message" msgid="2554424863101358857">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> құрылғысымен қатынаса алмайды"</string>
<string name="bluetooth_pairing_rejected_error_message" msgid="5943444352777314442">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> құрылғысы жұпталудан бас тартты."</string>
<string name="bluetooth_talkback_computer" msgid="3736623135703893773">"Компьютер"</string>
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"Шектелген профайл"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"Жаңа пайдаланушы қосылсын ба?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"Қосымша профильдер жасай отырып, бұл құрылғыны басқалармен ортақ пайдалануға болады. Әр пайдаланушы қолданбаларды, тұсқағаздарды орнатып, профилін өз қалауынша реттей алады. Сондай-ақ барлығы ортақ қолданатын Wi‑Fi сияқты параметрлерді де реттеуге болады.\n\nЖаңа пайдаланушы енгізілгенде, ол өз профилін реттеуі керек болады.\n\nКез келген пайдаланушы барлық басқа пайдаланушылар үшін қолданбаларды жаңарта алады. Арнайы мүмкіндіктерге қатысты параметрлер мен қызметтер жаңа пайдаланушыға өтпейді."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"Жаңа пайдаланушыны қосқанда сол адам өз кеңістігін реттеуі керек.\n\nКез келген пайдаланушы барлық басқа пайдаланушылар үшін қолданбаларды жаңарта алады."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"Жаңа пайдаланушыны қосқанда, сол адам өз кеңістігін реттеуі керек.\n\nКез келген пайдаланушы барлық басқа пайдаланушылар үшін қолданбаларды жаңарта алады."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"Профиль құру керек пе?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"Пайдаланушы құрылғыны алып, өз профилін реттеуі керек."</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"Профайл қазір жасақталсын ба?"</string>
@@ -655,12 +655,8 @@
<string name="bt_le_audio_scan_qr_code" msgid="3521809854780392679">"QR кодын сканерлеу"</string>
<string name="bt_le_audio_scan_qr_code_scanner" msgid="4679500020630341107">"Тыңдай бастау үшін төмендегі QR кодын ортаға орналастырыңыз."</string>
<string name="bt_le_audio_qr_code_is_not_valid_format" msgid="6092191081849434734">"QR кодының форматы жарамсыз."</string>
- <!-- no translation found for bt_le_audio_broadcast_dialog_title (5392738488989777074) -->
- <skip />
- <!-- no translation found for bt_le_audio_broadcast_dialog_sub_title (268234802198852753) -->
- <skip />
- <!-- no translation found for bt_le_audio_broadcast_dialog_switch_app (5749813313369517812) -->
- <skip />
- <!-- no translation found for bt_le_audio_broadcast_dialog_different_output (2638402023060391333) -->
- <skip />
+ <string name="bt_le_audio_broadcast_dialog_title" msgid="5392738488989777074">"<xliff:g id="APP_NAME">%1$s</xliff:g> қолданбасын таратуды тоқтатасыз ба?"</string>
+ <string name="bt_le_audio_broadcast_dialog_sub_title" msgid="268234802198852753">"<xliff:g id="SWITCHAPP">%1$s</xliff:g> қолданбасын таратсаңыз немесе аудио шығысын өзгертсеңіз, қазіргі тарату сеансы тоқтайды."</string>
+ <string name="bt_le_audio_broadcast_dialog_switch_app" msgid="5749813313369517812">"<xliff:g id="SWITCHAPP">%1$s</xliff:g> қолданбасын тарату"</string>
+ <string name="bt_le_audio_broadcast_dialog_different_output" msgid="2638402023060391333">"Аудио шығысын өзгерту"</string>
</resources>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index a770f61..080fc79 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"ប្រវត្តិបានដាក់កម្រិត"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"បញ្ចូលអ្នកប្រើប្រាស់ថ្មី?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"អ្នកអាចចែករំលែកឧបករណ៍នេះជាមួយមនុស្សផ្សេងទៀតបានដោយបង្កើតអ្នកប្រើប្រាស់បន្ថែម។ អ្នកប្រើប្រាស់ម្នាក់ៗមានទំហំផ្ទុកផ្ទាល់ខ្លួនរបស់គេ ដែលពួកគេអាចប្ដូរតាមបំណងសម្រាប់កម្មវិធី ផ្ទាំងរូបភាព និងអ្វីៗផ្សេងទៀត។ អ្នកប្រើប្រាស់ក៏អាចកែសម្រួលការកំណត់ឧបករណ៍ដូចជា Wi‑Fi ដែលប៉ះពាល់ដល់អ្នកប្រើប្រាស់ផ្សេងទៀតផងដែរ។\n\nនៅពេលដែលអ្នកបញ្ចូលអ្នកប្រើប្រាស់ថ្មី បុគ្គលនោះត្រូវតែរៀបចំទំហំផ្ទុករបស់គេ។\n\nអ្នកប្រើប្រាស់ណាក៏អាចដំឡើងកំណែកម្មវិធីសម្រាប់អ្នកប្រើប្រាស់ទាំងអស់ផ្សេងទៀតបានដែរ។ ការកំណត់ភាពងាយស្រួល និងសេវាកម្មមិនអាចផ្ទេរទៅកាន់អ្នកប្រើប្រាស់ថ្មីបានទេ។"</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"ពេលអ្នកបញ្ចូលអ្នកប្រើប្រាស់ថ្មី អ្នកប្រើប្រាស់នោះត្រូវកំណត់ទំហំផ្ទាល់របស់គេ។\n\nអ្នកប្រើប្រាស់ណាក៏អាចដំឡើងជំនាន់កម្មវិធីសម្រាប់អ្នកប្រើប្រាស់ផ្សេងទាំងអស់បានដែរ។"</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"នៅពេលអ្នកបញ្ចូលអ្នកប្រើប្រាស់ថ្មី អ្នកប្រើប្រាស់នោះចាំបាច់ត្រូវរៀបចំលំហផ្ទាល់ខ្លួនរបស់គាត់។\n\nអ្នកប្រើប្រាស់ណាក៏អាចដំឡើងកំណែកម្មវិធីសម្រាប់អ្នកប្រើប្រាស់ទាំងអស់ផ្សេងទៀតបានដែរ។"</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"រៀបចំអ្នកប្រើប្រាស់ឥឡូវនេះ?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"សូមប្រាកដថាអ្នកប្រើប្រាស់នេះអាចយកឧបករណ៍ និងរៀបចំទំហំផ្ទុករបស់គេបាន"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"រៀបចំប្រវត្តិរូបឥឡូវ?"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index 8af2627..73830c5 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Ажыратылууда…"</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Туташууда…"</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"Туташып турат<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"Жупташтырылууда…"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"Туташууда…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"Туташып турат (телефониясыз)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"Туташып турат (медиасыз)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"Туташып турат (SMS/MMS жазышуусуз)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -150,7 +150,7 @@
<string name="bluetooth_pairing_accept_all_caps" msgid="2734383073450506220">"ЖУПТАШТЫРУУ"</string>
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"Жок"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"Жупташканда байланыштарыңыз менен чалуу таржымалыңызды пайдалана аласыз."</string>
- <string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> менен жупташуу мүмкүн эмес."</string>
+ <string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> түзмөгүнө туташуу мүмкүн болгон жок."</string>
<string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"PIN-код же сырсөз туура эмес болгондуктан, \"<xliff:g id="DEVICE_NAME">%1$s</xliff:g>\" түзмөгүнө туташуу мүмкүн болгон жок."</string>
<string name="bluetooth_pairing_device_down_error_message" msgid="2554424863101358857">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> менен байланышуу мүмкүн эмес."</string>
<string name="bluetooth_pairing_rejected_error_message" msgid="5943444352777314442">"Жупташтырууну <xliff:g id="DEVICE_NAME">%1$s</xliff:g> четке какты."</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index 5c0f192..46ce28d 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"ໂປຣໄຟລ໌ທີ່ຖືກຈຳກັດ"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"ເພີ່ມຜູ້ໃຊ້ໃໝ່ບໍ?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"ທ່ານສາມາດໃຊ້ອຸປະກອນນີ້ຮ່ວມກັບຄົນອື່ນໄດ້ໂດຍການສ້າງຜູ້ໃຊ້ເພີ່ມເຕີມ. ຜູ້ໃຊ້ແຕ່ລະຄົນຈະມີພື້ນທີ່ຂອງຕົວເອງ, ເຊິ່ງເຂົາເຈົ້າສາມາດປັບແຕ່ງແອັບ, ຮູບພື້ນຫຼັງ ແລະ ອື່ນໆໄດ້. ຜູ້ໃຊ້ຕ່າງໆ ສາມາດປັບແຕ່ງການຕັ້ງຄ່າອຸປະກອນໄດ້ ເຊັ່ນ: Wi‑Fi ທີ່ມີຜົນກະທົບທຸກຄົນ.\n\nເມື່ອທ່ານເພີ່ມຜູ້ໃຊ້ໃໝ່, ບຸກຄົນນັ້ນຈະຕ້ອງຕັ້ງຄ່າພື້ນທີ່ຂອງເຂົາເຈົ້າກ່ອນ.\n\nຜູ້ໃຊ້ໃດກໍຕາມສາມາດອັບເດດແອັບສຳລັບຜູ້ໃຊ້ຄົນອື່ນທັງໝົດໄດ້. ການຕັ້ງຄ່າການຊ່ວຍເຂົ້າເຖິງອາດບໍ່ຖືກໂອນຍ້າຍໄປໃຫ້ຜູ້ໃຊ້ໃໝ່."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"ເມື່ອທ່ານເພີ່ມຜູ້ໃຊ້ໃໝ່, ຜູ້ໃຊ້ນັ້ນຈະຕ້ອງຕັ້ງຄ່າພື້ນທີ່ບ່ອນຈັດເກັບຂໍ້ມູນຂອງລາວ.\n\nຜູ້ໃຊ້ທຸກຄົນສາມາດອັບເດດແອັບຯສຳລັບຜູ້ໃຊ້ຄົນອື່ນທັງໝົດໄດ້."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"ເມື່ອທ່ານເພີ່ມຜູ້ໃຊ້ໃໝ່, ຜູ້ໃຊ້ນັ້ນຈະຕ້ອງຕັ້ງຄ່າພື້ນທີ່ບ່ອນຈັດເກັບຂໍ້ມູນຂອງລາວ.\n\nຜູ້ໃຊ້ທຸກຄົນສາມາດອັບເດດແອັບສຳລັບຜູ້ໃຊ້ຄົນອື່ນທັງໝົດໄດ້."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"ຕັ້ງຄ່າຜູ້ໃຊ້ຕອນນີ້ບໍ?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"ກວດສອບໃຫ້ແນ່ໃຈວ່າບຸກຄົນດັ່ງກ່າວສາມາດຮັບອຸປະກອນ ແລະ ຕັ້ງຄ່າພື້ນທີ່ຂອງພວກເຂົາໄດ້"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"ຕັ້ງຄ່າໂປຣໄຟລ໌ດຽວນີ້?"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index e69d25f6..ea0d9ee 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"നിയന്ത്രിത പ്രൊഫൈൽ"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"പുതിയ ഉപയോക്താവിനെ ചേർക്കണോ?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"കൂടുതൽ ഉപയോക്താക്കളെ സൃഷ്ടിച്ചുകൊണ്ട് ഈ ഉപകരണം മറ്റുള്ളവരുമായി നിങ്ങൾക്ക് പങ്കിടാം. ആപ്പുകളും വാൾപേപ്പറുകളും മറ്റും ഉപയോഗിച്ച് ഇഷ്ടാനുസൃതമാക്കാൻ ഓരോ ഉപയോക്താവിനും സാധിക്കും. വൈഫൈ പോലെ എല്ലാവരെയും ബാധിക്കുന്ന ഉപകരണ ക്രമീകരണവും ഉപയോക്താക്കൾക്ക് ക്രമീകരിക്കാം.\n\nനിങ്ങളൊരു പുതിയ ഉപയോക്താവിനെ ചേർക്കുമ്പോൾ, ആ വ്യക്തിക്ക് സ്വന്തമായ ഇടം സജ്ജീകരിക്കേണ്ടതുണ്ട്.\n\n എല്ലാ ഉപയോക്താക്കൾക്കുമായി ആപ്പുകൾ അപ്ഡേറ്റ് ചെയ്യാൻ ഏതൊരു ഉപയോക്താവിനുമാവും. ഉപയോഗസഹായി ക്രമീകരണവും സേവനങ്ങളും പുതിയ ഉപയോക്താവിന് കൈമാറുകയില്ല."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"നിങ്ങൾ ഒരു പുതിയ ഉപയോക്താവിനെ ചേർക്കുമ്പോൾ, ആ വ്യക്തിയ്ക്ക് അവരുടെ ഇടം സജ്ജീകരിക്കേണ്ടതുണ്ട്.\n\nമറ്റ് എല്ലാ ഉപയോക്താക്കൾക്കുമായി ഏതൊരു ഉപയോക്താവിനും അപ്ലിക്കേഷനുകൾ അപ്ഡേറ്റുചെയ്യാനാവും."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"നിങ്ങൾ ഒരു പുതിയ ഉപയോക്താവിനെ ചേർക്കുമ്പോൾ, ആ വ്യക്തിയ്ക്ക് അവരുടെ ഇടം സജ്ജീകരിക്കേണ്ടതുണ്ട്.\n\nമറ്റ് എല്ലാ ഉപയോക്താക്കൾക്കുമായി ഏതൊരു ഉപയോക്താവിനും ആപ്പുകൾ അപ്ഡേറ്റ് ചെയ്യാനാവും."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"ഉപയോക്താവിനെ ഇപ്പോൾ സജ്ജീകരിക്കണോ?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"ഉപകരണം എടുത്ത് ഇടം സജ്ജീകരിക്കുന്നതിന് വ്യക്തി ലഭ്യമാണെന്ന് ഉറപ്പാക്കുക"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"ഇപ്പോൾ പ്രൊഫൈൽ സജ്ജീകരിക്കണോ?"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index 4006665..5c3578c 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"डिस्कनेक्ट करत आहे..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"कनेक्ट करत आहे..."</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>कनेक्ट केले"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"जोडत आहे…"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"पेअर करत आहे…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"कनेक्ट केले (फोन नाही)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"कनेक्ट केले (मीडिया नाही)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"कनेक्ट केले (मेसेज अॅक्सेस नाही)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -151,7 +151,7 @@
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"रद्द करा"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"कनेक्ट केल्यावर पेअरिंग तुमचे संपर्क आणि कॉल इतिहास यामध्ये अॅक्सेस देते."</string>
<string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> शी जोडू शकलो नाही."</string>
- <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"अयोग्य पिन किंवा पासकीमुळे <xliff:g id="DEVICE_NAME">%1$s</xliff:g> सह जोडू शकलो नाही."</string>
+ <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"अयोग्य पिन किंवा पासकीमुळे <xliff:g id="DEVICE_NAME">%1$s</xliff:g> सह पेअर करू शकलो नाही."</string>
<string name="bluetooth_pairing_device_down_error_message" msgid="2554424863101358857">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> शी संवाद प्रस्थापित करू शकत नाही."</string>
<string name="bluetooth_pairing_rejected_error_message" msgid="5943444352777314442">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> द्वारे पेअरिंग नाकारले."</string>
<string name="bluetooth_talkback_computer" msgid="3736623135703893773">"कॉंप्युटर"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 98bac84..c0aafc4 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"အဆက်အသွယ်ဖြတ်တောက်သည်"</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"ချိတ်ဆက်နေသည်"</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> ချိတ်ဆက်ပြီးပြီ"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"တွဲချိတ်ပါ"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"တွဲချိတ်နေသည်…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> ချိတ်ဆက်ပြီးပြီ (ဖုန်းမရှိပါ)"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> ချိတ်ဆက်ပြီးပြီ (မီဒီယာ မရှိပါ)"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> ချိတ်ဆက်ပြီးပြီ (မက်ဆေ့ဂျ် သုံး၍မရပါ)"</string>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index 13bdd7e..4f64d10 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Kobler fra…"</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Kobler til…"</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"Koblet til <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"Sammenkobles …"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"Kobler til …"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"Koblet til (ingen telefon) <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"Koblet til (ingen medier) <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"Koblet til (ingen meldingstilgang) <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"Begrenset profil"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"Vil du legge til en ny bruker?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"Du kan dele denne enheten med andre folk ved å opprette flere brukere. Hver bruker har sin egen plass de kan tilpasse med apper, bakgrunner og annet. Brukere kan også justere enhetsinnstillinger, for eksempel Wi-Fi, som påvirker alle.\n\nNår du legger til en ny bruker, må vedkommende angi innstillinger for plassen sin.\n\nAlle brukere kan oppdatere apper for alle andre brukere. Innstillinger og tjenester for tilgjengelighet overføres kanskje ikke til den nye brukeren."</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"Når du legger til en ny bruker, må vedkommende konfigurere sitt eget område.\n\nAlle brukere kan oppdatere apper for alle andre brukere."</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"Når du legger til en ny bruker, må hen konfigurere sitt eget område.\n\nAlle brukere kan oppdatere apper for alle andre brukere."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"Konfigurere brukeren nå?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"Sørg for at brukeren er tilgjengelig for å konfigurere området sitt på enheten"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"Vil du konfigurere profilen nå?"</string>
@@ -590,7 +590,7 @@
<string name="add_guest_failed" msgid="8074548434469843443">"Kunne ikke opprette en ny gjest"</string>
<string name="user_nickname" msgid="262624187455825083">"Kallenavn"</string>
<string name="user_add_user" msgid="7876449291500212468">"Legg til bruker"</string>
- <string name="guest_new_guest" msgid="3482026122932643557">"Legg til en gjest"</string>
+ <string name="guest_new_guest" msgid="3482026122932643557">"Legg til gjest"</string>
<string name="guest_exit_guest" msgid="5908239569510734136">"Fjern gjesten"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Tilbakestill gjest"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"Vil du tilbakestille gjesten?"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index 30401ac..4f8ea37 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"जडान हटाइँदै ..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"जडान हुँदै..."</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> सँग जडान गरियो"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"जोडा बाँध्दै..."</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"कनेक्ट गरिँदै छ..."</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"जडान गरियो (फोनबाहेेक) <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"जडान गरियो (मिडियाबाहेक) <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"जडान गरियो (सन्देशमाथि पहुँच छैन) <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -117,7 +117,7 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"फाइल स्थानान्तरण"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"इनपुट उपकरण"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"इन्टरनेट पहुँच"</string>
- <string name="bluetooth_profile_pbap" msgid="7064307749579335765">"सम्पर्क ठेगानाको सेयरिङ"</string>
+ <string name="bluetooth_profile_pbap" msgid="7064307749579335765">"कन्ट्याक्ट सेयरिङ"</string>
<string name="bluetooth_profile_pbap_summary" msgid="2955819694801952056">"सम्पर्क साझेदारीका लागि प्रयोग"</string>
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"इन्टरनेट जडान साझेदारी गर्दै"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"टेक्स्ट म्यासेजहरू"</string>
@@ -591,7 +591,7 @@
<string name="user_nickname" msgid="262624187455825083">"उपनाम"</string>
<string name="user_add_user" msgid="7876449291500212468">"प्रयोगकर्ता थप्नुहोस्"</string>
<string name="guest_new_guest" msgid="3482026122932643557">"अतिथि थप्नुहोस्"</string>
- <string name="guest_exit_guest" msgid="5908239569510734136">"अतिथि हटाउनुहोस्"</string>
+ <string name="guest_exit_guest" msgid="5908239569510734136">"गेस्ट मोडबाट बाहिर निस्कियोस्"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"अतिथि सत्र रिसेट गर्नुहोस्"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"अतिथिका रूपमा ब्राउज गर्ने सेसन रिसेट गर्ने हो?"</string>
<string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"यी अतिथि हटाउने हो?"</string>
diff --git a/packages/SettingsLib/res/values-or/strings.xml b/packages/SettingsLib/res/values-or/strings.xml
index 337dd79..eb58dd2 100644
--- a/packages/SettingsLib/res/values-or/strings.xml
+++ b/packages/SettingsLib/res/values-or/strings.xml
@@ -570,7 +570,7 @@
<string name="user_add_profile_item_title" msgid="3111051717414643029">"ସୀମିତ ସୁବିଧା ଥିବା ପ୍ରୋଫାଇଲ୍"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"ନୂତନ ଉପଯୋଗକର୍ତ୍ତାଙ୍କୁ ଯୋଗ କରିବେ?"</string>
<string name="user_add_user_message_long" msgid="1527434966294733380">"ଅତିରିକ୍ତ ଉପଯୋଗକର୍ତ୍ତା ଯୋଗ କରି ଆପଣ ଏହି ଡିଭାଇସକୁ ଅନ୍ୟ ଲୋକମାନଙ୍କ ସହିତ ସେୟାର କରିପାରିବେ। ପ୍ରତ୍ୟେକ ଉପଯୋଗକର୍ତ୍ତାଙ୍କ ନିଜର ସ୍ପେସ୍ ଅଛି ଯାହାକୁ ସେମାନେ ଆପ, ୱାଲପେପର୍ ଓ ଏପରି ଅନେକ କିଛି ସହିତ କଷ୍ଟମାଇଜ କରିପାରିବେ। ଉପଯୋଗକର୍ତ୍ତା ୱାଇ-ଫାଇ ଭଳି ଡିଭାଇସ ସେଟିଂସକୁ ମଧ୍ୟ ଆଡଜଷ୍ଟ କରିପାରିବେ ଯାହା ସମସ୍ତଙ୍କୁ ପ୍ରଭାବିତ କରିଥାଏ। \n\nଯେତେବେଳେ ଆପଣ ଗୋଟିଏ ନୂଆ ଉପଯୋଗକର୍ତ୍ତାଙ୍କୁ ଯୋଗ କରିବେ, ସେତେବେଳେ ସେହି ବ୍ୟକ୍ତିଙ୍କୁ ନିଜର ସ୍ପେସ୍କୁ ସେଟଅପ କରିବାକୁ ପଡ଼ିବ। \n\nଅନ୍ୟ ଉପଯୋଗକର୍ତ୍ତାଙ୍କ ପାଇଁ ଯେ କୌଣସି ଉପଯୋଗକର୍ତ୍ତା ଆପକୁ ଅପଡେଟ କରିପାରିବେ। ଆକ୍ସେସିବିଲିଟୀ ସେଟିଂସ ଏବଂ ସେବାଗୁଡ଼ିକ ନୂଆ ଉପଯୋଗକର୍ତ୍ତାଙ୍କୁ ସ୍ଥାନାନ୍ତର ହୋଇନପାରେ।"</string>
- <string name="user_add_user_message_short" msgid="3295959985795716166">"ଜଣେ ନୂଆ ଉପଯୋଗକର୍ତ୍ତାଙ୍କୁ ଯୋଡ଼ିବାବେଳେ, ସେହି ବ୍ୟକ୍ତିଙ୍କୁ ସ୍ଥାନ ସେଟ୍ କରିବାକୁ ପଡ଼ିବ।\n\nଅନ୍ୟ ସମସ୍ତ ଉପଯୋଗକର୍ତ୍ତାଙ୍କ ପାଇଁ ଯେକୌଣସି ଉପଯୋଗକର୍ତ୍ତା ଆପ୍ଗୁଡ଼ିକୁ ଅପ୍ଡେଟ୍ କରିପାରିବେ।"</string>
+ <string name="user_add_user_message_short" msgid="3295959985795716166">"ଆପଣ ଜଣେ ନୂଆ ଉପଯୋଗକର୍ତ୍ତାଙ୍କୁ ଯୋଗ କରିବା ବେଳେ, ସେହି ବ୍ୟକ୍ତିଙ୍କୁ ତାଙ୍କ ସ୍ପେସ ସେଟ ଅପ କରିବାକୁ ପଡ଼ିବ।\n\nଅନ୍ୟ ସମସ୍ତ ଉପଯୋଗକର୍ତ୍ତାଙ୍କ ପାଇଁ, ଆପଗୁଡ଼ିକୁ ଯେ କୌଣସି ଉପଯୋଗକର୍ତ୍ତା ଅପଡେଟ କରିପାରିବେ।"</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"ଏବେ ଉପଯୋଗକର୍ତ୍ତା ସେଟଅପ କରିବେ?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"ସୁନିଶ୍ଚିତ କରନ୍ତୁ ଯେ, ବ୍ୟକ୍ତି ଜଣକ ଡିଭାଇସ୍ ଓ ନିଜର ସ୍ଥାନ ସେଟଅପ୍ କରିବା ପାଇଁ ଉପଲବ୍ଧ ଅଛନ୍ତି।"</string>
<string name="user_setup_profile_dialog_message" msgid="4788197052296962620">"ପ୍ରୋଫାଇଲ୍କୁ ଏବେ ସେଟ୍ କରିବେ?"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index 0da516c..a4e2aa7 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"ਡਿਸਕਨੈਕਟ ਕਰ ਰਿਹਾ ਹੈ..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"ਕਨੈਕਟ ਕਰ ਰਿਹਾ ਹੈ…"</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"ਕਨੈਕਟ ਕੀਤਾ ਹੋਇਆ<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"ਪੇਅਰ ਕਰ ਰਿਹਾ ਹੈ…"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"ਜੋੜਾਬੱਧ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"ਕਨੈਕਟ ਕੀਤਾ ਹੋਇਆ (ਕੋਈ ਫ਼ੋਨ ਨਹੀਂ)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"ਕਨੈਕਟ ਕੀਤਾ ਹੋਇਆ (ਕੋਈ ਮੀਡੀਆ ਨਹੀਂ)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"ਕਨੈਕਟ ਕੀਤਾ ਹੋਇਆ (ਸੁਨੇਹੇ \'ਤੇ ਪਹੁੰਚ ਨਹੀਂ)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index aa5359a..b40308e 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Rozłączanie..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Łączenie..."</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"Połączono – <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"Parowanie..."</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"Paruję…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"Połączono (bez telefonu) – <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"Połączono (bez multimediów) – <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"Połączono (bez dostępu do wiadomości) – <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 9c7a2ce..5a773cf 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"În curs de deconectare..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Se conectează..."</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"V-ați conectat la <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"Se conectează…"</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"Se asociază…"</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"Conectat (fără telefon) la <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"Conectat (fără conținut media) la <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"Conectat (fără acces la mesaje) la <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index 72a9f40..143941d 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"Prebieha odpájanie..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"Prebieha pripájanie…"</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"Pripojené k zariadeniu <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"Párovanie..."</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"Páruje sa..."</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"Pripojené k zariadeniu <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> (bez telefónu)"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"Pripojené k zariadeniu <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> (bez médií)"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"Pripojené k <xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g> (bez prístupu k správam)"</string>
@@ -403,9 +403,9 @@
<string name="show_notification_channel_warnings" msgid="3448282400127597331">"Zobraziť hlásenia kanála upozornení"</string>
<string name="show_notification_channel_warnings_summary" msgid="68031143745094339">"Zobrazovať na obrazovke varovné hlásenie, keď aplikácia zverejní upozornenie bez platného kanála"</string>
<string name="force_allow_on_external" msgid="9187902444231637880">"Vynútiť povolenie aplikácií na externom úložisku"</string>
- <string name="force_allow_on_external_summary" msgid="8525425782530728238">"Umožňuje zapísať akúkoľvek aplikáciu do externého úložiska bez ohľadu na hodnoty v manifeste"</string>
+ <string name="force_allow_on_external_summary" msgid="8525425782530728238">"Umožniť zapísať akúkoľvek aplikáciu do externého úložiska bez ohľadu na hodnoty v manifeste"</string>
<string name="force_resizable_activities" msgid="7143612144399959606">"Vynútiť možnosť zmeny veľkosti aktivít"</string>
- <string name="force_resizable_activities_summary" msgid="2490382056981583062">"Veľkosti všetkých aktivít bude možné zmeniť na niekoľko okien (bez ohľadu na hodnoty manifestu)."</string>
+ <string name="force_resizable_activities_summary" msgid="2490382056981583062">"Umožniť veľkosť všetkých aktivít na niekoľko okien (bez ohľadu na hodnoty manifestu)"</string>
<string name="enable_freeform_support" msgid="7599125687603914253">"Povoliť okná s voľným tvarom"</string>
<string name="enable_freeform_support_summary" msgid="1822862728719276331">"Povoliť podporu pre experimentálne okná s voľným tvarom"</string>
<string name="local_backup_password_title" msgid="4631017948933578709">"Heslo pre zálohy v počítači"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index e49f0c4..2ffa8bf 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -590,8 +590,8 @@
<string name="add_guest_failed" msgid="8074548434469843443">"Ustvarjanje novega gosta ni uspelo."</string>
<string name="user_nickname" msgid="262624187455825083">"Vzdevek"</string>
<string name="user_add_user" msgid="7876449291500212468">"Dodaj uporabnika"</string>
- <string name="guest_new_guest" msgid="3482026122932643557">"Dodajanje gosta"</string>
- <string name="guest_exit_guest" msgid="5908239569510734136">"Odstranitev gosta"</string>
+ <string name="guest_new_guest" msgid="3482026122932643557">"Dodaj gosta"</string>
+ <string name="guest_exit_guest" msgid="5908239569510734136">"Odstrani gosta"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Ponastavi gosta"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"Želite ponastaviti gosta?"</string>
<string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"Želite odstraniti gosta?"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index 9b62de2..208da7a 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -590,8 +590,8 @@
<string name="add_guest_failed" msgid="8074548434469843443">"Profili i vizitorit të ri nuk u krijua"</string>
<string name="user_nickname" msgid="262624187455825083">"Pseudonimi"</string>
<string name="user_add_user" msgid="7876449291500212468">"Shto përdorues"</string>
- <string name="guest_new_guest" msgid="3482026122932643557">"Shto të ftuar"</string>
- <string name="guest_exit_guest" msgid="5908239569510734136">"Hiq të ftuarin"</string>
+ <string name="guest_new_guest" msgid="3482026122932643557">"Shto vizitor"</string>
+ <string name="guest_exit_guest" msgid="5908239569510734136">"Hiq vizitorin"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Rivendos vizitorin"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"Të rivendoset vizitori?"</string>
<string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"Të hiqet vizitori?"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 187e179..c25966c 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -95,7 +95,7 @@
<string name="bluetooth_disconnecting" msgid="7638892134401574338">"డిస్కనెక్ట్ చేస్తోంది..."</string>
<string name="bluetooth_connecting" msgid="5871702668260192755">"కనెక్ట్ చేస్తోంది..."</string>
<string name="bluetooth_connected" msgid="8065345572198502293">"కనెక్ట్ చేయబడిన<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
- <string name="bluetooth_pairing" msgid="4269046942588193600">"జత చేస్తోంది..."</string>
+ <string name="bluetooth_pairing" msgid="4269046942588193600">"పెయిరింగ్..."</string>
<string name="bluetooth_connected_no_headset" msgid="2224101138659967604">"కనెక్ట్ చేయబడింది (ఫోన్ కాదు)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp" msgid="8566874395813947092">"కనెక్ట్ చేయబడింది (మీడియా కాదు)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_no_map" msgid="3381860077002724689">"కనెక్ట్ చేయబడింది (సందేశ యాక్సెస్ లేదు)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string>
@@ -594,7 +594,7 @@
<string name="guest_exit_guest" msgid="5908239569510734136">"గెస్ట్ను తీసివేయండి"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"గెస్ట్ సెషన్ను రీసెట్ చేయండి"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"గెస్ట్ సెషన్ను రీసెట్ చేయాలా?"</string>
- <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"అతిథిని తీసివేయాలా?"</string>
+ <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"గెస్ట్ను తీసివేయాలా?"</string>
<string name="guest_reset_guest_confirm_button" msgid="2989915693215617237">"రీసెట్ చేయండి"</string>
<string name="guest_remove_guest_confirm_button" msgid="7858123434954143879">"తీసివేయండి"</string>
<string name="guest_resetting" msgid="7822120170191509566">"గెస్ట్ సెషన్ను రీసెట్ చేస్తోంది…"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index 41ef1e4..8c3d6f3 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -594,7 +594,7 @@
<string name="guest_exit_guest" msgid="5908239569510734136">"นำผู้ใช้ชั่วคราวออก"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"รีเซ็ตผู้เข้าร่วม"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"รีเซ็ตผู้เข้าร่วมไหม"</string>
- <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"นำผู้เข้าร่วมออกไหม"</string>
+ <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"นำผู้ใช้ชั่วคราวออกไหม"</string>
<string name="guest_reset_guest_confirm_button" msgid="2989915693215617237">"รีเซ็ต"</string>
<string name="guest_remove_guest_confirm_button" msgid="7858123434954143879">"นำออก"</string>
<string name="guest_resetting" msgid="7822120170191509566">"กำลังรีเซ็ตผู้เข้าร่วม…"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index 5e5b427..15c9cac 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -151,7 +151,7 @@
<string name="bluetooth_pairing_decline" msgid="6483118841204885890">"İptal"</string>
<string name="bluetooth_pairing_will_share_phonebook" msgid="3064334458659165176">"Eşleme işlemi, bağlantı kurulduğunda kişilerinize ve çağrı geçmişine erişim izni verir."</string>
<string name="bluetooth_pairing_error_message" msgid="6626399020672335565">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> ile eşlenemedi."</string>
- <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"PIN veya parola yanlış olduğundan <xliff:g id="DEVICE_NAME">%1$s</xliff:g> ile eşlenemedi"</string>
+ <string name="bluetooth_pairing_pin_error_message" msgid="264422127613704940">"PIN veya parola yanlış olduğundan <xliff:g id="DEVICE_NAME">%1$s</xliff:g> ile eşlenemedi."</string>
<string name="bluetooth_pairing_device_down_error_message" msgid="2554424863101358857">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> ile iletişim kurulamıyor."</string>
<string name="bluetooth_pairing_rejected_error_message" msgid="5943444352777314442">"Eşleme <xliff:g id="DEVICE_NAME">%1$s</xliff:g> tarafından reddedildi."</string>
<string name="bluetooth_talkback_computer" msgid="3736623135703893773">"Bilgisayar"</string>
@@ -367,7 +367,7 @@
<string name="show_screen_updates" msgid="2078782895825535494">"Yüzey güncellemelerini göster"</string>
<string name="show_screen_updates_summary" msgid="2126932969682087406">"Güncellenirken tüm pencere yüzeylerini yakıp söndür"</string>
<string name="show_hw_screen_updates" msgid="2021286231267747506">"Görünüm güncellemelerini göster"</string>
- <string name="show_hw_screen_updates_summary" msgid="3539770072741435691">"Çizim yapılırken görünümleri pencerede çiz"</string>
+ <string name="show_hw_screen_updates_summary" msgid="3539770072741435691">"Çizildiğinde pencerelerin içini yakıp söndür"</string>
<string name="show_hw_layers_updates" msgid="5268370750002509767">"Donanım katmanı güncellemelerini göster"</string>
<string name="show_hw_layers_updates_summary" msgid="5850955890493054618">"Güncellenirken donanım katmanlarını yeşil renkte yanıp söndür"</string>
<string name="debug_hw_overdraw" msgid="8944851091008756796">"GPU fazla çizim hatasını ayıkla"</string>
@@ -594,7 +594,7 @@
<string name="guest_exit_guest" msgid="5908239569510734136">"Misafir oturumunu kaldır"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Misafir oturumunu sıfırla"</string>
<string name="guest_reset_guest_dialog_title" msgid="8047270010895437534">"Misafir oturumu sıfırlansın mı?"</string>
- <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"Konuk çıkarılsın mı?"</string>
+ <string name="guest_remove_guest_dialog_title" msgid="4548511006624088072">"Misafir oturumu kaldırılsın mı?"</string>
<string name="guest_reset_guest_confirm_button" msgid="2989915693215617237">"Sıfırla"</string>
<string name="guest_remove_guest_confirm_button" msgid="7858123434954143879">"Kaldır"</string>
<string name="guest_resetting" msgid="7822120170191509566">"Misafir oturumu sıfırlanıyor…"</string>
@@ -644,7 +644,7 @@
<string name="dream_complication_title_weather" msgid="598609151677172783">"Hava durumu"</string>
<string name="dream_complication_title_aqi" msgid="4587552608957834110">"Hava Kalitesi"</string>
<string name="dream_complication_title_cast_info" msgid="4038776652841885084">"Yayın Bilgisi"</string>
- <string name="avatar_picker_title" msgid="8492884172713170652">"Profil fotoğrafı seç"</string>
+ <string name="avatar_picker_title" msgid="8492884172713170652">"Profil fotoğrafı seçin"</string>
<string name="default_user_icon_description" msgid="6554047177298972638">"Varsayılan kullanıcı simgesi"</string>
<string name="physical_keyboard_title" msgid="4811935435315835220">"Fiziksel klavye"</string>
<string name="keyboard_layout_dialog_title" msgid="3927180147005616290">"Klavye düzenini seçin"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index b068670..0cbbae8 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -589,7 +589,7 @@
<string name="add_user_failed" msgid="4809887794313944872">"Не вдалося створити користувача"</string>
<string name="add_guest_failed" msgid="8074548434469843443">"Не вдалося створити гостя"</string>
<string name="user_nickname" msgid="262624187455825083">"Псевдонім"</string>
- <string name="user_add_user" msgid="7876449291500212468">"Додати користувача"</string>
+ <string name="user_add_user" msgid="7876449291500212468">"Додати користувача"</string>
<string name="guest_new_guest" msgid="3482026122932643557">"Додати гостя"</string>
<string name="guest_exit_guest" msgid="5908239569510734136">"Видалити гостя"</string>
<string name="guest_reset_guest" msgid="6110013010356013758">"Скинути сеанс у режимі \"Гість\""</string>
@@ -655,12 +655,8 @@
<string name="bt_le_audio_scan_qr_code" msgid="3521809854780392679">"Сканування QR-коду"</string>
<string name="bt_le_audio_scan_qr_code_scanner" msgid="4679500020630341107">"Щоб почати слухати аудіо, наведіть камеру на QR-код нижче"</string>
<string name="bt_le_audio_qr_code_is_not_valid_format" msgid="6092191081849434734">"Недійсний формат QR-коду"</string>
- <!-- no translation found for bt_le_audio_broadcast_dialog_title (5392738488989777074) -->
- <skip />
- <!-- no translation found for bt_le_audio_broadcast_dialog_sub_title (268234802198852753) -->
- <skip />
- <!-- no translation found for bt_le_audio_broadcast_dialog_switch_app (5749813313369517812) -->
- <skip />
- <!-- no translation found for bt_le_audio_broadcast_dialog_different_output (2638402023060391333) -->
- <skip />
+ <string name="bt_le_audio_broadcast_dialog_title" msgid="5392738488989777074">"Зупинити трансляцію з додатка <xliff:g id="APP_NAME">%1$s</xliff:g>?"</string>
+ <string name="bt_le_audio_broadcast_dialog_sub_title" msgid="268234802198852753">"Якщо ви зміните додаток (<xliff:g id="SWITCHAPP">%1$s</xliff:g>) або аудіовихід, поточну трансляцію буде припинено"</string>
+ <string name="bt_le_audio_broadcast_dialog_switch_app" msgid="5749813313369517812">"Змінити додаток для трансляції на <xliff:g id="SWITCHAPP">%1$s</xliff:g>"</string>
+ <string name="bt_le_audio_broadcast_dialog_different_output" msgid="2638402023060391333">"Змінити аудіовихід"</string>
</resources>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index 726827c..8a581b7 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -655,8 +655,8 @@
<string name="bt_le_audio_scan_qr_code" msgid="3521809854780392679">"掃瞄 QR 碼"</string>
<string name="bt_le_audio_scan_qr_code_scanner" msgid="4679500020630341107">"如要開始收聽,請將掃瞄器對準下方的 QR 碼"</string>
<string name="bt_le_audio_qr_code_is_not_valid_format" msgid="6092191081849434734">"QR 碼格式無效"</string>
- <string name="bt_le_audio_broadcast_dialog_title" msgid="5392738488989777074">"要停止播送「<xliff:g id="APP_NAME">%1$s</xliff:g>」的內容嗎?"</string>
- <string name="bt_le_audio_broadcast_dialog_sub_title" msgid="268234802198852753">"如果播送「<xliff:g id="SWITCHAPP">%1$s</xliff:g>」的內容或變更輸出來源,系統就會停止播送目前的內容"</string>
- <string name="bt_le_audio_broadcast_dialog_switch_app" msgid="5749813313369517812">"播送「<xliff:g id="SWITCHAPP">%1$s</xliff:g>」的內容"</string>
+ <string name="bt_le_audio_broadcast_dialog_title" msgid="5392738488989777074">"要停止廣播「<xliff:g id="APP_NAME">%1$s</xliff:g>」的內容嗎?"</string>
+ <string name="bt_le_audio_broadcast_dialog_sub_title" msgid="268234802198852753">"如要廣播「<xliff:g id="SWITCHAPP">%1$s</xliff:g>」的內容或變更輸出來源,系統就會停止廣播目前的內容"</string>
+ <string name="bt_le_audio_broadcast_dialog_switch_app" msgid="5749813313369517812">"廣播「<xliff:g id="SWITCHAPP">%1$s</xliff:g>」的內容"</string>
<string name="bt_le_audio_broadcast_dialog_different_output" msgid="2638402023060391333">"變更輸出來源"</string>
</resources>
diff --git a/packages/SettingsLib/src/com/android/settingslib/RestrictedSwitchPreference.java b/packages/SettingsLib/src/com/android/settingslib/RestrictedSwitchPreference.java
index 091e322..bdeb474 100644
--- a/packages/SettingsLib/src/com/android/settingslib/RestrictedSwitchPreference.java
+++ b/packages/SettingsLib/src/com/android/settingslib/RestrictedSwitchPreference.java
@@ -230,7 +230,9 @@
final int mode = mAppOpsManager.noteOpNoThrow(
AppOpsManager.OP_ACCESS_RESTRICTED_SETTINGS,
uid, packageName);
- final boolean appOpsAllowed = mode == AppOpsManager.MODE_ALLOWED;
+ final boolean ecmEnabled = getContext().getResources().getBoolean(
+ com.android.internal.R.bool.config_enhancedConfirmationModeEnabled);
+ final boolean appOpsAllowed = !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED;
if (appOpsAllowed || isEnabled) {
setEnabled(true);
} else {
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java b/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java
index 2fb534d..440a544 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java
@@ -250,6 +250,15 @@
}
/**
+ * Check if the device is Bluetooth LE Audio device.
+ *
+ * @return true if the RouteInfo equals TYPE_BLE_HEADSET.
+ */
+ public boolean isBLEDevice() {
+ return mRouteInfo.getType() == TYPE_BLE_HEADSET;
+ }
+
+ /**
* Get application label from MediaDevice.
*
* @return application label.
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStateWorker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStateWorker.java
new file mode 100644
index 0000000..a0c2698
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStateWorker.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.wifi;
+
+import static android.net.wifi.WifiManager.EXTRA_WIFI_STATE;
+import static android.net.wifi.WifiManager.WIFI_STATE_CHANGED_ACTION;
+import static android.net.wifi.WifiManager.WIFI_STATE_DISABLED;
+import static android.net.wifi.WifiManager.WIFI_STATE_ENABLED;
+
+import android.annotation.AnyThread;
+import android.annotation.NonNull;
+import android.annotation.TestApi;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.wifi.WifiManager;
+import android.os.HandlerThread;
+import android.os.Process;
+import android.util.Log;
+
+import androidx.annotation.GuardedBy;
+import androidx.annotation.VisibleForTesting;
+import androidx.annotation.WorkerThread;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * This is a singleton class for Wi-Fi state worker.
+ */
+public class WifiStateWorker {
+
+ private static final String TAG = "WifiStateWorker";
+ private static final Object sLock = new Object();
+
+ /**
+ * A singleton {@link WifiStateWorker} object is used to share with all sub-settings.
+ */
+ @GuardedBy("sLock")
+ private static WifiStateWorker sInstance;
+ @TestApi
+ @GuardedBy("sLock")
+ private static Map<Context, WifiStateWorker> sTestInstances;
+
+ @VisibleForTesting
+ static WifiManager sWifiManager;
+ private static int sWifiState;
+ private static HandlerThread sWorkerThread;
+
+ /**
+ * Static method to create a singleton class for WifiStateWorker.
+ *
+ * @param context The Context this is associated with.
+ * @return an instance of {@link WifiStateWorker} object.
+ */
+ @NonNull
+ @AnyThread
+ public static WifiStateWorker getInstance(@NonNull Context context) {
+ synchronized (sLock) {
+ if (sTestInstances != null && sTestInstances.containsKey(context)) {
+ WifiStateWorker testInstance = sTestInstances.get(context);
+ Log.w(TAG, "The context owner try to use a test instance:" + testInstance);
+ return testInstance;
+ }
+
+ if (sInstance != null) return sInstance;
+
+ sInstance = new WifiStateWorker();
+ sWorkerThread = new HandlerThread(
+ TAG + ":{" + context.getApplicationInfo().className + "}",
+ Process.THREAD_PRIORITY_DISPLAY);
+ sWorkerThread.start();
+ sWorkerThread.getThreadHandler().post(() -> init(context));
+ return sInstance;
+ }
+ }
+
+ /**
+ * A convenience method to set pre-prepared instance or mock(WifiStateWorker.class) for testing.
+ *
+ * @param context The Context this is associated with.
+ * @param instance of {@link WifiStateWorker} object.
+ * @hide
+ */
+ @TestApi
+ @VisibleForTesting
+ public static void setTestInstance(@NonNull Context context, WifiStateWorker instance) {
+ synchronized (sLock) {
+ if (sTestInstances == null) sTestInstances = new ConcurrentHashMap<>();
+
+ Log.w(TAG, "Try to set a test instance by context:" + context);
+ sTestInstances.put(context, instance);
+ }
+ }
+
+ @WorkerThread
+ private static void init(@NonNull Context context) {
+ final Context appContext = context.getApplicationContext();
+ final IntentReceiver receiver = new IntentReceiver();
+ appContext.registerReceiver(receiver, new IntentFilter(WIFI_STATE_CHANGED_ACTION), null,
+ sWorkerThread.getThreadHandler());
+ sWifiManager = appContext.getSystemService(WifiManager.class);
+ refresh();
+ }
+
+ /**
+ * Refresh Wi-Fi state with WifiManager#getWifiState()
+ */
+ @AnyThread
+ public static void refresh() {
+ if (sWifiManager == null) return;
+ Log.d(TAG, "Start calling WifiManager#getWifiState.");
+ sWifiState = sWifiManager.getWifiState();
+ Log.d(TAG, "WifiManager#getWifiState return state:" + sWifiState);
+ }
+
+ /**
+ * Gets the Wi-Fi enabled state.
+ *
+ * @return One of {@link WifiManager#WIFI_STATE_DISABLED},
+ * {@link WifiManager#WIFI_STATE_DISABLING}, {@link WifiManager#WIFI_STATE_ENABLED},
+ * {@link WifiManager#WIFI_STATE_ENABLING}, {@link WifiManager#WIFI_STATE_UNKNOWN}
+ * @see #isWifiEnabled()
+ */
+ @AnyThread
+ public int getWifiState() {
+ return sWifiState;
+ }
+
+ /**
+ * Return whether Wi-Fi is enabled or disabled.
+ *
+ * @return {@code true} if Wi-Fi is enabled
+ * @see #getWifiState()
+ */
+ @AnyThread
+ public boolean isWifiEnabled() {
+ return sWifiState == WIFI_STATE_ENABLED;
+ }
+
+ @WorkerThread
+ private static class IntentReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (WIFI_STATE_CHANGED_ACTION.equals(intent.getAction())) {
+ sWifiState = intent.getIntExtra(EXTRA_WIFI_STATE, WIFI_STATE_DISABLED);
+ }
+ }
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/wifi/WifiStateWorkerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/wifi/WifiStateWorkerTest.java
new file mode 100644
index 0000000..2589a90
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/wifi/WifiStateWorkerTest.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.wifi;
+
+import static android.net.wifi.WifiManager.WIFI_STATE_DISABLED;
+import static android.net.wifi.WifiManager.WIFI_STATE_DISABLING;
+import static android.net.wifi.WifiManager.WIFI_STATE_ENABLED;
+import static android.net.wifi.WifiManager.WIFI_STATE_ENABLING;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.net.wifi.WifiManager;
+import android.os.UserHandle;
+
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+import org.robolectric.RobolectricTestRunner;
+
+@RunWith(RobolectricTestRunner.class)
+public class WifiStateWorkerTest {
+
+ @Rule
+ public final MockitoRule mMockitoRule = MockitoJUnit.rule();
+ @Spy
+ Context mContext = ApplicationProvider.getApplicationContext();
+ @Mock
+ WifiManager mWifiManager;
+
+ WifiStateWorker mWifiStateWorker;
+
+ @Before
+ public void setUp() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_ENABLED);
+ WifiStateWorker.sWifiManager = mWifiManager;
+
+ mWifiStateWorker = WifiStateWorker.getInstance(mContext);
+ }
+
+ @Test
+ public void getInstance_diffContext_getSameInstance() {
+ Context context = mContext.createContextAsUser(UserHandle.ALL, 0 /* flags */);
+ WifiStateWorker instance = WifiStateWorker.getInstance(context);
+
+ assertThat(mContext).isNotEqualTo(context);
+ assertThat(mWifiStateWorker).isEqualTo(instance);
+ }
+
+ @Test
+ public void getWifiState_wifiStateDisabling_returnWifiStateDisabling() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_DISABLING);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.getWifiState()).isEqualTo(WIFI_STATE_DISABLING);
+ }
+
+ @Test
+ public void getWifiState_wifiStateDisabled_returnWifiStateDisabled() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_DISABLED);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.getWifiState()).isEqualTo(WIFI_STATE_DISABLED);
+ }
+
+ @Test
+ public void getWifiState_wifiStateEnabling_returnWifiStateEnabling() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_ENABLING);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.getWifiState()).isEqualTo(WIFI_STATE_ENABLING);
+ }
+
+ @Test
+ public void getWifiState_wifiStateEnabled_returnWifiStateEnabled() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_ENABLED);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.getWifiState()).isEqualTo(WIFI_STATE_ENABLED);
+ }
+
+ @Test
+ public void isWifiEnabled_wifiStateDisabling_returnFalse() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_DISABLING);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.isWifiEnabled()).isFalse();
+ }
+
+ @Test
+ public void isWifiEnabled_wifiStateDisabled_returnFalse() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_DISABLED);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.isWifiEnabled()).isFalse();
+ }
+
+ @Test
+ public void isWifiEnabled_wifiStateEnabling_returnFalse() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_ENABLING);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.isWifiEnabled()).isFalse();
+ }
+
+ @Test
+ public void isWifiEnabled_wifiStateEnabled_returnTrue() {
+ when(mWifiManager.getWifiState()).thenReturn(WIFI_STATE_ENABLED);
+ WifiStateWorker.refresh();
+
+ assertThat(mWifiStateWorker.isWifiEnabled()).isTrue();
+ }
+}
diff --git a/packages/SystemUI/OWNERS b/packages/SystemUI/OWNERS
index 6c8a92d..4b07eaf 100644
--- a/packages/SystemUI/OWNERS
+++ b/packages/SystemUI/OWNERS
@@ -73,6 +73,7 @@
zakcohen@google.com
jernej@google.com
jglazier@google.com
+peskal@google.com
#Android Auto
hseog@google.com
diff --git a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
index d4b4a74..f492c06 100644
--- a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
+++ b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
@@ -94,6 +94,12 @@
void setPrimaryTextColor(int color);
/**
+ * When the view is displayed on Dream, set the flag to true, immediately after the view is
+ * created.
+ */
+ void setIsDreaming(boolean isDreaming);
+
+ /**
* Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD
*/
void setDozeAmount(float amount);
diff --git a/packages/SystemUI/res-keyguard/values-es/strings.xml b/packages/SystemUI/res-keyguard/values-es/strings.xml
index 3702be2..84016da 100644
--- a/packages/SystemUI/res-keyguard/values-es/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-es/strings.xml
@@ -80,7 +80,7 @@
<string name="kg_password_pin_failed" msgid="5136259126330604009">"No se ha podido desbloquear la tarjeta SIM con el código PIN."</string>
<string name="kg_password_puk_failed" msgid="6778867411556937118">"No se ha podido desbloquear la tarjeta SIM con el código PUK."</string>
<string name="accessibility_ime_switch_button" msgid="9082358310194861329">"Cambiar método de introducción"</string>
- <string name="airplane_mode" msgid="2528005343938497866">"Modo avión"</string>
+ <string name="airplane_mode" msgid="2528005343938497866">"Modo Avión"</string>
<string name="kg_prompt_reason_restart_pattern" msgid="4720554342633852066">"Debes introducir el patrón después de reiniciar el dispositivo"</string>
<string name="kg_prompt_reason_restart_pin" msgid="1587671566498057656">"Debes introducir el PIN después de reiniciar el dispositivo"</string>
<string name="kg_prompt_reason_restart_password" msgid="8061279087240952002">"Debes introducir la contraseña después de reiniciar el dispositivo"</string>
diff --git a/packages/SystemUI/res/layout/auth_biometric_contents.xml b/packages/SystemUI/res/layout/auth_biometric_contents.xml
index 58adb91..e1b294f 100644
--- a/packages/SystemUI/res/layout/auth_biometric_contents.xml
+++ b/packages/SystemUI/res/layout/auth_biometric_contents.xml
@@ -21,6 +21,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="@integer/biometric_dialog_text_gravity"
+ android:singleLine="true"
+ android:marqueeRepeatLimit="1"
+ android:ellipsize="marquee"
style="@style/TextAppearance.AuthCredential.Title"/>
<TextView
@@ -28,13 +31,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="@integer/biometric_dialog_text_gravity"
+ android:singleLine="true"
+ android:marqueeRepeatLimit="1"
+ android:ellipsize="marquee"
style="@style/TextAppearance.AuthCredential.Subtitle"/>
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="@integer/biometric_dialog_text_gravity"
+ android:scrollbars ="vertical"
style="@style/TextAppearance.AuthCredential.Description"/>
<Space android:id="@+id/space_above_icon"
diff --git a/packages/SystemUI/res/layout/dream_overlay_complication_preview.xml b/packages/SystemUI/res/layout/dream_overlay_complication_preview.xml
deleted file mode 100644
index ca5c499..0000000
--- a/packages/SystemUI/res/layout/dream_overlay_complication_preview.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2022 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/dream_preview_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="@dimen/dream_overlay_complication_preview_text_size"
- android:textColor="@android:color/white"
- android:shadowColor="@color/keyguard_shadow_color"
- android:shadowRadius="?attr/shadowRadius"
- android:gravity="center_vertical"
- android:drawableStart="@drawable/dream_preview_back_arrow"
- android:drawablePadding="@dimen/dream_overlay_complication_preview_icon_padding"/>
diff --git a/packages/SystemUI/res/layout/media_carousel.xml b/packages/SystemUI/res/layout/media_carousel.xml
index 52132e8..50d3cc4 100644
--- a/packages/SystemUI/res/layout/media_carousel.xml
+++ b/packages/SystemUI/res/layout/media_carousel.xml
@@ -48,7 +48,7 @@
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginBottom="4dp"
- android:tint="?android:attr/textColor"
+ android:tint="@color/media_paging_indicator"
android:forceHasOverlappingRendering="false"
/>
</FrameLayout>
diff --git a/packages/SystemUI/res/layout/media_long_press_menu.xml b/packages/SystemUI/res/layout/media_long_press_menu.xml
new file mode 100644
index 0000000..99c5e47
--- /dev/null
+++ b/packages/SystemUI/res/layout/media_long_press_menu.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<merge
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto" >
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="0dp"
+ android:layout_marginStart="@dimen/qs_media_padding"
+ android:layout_marginEnd="@dimen/qs_media_padding"
+ android:id="@+id/remove_text"
+ android:fontFamily="@*android:string/config_headlineFontFamily"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:marqueeRepeatLimit="marquee_forever"
+ android:text="@string/controls_media_close_session"
+ android:gravity="center_horizontal|top"
+ app:layout_constraintTop_toBottomOf="@id/settings"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintBottom_toTopOf="@id/cancel" />
+
+ <ImageButton
+ android:id="@+id/settings"
+ android:src="@drawable/ic_settings"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="4dp"
+ android:background="@drawable/qs_media_light_source"
+ android:contentDescription="@string/controls_media_settings_button"
+ android:layout_gravity="top"
+ app:layout_constraintWidth_min="@dimen/min_clickable_item_size"
+ app:layout_constraintHeight_min="@dimen/min_clickable_item_size"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+ </ImageButton>
+
+ <FrameLayout
+ android:id="@+id/dismiss"
+ android:background="@drawable/qs_media_light_source"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/qs_media_padding"
+ android:layout_marginEnd="@dimen/qs_media_action_spacing"
+ android:layout_marginBottom="@dimen/qs_media_padding"
+ app:layout_constrainedWidth="true"
+ app:layout_constraintWidth_min="@dimen/min_clickable_item_size"
+ app:layout_constraintHeight_min="@dimen/min_clickable_item_size"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/cancel"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/remove_text">
+ <TextView
+ android:id="@+id/dismiss_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center|top"
+ style="@style/MediaPlayer.SolidButton"
+ android:background="@drawable/qs_media_solid_button"
+ android:text="@string/controls_media_dismiss_button" />
+ </FrameLayout>
+ <FrameLayout
+ android:id="@+id/cancel"
+ android:background="@drawable/qs_media_light_source"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/qs_media_action_spacing"
+ android:layout_marginEnd="@dimen/qs_media_padding"
+ android:layout_marginBottom="@dimen/qs_media_padding"
+ app:layout_constrainedWidth="true"
+ app:layout_constraintWidth_min="@dimen/min_clickable_item_size"
+ app:layout_constraintHeight_min="@dimen/min_clickable_item_size"
+ app:layout_constraintStart_toEndOf="@id/dismiss"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/remove_text">
+ <TextView
+ android:id="@+id/cancel_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center|top"
+ style="@style/MediaPlayer.OutlineButton"
+ android:text="@string/cancel" />
+ </FrameLayout>
+
+</merge>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/media_session_view.xml b/packages/SystemUI/res/layout/media_session_view.xml
index 665edac..534c80d 100644
--- a/packages/SystemUI/res/layout/media_session_view.xml
+++ b/packages/SystemUI/res/layout/media_session_view.xml
@@ -80,7 +80,7 @@
android:background="@drawable/qs_media_light_source"
android:forceHasOverlappingRendering="false"
android:layout_width="wrap_content"
- android:layout_height="48dp"
+ android:layout_height="@dimen/min_clickable_item_size"
android:layout_marginStart="@dimen/qs_center_guideline_padding"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -92,8 +92,9 @@
<LinearLayout
android:id="@+id/media_seamless_button"
android:layout_width="wrap_content"
- android:layout_height="@dimen/qs_seamless_height"
+ android:layout_height="wrap_content"
android:minHeight="@dimen/qs_seamless_height"
+ android:maxHeight="@dimen/min_clickable_item_size"
android:theme="@style/MediaPlayer.SolidButton"
android:background="@drawable/qs_media_seamless_background"
android:orientation="horizontal"
@@ -300,87 +301,7 @@
android:layout_marginBottom="@dimen/qs_media_padding"
android:layout_marginTop="0dp" />
- <!-- Long press menu -->
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="0dp"
- android:layout_marginStart="@dimen/qs_media_padding"
- android:layout_marginEnd="@dimen/qs_media_padding"
- android:id="@+id/remove_text"
- android:fontFamily="@*android:string/config_headlineFontFamily"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:marqueeRepeatLimit="marquee_forever"
- android:text="@string/controls_media_close_session"
- android:gravity="center_horizontal|top"
- app:layout_constraintTop_toBottomOf="@id/settings"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toTopOf="@id/cancel" />
+ <include
+ layout="@layout/media_long_press_menu" />
- <ImageButton
- android:id="@+id/settings"
- android:src="@drawable/ic_settings"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="4dp"
- android:layout_marginEnd="4dp"
- android:background="@drawable/qs_media_light_source"
- android:contentDescription="@string/controls_media_settings_button"
- android:layout_gravity="top"
- app:layout_constraintWidth_min="@dimen/min_clickable_item_size"
- app:layout_constraintHeight_min="@dimen/min_clickable_item_size"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintTop_toTopOf="parent">
- </ImageButton>
-
- <FrameLayout
- android:id="@+id/dismiss"
- android:background="@drawable/qs_media_light_source"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/qs_media_padding"
- android:layout_marginEnd="@dimen/qs_media_action_spacing"
- android:layout_marginBottom="@dimen/qs_media_padding"
- app:layout_constrainedWidth="true"
- app:layout_constraintWidth_min="@dimen/min_clickable_item_size"
- app:layout_constraintHeight_min="@dimen/min_clickable_item_size"
- app:layout_constraintHorizontal_chainStyle="packed"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@id/cancel"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintTop_toBottomOf="@id/remove_text">
- <TextView
- android:id="@+id/dismiss_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center|top"
- style="@style/MediaPlayer.SolidButton"
- android:background="@drawable/qs_media_solid_button"
- android:text="@string/controls_media_dismiss_button" />
- </FrameLayout>
- <FrameLayout
- android:id="@+id/cancel"
- android:background="@drawable/qs_media_light_source"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/qs_media_action_spacing"
- android:layout_marginEnd="@dimen/qs_media_padding"
- android:layout_marginBottom="@dimen/qs_media_padding"
- app:layout_constrainedWidth="true"
- app:layout_constraintWidth_min="@dimen/min_clickable_item_size"
- app:layout_constraintHeight_min="@dimen/min_clickable_item_size"
- app:layout_constraintStart_toEndOf="@id/dismiss"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintTop_toBottomOf="@id/remove_text">
- <TextView
- android:id="@+id/cancel_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center|top"
- style="@style/MediaPlayer.OutlineButton"
- android:text="@string/cancel" />
- </FrameLayout>
</com.android.systemui.util.animation.TransitionLayout>
diff --git a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
index 5510f24..79ba7ead 100644
--- a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
+++ b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
@@ -16,6 +16,8 @@
-->
<!-- Layout for media recommendations inside QSPanel carousel -->
+<!-- See media_recommendation_expanded.xml and media_recommendation_collapsed.xml for the
+ constraints. -->
<com.android.systemui.util.animation.TransitionLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -46,14 +48,6 @@
<FrameLayout
android:id="@+id/media_cover1_container"
style="@style/MediaPlayer.Recommendation.AlbumContainer"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toTopOf="@+id/media_title1"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@id/media_cover2_container"
- android:layout_marginEnd="@dimen/qs_media_rec_album_side_margin"
- app:layout_constraintHorizontal_chainStyle="packed"
- app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintVertical_bias="0.5"
>
<ImageView
android:id="@+id/media_cover1"
@@ -71,31 +65,16 @@
<TextView
android:id="@+id/media_title1"
style="@style/MediaPlayer.Recommendation.Text.Title"
- app:layout_constraintStart_toStartOf="@+id/media_cover1_container"
- app:layout_constraintEnd_toEndOf="@+id/media_cover1_container"
- app:layout_constraintTop_toBottomOf="@+id/media_cover1_container"
- app:layout_constraintBottom_toTopOf="@+id/media_subtitle1"
/>
<TextView
android:id="@+id/media_subtitle1"
style="@style/MediaPlayer.Recommendation.Text.Subtitle"
- app:layout_constraintStart_toStartOf="@+id/media_cover1_container"
- app:layout_constraintEnd_toEndOf="@+id/media_cover1_container"
- app:layout_constraintTop_toBottomOf="@+id/media_title1"
- app:layout_constraintBottom_toBottomOf="parent"
- android:layout_marginBottom="@dimen/qs_media_padding"
/>
<FrameLayout
android:id="@+id/media_cover2_container"
style="@style/MediaPlayer.Recommendation.AlbumContainer"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toTopOf="@id/media_title2"
- app:layout_constraintStart_toEndOf="@id/media_cover1_container"
- app:layout_constraintEnd_toStartOf="@id/media_cover3_container"
- android:layout_marginEnd="@dimen/qs_media_rec_album_side_margin"
- app:layout_constraintVertical_bias="0.5"
>
<ImageView
android:id="@+id/media_cover2"
@@ -111,31 +90,16 @@
<TextView
android:id="@+id/media_title2"
style="@style/MediaPlayer.Recommendation.Text.Title"
- app:layout_constraintStart_toStartOf="@+id/media_cover2_container"
- app:layout_constraintEnd_toEndOf="@+id/media_cover2_container"
- app:layout_constraintTop_toBottomOf="@+id/media_cover2_container"
- app:layout_constraintBottom_toTopOf="@+id/media_subtitle2"
/>
<TextView
android:id="@+id/media_subtitle2"
style="@style/MediaPlayer.Recommendation.Text.Subtitle"
- app:layout_constraintStart_toStartOf="@+id/media_cover2_container"
- app:layout_constraintEnd_toEndOf="@+id/media_cover2_container"
- app:layout_constraintTop_toBottomOf="@+id/media_title2"
- app:layout_constraintBottom_toBottomOf="parent"
- android:layout_marginBottom="@dimen/qs_media_padding"
/>
<FrameLayout
android:id="@+id/media_cover3_container"
style="@style/MediaPlayer.Recommendation.AlbumContainer"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toTopOf="@id/media_title3"
- app:layout_constraintStart_toEndOf="@id/media_cover2_container"
- app:layout_constraintEnd_toEndOf="parent"
- android:layout_marginEnd="@dimen/qs_media_padding"
- app:layout_constraintVertical_bias="0.5"
>
<ImageView
android:id="@+id/media_cover3"
@@ -151,113 +115,14 @@
<TextView
android:id="@+id/media_title3"
style="@style/MediaPlayer.Recommendation.Text.Title"
- app:layout_constraintStart_toStartOf="@+id/media_cover3_container"
- app:layout_constraintEnd_toEndOf="@+id/media_cover3_container"
- app:layout_constraintTop_toBottomOf="@+id/media_cover3_container"
- app:layout_constraintBottom_toTopOf="@+id/media_subtitle3"
/>
<TextView
android:id="@+id/media_subtitle3"
style="@style/MediaPlayer.Recommendation.Text.Subtitle"
- app:layout_constraintStart_toStartOf="@+id/media_cover3_container"
- app:layout_constraintEnd_toEndOf="@+id/media_cover3_container"
- app:layout_constraintTop_toBottomOf="@+id/media_title3"
- app:layout_constraintBottom_toBottomOf="parent"
- android:layout_marginBottom="@dimen/qs_media_padding"
/>
- <!-- Long press menu -->
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/qs_media_padding"
- android:layout_marginStart="@dimen/qs_media_padding"
- android:layout_marginEnd="@dimen/qs_media_padding"
- android:id="@+id/remove_text"
- android:fontFamily="@*android:string/config_headlineFontFamily"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:marqueeRepeatLimit="marquee_forever"
- android:text="@string/controls_media_close_session"
- android:gravity="center_horizontal|top"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toTopOf="@id/cancel"/>
+ <include
+ layout="@layout/media_long_press_menu" />
- <FrameLayout
- android:id="@+id/settings"
- android:background="@drawable/qs_media_light_source"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/qs_media_padding"
- android:layout_marginEnd="@dimen/qs_media_action_spacing"
- android:layout_marginBottom="@dimen/qs_media_padding"
- app:layout_constrainedWidth="true"
- app:layout_constraintWidth_min="48dp"
- app:layout_constraintHeight_min="48dp"
- app:layout_constraintHorizontal_chainStyle="spread_inside"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@id/cancel"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintTop_toBottomOf="@id/remove_text">
-
- <TextView
- android:id="@+id/settings_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center|bottom"
- style="@style/MediaPlayer.OutlineButton"
- android:text="@string/controls_media_settings_button" />
- </FrameLayout>
-
- <FrameLayout
- android:id="@+id/cancel"
- android:background="@drawable/qs_media_light_source"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/qs_media_action_spacing"
- android:layout_marginEnd="@dimen/qs_media_action_spacing"
- android:layout_marginBottom="@dimen/qs_media_padding"
- app:layout_constrainedWidth="true"
- app:layout_constraintWidth_min="48dp"
- app:layout_constraintHeight_min="48dp"
- app:layout_constraintStart_toEndOf="@id/settings"
- app:layout_constraintEnd_toStartOf="@id/dismiss"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintTop_toBottomOf="@id/remove_text">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center|bottom"
- style="@style/MediaPlayer.OutlineButton"
- android:text="@string/cancel" />
- </FrameLayout>
-
- <FrameLayout
- android:id="@+id/dismiss"
- android:background="@drawable/qs_media_light_source"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/qs_media_action_spacing"
- android:layout_marginEnd="@dimen/qs_media_padding"
- android:layout_marginBottom="@dimen/qs_media_padding"
- app:layout_constrainedWidth="true"
- app:layout_constraintWidth_min="48dp"
- app:layout_constraintHeight_min="48dp"
- app:layout_constraintStart_toEndOf="@id/cancel"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintTop_toBottomOf="@id/remove_text">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center|bottom"
- style="@style/MediaPlayer.OutlineButton"
- android:text="@string/controls_media_dismiss_button"
- />
- </FrameLayout>
</com.android.systemui.util.animation.TransitionLayout>
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 0cb7735..dbf8e11 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -911,11 +911,13 @@
<string name="qs_tile_request_dialog_add" msgid="4888460910694986304">"Voeg teël by"</string>
<string name="qs_tile_request_dialog_not_add" msgid="4168716573114067296">"Moenie teël byvoeg nie"</string>
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Kies gebruiker"</string>
- <!-- no translation found for fgs_manager_footer_label (790443735462280164) -->
+ <plurals name="fgs_manager_footer_label" formatted="false" msgid="790443735462280164">
+ <item quantity="other"><xliff:g id="COUNT_1">%s</xliff:g> programme is aktief</item>
+ <item quantity="one"><xliff:g id="COUNT_0">%s</xliff:g> program is aktief</item>
+ </plurals>
<string name="fgs_dot_content_description" msgid="2865071539464777240">"Nuwe inligting"</string>
<string name="fgs_manager_dialog_title" msgid="5879184257257718677">"Aktiewe programme"</string>
- <!-- no translation found for fgs_manager_dialog_message (6839542063522121108) -->
- <skip />
+ <string name="fgs_manager_dialog_message" msgid="6839542063522121108">"Hierdie programme is steeds aktief en beïnvloed dalk batterylewe, selfs al gebruik jy hulle nie"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
<string name="fgs_manager_app_item_stop_button_stopped_label" msgid="6950382004441263922">"Gestop"</string>
<string name="clipboard_edit_text_done" msgid="4551887727694022409">"Klaar"</string>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index e5920fc..fa7dd75 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"অগ্রাধিকার"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g>-এ কথোপকথন ফিচার কাজ করে না"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"এই বিজ্ঞপ্তিগুলি পরিবর্তন করা যাবে না।"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"কল বিজ্ঞপ্তি পরিবর্তন করা যাবে না।"</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"এই সমস্ত বিজ্ঞপ্তিকে এখানে কনফিগার করা যাবে না"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"প্রক্সি করা বিজ্ঞপ্তি"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"<xliff:g id="APP_NAME">%1$s</xliff:g> সংক্রান্ত সমস্ত বিজ্ঞপ্তি"</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 8822875..8e863d6f 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritat"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> no admet les funcions de converses"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Aquestes notificacions no es poden modificar."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Les notificacions de trucades no es poden modificar."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Aquest grup de notificacions no es pot configurar aquí"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Notificació mitjançant aplicació intermediària"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Totes les notificacions de l\'aplicació <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 820749f..4e61915 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -419,7 +419,7 @@
<string name="screen_pinning_title" msgid="9058007390337841305">"Aplikace je připnutá"</string>
<string name="screen_pinning_description" msgid="8699395373875667743">"Obsah bude připnut v zobrazení, dokud jej neuvolníte. Uvolníte jej stisknutím a podržením tlačítek Zpět a Přehled."</string>
<string name="screen_pinning_description_recents_invisible" msgid="4564466648700390037">"Obsah bude připnut v zobrazení, dokud ho neuvolníte. Uvolníte ho podržením tlačítek Zpět a Plocha."</string>
- <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"Díky připnutí bude vidět, dokud ji neodepnete. Odepnout ji můžete přejetím nahoru a podržením."</string>
+ <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"Díky připnutí bude aplikace vidět, dokud ji neodepnete. Odepnout ji můžete přejetím prstem nahoru a podržením."</string>
<string name="screen_pinning_description_accessible" msgid="7386449191953535332">"Obsah bude připnut v zobrazení, dokud jej neuvolníte. Uvolníte jej stisknutím a podržením tlačítka Přehled."</string>
<string name="screen_pinning_description_recents_invisible_accessible" msgid="2857071808674481986">"Obsah bude připnut v zobrazení, dokud ho neuvolníte. Uvolníte ho podržením tlačítka Plocha."</string>
<string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"Může mít přístup k soukromým datům (například kontaktům a obsahu e-mailů)."</string>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 50061fb..41035e0 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Priorität"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> unterstützt keine Funktionen für Unterhaltungen"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Diese Benachrichtigungen können nicht geändert werden."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Anrufbenachrichtigungen können nicht geändert werden."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Die Benachrichtigungsgruppe kann hier nicht konfiguriert werden"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Weitergeleitete Benachrichtigung"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Alle Benachrichtigungen von <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index d82a28c..14ba4a2 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -33,8 +33,8 @@
<string name="battery_saver_dismiss_action" msgid="7199342621040014738">"Όχι, ευχαριστώ"</string>
<string name="status_bar_settings_auto_rotation" msgid="8329080442278431708">"Αυτόματη περιστροφή οθόνης"</string>
<string name="usb_device_permission_prompt" msgid="4414719028369181772">"Να επιτρέπεται η πρόσβαση της εφαρμογής <xliff:g id="APPLICATION">%1$s</xliff:g> στη συσκευή <xliff:g id="USB_DEVICE">%2$s</xliff:g>;"</string>
- <string name="usb_device_permission_prompt_warn" msgid="2309129784984063656">"Να επιτρέπεται στην εφαρμογή <xliff:g id="APPLICATION">%1$s</xliff:g> να έχει πρόσβαση στη συσκευή <xliff:g id="USB_DEVICE">%2$s</xliff:g>;\nΔεν έχει εκχωρηθεί άδεια εγγραφής σε αυτήν την εφαρμογή, αλλά μέσω αυτής της συσκευής USB θα μπορεί να εγγράφει ήχο."</string>
- <string name="usb_audio_device_permission_prompt_title" msgid="4221351137250093451">"Να επιτρέπεται στην εφαρμογή <xliff:g id="APPLICATION">%1$s</xliff:g> η πρόσβαση στη συσκευή <xliff:g id="USB_DEVICE">%2$s</xliff:g>;"</string>
+ <string name="usb_device_permission_prompt_warn" msgid="2309129784984063656">"Να επιτρέπεται στο <xliff:g id="APPLICATION">%1$s</xliff:g> να έχει πρόσβαση στη συσκευή <xliff:g id="USB_DEVICE">%2$s</xliff:g>;\nΔεν έχει εκχωρηθεί άδεια εγγραφής σε αυτήν την εφαρμογή, αλλά μέσω αυτής της συσκευής USB θα μπορεί να εγγράφει ήχο."</string>
+ <string name="usb_audio_device_permission_prompt_title" msgid="4221351137250093451">"Να επιτρέπεται στο <xliff:g id="APPLICATION">%1$s</xliff:g> η πρόσβαση στη συσκευή <xliff:g id="USB_DEVICE">%2$s</xliff:g>;"</string>
<string name="usb_audio_device_confirm_prompt_title" msgid="8828406516732985696">"Άνοιγμα <xliff:g id="APPLICATION">%1$s</xliff:g> για διαχείριση συσκευής <xliff:g id="USB_DEVICE">%2$s</xliff:g>;"</string>
<string name="usb_audio_device_prompt_warn" msgid="2504972133361130335">"Δεν έχει εκχωρηθεί άδεια εγγραφής σε αυτήν την εφαρμογή, αλλά μέσω αυτής της συσκευής USB θα μπορεί να εγγράφει ήχο. Η χρήση της εφαρμογής <xliff:g id="APPLICATION">%1$s</xliff:g> με αυτήν τη συσκευή μπορεί να σας εμποδίσει να ακούσετε κλήσεις, ειδοποιήσεις και ξυπνητήρια."</string>
<string name="usb_audio_device_prompt" msgid="7944987408206252949">"Η χρήση της εφαρμογής <xliff:g id="APPLICATION">%1$s</xliff:g> με αυτήν τη συσκευή μπορεί να σας εμποδίσει να ακούσετε κλήσεις, ειδοποιήσεις και ξυπνητήρια."</string>
@@ -708,10 +708,10 @@
<string name="mobile_data_disable_message" msgid="8604966027899770415">"Δεν θα έχετε πρόσβαση σε δεδομένα ή στο διαδίκτυο μέσω της εταιρείας κινητής τηλεφωνίας <xliff:g id="CARRIER">%s</xliff:g>. Θα έχετε πρόσβαση στο διαδίκτυο μόνο μέσω Wi-Fi."</string>
<string name="mobile_data_disable_message_default_carrier" msgid="6496033312431658238">"η εταιρεία κινητής τηλεφωνίας"</string>
<string name="touch_filtered_warning" msgid="8119511393338714836">"Επειδή μια εφαρμογή αποκρύπτει ένα αίτημα άδειας, δεν είναι δυνατή η επαλήθευση της απάντησής σας από τις Ρυθμίσεις."</string>
- <string name="slice_permission_title" msgid="3262615140094151017">"Να επιτρέπεται στην εφαρμογή <xliff:g id="APP_0">%1$s</xliff:g> να εμφανίζει τμήματα της εφαρμογής <xliff:g id="APP_2">%2$s</xliff:g>;"</string>
+ <string name="slice_permission_title" msgid="3262615140094151017">"Να επιτρέπεται στο <xliff:g id="APP_0">%1$s</xliff:g> να εμφανίζει τμήματα της εφαρμογής <xliff:g id="APP_2">%2$s</xliff:g>;"</string>
<string name="slice_permission_text_1" msgid="6675965177075443714">"- Μπορεί να διαβάζει πληροφορίες από την εφαρμογή <xliff:g id="APP">%1$s</xliff:g>"</string>
<string name="slice_permission_text_2" msgid="6758906940360746983">"- Μπορεί να εκτελεί ενέργειες εντός της εφαρμογής <xliff:g id="APP">%1$s</xliff:g>"</string>
- <string name="slice_permission_checkbox" msgid="4242888137592298523">"Να επιτρέπεται στην εφαρμογή <xliff:g id="APP">%1$s</xliff:g> να εμφανίζει τμήματα από οποιαδήποτε εφαρμογή"</string>
+ <string name="slice_permission_checkbox" msgid="4242888137592298523">"Να επιτρέπεται στο <xliff:g id="APP">%1$s</xliff:g> να εμφανίζει τμήματα από οποιαδήποτε εφαρμογή"</string>
<string name="slice_permission_allow" msgid="6340449521277951123">"Επιτρέπεται"</string>
<string name="slice_permission_deny" msgid="6870256451658176895">"Δεν επιτρέπεται"</string>
<string name="auto_saver_title" msgid="6873691178754086596">"Πατήστε για προγραμματισμό της Εξοικονόμησης μπαταρίας"</string>
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index be94028..9b01b9f 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -911,11 +911,13 @@
<string name="qs_tile_request_dialog_add" msgid="4888460910694986304">"Add tile"</string>
<string name="qs_tile_request_dialog_not_add" msgid="4168716573114067296">"Do not add tile"</string>
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Select user"</string>
- <!-- no translation found for fgs_manager_footer_label (790443735462280164) -->
+ <plurals name="fgs_manager_footer_label" formatted="false" msgid="790443735462280164">
+ <item quantity="other"><xliff:g id="COUNT_1">%s</xliff:g> apps are active</item>
+ <item quantity="one"><xliff:g id="COUNT_0">%s</xliff:g> app is active</item>
+ </plurals>
<string name="fgs_dot_content_description" msgid="2865071539464777240">"New information"</string>
<string name="fgs_manager_dialog_title" msgid="5879184257257718677">"Active apps"</string>
- <!-- no translation found for fgs_manager_dialog_message (6839542063522121108) -->
- <skip />
+ <string name="fgs_manager_dialog_message" msgid="6839542063522121108">"Even if you’re not using these apps, they’re still active and might affect battery life"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
<string name="fgs_manager_app_item_stop_button_stopped_label" msgid="6950382004441263922">"Stopped"</string>
<string name="clipboard_edit_text_done" msgid="4551887727694022409">"Done"</string>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 9839405..38d8d1d 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -167,7 +167,7 @@
<string name="accessibility_not_connected" msgid="4061305616351042142">"No conectado"</string>
<string name="data_connection_roaming" msgid="375650836665414797">"Roaming"</string>
<string name="cell_data_off" msgid="4886198950247099526">"Desactivados"</string>
- <string name="accessibility_airplane_mode" msgid="1899529214045998505">"Modo avión"</string>
+ <string name="accessibility_airplane_mode" msgid="1899529214045998505">"Modo Avión"</string>
<string name="accessibility_vpn_on" msgid="8037549696057288731">"La red VPN está activada."</string>
<string name="accessibility_battery_level" msgid="5143715405241138822">"<xliff:g id="NUMBER">%d</xliff:g> por ciento de batería"</string>
<string name="accessibility_battery_level_with_estimate" msgid="4843119982547599452">"Queda un <xliff:g id="PERCENTAGE">%1$s</xliff:g> por ciento de batería (<xliff:g id="TIME">%2$s</xliff:g> aproximadamente según tu uso)"</string>
@@ -175,7 +175,7 @@
<string name="accessibility_overflow_action" msgid="8555835828182509104">"Ver todas las notificaciones"</string>
<string name="accessibility_tty_enabled" msgid="1123180388823381118">"Teletipo habilitado"</string>
<string name="accessibility_ringer_vibrate" msgid="6261841170896561364">"Modo vibración"</string>
- <string name="accessibility_ringer_silent" msgid="8994620163934249882">"Modo silencio"</string>
+ <string name="accessibility_ringer_silent" msgid="8994620163934249882">"Modo Silencio"</string>
<!-- no translation found for accessibility_casting (8708751252897282313) -->
<skip />
<string name="accessibility_desc_notification_shade" msgid="5355229129428759989">"Pantalla de notificaciones"</string>
@@ -284,7 +284,7 @@
<string name="quick_settings_screen_record_label" msgid="8650355346742003694">"Grabar pantalla"</string>
<string name="quick_settings_screen_record_start" msgid="1574725369331638985">"Iniciar"</string>
<string name="quick_settings_screen_record_stop" msgid="8087348522976412119">"Detener"</string>
- <string name="quick_settings_onehanded_label" msgid="2416537930246274991">"Modo una mano"</string>
+ <string name="quick_settings_onehanded_label" msgid="2416537930246274991">"Modo Una mano"</string>
<string name="sensor_privacy_start_use_mic_dialog_title" msgid="563796653825944944">"¿Desbloquear el micrófono del dispositivo?"</string>
<string name="sensor_privacy_start_use_camera_dialog_title" msgid="8807639852654305227">"¿Desbloquear la cámara del dispositivo?"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_title" msgid="4316471859905020023">"¿Desbloquear la cámara y el micrófono del dispositivo?"</string>
@@ -450,9 +450,9 @@
<string name="volume_dialog_ringer_guidance_ring" msgid="9143194270463146858">"Las llamadas y las notificaciones sonarán (<xliff:g id="VOLUME_LEVEL">%1$s</xliff:g>)"</string>
<string name="system_ui_tuner" msgid="1471348823289954729">"Configurador de UI del sistema"</string>
<string name="status_bar" msgid="4357390266055077437">"Barra de estado"</string>
- <string name="demo_mode" msgid="263484519766901593">"Modo de demostración de UI del sistema"</string>
- <string name="enable_demo_mode" msgid="3180345364745966431">"Habilitar modo demo"</string>
- <string name="show_demo_mode" msgid="3677956462273059726">"Mostrar modo demo"</string>
+ <string name="demo_mode" msgid="263484519766901593">"Modo Demo de UI del sistema"</string>
+ <string name="enable_demo_mode" msgid="3180345364745966431">"Habilitar modo Demo"</string>
+ <string name="show_demo_mode" msgid="3677956462273059726">"Mostrar modo Demo"</string>
<string name="status_bar_ethernet" msgid="5690979758988647484">"Ethernet"</string>
<string name="status_bar_alarm" msgid="87160847643623352">"Alarma"</string>
<string name="wallet_title" msgid="5369767670735827105">"Wallet"</string>
@@ -465,7 +465,7 @@
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Ajustes de pantalla de bloqueo"</string>
<string name="qr_code_scanner_title" msgid="5290201053875420785">"Escanear código QR"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Perfil de trabajo"</string>
- <string name="status_bar_airplane" msgid="4848702508684541009">"Modo avión"</string>
+ <string name="status_bar_airplane" msgid="4848702508684541009">"Modo Avión"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"No oirás la próxima alarma (<xliff:g id="WHEN">%1$s</xliff:g>)"</string>
<string name="alarm_template" msgid="2234991538018805736">"a las <xliff:g id="WHEN">%1$s</xliff:g>"</string>
<string name="alarm_template_far" msgid="3561752195856839456">"<xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Prioridad"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> no admite funciones de conversación"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Estas notificaciones no se pueden modificar."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Las notificaciones de llamada no se pueden modificar."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Este grupo de notificaciones no se puede configurar aquí"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Notificación mediante proxy"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Todas las notificaciones de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
@@ -581,7 +580,7 @@
<string name="keyboard_shortcut_group_applications_music" msgid="9032078456666204025">"Música"</string>
<string name="keyboard_shortcut_group_applications_calendar" msgid="4229602992120154157">"Calendario"</string>
<string name="volume_and_do_not_disturb" msgid="502044092739382832">"No molestar"</string>
- <string name="volume_dnd_silent" msgid="4154597281458298093">"Combinación de teclas para los botones de volumen"</string>
+ <string name="volume_dnd_silent" msgid="4154597281458298093">"Acceso directo de los botones de volumen"</string>
<string name="battery" msgid="769686279459897127">"Batería"</string>
<string name="headset" msgid="4485892374984466437">"Auriculares"</string>
<string name="accessibility_long_click_tile" msgid="210472753156768705">"Abrir ajustes"</string>
@@ -907,11 +906,11 @@
<string name="see_all_networks" msgid="3773666844913168122">"Ver todo"</string>
<string name="to_switch_networks_disconnect_ethernet" msgid="6698111101156951955">"Para cambiar de red, desconecta el cable Ethernet"</string>
<string name="wifi_scan_notify_message" msgid="3753839537448621794">"Para mejorar la experiencia con el dispositivo, las aplicaciones y los servicios podrán buscar redes Wi-Fi en cualquier momento, aunque la conexión Wi-Fi esté desactivada. Puedes cambiar esto en los ajustes de búsqueda de redes Wi-Fi. "<annotation id="link">"Cambiar"</annotation></string>
- <string name="turn_off_airplane_mode" msgid="8425587763226548579">"Desactivar modo avión"</string>
+ <string name="turn_off_airplane_mode" msgid="8425587763226548579">"Desactivar modo Avión"</string>
<string name="qs_tile_request_dialog_text" msgid="3501359944139877694">"<xliff:g id="APPNAME">%1$s</xliff:g> quiere añadir el siguiente recuadro a ajustes rápidos"</string>
<string name="qs_tile_request_dialog_add" msgid="4888460910694986304">"Añadir recuadro"</string>
<string name="qs_tile_request_dialog_not_add" msgid="4168716573114067296">"No añadir recuadro"</string>
- <string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Seleccionar usuario"</string>
+ <string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Selecciona un usuario"</string>
<!-- no translation found for fgs_manager_footer_label (790443735462280164) -->
<string name="fgs_dot_content_description" msgid="2865071539464777240">"Información nueva"</string>
<string name="fgs_manager_dialog_title" msgid="5879184257257718677">"Aplicaciones activas"</string>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 42842fc..d52376d 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Prioriteetne"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> ei toeta vestlusfunktsioone"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Neid märguandeid ei saa muuta."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Kõnemärguandeid ei saa muuta."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Seda märguannete rühma ei saa siin seadistada"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Puhvriga märguanne"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Kõik rakenduse <xliff:g id="APP_NAME">%1$s</xliff:g> märguanded"</string>
diff --git a/packages/SystemUI/res/values-eu/strings.xml b/packages/SystemUI/res/values-eu/strings.xml
index 53c3698..9eaa3e6 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -278,7 +278,7 @@
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Desaktibatze-ordua: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at_bedtime" msgid="2274300599408864897">"Aktibatuta lo egiteko garaian"</string>
<string name="quick_settings_dark_mode_secondary_label_until_bedtime_ends" msgid="1790772410777123685">"Lo egiteko garaia amaitzen den arte"</string>
- <string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
+ <string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFCa"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Desgaituta dago NFC"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Gaituta dago NFC"</string>
<string name="quick_settings_screen_record_label" msgid="8650355346742003694">"Pantaila-grabaketa"</string>
@@ -313,7 +313,7 @@
<string name="keyguard_unlock_press" msgid="9140109453735019209">"Irekitzeko, sakatu desblokeatzeko ikonoa"</string>
<string name="keyguard_face_successful_unlock_press" msgid="25520941264602588">"Aurpegiaren bidez desblokeatu da. Irekitzeko, sakatu desblokeatzeko ikonoa."</string>
<string name="keyguard_retry" msgid="886802522584053523">"Berriro saiatzeko, pasatu hatza gora"</string>
- <string name="require_unlock_for_nfc" msgid="1305686454823018831">"Desblokea ezazu NFC erabiltzeko"</string>
+ <string name="require_unlock_for_nfc" msgid="1305686454823018831">"Desblokea ezazu NFCa erabiltzeko"</string>
<string name="do_disclosure_generic" msgid="4896482821974707167">"Gailu hau zure erakundearena da"</string>
<string name="do_disclosure_with_name" msgid="2091641464065004091">"Gailu hau <xliff:g id="ORGANIZATION_NAME">%s</xliff:g> erakundearena da"</string>
<string name="do_financed_disclosure_with_name" msgid="6723004643314467864">"<xliff:g id="ORGANIZATION_NAME">%s</xliff:g> erakundeak eman du gailu hau"</string>
@@ -424,7 +424,7 @@
<string name="screen_pinning_positive" msgid="3285785989665266984">"Ados"</string>
<string name="screen_pinning_negative" msgid="6882816864569211666">"Ez, eskerrik asko"</string>
<string name="screen_pinning_start" msgid="7483998671383371313">"Ainguratu da aplikazioa"</string>
- <string name="screen_pinning_exit" msgid="4553787518387346893">"Kendu da aplikazioaren aingura"</string>
+ <string name="screen_pinning_exit" msgid="4553787518387346893">"Kendu zaio aingura aplikazioari"</string>
<string name="stream_voice_call" msgid="7468348170702375660">"Deia"</string>
<string name="stream_system" msgid="7663148785370565134">"Sistema"</string>
<string name="stream_ring" msgid="7550670036738697526">"Jo tonua"</string>
@@ -836,7 +836,7 @@
<string name="media_output_dialog_pairing_new" msgid="9099497976087485862">"Parekatu beste gailu batekin"</string>
<string name="media_output_dialog_launch_app_text" msgid="1527413319632586259">"Saioa ireki nahi baduzu, ireki aplikazioa."</string>
<string name="media_output_dialog_unknown_launch_app_name" msgid="1084899329829371336">"Aplikazio ezezaguna"</string>
- <string name="media_output_dialog_button_stop_casting" msgid="6581379537930199189">"Utzi igortzeari"</string>
+ <string name="media_output_dialog_button_stop_casting" msgid="6581379537930199189">"Gelditu igorpena"</string>
<string name="media_output_first_broadcast_title" msgid="6292237789860753022">"Nola funtzionatzen dute iragarpenek?"</string>
<string name="media_output_broadcast" msgid="3555580945878071543">"Iragarri"</string>
<string name="media_output_first_notify_broadcast_message" msgid="6353857724136398494">"Bluetooth bidezko gailu bateragarriak dituzten inguruko pertsonek iragartzen ari zaren multimedia-edukia entzun dezakete"</string>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 38b1f9f..1372355 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -19,7 +19,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_label" msgid="4811759950673118541">"میانای کاربر سیستم"</string>
+ <string name="app_label" msgid="4811759950673118541">"واسط کاربری سیستم"</string>
<string name="battery_low_title" msgid="5319680173344341779">"«بهینهسازی باتری» روشن شود؟"</string>
<string name="battery_low_description" msgid="3282977755476423966">"<xliff:g id="PERCENTAGE">%s</xliff:g> از باتریتان باقی مانده است. «بهینهسازی باتری» زمینه تیره را روشن میکند، فعالیتهای پسزمینه را محدود میکند، و اعلانها را بهتأخیر میاندازد."</string>
<string name="battery_low_intro" msgid="5148725009653088790">"«بهینهسازی باتری» زمینه «تیره» را روشن میکند، فعالیتهای پسزمینه را محدود میکند، و اعلانها را بهتأخیر میاندازد."</string>
@@ -448,9 +448,9 @@
<string name="volume_ringer_hint_vibrate" msgid="6211609047099337509">"لرزش"</string>
<string name="volume_dialog_title" msgid="6502703403483577940">"%s کنترلهای میزان صدا"</string>
<string name="volume_dialog_ringer_guidance_ring" msgid="9143194270463146858">"تماسها و اعلانها زنگ میخورند (<xliff:g id="VOLUME_LEVEL">%1$s</xliff:g>)"</string>
- <string name="system_ui_tuner" msgid="1471348823289954729">"تنظیمکننده میانای کاربری سیستم"</string>
+ <string name="system_ui_tuner" msgid="1471348823289954729">"تنظیمکننده واسط کاربری سیستم"</string>
<string name="status_bar" msgid="4357390266055077437">"نوار وضعیت"</string>
- <string name="demo_mode" msgid="263484519766901593">"حالت نمایشی میانای کاربر سیستم"</string>
+ <string name="demo_mode" msgid="263484519766901593">"حالت نمایشی واسط کاربری سیستم"</string>
<string name="enable_demo_mode" msgid="3180345364745966431">"فعال کردن حالت نمایشی"</string>
<string name="show_demo_mode" msgid="3677956462273059726">"نمایش حالت نمایشی"</string>
<string name="status_bar_ethernet" msgid="5690979758988647484">"اترنت"</string>
@@ -472,12 +472,12 @@
<string name="accessibility_status_bar_hotspot" msgid="2888479317489131669">"نقطه اتصال"</string>
<string name="accessibility_managed_profile" msgid="4703836746209377356">"نمایه کاری"</string>
<string name="tuner_warning_title" msgid="7721976098452135267">"برای بعضی افراد سرگرمکننده است اما نه برای همه"</string>
- <string name="tuner_warning" msgid="1861736288458481650">"«تنظیمکننده میانای کاربری سیستم» روشهای بیشتری برای تنظیم دقیق و سفارشی کردن واسط کاربری Android در اختیار شما قرار میدهد. ممکن است این ویژگیهای آزمایشی تغییر کنند، خراب شوند یا در نسخههای آینده جود نداشته باشند. با احتیاط ادامه دهید."</string>
+ <string name="tuner_warning" msgid="1861736288458481650">"«تنظیمکننده واسط کاربری سیستم» روشهای بیشتری برای تنظیم دقیق و سفارشی کردن واسط کاربری Android در اختیار شما قرار میدهد. ممکن است این ویژگیهای آزمایشی تغییر کنند، خراب شوند یا در نسخههای آینده جود نداشته باشند. با احتیاط ادامه دهید."</string>
<string name="tuner_persistent_warning" msgid="230466285569307806">"ممکن است این قابلیتهای آزمایشی تغییر کنند، خراب شوند یا در نسخههای آینده وجود نداشته باشد. بااحتیاط ادامه دهید."</string>
<string name="got_it" msgid="477119182261892069">"متوجه شدم"</string>
- <string name="tuner_toast" msgid="3812684836514766951">"تبریک میگوییم! «تنظیمکننده میانای کاربری سیستم» به «تنظیمات» اضافه شد"</string>
+ <string name="tuner_toast" msgid="3812684836514766951">"تبریک! «تنظیمکننده واسط کاربری سیستم» به «تنظیمات» اضافه شد"</string>
<string name="remove_from_settings" msgid="633775561782209994">"حذف از تنظیمات"</string>
- <string name="remove_from_settings_prompt" msgid="551565437265615426">"«تنظیمکننده میانای کاربری سیستم» از تنظیمات حذف شود و همه ویژگیهای آن متوقف شوند؟"</string>
+ <string name="remove_from_settings_prompt" msgid="551565437265615426">"«تنظیمکننده واسط کاربری سیستم» از «تنظیمات» حذف شود و استفاده از همه ویژگیهای آن متوقف شود؟"</string>
<string name="enable_bluetooth_title" msgid="866883307336662596">"بلوتوث روشن شود؟"</string>
<string name="enable_bluetooth_message" msgid="6740938333772779717">"برای مرتبط کردن صفحهکلید با رایانه لوحی، ابتدا باید بلوتوث را روشن کنید."</string>
<string name="enable_bluetooth_confirmation_ok" msgid="2866408183324184876">"روشن کردن"</string>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 75e4869..04c0c12 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritaire"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> ne prend pas en charge les fonctionnalités de conversation"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Ces notifications ne peuvent pas être modifiées"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Les notifications d\'appel ne peuvent pas être modifiées."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Ce groupe de notifications ne peut pas être configuré ici"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Notification par mandataire"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Toutes les notifications de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 8854de2..767266a 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -313,7 +313,7 @@
<string name="keyguard_unlock_press" msgid="9140109453735019209">"Appuyez sur l\'icône de déverrouillage pour ouvrir"</string>
<string name="keyguard_face_successful_unlock_press" msgid="25520941264602588">"Déverrouillé par visage. Appuyez sur icône déverrouillage pour ouvrir."</string>
<string name="keyguard_retry" msgid="886802522584053523">"Balayez l\'écran vers le haut pour réessayer"</string>
- <string name="require_unlock_for_nfc" msgid="1305686454823018831">"Déverrouillez l\'écran pour pouvoir utiliser NFC"</string>
+ <string name="require_unlock_for_nfc" msgid="1305686454823018831">"Déverrouillez l\'écran pour pouvoir utiliser la NFC"</string>
<string name="do_disclosure_generic" msgid="4896482821974707167">"Cet appareil appartient à votre organisation"</string>
<string name="do_disclosure_with_name" msgid="2091641464065004091">"Cet appareil appartient à <xliff:g id="ORGANIZATION_NAME">%s</xliff:g>"</string>
<string name="do_financed_disclosure_with_name" msgid="6723004643314467864">"Cet appareil est fourni par <xliff:g id="ORGANIZATION_NAME">%s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index 9981769..388c948 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"પ્રાધાન્યતા"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> વાતચીતની સુવિધાઓને સપોર્ટ આપતી નથી"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"આ નોટિફિકેશનમાં કોઈ ફેરફાર થઈ શકશે નહીં."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"કૉલના નોટિફિકેશનમાં કોઈ ફેરફાર કરી શકાતો નથી."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"નોટિફિકેશનના આ ગ્રૂપની ગોઠવણી અહીં કરી શકાશે નહીં"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"પ્રૉક્સી નોટિફિકેશન"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"<xliff:g id="APP_NAME">%1$s</xliff:g>ના બધા નોટિફિકેશન"</string>
@@ -807,8 +806,7 @@
<string name="controls_media_button_pause" msgid="8614887780950376258">"થોભાવો"</string>
<string name="controls_media_button_prev" msgid="8126822360056482970">"પહેલાનો ટ્રૅક"</string>
<string name="controls_media_button_next" msgid="6662636627525947610">"આગલો ટ્રૅક"</string>
- <!-- no translation found for controls_media_button_connecting (3138354625847598095) -->
- <skip />
+ <string name="controls_media_button_connecting" msgid="3138354625847598095">"કનેક્ટ કરી રહ્યાં છીએ"</string>
<string name="controls_media_smartspace_rec_title" msgid="1699818353932537407">"ચલાવો"</string>
<string name="controls_media_smartspace_rec_description" msgid="4136242327044070732">"<xliff:g id="APP_LABEL">%1$s</xliff:g> ખોલો"</string>
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> પર <xliff:g id="ARTIST_NAME">%2$s</xliff:g>નું <xliff:g id="SONG_NAME">%1$s</xliff:g> ગીત ચલાવો"</string>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 416e0c4..455a586 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -333,7 +333,7 @@
<string name="keyguard_indication_charging_time_slowly" msgid="301936949731705417">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • धीरे चार्ज हो रहा है • <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g> में पूरा चार्ज हो जाएगा"</string>
<string name="keyguard_indication_charging_time_dock" msgid="6150404291427377863">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • डॉक पर चार्ज हो रहा है • <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g> में पूरा चार्ज हो जाएगा"</string>
<string name="accessibility_multi_user_switch_switcher" msgid="5330448341251092660">"उपयोगकर्ता बदलें"</string>
- <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"इस सत्र के सभी ऐप्लिकेशन और डेटा को हटा दिया जाएगा."</string>
+ <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"इस सेशन के सभी ऐप्लिकेशन और डेटा को हटा दिया जाएगा."</string>
<string name="guest_wipe_session_title" msgid="7147965814683990944">"मेहमान, आपका फिर से स्वागत है!"</string>
<string name="guest_wipe_session_message" msgid="3393823610257065457">"क्या आप अपना सत्र जारी रखना चाहते हैं?"</string>
<string name="guest_wipe_session_wipe" msgid="8056836584445473309">"फिर से शुरू करें"</string>
@@ -413,7 +413,7 @@
<string name="screen_pinning_title" msgid="9058007390337841305">"ऐप्लिकेशन पिन किया गया है"</string>
<string name="screen_pinning_description" msgid="8699395373875667743">"इससे वह तब तक दिखता रहता है, जब तक कि आप उसे अनपिन नहीं कर देते. अनपिन करने के लिए, \'वापस जाएं\' और \'खास जानकारी\' को दबाकर रखें."</string>
<string name="screen_pinning_description_recents_invisible" msgid="4564466648700390037">"इससे वह तब तक दिखाई देती है जब तक आप उसे अनपिन नहीं कर देते. अनपिन करने के लिए, होम और वापस जाएं वाले बटन को दबाकर रखें."</string>
- <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"इससे ऐप्लिकेशन की स्क्रीन तब तक दिखाई देती है, जब तक आप उसे अनपिन नहीं करते. अनपिन करने के लिए ऊपर स्वाइप करें और स्क्रीन दबाकर रखें."</string>
+ <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"इससे ऐप्लिकेशन की स्क्रीन तब तक दिखती है, जब तक उसे अनपिन नहीं किया जाता. अनपिन करने के लिए ऊपर स्वाइप करें और स्क्रीन दबाकर रखें."</string>
<string name="screen_pinning_description_accessible" msgid="7386449191953535332">"इससे वह तब तक दिखता रहता है जब तक कि आप उसे अनपिन नहीं कर देते. अनपिन करने के लिए, \'खास जानकारी\' को दबाकर रखें."</string>
<string name="screen_pinning_description_recents_invisible_accessible" msgid="2857071808674481986">"इससे वह तब तक दिखाई देती है जब तक आप उसे अनपिन नहीं कर देते. अनपिन करने के लिए, होम बटन को दबाकर रखें."</string>
<string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"निजी डेटा ऐक्सेस किया जा सकता है, जैसे कि संपर्क और ईमेल का कॉन्टेंट."</string>
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"प्राथमिकता"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> पर बातचीत की सुविधाएं काम नहीं करतीं"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"ये सूचनाएं नहीं बदली जा सकती हैं."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"कॉल से जुड़ी सूचनाओं को ब्लॉक नहीं किया जा सकता."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"सूचनाओं के इस समूह को यहां कॉन्फ़िगर नहीं किया जा सकता"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"प्रॉक्सी सूचना"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"सभी <xliff:g id="APP_NAME">%1$s</xliff:g> सूचनाएं"</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 66613d4..26642c9 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -335,7 +335,7 @@
<string name="keyguard_indication_charging_time_slowly" msgid="301936949731705417">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • sporo punjenje • <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g> do napunjenosti"</string>
<string name="keyguard_indication_charging_time_dock" msgid="6150404291427377863">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Priključna stanica za punjenje • <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g> do napunjenosti"</string>
<string name="accessibility_multi_user_switch_switcher" msgid="5330448341251092660">"Promjena korisnika"</string>
- <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Sve aplikacije i podaci u ovoj sesiji bit će izbrisani."</string>
+ <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Izbrisat će se sve aplikacije i podaci u ovoj sesiji."</string>
<string name="guest_wipe_session_title" msgid="7147965814683990944">"Dobro došli natrag, gostu!"</string>
<string name="guest_wipe_session_message" msgid="3393823610257065457">"Želite li nastaviti sesiju?"</string>
<string name="guest_wipe_session_wipe" msgid="8056836584445473309">"Počni ispočetka"</string>
@@ -571,7 +571,7 @@
<string name="notif_inline_reply_remove_attachment_description" msgid="7954075334095405429">"Ukloni privitak"</string>
<string name="keyboard_shortcut_group_system" msgid="1583416273777875970">"Sustav"</string>
<string name="keyboard_shortcut_group_system_home" msgid="7465138628692109907">"Početni zaslon"</string>
- <string name="keyboard_shortcut_group_system_recents" msgid="8628108256824616927">"Najnovije"</string>
+ <string name="keyboard_shortcut_group_system_recents" msgid="8628108256824616927">"Nedavno"</string>
<string name="keyboard_shortcut_group_system_back" msgid="1055709713218453863">"Natrag"</string>
<string name="keyboard_shortcut_group_system_notifications" msgid="3615971650562485878">"Obavijesti"</string>
<string name="keyboard_shortcut_group_system_shortcuts_helper" msgid="4856808328618265589">"Tipkovni prečaci"</string>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index e21f8e0..9d82697 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -333,7 +333,7 @@
<string name="keyguard_indication_charging_time_slowly" msgid="301936949731705417">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Դանդաղ լիցքավորում • Մնացել է <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g>"</string>
<string name="keyguard_indication_charging_time_dock" msgid="6150404291427377863">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Լիցքավորում դոկ-կայանի միջոցով • Մնացել է <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g>"</string>
<string name="accessibility_multi_user_switch_switcher" msgid="5330448341251092660">"Անջատել օգտվողին"</string>
- <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Այս աշխատաշրջանի բոլոր ծրագրերն ու տվյալները կջնջվեն:"</string>
+ <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Այս աշխատաշրջանի բոլոր հավելվածներն ու տվյալները կջնջվեն:"</string>
<string name="guest_wipe_session_title" msgid="7147965814683990944">"Բարի վերադարձ, հյուր"</string>
<string name="guest_wipe_session_message" msgid="3393823610257065457">"Շարունակե՞լ աշխատաշրջանը։"</string>
<string name="guest_wipe_session_wipe" msgid="8056836584445473309">"Վերսկսել"</string>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 3a15692..2c00a7a 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -263,7 +263,7 @@
<string name="quick_settings_cellular_detail_over_limit" msgid="4561921367680636235">"Melebihi batas"</string>
<string name="quick_settings_cellular_detail_data_used" msgid="6798849610647988987">"<xliff:g id="DATA_USED">%s</xliff:g> digunakan"</string>
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Batas <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
- <string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Peringatan <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
+ <string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Peringatan <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplikasi kerja"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Cahaya Malam"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Aktif saat malam"</string>
@@ -333,7 +333,7 @@
<string name="keyguard_indication_charging_time_slowly" msgid="301936949731705417">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Mengisi daya dengan lambat • Penuh dalam waktu <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g>"</string>
<string name="keyguard_indication_charging_time_dock" msgid="6150404291427377863">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Mengisi Daya dengan Dok • Penuh dalam waktu <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g>"</string>
<string name="accessibility_multi_user_switch_switcher" msgid="5330448341251092660">"Beralih pengguna"</string>
- <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Semua aplikasi dan data di sesi ini akan dihapus."</string>
+ <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Semua aplikasi dan data dalam sesi ini akan dihapus."</string>
<string name="guest_wipe_session_title" msgid="7147965814683990944">"Selamat datang kembali, tamu!"</string>
<string name="guest_wipe_session_message" msgid="3393823610257065457">"Lanjutkan sesi Anda?"</string>
<string name="guest_wipe_session_wipe" msgid="8056836584445473309">"Mulai ulang"</string>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 55c854b..25a52f7 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -417,7 +417,7 @@
<string name="screen_pinning_description_accessible" msgid="7386449191953535332">"La schermata rimane visibile finché non viene sganciata. Per sganciarla, tieni premuto Panoramica."</string>
<string name="screen_pinning_description_recents_invisible_accessible" msgid="2857071808674481986">"La schermata rimane visibile finché non viene disattivato il blocco su schermo. Per disattivarlo, tocca e tieni premuto Home."</string>
<string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"I dati personali potrebbero essere accessibili (ad esempio i contatti e i contenuti delle email)."</string>
- <string name="screen_pinning_can_open_other_apps" msgid="7529756813231421455">"L\'app bloccata su schermo potrebbe aprire altre app."</string>
+ <string name="screen_pinning_can_open_other_apps" msgid="7529756813231421455">"L\'app bloccata sullo schermo potrebbe aprire altre app."</string>
<string name="screen_pinning_toast" msgid="8177286912533744328">"Per sbloccare questa app, tocca e tieni premuti i pulsanti Indietro e Panoramica"</string>
<string name="screen_pinning_toast_recents_invisible" msgid="6850978077443052594">"Per sbloccare questa app, tocca e tieni premuti i pulsanti Indietro e Home"</string>
<string name="screen_pinning_toast_gesture_nav" msgid="170699893395336705">"Per sbloccare questa app, scorri verso l\'alto e tieni premuto"</string>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index 6cbc0a5..eab4375 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -512,8 +512,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"בעדיפות גבוהה"</string>
<string name="no_shortcut" msgid="8257177117568230126">"האפליקציה <xliff:g id="APP_NAME">%1$s</xliff:g> לא תומכת בתכונות השיחה"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"לא ניתן לשנות את ההתראות האלה."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"לא ניתן לשנות את התראות השיחה."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"לא ניתן להגדיר כאן את קבוצת ההתראות הזו"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"התראה דרך שרת proxy"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"כל ההתראות של <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 4b7e130..33f8185 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"優先"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g>は会話機能に対応していません"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"これらの通知は変更できません。"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"着信通知は変更できません。"</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"このグループの通知はここでは設定できません"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"代理通知"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"<xliff:g id="APP_NAME">%1$s</xliff:g> のすべての通知"</string>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index 6b233c8..3e1d96d 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Маңызды"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> әңгіме функцияларын қолдамайды."</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Бұл хабарландыруларды өзгерту мүмкін емес."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Қоңырау туралы хабарландыруларды өзгерту мүмкін емес."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Мұндай хабарландырулар бұл жерде конфигурацияланбайды."</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Прокси-сервер арқылы жіберілген хабарландыру"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Барлық <xliff:g id="APP_NAME">%1$s</xliff:g> хабарландырулары"</string>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index 7dcf066..8a2e838 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"អាទិភាព"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> មិនអាចប្រើមុខងារសន្ទនាបានទេ"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"មិនអាចកែប្រែការជូនដំណឹងទាំងនេះបានទេ។"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"មិនអាចកែប្រែការជូនដំណឹងអំពីការហៅទូរសព្ទបានទេ។"</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"មិនអាចកំណត់រចនាសម្ព័ន្ធក្រុមការជូនដំណឹងនេះនៅទីនេះបានទេ"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"ការជូនដំណឹងជាប្រូកស៊ី"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"ការជូនដំណឹងទាំងអស់ពី<xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index f6a38b8..172a087 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"ಆದ್ಯತೆ"</string>
<string name="no_shortcut" msgid="8257177117568230126">"ಸಂವಾದ ಫೀಚರ್ಗಳನ್ನು <xliff:g id="APP_NAME">%1$s</xliff:g> ಬೆಂಬಲಿಸುವುದಿಲ್ಲ"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"ಈ ಅಧಿಸೂಚನೆಗಳನ್ನು ಮಾರ್ಪಡಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"ಕರೆ ಅಧಿಸೂಚನೆಗಳನ್ನು ಮಾರ್ಪಡಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"ಈ ಗುಂಪಿನ ಅಧಿಸೂಚನೆಗಳನ್ನು ಇಲ್ಲಿ ಕಾನ್ಫಿಗರ್ ಮಾಡಲಾಗಿರುವುದಿಲ್ಲ"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"ಪ್ರಾಕ್ಸಿ ಮಾಡಿದ ಅಧಿಸೂಚನೆಗಳು"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"<xliff:g id="APP_NAME">%1$s</xliff:g> ನ ಎಲ್ಲಾ ಅಧಿಸೂಚನೆಗಳು"</string>
@@ -911,7 +910,7 @@
<string name="qs_tile_request_dialog_text" msgid="3501359944139877694">"<xliff:g id="APPNAME">%1$s</xliff:g> ಈ ಕೆಳಗಿನ ಟೈಲ್ ಅನ್ನು ತ್ವರಿತ ಸೆಟ್ಟಿಂಗ್ಗಳಿಗೆ ಸೇರಿಸಲು ಬಯಸುತ್ತದೆ"</string>
<string name="qs_tile_request_dialog_add" msgid="4888460910694986304">"ಟೈಲ್ ಅನ್ನು ಸೇರಿಸಿ"</string>
<string name="qs_tile_request_dialog_not_add" msgid="4168716573114067296">"ಟೈಲ್ ಅನ್ನು ಸೇರಿಸಬೇಡಿ"</string>
- <string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ಬಳಕೆದಾರ ಆಯ್ಕೆಮಾಡಿ"</string>
+ <string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ಬಳಕೆದಾರರನ್ನು ಆಯ್ಕೆಮಾಡಿ"</string>
<!-- no translation found for fgs_manager_footer_label (790443735462280164) -->
<string name="fgs_dot_content_description" msgid="2865071539464777240">"ಹೊಸ ಮಾಹಿತಿ"</string>
<string name="fgs_manager_dialog_title" msgid="5879184257257718677">"ಸಕ್ರಿಯ ಆ್ಯಪ್ಗಳು"</string>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 1f4f913..0bb3df3 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"우선순위"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> 앱은 대화 기능을 지원하지 않습니다."</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"이 알림은 수정할 수 없습니다."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"전화 알림은 수정할 수 없습니다."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"이 알림 그룹은 여기에서 설정할 수 없습니다."</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"프록시를 통한 알림"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"모든 <xliff:g id="APP_NAME">%1$s</xliff:g> 알림"</string>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 9314c9d..4cd8e7e 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -459,7 +459,7 @@
<string name="wallet_empty_state_label" msgid="7776761245237530394">"Телефонуңуз менен тез жана коопсуз сатып алуу үчүн жөндөңүз"</string>
<string name="wallet_app_button_label" msgid="7123784239111190992">"Баарын көрсөтүү"</string>
<string name="wallet_secondary_label_no_card" msgid="530725155985223497">"Картаны кошуу"</string>
- <string name="wallet_secondary_label_updating" msgid="5726130686114928551">"Жаңыртылууда"</string>
+ <string name="wallet_secondary_label_updating" msgid="5726130686114928551">"Жаңырууда"</string>
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Колдонуу үчүн кулпусун ачыңыз"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Кыйытмаларды алууда ката кетти. Бир аздан кийин кайталап көрүңүз."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Кулпуланган экран жөндөөлөрү"</string>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 6a7898a..dc13aae 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -512,8 +512,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritetiniai"</string>
<string name="no_shortcut" msgid="8257177117568230126">"Programa „<xliff:g id="APP_NAME">%1$s</xliff:g>“ nepalaiko pokalbių funkcijų"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Šių pranešimų keisti negalima."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Skambučių pranešimų keisti negalima."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Šios grupės pranešimai čia nekonfigūruojami"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Per tarpinį serverį gautas pranešimas"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Visi „<xliff:g id="APP_NAME">%1$s</xliff:g>“ pranešimai"</string>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index b53e763..f798de3 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -509,8 +509,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Prioritārs"</string>
<string name="no_shortcut" msgid="8257177117568230126">"Lietotnē <xliff:g id="APP_NAME">%1$s</xliff:g> netiek atbalstītas sarunu funkcijas."</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Šos paziņojumus nevar modificēt."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Paziņojumus par zvaniem nevar modificēt."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Šeit nevar konfigurēt šo paziņojumu grupu."</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Starpniekservera paziņojums"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Visi lietotnes <xliff:g id="APP_NAME">%1$s</xliff:g> paziņojumi"</string>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index 2dee0e0..2fe911a 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Приоритетно"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> не поддржува функции за разговор"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Овие известувања не може да се изменат"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Известувањата за повици не може да се изменат."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Оваа група известувања не може да се конфигурира тука"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Известување преку прокси"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Сите известувања од <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index e32e305..160e6d0 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -911,11 +911,13 @@
<string name="qs_tile_request_dialog_add" msgid="4888460910694986304">"ടൈൽ ചേർക്കുക"</string>
<string name="qs_tile_request_dialog_not_add" msgid="4168716573114067296">"ടൈൽ ചേർക്കരുത്"</string>
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ഉപയോക്താവിനെ തിരഞ്ഞെടുക്കൂ"</string>
- <!-- no translation found for fgs_manager_footer_label (790443735462280164) -->
+ <plurals name="fgs_manager_footer_label" formatted="false" msgid="790443735462280164">
+ <item quantity="other"><xliff:g id="COUNT_1">%s</xliff:g> ആപ്പുകൾ സജീവമാണ്</item>
+ <item quantity="one"><xliff:g id="COUNT_0">%s</xliff:g> ആപ്പ് സജീവമാണ്</item>
+ </plurals>
<string name="fgs_dot_content_description" msgid="2865071539464777240">"പുതിയ വിവരങ്ങൾ"</string>
<string name="fgs_manager_dialog_title" msgid="5879184257257718677">"സജീവമായ ആപ്പുകൾ"</string>
- <!-- no translation found for fgs_manager_dialog_message (6839542063522121108) -->
- <skip />
+ <string name="fgs_manager_dialog_message" msgid="6839542063522121108">"നിങ്ങൾ ഈ ആപ്പുകൾ ഉപയോഗിക്കുന്നില്ലെങ്കിൽ പോലും അവ ഇപ്പോഴും സജീവമാണ്, ഇത് ബാറ്ററി ലൈഫിനെ ബാധിച്ചേക്കാം"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"നിർത്തുക"</string>
<string name="fgs_manager_app_item_stop_button_stopped_label" msgid="6950382004441263922">"നിർത്തി"</string>
<string name="clipboard_edit_text_done" msgid="4551887727694022409">"പൂർത്തിയായി"</string>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index 4add96d..2540116 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"प्राधान्य"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> हे संभाषण वैशिष्ट्यांना सपोर्ट करत नाही"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"या सूचनांमध्ये सुधारणा केली जाऊ शकत नाही."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"कॉलशी संबंधित सूचनांमध्ये फेरबदल केला जाऊ शकत नाही."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"या सूचनांचा संच येथे कॉंफिगर केला जाऊ शकत नाही"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"प्रॉक्सी केलेल्या सूचना"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"सर्व <xliff:g id="APP_NAME">%1$s</xliff:g> वरील सूचना"</string>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index c946ca5..8008a71 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -333,7 +333,7 @@
<string name="keyguard_indication_charging_time_slowly" msgid="301936949731705417">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Lader sakte • Fulladet om <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g>"</string>
<string name="keyguard_indication_charging_time_dock" msgid="6150404291427377863">"<xliff:g id="PERCENTAGE">%2$s</xliff:g> • Ladedokk • Fulladet om <xliff:g id="CHARGING_TIME_LEFT">%1$s</xliff:g>"</string>
<string name="accessibility_multi_user_switch_switcher" msgid="5330448341251092660">"Bytt bruker"</string>
- <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Alle appene og all informasjon i denne økten slettes."</string>
+ <string name="guest_exit_guest_dialog_message" msgid="8183450985628495709">"Alle apper og data i denne økten blir slettet."</string>
<string name="guest_wipe_session_title" msgid="7147965814683990944">"Velkommen tilbake, gjest!"</string>
<string name="guest_wipe_session_message" msgid="3393823610257065457">"Vil du fortsette økten?"</string>
<string name="guest_wipe_session_wipe" msgid="8056836584445473309">"Start på nytt"</string>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index d285c76..bf23642 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -423,7 +423,7 @@
<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_start" msgid="7483998671383371313">"एप पिन गरियो"</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>
<string name="stream_system" msgid="7663148785370565134">"प्रणाली"</string>
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"प्राथमिकता"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> मा वार्तालापसम्बन्धी सुविधा प्रयोग गर्न मिल्दैन"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"यी सूचनाहरू परिमार्जन गर्न मिल्दैन।"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"कलसम्बन्धी सूचनाहरू परिमार्जन गर्न मिल्दैन।"</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"यहाँबाट सूचनाहरूको यो समूह कन्फिगर गर्न सकिँदैन"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"प्रोक्सीमार्फत आउने सूचना"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"<xliff:g id="APP_NAME">%1$s</xliff:g> सम्बन्धी सबै सूचनाहरू"</string>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index 61be843..181f277 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"ପ୍ରାଥମିକତା"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> ବାର୍ତ୍ତାଳାପ ଫିଚରଗୁଡ଼ିକୁ ସମର୍ଥନ କରେ ନାହିଁ"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"ଏହି ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକ ପରିବର୍ତ୍ତନ କରିହେବ ନାହିଁ।"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"କଲ ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକୁ ପରିବର୍ତ୍ତନ କରାଯାଇପାରିବ ନାହିଁ।"</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"ଏଠାରେ ଏହି ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକର ଗ୍ରୁପ୍ କନଫ୍ୟୁଗର୍ କରାଯାଇପାରିବ ନାହିଁ"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"ବିଜ୍ଞପ୍ତି ପ୍ରକ୍ସୀ ହୋଇଛି"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"ସମସ୍ତ <xliff:g id="APP_NAME">%1$s</xliff:g>ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକ"</string>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index e03dbf3..ce5d176 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"ਤਰਜੀਹ"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> ਐਪ ਗੱਲਬਾਤ ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਕਰਦੀ"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"ਇਹਨਾਂ ਸੂਚਨਾਵਾਂ ਨੂੰ ਸੋਧਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ।"</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"ਕਾਲ ਸੰਬੰਧੀ ਸੂਚਨਾਵਾਂ ਨੂੰ ਸੋਧਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ।"</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"ਇਹ ਸੂਚਨਾਵਾਂ ਦਾ ਗਰੁੱਪ ਇੱਥੇ ਸੰਰੂਪਿਤ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"ਇੱਕ ਐਪ ਦੀ ਥਾਂ \'ਤੇ ਦੂਜੀ ਐਪ ਰਾਹੀਂ ਦਿੱਤੀ ਗਈ ਸੂਚਨਾ"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"ਸਾਰੀਆਂ <xliff:g id="APP_NAME">%1$s</xliff:g> ਸੂਚਨਾਵਾਂ"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 0ebbb49..917c139 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -422,7 +422,7 @@
<string name="screen_pinning_description_gestural" msgid="7246323931831232068">"Ekran będzie widoczny, dopóki go nie odepniesz. Przesuń palcem w górę i przytrzymaj, by odpiąć."</string>
<string name="screen_pinning_description_accessible" msgid="7386449191953535332">"Ekran będzie widoczny, dopóki go nie odepniesz. Aby to zrobić, kliknij i przytrzymaj Przegląd."</string>
<string name="screen_pinning_description_recents_invisible_accessible" msgid="2857071808674481986">"Ekran będzie widoczny, dopóki go nie odepniesz. Aby to zrobić, naciśnij i przytrzymaj Ekran główny."</string>
- <string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"Dostępne mogą być dane osobiste (np. kontakty czy treść e-maili)."</string>
+ <string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"Dostępne mogą być dane prywatne (np. kontakty czy treść e-maili)."</string>
<string name="screen_pinning_can_open_other_apps" msgid="7529756813231421455">"Przypięta aplikacja może otwierać inne aplikacje."</string>
<string name="screen_pinning_toast" msgid="8177286912533744328">"Aby odpiąć tę aplikację, naciśnij i przytrzymaj przyciski Wstecz oraz Przegląd"</string>
<string name="screen_pinning_toast_recents_invisible" msgid="6850978077443052594">"Aby odpiąć tę aplikację, naciśnij i przytrzymaj przyciski Wstecz oraz Ekran główny"</string>
@@ -512,8 +512,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Priorytetowe"</string>
<string name="no_shortcut" msgid="8257177117568230126">"Aplikacja <xliff:g id="APP_NAME">%1$s</xliff:g> nie obsługuje funkcji rozmów"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Tych powiadomień nie można zmodyfikować."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Powiadomień o połączeniach nie można modyfikować."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Tej grupy powiadomień nie można tu skonfigurować"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Powiadomienie w zastępstwie"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Wszystkie powiadomienia z aplikacji <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index f9c4bee..ab09c29 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Prioridade"</string>
<string name="no_shortcut" msgid="8257177117568230126">"A app <xliff:g id="APP_NAME">%1$s</xliff:g> não suporta funcionalidades de conversa."</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Não é possível modificar estas notificações."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Não é possível modificar as notificações de chamadas."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Não é possível configurar este grupo de notificações aqui."</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Notificação de app proxy"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Todas as notificações da app <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
@@ -894,7 +893,7 @@
<string name="mobile_data_settings_title" msgid="3955246641380064901">"Dados móveis"</string>
<string name="preference_summary_default_combination" msgid="8453246369903749670">"<xliff:g id="STATE">%1$s</xliff:g>/<xliff:g id="NETWORKMODE">%2$s</xliff:g>"</string>
<string name="mobile_data_connection_active" msgid="944490013299018227">"Ligado"</string>
- <string name="mobile_data_off_summary" msgid="3663995422004150567">"Não é efetuada ligação de dados móveis automática"</string>
+ <string name="mobile_data_off_summary" msgid="3663995422004150567">"Sem ligação automática com dados móveis"</string>
<string name="mobile_data_no_connection" msgid="1713872434869947377">"Sem ligação"</string>
<string name="non_carrier_network_unavailable" msgid="770049357024492372">"Nenhuma outra rede disponível"</string>
<string name="all_network_unavailable" msgid="4112774339909373349">"Sem redes disponíveis"</string>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 2d46829..67dfa0a 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -419,7 +419,7 @@
<string name="screen_pinning_title" msgid="9058007390337841305">"Aplikácia je pripnutá"</string>
<string name="screen_pinning_description" msgid="8699395373875667743">"Obsah bude pripnutý v zobrazení, dokým ho neuvoľníte. Uvoľníte ho stlačením a podržaním tlačidiel Späť a Prehľad."</string>
<string name="screen_pinning_description_recents_invisible" msgid="4564466648700390037">"Obsah bude pripnutý v zobrazení, dokým ho neuvoľníte. Uvoľníte ho pridržaním tlačidiel Späť a Domov."</string>
- <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"Táto možnosť ponechá položku v zobrazení, dokým ju neodopnete. Odpojíte ju potiahnutím nahor a pridržaním."</string>
+ <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"Táto možnosť ponechá položku v zobrazení, dokým ju neodopnete potiahnutím nahor a pridržaním."</string>
<string name="screen_pinning_description_accessible" msgid="7386449191953535332">"Obsah bude pripnutý v zobrazení, dokým ho neuvoľníte. Uvoľníte ho stlačením a podržaním tlačidla Prehľad."</string>
<string name="screen_pinning_description_recents_invisible_accessible" msgid="2857071808674481986">"Obsah bude pripnutý v zobrazení, dokým ho neuvoľníte. Uvoľníte ho pridržaním tlačidla Domov."</string>
<string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"Môže mať prístup k osobným údajom (napríklad kontaktom a obsahu správ)."</string>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index d66bc41..aad048c 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"முன்னுரிமை"</string>
<string name="no_shortcut" msgid="8257177117568230126">"உரையாடல் அம்சங்களை <xliff:g id="APP_NAME">%1$s</xliff:g> ஆதரிக்காது"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"இந்த அறிவிப்புகளை மாற்ற இயலாது."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"அழைப்பு அறிவிப்புகளை மாற்ற முடியாது."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"இந்த அறிவுப்புக் குழுக்களை இங்கே உள்ளமைக்க இயலாது"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"ப்ராக்ஸியான அறிவிப்பு"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"அனைத்து <xliff:g id="APP_NAME">%1$s</xliff:g> அறிவிப்புகளும்"</string>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index 8712825..32ff40a 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"ప్రాధాన్యత"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> సంభాషణ ఫీచర్లను సపోర్ట్ చేయదు"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"ఈ నోటిఫికేషన్లను సవరించడం వీలుపడదు."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"కాల్ నోటిఫికేషన్లను ఎడిట్ చేయడం సాధ్యం కాదు."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"ఈ నోటిఫికేషన్ల సమూహాన్ని ఇక్కడ కాన్ఫిగర్ చేయలేము"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"ప్రాక్సీ చేయబడిన నోటిఫికేషన్"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"అన్ని <xliff:g id="APP_NAME">%1$s</xliff:g> నోటిఫికేషన్లు"</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index b7415fd..2486af6 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -410,14 +410,14 @@
<string name="volume_odi_captions_content_description" msgid="4172765742046013630">"Altyazı yer paylaşımı"</string>
<string name="volume_odi_captions_hint_enable" msgid="2073091194012843195">"etkinleştir"</string>
<string name="volume_odi_captions_hint_disable" msgid="2518846326748183407">"devre dışı bırak"</string>
- <string name="screen_pinning_title" msgid="9058007390337841305">"Uygulama sabitlenmiştir"</string>
+ <string name="screen_pinning_title" msgid="9058007390337841305">"Uygulama sabitlendi"</string>
<string name="screen_pinning_description" msgid="8699395373875667743">"Bu işlem, siz sabitlemeyi kaldırana kadar ekranı görünür durumda tutar. Sabitlemeyi kaldırmak için Geri\'ye ve Genel Bakış\'a dokunup basılı tutun."</string>
<string name="screen_pinning_description_recents_invisible" msgid="4564466648700390037">"Bu işlem, siz sabitlemeyi kaldırana kadar ekranı görünür durumda tutar. Sabitlemeyi kaldırmak için Geri\'ye ve Ana sayfaya dokunup basılı tutun."</string>
<string name="screen_pinning_description_gestural" msgid="7246323931831232068">"Bu, sabitleme kaldırılana kadar öğenin görünmesini sağlar. Sabitlemeyi kaldırmak için yukarı kaydırıp basılı tutun."</string>
<string name="screen_pinning_description_accessible" msgid="7386449191953535332">"Bu işlem, siz sabitlemeyi kaldırana kadar ekranı görünür durumda tutar. Sabitlemeyi kaldırmak için Genel bakış\'a dokunup basılı tutun."</string>
<string name="screen_pinning_description_recents_invisible_accessible" msgid="2857071808674481986">"Bu işlem, siz sabitlemeyi kaldırana kadar ekranı görünür durumda tutar. Sabitlemeyi kaldırmak için Ana sayfaya dokunup basılı tutun."</string>
<string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"Kişisel verilere erişilebilir (ör. kişiler ve e-posta içerikleri)."</string>
- <string name="screen_pinning_can_open_other_apps" msgid="7529756813231421455">"Sabitlenmiş uygulama diğer uygulamaları açabilir."</string>
+ <string name="screen_pinning_can_open_other_apps" msgid="7529756813231421455">"Sabitlenen uygulama diğer uygulamaları açabilir."</string>
<string name="screen_pinning_toast" msgid="8177286912533744328">"Bu uygulamanın sabitlemesini kaldırmak için Geri ve Genel Bakış düğmelerine dokunup basılı tutun"</string>
<string name="screen_pinning_toast_recents_invisible" msgid="6850978077443052594">"Bu uygulamanın sabitlemesini kaldırmak için Geri ve Ana sayfa düğmelerine dokunup basılı tutun"</string>
<string name="screen_pinning_toast_gesture_nav" msgid="170699893395336705">"Bu uygulamanın sabitlemesini kaldırmak için yukarı kaydırıp tutun"</string>
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Öncelikli"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g>, sohbet özelliklerini desteklemiyor"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Bu bildirimler değiştirilemez."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Arama bildirimleri değiştirilemez."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Bu bildirim grubu burada yapılandırılamaz"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Proxy uygulanan bildirim"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Tüm <xliff:g id="APP_NAME">%1$s</xliff:g> bildirimleri"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 7a24191..a85fa9c 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -512,8 +512,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Пріоритет"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> не підтримує функції розмов"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Ці сповіщення не можна змінити."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Сповіщення про виклик не можна змінити."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Цю групу сповіщень не можна налаштувати тут"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Проксі-сповіщення"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Усі сповіщення від додатка <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index a2831e0..6662e84 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Muhim"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> ilovasida suhbat funksiyalari ishlamaydi"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Bu bildirishnomalarni tahrirlash imkonsiz."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Chaqiruv bildirishnomalarini tahrirlash imkonsiz."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Ushbu bildirishnomalar guruhi bu yerda sozlanmaydi"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Ishonchli bildirishnoma"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Barcha <xliff:g id="APP_NAME">%1$s</xliff:g> bildirishnomalari"</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index ef782a2..377e72e 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Mức độ ưu tiên"</string>
<string name="no_shortcut" msgid="8257177117568230126">"<xliff:g id="APP_NAME">%1$s</xliff:g> không hỗ trợ các tính năng trò chuyện"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Không thể sửa đổi các thông báo này."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Không thể sửa đổi các thông báo cuộc gọi."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Không thể định cấu hình nhóm thông báo này tại đây"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Thông báo đã xử lý qua máy chủ proxy"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Tất cả thông báo của <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 297715d..69d7046 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -413,7 +413,7 @@
<string name="screen_pinning_title" msgid="9058007390337841305">"應用程式已固定"</string>
<string name="screen_pinning_description" msgid="8699395373875667743">"這會讓目前的螢幕畫面保持顯示狀態,直到取消固定為止。按住 [返回] 按鈕和 [總覽] 按鈕即可取消固定。"</string>
<string name="screen_pinning_description_recents_invisible" msgid="4564466648700390037">"這會讓應用程式顯示在螢幕上,直到取消固定為止。按住 [返回] 按鈕和主畫面按鈕即可取消固定。"</string>
- <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"這會讓目前的螢幕畫面保持顯示,直到取消固定為止。向上滑動並按住即可取消固定。"</string>
+ <string name="screen_pinning_description_gestural" msgid="7246323931831232068">"這會讓應用程式一直顯示在螢幕畫面上,直到你取消固定為止。向上滑動並按住即可取消固定。"</string>
<string name="screen_pinning_description_accessible" msgid="7386449191953535332">"這會讓目前的螢幕畫面保持顯示狀態,直到取消固定為止。按住 [總覽] 按鈕即可取消固定。"</string>
<string name="screen_pinning_description_recents_invisible_accessible" msgid="2857071808674481986">"這會讓應用程式顯示在螢幕上,直到取消固定為止。按住主畫面按鈕即可取消固定。"</string>
<string name="screen_pinning_exposes_personal_data" msgid="8189852022981524789">"該應用程式或許可存取個人資料 (例如聯絡人和電子郵件內容)。"</string>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index d932406..1cc53b1 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -410,7 +410,7 @@
<string name="volume_odi_captions_content_description" msgid="4172765742046013630">"Imbondela yamagama-ncazo"</string>
<string name="volume_odi_captions_hint_enable" msgid="2073091194012843195">"nika amandla"</string>
<string name="volume_odi_captions_hint_disable" msgid="2518846326748183407">"khubaza"</string>
- <string name="screen_pinning_title" msgid="9058007390337841305">"Uhlelo lokusebenza luphiniwe"</string>
+ <string name="screen_pinning_title" msgid="9058007390337841305">"I-app iphiniwe"</string>
<string name="screen_pinning_description" msgid="8699395373875667743">"Lokhu kuyigcina ibukeka uze ususe ukuphina. Thinta uphinde ubambe okuthi Emuva Nokubuka konke ukuze ususe ukuphina."</string>
<string name="screen_pinning_description_recents_invisible" msgid="4564466648700390037">"Lokhu kuyigcina ibonakala uze uyisuse. Thinta uphinde ubambe okuthi Emuva nokuthi Ekhaya ukuze ususe ukuphina."</string>
<string name="screen_pinning_description_gestural" msgid="7246323931831232068">"Lokhu kuyigcina ibonakala uze ususe ukuphina. Swayiphela phezulu uphinde ubambe ukuze ususe ukuphina."</string>
@@ -506,8 +506,7 @@
<string name="notification_priority_title" msgid="2079708866333537093">"Okubalulekile"</string>
<string name="no_shortcut" msgid="8257177117568230126">"I-<xliff:g id="APP_NAME">%1$s</xliff:g> ayisekeli izici zengxoxo"</string>
<string name="notification_unblockable_desc" msgid="2073030886006190804">"Lezi zaziso azikwazi ukushintshwa."</string>
- <!-- no translation found for notification_unblockable_call_desc (5907328164696532169) -->
- <skip />
+ <string name="notification_unblockable_call_desc" msgid="5907328164696532169">"Izaziso zekholi azikwazi ukushintshwa."</string>
<string name="notification_multichannel_desc" msgid="7414593090056236179">"Leli qembu lezaziso alikwazi ukulungiselelwa lapha"</string>
<string name="notification_delegate_header" msgid="1264510071031479920">"Isaziso sommeli"</string>
<string name="notification_channel_dialog_title" msgid="6856514143093200019">"Zonke izaziso ze-<xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 24118d2..02ba271 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -176,6 +176,7 @@
<!-- media -->
<color name="media_seamless_border">?android:attr/colorAccent</color>
+ <color name="media_paging_indicator">@color/material_dynamic_neutral_variant80</color>
<!-- media output dialog-->
<color name="media_dialog_background" android:lstar="98">@color/material_dynamic_neutral90</color>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index ae5b8d8..83b1b52 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -512,9 +512,6 @@
<!-- Flag to turn on the rendering of the above path or not -->
<bool name="config_enableDisplayCutoutProtection">false</bool>
- <!-- Respect drawable/rounded.xml intrinsic size for multiple radius corner path customization -->
- <bool name="config_roundedCornerMultipleRadius">false</bool>
-
<!-- Controls can query 2 preferred applications for limited number of suggested controls.
This config value should contain a list of package names of thoses preferred applications.
-->
@@ -659,17 +656,6 @@
<!-- Flag to activate notification to contents feature -->
<bool name="config_notificationToContents">true</bool>
- <!-- Respect drawable/rounded_secondary.xml intrinsic size for multiple radius corner path
- customization for secondary display-->
- <bool name="config_roundedCornerMultipleRadiusSecondary">false</bool>
-
- <!-- Whether the rounded corners are multiple radius for each display in a multi-display device.
- {@see com.android.internal.R.array#config_displayUniqueIdArray} -->
- <array name="config_roundedCornerMultipleRadiusArray">
- <item>@bool/config_roundedCornerMultipleRadius</item>
- <item>@bool/config_roundedCornerMultipleRadiusSecondary</item>
- </array>
-
<!-- The rounded corner drawable for each display in a multi-display device.
{@see com.android.internal.R.array#config_displayUniqueIdArray} -->
<array name="config_roundedCornerDrawableArray">
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index f7acda7e..f92d623 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -966,10 +966,10 @@
<string name="quick_settings_financed_disclosure_named_management">This device is provided by <xliff:g id="organization_name" example="Foo, Inc.">%s</xliff:g></string>
<!-- Disclosure at the bottom of Quick Settings that indicates that the user's device belongs to their organization, and the device is connected to a VPN. The placeholder is the VPN name. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_management_named_vpn">This device belongs to your organization and is connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
+ <string name="quick_settings_disclosure_management_named_vpn">This device belongs to your organization and is connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
- <!-- Disclosure at the bottom of Quick Settings that indicates that the user's device belongs to their organization, and the device is connected to a VPN. The first placeholder is the organization name, and the second placeholder is the VPN name. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_named_management_named_vpn">This device belongs to <xliff:g id="organization_name" example="Foo, Inc.">%1$s</xliff:g> and is connected to <xliff:g id="vpn_app" example="Foo VPN App">%2$s</xliff:g></string>
+ <!-- Disclosure at the bottom of Quick Settings that indicates that the user's device belongs to their organization, and the device is connected to a VPN. The first placeholder is the organization name, and the second placeholder is the VPN name. [CHAR LIMIT=150] -->
+ <string name="quick_settings_disclosure_named_management_named_vpn">This device belongs to <xliff:g id="organization_name" example="Foo, Inc.">%1$s</xliff:g> and is connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%2$s</xliff:g></string>
<!-- Disclosure at the bottom of Quick Settings that indicates that the user's device belongs to their organization. [CHAR LIMIT=100] -->
<string name="quick_settings_disclosure_management">This device belongs to your organization</string>
@@ -978,10 +978,10 @@
<string name="quick_settings_disclosure_named_management">This device belongs to <xliff:g id="organization_name" example="Foo, Inc.">%1$s</xliff:g></string>
<!-- Disclosure at the bottom of Quick Settings that indicates that the user's device belongs to their organization, and the device is connected to multiple VPNs. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_management_vpns">This device belongs to your organization and is connected to VPNs</string>
+ <string name="quick_settings_disclosure_management_vpns">This device belongs to your organization and is connected to the internet through VPNs</string>
<!-- Disclosure at the bottom of Quick Settings that indicates that the user's device belongs to their organization, and the device is connected to multiple VPNs. The placeholder is the organization's name. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_named_management_vpns">This device belongs to <xliff:g id="organization_name" example="Foo, Inc.">%1$s</xliff:g> and is connected to VPNs</string>
+ <string name="quick_settings_disclosure_named_management_vpns">This device belongs to <xliff:g id="organization_name" example="Foo, Inc.">%1$s</xliff:g> and is connected to the internet through VPNs</string>
<!-- Disclosure at the bottom of Quick Settings that indicates that the device has a managed profile which can be monitored by the profile owner [CHAR LIMIT=100] -->
<string name="quick_settings_disclosure_managed_profile_monitoring">Your organization may monitor network traffic in your work profile</string>
@@ -996,16 +996,19 @@
<string name="quick_settings_disclosure_monitoring">Network may be monitored</string>
<!-- Disclosure at the bottom of Quick Settings that indicates that the device is connected to multiple VPNs. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_vpns">This device is connected to VPNs</string>
+ <string name="quick_settings_disclosure_vpns">This device is connected to the internet through VPNs</string>
<!-- Disclosure at the bottom of Quick Settings that indicates that the device is connected to a VPN in the work profile. The placeholder is the VPN name. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_managed_profile_named_vpn">Your work profile is connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
+ <string name="quick_settings_disclosure_managed_profile_named_vpn">Your work apps are connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
+
<!-- Disclosure at the bottom of Quick Settings that indicates that the device is connected to a VPN in the personal profile (instead of the work profile). The placeholder is the VPN name. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_personal_profile_named_vpn">Your personal profile is connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
+ <string name="quick_settings_disclosure_personal_profile_named_vpn">Your personal apps are connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
+
<!-- Disclosure at the bottom of Quick Settings that indicates that the device is connected to a VPN. The placeholder is the VPN name. [CHAR LIMIT=100] -->
- <string name="quick_settings_disclosure_named_vpn">This device is connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
+ <string name="quick_settings_disclosure_named_vpn">This device is connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g></string>
+
<!-- Monitoring dialog title for financed device [CHAR LIMIT=60] -->
<string name="monitoring_title_financed_device">This device is provided by <xliff:g id="organization_name" example="Foo, Inc.">%s</xliff:g></string>
@@ -1054,16 +1057,16 @@
<string name="monitoring_description_managed_profile_network_logging">Your admin has turned on network logging, which monitors traffic in your work profile but not in your personal profile.</string>
<!-- Monitoring dialog: Description of an active VPN. [CHAR LIMIT=NONE]-->
- <string name="monitoring_description_named_vpn">You\'re connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g>, which can monitor your network activity, including emails, apps, and websites.</string>
+ <string name="monitoring_description_named_vpn">This device is connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g>. Your network activity, including emails and browsing data, is visible to your IT admin.</string>
<!-- Monitoring dialog: Description of two active VPNs. [CHAR LIMIT=NONE]-->
- <string name="monitoring_description_two_named_vpns">You\'re connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g> and <xliff:g id="vpn_app" example="Bar VPN App">%2$s</xliff:g>, which can monitor your network activity, including emails, apps, and websites.</string>
+ <string name="monitoring_description_two_named_vpns">This device is connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g> and <xliff:g id="vpn_app" example="Bar VPN App">%2$s</xliff:g>. Your network activity, including emails and browsing data, is visible to your IT admin.</string>
<!-- Monitoring dialog: Description of an active VPN in the work profile. [CHAR LIMIT=NONE]-->
- <string name="monitoring_description_managed_profile_named_vpn">Your work profile is connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g>, which can monitor your network activity, including emails, apps, and websites.</string>
+ <string name="monitoring_description_managed_profile_named_vpn">Your work apps are connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g>. Your network activity in work apps, including emails and browsing data, is visible to your IT admin and VPN provider.</string>
<!-- Monitoring dialog: Description of an active VPN in the personal profile (as opposed to the work profile). [CHAR LIMIT=NONE]-->
- <string name="monitoring_description_personal_profile_named_vpn">Your personal profile is connected to <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g>, which can monitor your network activity, including emails, apps, and websites.</string>
+ <string name="monitoring_description_personal_profile_named_vpn">Your personal apps are connected to the internet through <xliff:g id="vpn_app" example="Foo VPN App">%1$s</xliff:g>. Your network activity, including emails and browsing data, is visible to your VPN provider.</string>
<!-- Monitoring dialog: Space that separates the VPN body text and the "Open VPN Settings" link that follows it. [CHAR LIMIT=5] -->
<string name="monitoring_description_vpn_settings_separator">" "</string>
@@ -2283,6 +2286,10 @@
<string name="media_output_broadcast_code">Password</string>
<!-- Button for change broadcast name and broadcast code [CHAR LIMIT=60] -->
<string name="media_output_broadcast_dialog_save">Save</string>
+ <!-- The "starting" text when Broadcast is starting [CHAR LIMIT=60] -->
+ <string name="media_output_broadcast_starting">Starting…</string>
+ <!-- The button text when Broadcast start failed [CHAR LIMIT=60] -->
+ <string name="media_output_broadcast_start_failed">Can\u2019t broadcast</string>
<!-- Label for clip data when copying the build number off QS [CHAR LIMIT=NONE]-->
<string name="build_number_clip_data_label">Build number</string>
diff --git a/packages/SystemUI/res/xml/media_recommendation_collapsed.xml b/packages/SystemUI/res/xml/media_recommendation_collapsed.xml
index a6113473..b7d4b3a 100644
--- a/packages/SystemUI/res/xml/media_recommendation_collapsed.xml
+++ b/packages/SystemUI/res/xml/media_recommendation_collapsed.xml
@@ -25,8 +25,10 @@
/>
<!-- Only the constraintBottom and marginBottom are different. The rest of the constraints are
- the same as the constraints in media_smartspace_recommendations. But due to how
- ConstraintSets work, all the constraints need to be in the same place.
+ the same as the constraints in media_recommendations_expanded.xml. But, due to how
+ ConstraintSets work, all the constraints need to be in the same place. So, the shared
+ constraints can't be put in the shared layout file media_smartspace_recommendations.xml and
+ the constraints are instead duplicated between here and media_recommendations_expanded.xml.
Ditto for the other cover containers. -->
<Constraint
android:id="@+id/media_cover1_container"
diff --git a/packages/SystemUI/res/xml/media_recommendation_expanded.xml b/packages/SystemUI/res/xml/media_recommendation_expanded.xml
index 09ffebb..ce25a7d 100644
--- a/packages/SystemUI/res/xml/media_recommendation_expanded.xml
+++ b/packages/SystemUI/res/xml/media_recommendation_expanded.xml
@@ -15,7 +15,9 @@
~ limitations under the License
-->
<ConstraintSet
- xmlns:android="http://schemas.android.com/apk/res/android" >
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ >
<Constraint
android:id="@+id/sizing_view"
@@ -23,4 +25,99 @@
android:layout_height="@dimen/qs_media_session_height_expanded"
/>
+ <Constraint
+ android:id="@+id/media_cover1_container"
+ style="@style/MediaPlayer.Recommendation.AlbumContainer"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toTopOf="@+id/media_title1"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/media_cover2_container"
+ android:layout_marginEnd="@dimen/qs_media_rec_album_side_margin"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintVertical_chainStyle="packed"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintVertical_bias="0.4"
+ />
+
+ <Constraint
+ android:id="@+id/media_title1"
+ style="@style/MediaPlayer.Recommendation.Text.Title"
+ app:layout_constraintStart_toStartOf="@+id/media_cover1_container"
+ app:layout_constraintEnd_toEndOf="@+id/media_cover1_container"
+ app:layout_constraintTop_toBottomOf="@+id/media_cover1_container"
+ app:layout_constraintBottom_toTopOf="@+id/media_subtitle1"
+ />
+
+ <Constraint
+ android:id="@+id/media_subtitle1"
+ style="@style/MediaPlayer.Recommendation.Text.Subtitle"
+ app:layout_constraintStart_toStartOf="@+id/media_cover1_container"
+ app:layout_constraintEnd_toEndOf="@+id/media_cover1_container"
+ app:layout_constraintTop_toBottomOf="@+id/media_title1"
+ app:layout_constraintBottom_toBottomOf="parent"
+ android:layout_marginBottom="@dimen/qs_media_padding"
+ />
+
+ <Constraint
+ android:id="@+id/media_cover2_container"
+ style="@style/MediaPlayer.Recommendation.AlbumContainer"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toTopOf="@id/media_title2"
+ app:layout_constraintStart_toEndOf="@id/media_cover1_container"
+ app:layout_constraintEnd_toStartOf="@id/media_cover3_container"
+ android:layout_marginEnd="@dimen/qs_media_rec_album_side_margin"
+ app:layout_constraintVertical_chainStyle="packed"
+ app:layout_constraintVertical_bias="0.4"
+ />
+
+ <Constraint
+ android:id="@+id/media_title2"
+ style="@style/MediaPlayer.Recommendation.Text.Title"
+ app:layout_constraintStart_toStartOf="@+id/media_cover2_container"
+ app:layout_constraintEnd_toEndOf="@+id/media_cover2_container"
+ app:layout_constraintTop_toBottomOf="@+id/media_cover2_container"
+ app:layout_constraintBottom_toTopOf="@+id/media_subtitle2"
+ />
+
+ <Constraint
+ android:id="@+id/media_subtitle2"
+ style="@style/MediaPlayer.Recommendation.Text.Subtitle"
+ app:layout_constraintStart_toStartOf="@+id/media_cover2_container"
+ app:layout_constraintEnd_toEndOf="@+id/media_cover2_container"
+ app:layout_constraintTop_toBottomOf="@+id/media_title2"
+ app:layout_constraintBottom_toBottomOf="parent"
+ android:layout_marginBottom="@dimen/qs_media_padding"
+ />
+
+ <Constraint
+ android:id="@+id/media_cover3_container"
+ style="@style/MediaPlayer.Recommendation.AlbumContainer"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toTopOf="@id/media_title3"
+ app:layout_constraintStart_toEndOf="@id/media_cover2_container"
+ app:layout_constraintEnd_toEndOf="parent"
+ android:layout_marginEnd="@dimen/qs_media_padding"
+ app:layout_constraintVertical_chainStyle="packed"
+ app:layout_constraintVertical_bias="0.4"
+ />
+
+ <Constraint
+ android:id="@+id/media_title3"
+ style="@style/MediaPlayer.Recommendation.Text.Title"
+ app:layout_constraintStart_toStartOf="@+id/media_cover3_container"
+ app:layout_constraintEnd_toEndOf="@+id/media_cover3_container"
+ app:layout_constraintTop_toBottomOf="@+id/media_cover3_container"
+ app:layout_constraintBottom_toTopOf="@+id/media_subtitle3"
+ />
+
+ <Constraint
+ android:id="@+id/media_subtitle3"
+ style="@style/MediaPlayer.Recommendation.Text.Subtitle"
+ app:layout_constraintStart_toStartOf="@+id/media_cover3_container"
+ app:layout_constraintEnd_toEndOf="@+id/media_cover3_container"
+ app:layout_constraintTop_toBottomOf="@+id/media_title3"
+ app:layout_constraintBottom_toBottomOf="parent"
+ android:layout_marginBottom="@dimen/qs_media_padding"
+ />
+
</ConstraintSet>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java
index 938b1ca..88fe034 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/pip/PipSurfaceTransactionHelper.java
@@ -165,7 +165,7 @@
/** @return {@link SurfaceControl.Transaction} instance with vsync-id */
public static SurfaceControl.Transaction newSurfaceControlTransaction() {
final SurfaceControl.Transaction tx = new SurfaceControl.Transaction();
- tx.setFrameTimelineVsync(Choreographer.getInstance().getVsyncId());
+ tx.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
return tx;
}
}
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 e253360..b8319e5 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
@@ -45,7 +45,7 @@
private boolean mHandled;
@Override
- public void onAnimationStarted() {
+ public void onAnimationStarted(long elapsedRealTime) {
// OnAnimationStartedListener can be called numerous times, so debounce here to
// prevent multiple callbacks
if (mHandled) {
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
index 461c2dc..be3dfdc 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
@@ -23,6 +23,7 @@
import static android.app.ActivityTaskManager.getService;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.app.Activity;
import android.app.ActivityClient;
import android.app.ActivityManager;
@@ -154,11 +155,15 @@
/**
* Removes the outdated snapshot of home task.
+ *
+ * @param homeActivity The home task activity, or null if you have the
+ * {@link android.Manifest.permission#MANAGE_ACTIVITY_TASKS} permission and
+ * want us to find the home task for you.
*/
- public void invalidateHomeTaskSnapshot(final Activity homeActivity) {
+ public void invalidateHomeTaskSnapshot(@Nullable final Activity homeActivity) {
try {
ActivityClient.getInstance().invalidateHomeTaskSnapshot(
- homeActivity.getActivityToken());
+ homeActivity == null ? null : homeActivity.getActivityToken());
} catch (Throwable e) {
Log.w(TAG, "Failed to invalidate home snapshot", e);
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java
index e38d2ba..add2d02 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java
@@ -67,7 +67,7 @@
callbackHandler,
new ActivityOptions.OnAnimationStartedListener() {
@Override
- public void onAnimationStarted() {
+ public void onAnimationStarted(long elapsedRealTime) {
if (callback != null) {
callbackHandler.post(callback);
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java
index b82d896..f0210fd 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java
@@ -18,6 +18,7 @@
import android.annotation.IntDef;
import android.os.Build;
+import android.text.TextUtils;
import android.view.View;
import com.android.internal.jank.InteractionJankMonitor;
@@ -46,6 +47,8 @@
InteractionJankMonitor.CUJ_LAUNCHER_ALL_APPS_SCROLL;
public static final int CUJ_APP_LAUNCH_FROM_WIDGET =
InteractionJankMonitor.CUJ_LAUNCHER_APP_LAUNCH_FROM_WIDGET;
+ public static final int CUJ_SPLIT_SCREEN_ENTER =
+ InteractionJankMonitor.CUJ_SPLIT_SCREEN_ENTER;
@IntDef({
CUJ_APP_LAUNCH_FROM_RECENTS,
@@ -86,6 +89,23 @@
}
/**
+ * Begin a trace session.
+ *
+ * @param v an attached view.
+ * @param cujType the specific {@link InteractionJankMonitor.CujType}.
+ * @param tag the tag to distinguish different flow of same type CUJ.
+ */
+ public static void begin(View v, @CujType int cujType, String tag) {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return;
+ Configuration.Builder builder =
+ Configuration.Builder.withView(cujType, v);
+ if (!TextUtils.isEmpty(tag)) {
+ builder.setTag(tag);
+ }
+ InteractionJankMonitor.getInstance().begin(builder);
+ }
+
+ /**
* End a trace session.
*
* @param cujType the specific {@link InteractionJankMonitor.CujType}.
diff --git a/packages/SystemUI/shared/src/com/android/systemui/unfold/progress/PhysicsBasedUnfoldTransitionProgressProvider.kt b/packages/SystemUI/shared/src/com/android/systemui/unfold/progress/PhysicsBasedUnfoldTransitionProgressProvider.kt
index 3daae75..04d920c 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/unfold/progress/PhysicsBasedUnfoldTransitionProgressProvider.kt
+++ b/packages/SystemUI/shared/src/com/android/systemui/unfold/progress/PhysicsBasedUnfoldTransitionProgressProvider.kt
@@ -77,7 +77,7 @@
// Stop the animation if the device has already opened by the time when
// the display is available as we won't receive the full open event anymore
- if (foldStateProvider.isFullyOpened) {
+ if (foldStateProvider.isFinishedOpening) {
cancelTransition(endValue = 1f, animate = true)
}
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt b/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt
index 83b72e8..14581cc 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt
+++ b/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt
@@ -90,10 +90,12 @@
outputListeners.remove(listener)
}
- override val isFullyOpened: Boolean
- get() = !isFolded && lastFoldUpdate == FOLD_UPDATE_FINISH_FULL_OPEN
+ override val isFinishedOpening: Boolean
+ get() = !isFolded &&
+ (lastFoldUpdate == FOLD_UPDATE_FINISH_FULL_OPEN ||
+ lastFoldUpdate == FOLD_UPDATE_FINISH_HALF_OPEN)
- private val isTransitionInProgess: Boolean
+ private val isTransitionInProgress: Boolean
get() =
lastFoldUpdate == FOLD_UPDATE_START_OPENING ||
lastFoldUpdate == FOLD_UPDATE_START_CLOSING
@@ -113,7 +115,7 @@
notifyFoldUpdate(FOLD_UPDATE_START_CLOSING)
}
- if (isTransitionInProgess) {
+ if (isTransitionInProgress) {
if (isFullyOpened) {
notifyFoldUpdate(FOLD_UPDATE_FINISH_FULL_OPEN)
cancelTimeout()
@@ -177,7 +179,7 @@
}
private fun rescheduleAbortAnimationTimeout() {
- if (isTransitionInProgess) {
+ if (isTransitionInProgress) {
cancelTimeout()
}
handler.postDelayed(timeoutRunnable, halfOpenedTimeoutMillis.toLong())
diff --git a/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/FoldStateProvider.kt b/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/FoldStateProvider.kt
index 5495316..14a3a70 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/FoldStateProvider.kt
+++ b/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/FoldStateProvider.kt
@@ -28,7 +28,7 @@
fun start()
fun stop()
- val isFullyOpened: Boolean
+ val isFinishedOpening: Boolean
interface FoldUpdatesListener {
fun onHingeAngleUpdate(@FloatRange(from = 0.0, to = 180.0) angle: Float)
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
index c0ba51f..f435579 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -860,7 +860,7 @@
private void setupUserSwitcher() {
final UserRecord currentUser = mUserSwitcherController.getCurrentUserRecord();
if (currentUser == null) {
- Log.wtf(TAG, "Current user in user switcher is null.");
+ Log.e(TAG, "Current user in user switcher is null.");
return;
}
Drawable userIcon = findUserIcon(currentUser.info.id);
diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
index 38f9ac1..b98fc03 100644
--- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
+++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
@@ -19,8 +19,6 @@
import static android.view.DisplayCutout.BOUNDS_POSITION_LENGTH;
import static android.view.DisplayCutout.BOUNDS_POSITION_RIGHT;
import static android.view.DisplayCutout.BOUNDS_POSITION_TOP;
-import static android.view.Surface.ROTATION_270;
-import static android.view.Surface.ROTATION_90;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
@@ -38,10 +36,10 @@
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
-import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
+import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.hardware.display.DisplayManager;
@@ -51,10 +49,12 @@
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings.Secure;
+import android.util.DisplayUtils;
import android.util.Log;
import android.util.Size;
import android.view.DisplayCutout;
import android.view.DisplayCutout.BoundsPosition;
+import android.view.DisplayInfo;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@@ -320,13 +320,15 @@
}
private void startOnScreenDecorationsThread() {
+ mWindowManager = mContext.getSystemService(WindowManager.class);
+ mDisplayManager = mContext.getSystemService(DisplayManager.class);
mRotation = mContext.getDisplay().getRotation();
mDisplayUniqueId = mContext.getDisplay().getUniqueId();
mRoundedCornerResDelegate = new RoundedCornerResDelegate(mContext.getResources(),
mDisplayUniqueId);
+ mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio(
+ getPhysicalPixelDisplaySizeRatio());
mRoundedCornerFactory = new RoundedCornerDecorProviderFactory(mRoundedCornerResDelegate);
- mWindowManager = mContext.getSystemService(WindowManager.class);
- mDisplayManager = mContext.getSystemService(DisplayManager.class);
mHwcScreenDecorationSupport = mContext.getDisplay().getDisplayDecorationSupport();
updateHwLayerRoundedCornerDrawable();
setupDecorations();
@@ -402,6 +404,16 @@
updateOverlayProviderViews();
}
+
+ final float newRatio = getPhysicalPixelDisplaySizeRatio();
+ if (mRoundedCornerResDelegate.getPhysicalPixelDisplaySizeRatio() != newRatio) {
+ mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio(newRatio);
+ if (mScreenDecorHwcLayer != null) {
+ updateHwLayerRoundedCornerExistAndSize();
+ }
+ updateOverlayProviderViews();
+ }
+
if (mCutoutViews != null) {
final int size = mCutoutViews.length;
for (int i = 0; i < size; i++) {
@@ -878,6 +890,16 @@
}
}
+ @VisibleForTesting
+ float getPhysicalPixelDisplaySizeRatio() {
+ final Point stableDisplaySize = mDisplayManager.getStableDisplaySize();
+ final DisplayInfo displayInfo = new DisplayInfo();
+ mContext.getDisplay().getDisplayInfo(displayInfo);
+ return DisplayUtils.getPhysicalPixelDisplaySizeRatio(
+ stableDisplaySize.x, stableDisplaySize.y, displayInfo.logicalWidth,
+ displayInfo.logicalHeight);
+ }
+
@Override
protected void onConfigurationChanged(Configuration newConfig) {
if (DEBUG_DISABLE_SCREEN_DECORATIONS) {
@@ -1182,25 +1204,12 @@
}
private void updateBoundingPath() {
- int lw = displayInfo.logicalWidth;
- int lh = displayInfo.logicalHeight;
-
- boolean flipped = displayInfo.rotation == ROTATION_90
- || displayInfo.rotation == ROTATION_270;
-
- int dw = flipped ? lh : lw;
- int dh = flipped ? lw : lh;
-
- Path path = DisplayCutout.pathFromResources(
- getResources(), getDisplay().getUniqueId(), dw, dh);
+ final Path path = displayInfo.displayCutout.getCutoutPath();
if (path != null) {
cutoutPath.set(path);
} else {
cutoutPath.reset();
}
- Matrix m = new Matrix();
- transformPhysicalToLogicalCoordinates(displayInfo.rotation, dw, dh, m);
- cutoutPath.transform(m);
}
private void updateGravity() {
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenu.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenu.java
index f182e77..9af8300 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenu.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenu.java
@@ -39,10 +39,13 @@
import androidx.annotation.NonNull;
+import com.android.internal.accessibility.dialog.AccessibilityTarget;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.Prefs;
import com.android.systemui.shared.system.SysUiStatsLog;
+import java.util.List;
+
/**
* Contains logic for an accessibility floating menu view.
*/
@@ -120,9 +123,13 @@
if (isShowing()) {
return;
}
+ final List<AccessibilityTarget> targetList = getTargets(mContext, ACCESSIBILITY_BUTTON);
+ if (targetList.isEmpty()) {
+ return;
+ }
mMenuView.show();
- mMenuView.onTargetsChanged(getTargets(mContext, ACCESSIBILITY_BUTTON));
+ mMenuView.onTargetsChanged(targetList);
mMenuView.updateOpacityWith(isFadeEffectEnabled(mContext),
getOpacityValue(mContext));
mMenuView.setSizeType(getSizeType(mContext));
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuController.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuController.java
index cc5a792..11353f6 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuController.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuController.java
@@ -51,26 +51,19 @@
private int mBtnMode;
private String mBtnTargets;
private boolean mIsKeyguardVisible;
- private boolean mIsAccessibilityManagerServiceReady;
@VisibleForTesting
final KeyguardUpdateMonitorCallback mKeyguardCallback = new KeyguardUpdateMonitorCallback() {
- // Accessibility floating menu needs to retrieve information from
- // AccessibilityManagerService, and it would be ready before onUserUnlocked().
+
@Override
public void onUserUnlocked() {
- mIsAccessibilityManagerServiceReady = true;
handleFloatingMenuVisibility(mIsKeyguardVisible, mBtnMode, mBtnTargets);
}
- // Keyguard state would be changed before AccessibilityManagerService is ready to retrieve,
- // need to wait until receive onUserUnlocked().
@Override
public void onKeyguardVisibilityChanged(boolean showing) {
mIsKeyguardVisible = showing;
- if (mIsAccessibilityManagerServiceReady) {
- handleFloatingMenuVisibility(mIsKeyguardVisible, mBtnMode, mBtnTargets);
- }
+ handleFloatingMenuVisibility(mIsKeyguardVisible, mBtnMode, mBtnTargets);
}
@Override
@@ -99,7 +92,6 @@
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mIsKeyguardVisible = false;
- mIsAccessibilityManagerServiceReady = false;
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricView.java
index 55da8da..1413f4a 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricView.java
@@ -34,6 +34,7 @@
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
+import android.text.method.ScrollingMovementMethod;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
@@ -706,6 +707,12 @@
mTitleView.setText(mPromptInfo.getTitle());
+ //setSelected could make marguee work
+ mTitleView.setSelected(true);
+ mSubtitleView.setSelected(true);
+ //make description view become scrollable
+ mDescriptionView.setMovementMethod(new ScrollingMovementMethod());
+
if (isDeviceCredentialAllowed()) {
final CharSequence credentialButtonText;
@Utils.CredentialType final int credentialType =
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
index 15d0648..d4dad73 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
@@ -30,7 +30,9 @@
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.graphics.Point;
import android.graphics.PointF;
+import android.graphics.Rect;
import android.hardware.SensorPrivacyManager;
import android.hardware.biometrics.BiometricAuthenticator.Modality;
import android.hardware.biometrics.BiometricConstants;
@@ -54,6 +56,7 @@
import android.os.UserManager;
import android.util.Log;
import android.util.SparseBooleanArray;
+import android.view.DisplayInfo;
import android.view.MotionEvent;
import android.view.WindowManager;
@@ -104,16 +107,16 @@
private final CommandQueue mCommandQueue;
private final StatusBarStateController mStatusBarStateController;
private final ActivityTaskManager mActivityTaskManager;
- @Nullable
- private final FingerprintManager mFingerprintManager;
- @Nullable
- private final FaceManager mFaceManager;
+ @Nullable private final FingerprintManager mFingerprintManager;
+ @Nullable private final FaceManager mFaceManager;
private final Provider<UdfpsController> mUdfpsControllerFactory;
private final Provider<SidefpsController> mSidefpsControllerFactory;
- @Nullable
- private final PointF mFaceAuthSensorLocation;
- @Nullable
- private PointF mFingerprintLocation;
+
+ @NonNull private Point mStableDisplaySize = new Point();
+
+ @Nullable private final PointF mFaceAuthSensorLocation;
+ @Nullable private PointF mFingerprintLocation;
+ @Nullable private Rect mUdfpsBounds;
private final Set<Callback> mCallbacks = new HashSet<>();
// TODO: These should just be saved from onSaveState
@@ -122,14 +125,13 @@
AuthDialog mCurrentDialog;
@NonNull private final WindowManager mWindowManager;
+ @NonNull private final DisplayManager mDisplayManager;
@Nullable private UdfpsController mUdfpsController;
@Nullable private IUdfpsHbmListener mUdfpsHbmListener;
@Nullable private SidefpsController mSidefpsController;
@Nullable private IBiometricContextListener mBiometricContextListener;
- @VisibleForTesting
- IBiometricSysuiReceiver mReceiver;
- @VisibleForTesting
- @NonNull final BiometricDisplayListener mOrientationListener;
+ @VisibleForTesting IBiometricSysuiReceiver mReceiver;
+ @VisibleForTesting @NonNull final BiometricDisplayListener mOrientationListener;
@Nullable private final List<FaceSensorPropertiesInternal> mFaceProps;
@Nullable private List<FingerprintSensorPropertiesInternal> mFpProps;
@Nullable private List<FingerprintSensorPropertiesInternal> mUdfpsProps;
@@ -147,7 +149,7 @@
final TaskStackListener mTaskStackListener = new TaskStackListener() {
@Override
public void onTaskStackChanged() {
- mHandler.post(AuthController.this::handleTaskStackChanged);
+ mHandler.post(AuthController.this::cancelIfOwnerIsNotInForeground);
}
};
@@ -198,7 +200,7 @@
}
};
- private void handleTaskStackChanged() {
+ private void cancelIfOwnerIsNotInForeground() {
mExecution.assertIsMainThread();
if (mCurrentDialog != null) {
try {
@@ -210,7 +212,7 @@
final String topPackage = runningTasks.get(0).topActivity.getPackageName();
if (!topPackage.contentEquals(clientPackage)
&& !Utils.isSystem(mContext, clientPackage)) {
- Log.w(TAG, "Evicting client due to: " + topPackage);
+ Log.e(TAG, "Evicting client due to: " + topPackage);
mCurrentDialog.dismissWithoutCallback(true /* animate */);
mCurrentDialog = null;
mOrientationListener.disable();
@@ -249,6 +251,7 @@
}
mAllFingerprintAuthenticatorsRegistered = true;
mFpProps = sensors;
+
List<FingerprintSensorPropertiesInternal> udfpsProps = new ArrayList<>();
List<FingerprintSensorPropertiesInternal> sidefpsProps = new ArrayList<>();
for (FingerprintSensorPropertiesInternal props : mFpProps) {
@@ -259,12 +262,14 @@
sidefpsProps.add(props);
}
}
+
mUdfpsProps = !udfpsProps.isEmpty() ? udfpsProps : null;
if (mUdfpsProps != null) {
mUdfpsController = mUdfpsControllerFactory.get();
mUdfpsController.addCallback(new UdfpsController.Callback() {
@Override
- public void onFingerUp() {}
+ public void onFingerUp() {
+ }
@Override
public void onFingerDown() {
@@ -273,15 +278,22 @@
}
}
});
+ mUdfpsController.setAuthControllerUpdateUdfpsLocation(this::updateUdfpsLocation);
+ mUdfpsBounds = mUdfpsProps.get(0).getLocation().getRect();
+ updateUdfpsLocation();
}
+
mSidefpsProps = !sidefpsProps.isEmpty() ? sidefpsProps : null;
if (mSidefpsProps != null) {
mSidefpsController = mSidefpsControllerFactory.get();
}
+
+ mFingerprintManager.registerBiometricStateListener(mBiometricStateListener);
+ updateFingerprintLocation();
+
for (Callback cb : mCallbacks) {
cb.onAllAuthenticatorsRegistered();
}
- mFingerprintManager.registerBiometricStateListener(mBiometricStateListener);
}
private void handleEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments) {
@@ -424,12 +436,11 @@
/**
* @return where the UDFPS exists on the screen in pixels in portrait mode.
*/
- @Nullable public PointF getUdfpsSensorLocation() {
- if (mUdfpsController == null) {
+ @Nullable public PointF getUdfpsLocation() {
+ if (mUdfpsController == null || mUdfpsBounds == null) {
return null;
}
- return new PointF(mUdfpsController.getSensorLocation().centerX(),
- mUdfpsController.getSensorLocation().centerY());
+ return new PointF(mUdfpsBounds.centerX(), mUdfpsBounds.centerY());
}
/**
@@ -437,8 +448,8 @@
* overridden value will use the default value even if they don't have a fingerprint sensor
*/
@Nullable public PointF getFingerprintSensorLocation() {
- if (getUdfpsSensorLocation() != null) {
- return getUdfpsSensorLocation();
+ if (getUdfpsLocation() != null) {
+ return getUdfpsLocation();
}
return mFingerprintLocation;
}
@@ -525,12 +536,13 @@
mFaceManager = faceManager;
mUdfpsControllerFactory = udfpsControllerFactory;
mSidefpsControllerFactory = sidefpsControllerFactory;
+ mDisplayManager = displayManager;
mWindowManager = windowManager;
mUdfpsEnrolledForUser = new SparseBooleanArray();
mOrientationListener = new BiometricDisplayListener(
context,
- displayManager,
+ mDisplayManager,
mHandler,
BiometricDisplayListener.SensorType.Generic.INSTANCE,
() -> {
@@ -582,6 +594,27 @@
yLocation);
}
+ // TODO(b/229290039): UDFPS controller should manage its dimensions on its own. Remove this.
+ // This is not combined with updateFingerprintLocation because this is invoked directly from
+ // UdfpsController, only when it cares about a rotation change. The implications of calling
+ // updateFingerprintLocation in such a case are unclear.
+ private void updateUdfpsLocation() {
+ if (mUdfpsController != null) {
+ final DisplayInfo displayInfo = new DisplayInfo();
+ mContext.getDisplay().getDisplayInfo(displayInfo);
+ final float scaleFactor = android.util.DisplayUtils.getPhysicalPixelDisplaySizeRatio(
+ mStableDisplaySize.x, mStableDisplaySize.y, displayInfo.getNaturalWidth(),
+ displayInfo.getNaturalHeight());
+
+ final FingerprintSensorPropertiesInternal udfpsProp = mUdfpsProps.get(0);
+ mUdfpsBounds = udfpsProp.getLocation().getRect();
+ mUdfpsBounds.scale(scaleFactor);
+ mUdfpsController.updateOverlayParams(udfpsProp.sensorId,
+ new UdfpsOverlayParams(mUdfpsBounds, displayInfo.getNaturalWidth(),
+ displayInfo.getNaturalHeight(), scaleFactor, displayInfo.rotation));
+ }
+ }
+
@SuppressWarnings("deprecation")
@Override
public void start() {
@@ -592,6 +625,7 @@
mFingerprintAuthenticatorsRegisteredCallback);
}
+ mStableDisplaySize = mDisplayManager.getStableDisplaySize();
mActivityTaskManager.registerTaskStackListener(mTaskStackListener);
}
@@ -885,6 +919,10 @@
mCurrentDialog = newDialog;
mCurrentDialog.show(mWindowManager, savedState);
mOrientationListener.enable();
+
+ if (!promptInfo.isAllowBackgroundAuthentication()) {
+ mHandler.post(this::cancelIfOwnerIsNotInForeground);
+ }
}
private void onDialogDismissed(@DismissedReason int reason) {
@@ -906,6 +944,7 @@
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
updateFingerprintLocation();
+ updateUdfpsLocation();
// Save the state of the current dialog (buttons showing, etc)
if (mCurrentDialog != null) {
@@ -935,6 +974,7 @@
private void onOrientationChanged() {
updateFingerprintLocation();
+ updateUdfpsLocation();
if (mCurrentDialog != null) {
mCurrentDialog.onOrientationChanged();
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt
index dfbe348..38a7c5d 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt
@@ -64,7 +64,11 @@
/** Listen for changes. */
fun enable() {
lastRotation = context.display?.rotation ?: Surface.ROTATION_0
- displayManager.registerDisplayListener(this, handler)
+ displayManager.registerDisplayListener(
+ this,
+ handler,
+ DisplayManager.EVENT_FLAG_DISPLAY_CHANGED
+ )
}
/** Stop listening for changes. */
@@ -80,9 +84,7 @@
*/
sealed class SensorType {
object Generic : SensorType()
- data class UnderDisplayFingerprint(
- val properties: FingerprintSensorPropertiesInternal
- ) : SensorType()
+ object UnderDisplayFingerprint : SensorType()
data class SideFingerprint(
val properties: FingerprintSensorPropertiesInternal
) : SensorType()
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index 2847246..0096032 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -19,7 +19,6 @@
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_GOOD;
import static android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD;
-import static com.android.internal.util.Preconditions.checkArgument;
import static com.android.internal.util.Preconditions.checkNotNull;
import static com.android.systemui.classifier.Classifier.UDFPS_AUTHENTICATION;
@@ -30,12 +29,9 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Point;
-import android.graphics.RectF;
import android.hardware.biometrics.BiometricFingerprintConstants;
-import android.hardware.biometrics.SensorLocationInternal;
import android.hardware.display.DisplayManager;
import android.hardware.fingerprint.FingerprintManager;
-import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.hardware.fingerprint.IUdfpsOverlayController;
import android.hardware.fingerprint.IUdfpsOverlayControllerCallback;
import android.os.Handler;
@@ -45,6 +41,7 @@
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
import android.util.Log;
+import android.util.RotationUtils;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.Surface;
@@ -99,7 +96,6 @@
public class UdfpsController implements DozeReceiver {
private static final String TAG = "UdfpsController";
private static final long AOD_INTERRUPT_TIMEOUT_MILLIS = 1000;
- private static final long DEFAULT_VIBRATION_DURATION = 1000; // milliseconds
// Minimum required delay between consecutive touch logs in milliseconds.
private static final long MIN_TOUCH_LOG_INTERVAL = 50;
@@ -129,10 +125,14 @@
mUnlockedScreenOffAnimationController;
@NonNull private final LatencyTracker mLatencyTracker;
@VisibleForTesting @NonNull final BiometricDisplayListener mOrientationListener;
+ @NonNull private final ActivityLaunchAnimator mActivityLaunchAnimator;
+
// Currently the UdfpsController supports a single UDFPS sensor. If devices have multiple
// sensors, this, in addition to a lot of the code here, will be updated.
- @VisibleForTesting final FingerprintSensorPropertiesInternal mSensorProps;
- @NonNull private final ActivityLaunchAnimator mActivityLaunchAnimator;
+ @VisibleForTesting int mSensorId;
+ @VisibleForTesting @NonNull UdfpsOverlayParams mOverlayParams = new UdfpsOverlayParams();
+ // TODO(b/229290039): UDFPS controller should manage its dimensions on its own. Remove this.
+ @Nullable private Runnable mAuthControllerUpdateUdfpsLocation;
@Nullable private final AlternateUdfpsTouchProvider mAlternateTouchProvider;
// Tracks the velocity of a touch to help filter out the touches that move too fast.
@@ -193,19 +193,16 @@
@Override
public void showUdfpsOverlay(long requestId, int sensorId, int reason,
@NonNull IUdfpsOverlayControllerCallback callback) {
- mFgExecutor.execute(
- () -> UdfpsController.this.showUdfpsOverlay(new UdfpsControllerOverlay(
- mContext, mFingerprintManager, mInflater, mWindowManager,
- mAccessibilityManager, mStatusBarStateController,
+ mFgExecutor.execute(() -> UdfpsController.this.showUdfpsOverlay(
+ new UdfpsControllerOverlay(mContext, mFingerprintManager, mInflater,
+ mWindowManager, mAccessibilityManager, mStatusBarStateController,
mPanelExpansionStateManager, mKeyguardViewManager,
mKeyguardUpdateMonitor, mDialogManager, mDumpManager,
mLockscreenShadeTransitionController, mConfigurationController,
mSystemClock, mKeyguardStateController,
- mUnlockedScreenOffAnimationController, mSensorProps,
- mHbmProvider, requestId, reason, callback,
- (view, event, fromUdfpsView) ->
- onTouch(requestId, event, fromUdfpsView),
- mActivityLaunchAnimator)));
+ mUnlockedScreenOffAnimationController, mHbmProvider, requestId, reason,
+ callback, (view, event, fromUdfpsView) -> onTouch(requestId, event,
+ fromUdfpsView), mActivityLaunchAnimator)));
}
@Override
@@ -281,6 +278,38 @@
}
/**
+ * Updates the overlay parameters and reconstructs or redraws the overlay, if necessary.
+ *
+ * @param sensorId sensor for which the overlay is getting updated.
+ * @param overlayParams See {@link UdfpsOverlayParams}.
+ */
+ public void updateOverlayParams(int sensorId, @NonNull UdfpsOverlayParams overlayParams) {
+ if (sensorId != mSensorId) {
+ mSensorId = sensorId;
+ Log.w(TAG, "updateUdfpsParams | sensorId has changed");
+ }
+
+ if (!mOverlayParams.equals(overlayParams)) {
+ mOverlayParams = overlayParams;
+
+ final boolean wasShowingAltAuth = mKeyguardViewManager.isShowingAlternateAuth();
+
+ // When the bounds change it's always necessary to re-create the overlay's window with
+ // new LayoutParams. If the overlay needs to be shown, this will re-create and show the
+ // overlay with the updated LayoutParams. Otherwise, the overlay will remain hidden.
+ redrawOverlay();
+ if (wasShowingAltAuth) {
+ mKeyguardViewManager.showGenericBouncer(true);
+ }
+ }
+ }
+
+ // TODO(b/229290039): UDFPS controller should manage its dimensions on its own. Remove this.
+ public void setAuthControllerUpdateUdfpsLocation(@Nullable Runnable r) {
+ mAuthControllerUpdateUdfpsLocation = r;
+ }
+
+ /**
* Calculate the pointer speed given a velocity tracker and the pointer id.
* This assumes that the velocity tracker has already been passed all relevant motion events.
*/
@@ -340,10 +369,11 @@
}
return !mOverlay.getAnimationViewController().shouldPauseAuth()
- && getSensorLocation().contains(x, y);
+ && mOverlayParams.getSensorBounds().contains((int) x, (int) y);
}
- private boolean onTouch(long requestId, @NonNull MotionEvent event, boolean fromUdfpsView) {
+ @VisibleForTesting
+ boolean onTouch(long requestId, @NonNull MotionEvent event, boolean fromUdfpsView) {
if (mOverlay == null) {
Log.w(TAG, "ignoring onTouch with null overlay");
return false;
@@ -438,33 +468,28 @@
final long sinceLastLog = mSystemClock.elapsedRealtime() - mTouchLogTime;
if (!isIlluminationRequested && !mAcquiredReceived
&& !exceedsVelocityThreshold) {
- final int rawX = (int) event.getRawX();
- final int rawY = (int) event.getRawY();
- // Default coordinates assume portrait mode.
- int x = rawX;
- int y = rawY;
-
- // Gets the size based on the current rotation of the display.
- Point p = new Point();
- mContext.getDisplay().getRealSize(p);
-
- // Transform x, y to portrait mode if the device is in landscape mode.
- switch (mContext.getDisplay().getRotation()) {
- case Surface.ROTATION_90:
- x = p.y - rawY;
- y = rawX;
- break;
-
- case Surface.ROTATION_270:
- x = rawY;
- y = p.x - rawX;
- break;
-
- default:
- // Do nothing to stay in portrait mode.
+ // Map the touch to portrait mode if the device is in landscape mode.
+ Point portraitTouch = new Point(
+ (int) event.getRawX(idx),
+ (int) event.getRawY(idx)
+ );
+ final int rot = mOverlayParams.getRotation();
+ if (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270) {
+ RotationUtils.rotatePoint(portraitTouch,
+ RotationUtils.deltaRotation(rot, Surface.ROTATION_0),
+ mOverlayParams.getLogicalDisplayWidth(),
+ mOverlayParams.getLogicalDisplayHeight()
+ );
}
- onFingerDown(requestId, x, y, minor, major);
+ // Scale the coordinates to native resolution.
+ final float scale = mOverlayParams.getScaleFactor();
+ int scaledX = (int) (portraitTouch.x / scale);
+ int scaledY = (int) (portraitTouch.y / scale);
+ float scaledMinor = minor / scale;
+ float scaledMajor = major / scale;
+
+ onFingerDown(requestId, scaledX, scaledY, scaledMinor, scaledMajor);
Log.v(TAG, "onTouch | finger down: " + touchInfo);
mTouchLogTime = mSystemClock.elapsedRealtime();
mPowerManager.userActivity(mSystemClock.uptimeMillis(),
@@ -571,16 +596,15 @@
mActivityLaunchAnimator = activityLaunchAnimator;
mAlternateTouchProvider = aternateTouchProvider.orElse(null);
- mSensorProps = findFirstUdfps();
- // At least one UDFPS sensor exists
- checkArgument(mSensorProps != null);
mOrientationListener = new BiometricDisplayListener(
context,
displayManager,
mainHandler,
- new BiometricDisplayListener.SensorType.UnderDisplayFingerprint(mSensorProps),
+ BiometricDisplayListener.SensorType.UnderDisplayFingerprint.INSTANCE,
() -> {
- onOrientationChanged();
+ if (mAuthControllerUpdateUdfpsLocation != null) {
+ mAuthControllerUpdateUdfpsLocation.run();
+ }
return Unit.INSTANCE;
});
@@ -609,17 +633,6 @@
}
}
- @Nullable
- private FingerprintSensorPropertiesInternal findFirstUdfps() {
- for (FingerprintSensorPropertiesInternal props :
- mFingerprintManager.getSensorPropertiesInternal()) {
- if (props.isAnyUdfpsType()) {
- return props;
- }
- }
- return null;
- }
-
@Override
public void dozeTimeTick() {
if (mOverlay != null) {
@@ -630,21 +643,6 @@
}
}
- /**
- * @return where the UDFPS exists on the screen in pixels.
- */
- public RectF getSensorLocation() {
- // This is currently used to calculate the amount of space available for notifications
- // on lockscreen and for the udfps light reveal animation on keyguard.
- // Keyguard is only shown in portrait mode for now, so this will need to
- // be updated if that ever changes.
- final SensorLocationInternal location = mSensorProps.getLocation();
- return new RectF(location.sensorLocationX - location.sensorRadius,
- location.sensorLocationY - location.sensorRadius,
- location.sensorLocationX + location.sensorRadius,
- location.sensorLocationY + location.sensorRadius);
- }
-
private void redrawOverlay() {
UdfpsControllerOverlay overlay = mOverlay;
if (overlay != null) {
@@ -653,26 +651,11 @@
}
}
- private void onOrientationChanged() {
- // When the configuration changes it's almost always necessary to destroy and re-create
- // the overlay's window to pass it the new LayoutParams.
- // Hiding the overlay will destroy its window. It's safe to hide the overlay regardless
- // of whether it is already hidden.
- final boolean wasShowingAltAuth = mKeyguardViewManager.isShowingAlternateAuth();
-
- // If the overlay needs to be shown, this will re-create and show the overlay with the
- // updated LayoutParams. Otherwise, the overlay will remain hidden.
- redrawOverlay();
- if (wasShowingAltAuth) {
- mKeyguardViewManager.showGenericBouncer(true);
- }
- }
-
private void showUdfpsOverlay(@NonNull UdfpsControllerOverlay overlay) {
mExecution.assertIsMainThread();
mOverlay = overlay;
- if (overlay.show(this)) {
+ if (overlay.show(this, mOverlayParams)) {
Log.v(TAG, "showUdfpsOverlay | adding window reason="
+ overlay.getRequestReason());
mOnFingerDown = false;
@@ -814,14 +797,14 @@
if (mAlternateTouchProvider != null) {
mAlternateTouchProvider.onPointerDown(requestId, x, y, minor, major);
} else {
- mFingerprintManager.onPointerDown(requestId, mSensorProps.sensorId, x, y, minor, major);
+ mFingerprintManager.onPointerDown(requestId, mSensorId, x, y, minor, major);
}
Trace.endAsyncSection("UdfpsController.e2e.onPointerDown", 0);
final UdfpsView view = mOverlay.getOverlayView();
if (view != null) {
view.startIllumination(() -> {
- mFingerprintManager.onUiReady(requestId, mSensorProps.sensorId);
+ mFingerprintManager.onUiReady(requestId, mSensorId);
mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
});
}
@@ -839,7 +822,7 @@
if (mAlternateTouchProvider != null) {
mAlternateTouchProvider.onPointerUp(requestId);
} else {
- mFingerprintManager.onPointerUp(requestId, mSensorProps.sensorId);
+ mFingerprintManager.onPointerUp(requestId, mSensorId);
}
for (Callback cb : mCallbacks) {
cb.onFingerUp();
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
index ee43e93..9c8aee4 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
@@ -20,17 +20,16 @@
import android.annotation.UiThread
import android.content.Context
import android.graphics.PixelFormat
-import android.graphics.Point
+import android.graphics.Rect
import android.hardware.biometrics.BiometricOverlayConstants
import android.hardware.biometrics.BiometricOverlayConstants.REASON_ENROLL_ENROLLING
import android.hardware.biometrics.BiometricOverlayConstants.REASON_ENROLL_FIND_SENSOR
import android.hardware.biometrics.BiometricOverlayConstants.ShowReason
-import android.hardware.biometrics.SensorLocationInternal
import android.hardware.fingerprint.FingerprintManager
-import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
import android.hardware.fingerprint.IUdfpsOverlayControllerCallback
import android.os.RemoteException
import android.util.Log
+import android.util.RotationUtils
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.Surface
@@ -78,7 +77,6 @@
private val systemClock: SystemClock,
private val keyguardStateController: KeyguardStateController,
private val unlockedScreenOffAnimationController: UnlockedScreenOffAnimationController,
- private val sensorProps: FingerprintSensorPropertiesInternal,
private var hbmProvider: UdfpsHbmProvider,
val requestId: Long,
@ShowReason val requestReason: Int,
@@ -90,6 +88,8 @@
var overlayView: UdfpsView? = null
private set
+ private var overlayParams: UdfpsOverlayParams = UdfpsOverlayParams()
+
private var overlayTouchListener: TouchExplorationStateChangeListener? = null
private val coreLayoutParams = WindowManager.LayoutParams(
@@ -101,7 +101,11 @@
fitInsetsTypes = 0
gravity = android.view.Gravity.TOP or android.view.Gravity.LEFT
layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
+ flags =
+ (Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS or WindowManager.LayoutParams.FLAG_SPLIT_TOUCH)
privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
+ // Avoid announcing window title.
+ accessibilityTitle = " "
}
/** A helper if the [requestReason] was due to enrollment. */
@@ -125,13 +129,14 @@
/** Show the overlay or return false and do nothing if it is already showing. */
@SuppressLint("ClickableViewAccessibility")
- fun show(controller: UdfpsController): Boolean {
+ fun show(controller: UdfpsController, params: UdfpsOverlayParams): Boolean {
if (overlayView == null) {
+ overlayParams = params
try {
overlayView = (inflater.inflate(
R.layout.udfps_view, null, false
) as UdfpsView).apply {
- sensorProperties = sensorProps
+ overlayParams = params
setHbmProvider(hbmProvider)
val animation = inflateUdfpsAnimation(this, controller)
if (animation != null) {
@@ -144,8 +149,7 @@
importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
}
- windowManager.addView(this,
- coreLayoutParams.updateForLocation(sensorProps.location, animation))
+ windowManager.addView(this, coreLayoutParams.updateDimensions(animation))
overlayTouchListener = TouchExplorationStateChangeListener {
if (accessibilityManager.isTouchExplorationEnabled) {
@@ -180,13 +184,14 @@
REASON_ENROLL_ENROLLING -> {
UdfpsEnrollViewController(
view.addUdfpsView(R.layout.udfps_enroll_view) {
- updateSensorLocation(sensorProps)
+ updateSensorLocation(overlayParams.sensorBounds)
},
enrollHelper ?: throw IllegalStateException("no enrollment helper"),
statusBarStateController,
panelExpansionStateManager,
dialogManager,
- dumpManager
+ dumpManager,
+ overlayParams.scaleFactor
)
}
BiometricOverlayConstants.REASON_AUTH_KEYGUARD -> {
@@ -280,57 +285,42 @@
/** Checks if the id is relevant for this overlay. */
fun matchesRequestId(id: Long): Boolean = requestId == -1L || requestId == id
- private fun WindowManager.LayoutParams.updateForLocation(
- location: SensorLocationInternal,
+ private fun WindowManager.LayoutParams.updateDimensions(
animation: UdfpsAnimationViewController<*>?
): WindowManager.LayoutParams {
val paddingX = animation?.paddingX ?: 0
val paddingY = animation?.paddingY ?: 0
- flags = (Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS
- or WindowManager.LayoutParams.FLAG_SPLIT_TOUCH)
if (animation != null && animation.listenForTouchesOutsideView()) {
flags = flags or WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
}
- // Default dimensions assume portrait mode.
- x = location.sensorLocationX - location.sensorRadius - paddingX
- y = location.sensorLocationY - location.sensorRadius - paddingY
- height = 2 * location.sensorRadius + 2 * paddingX
- width = 2 * location.sensorRadius + 2 * paddingY
+ // Original sensorBounds assume portrait mode.
+ val rotatedSensorBounds = Rect(overlayParams.sensorBounds)
- // Gets the size based on the current rotation of the display.
- val p = Point()
- context.display!!.getRealSize(p)
- when (context.display!!.rotation) {
- Surface.ROTATION_90 -> {
- if (!shouldRotate(animation)) {
- Log.v(TAG, "skip rotating udfps location ROTATION_90" +
+ val rot = overlayParams.rotation
+ if (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270) {
+ if (!shouldRotate(animation)) {
+ Log.v(
+ TAG, "Skip rotating UDFPS bounds " + Surface.rotationToString(rot) +
" animation=$animation" +
" isGoingToSleep=${keyguardUpdateMonitor.isGoingToSleep}" +
- " isOccluded=${keyguardStateController.isOccluded}")
- } else {
- Log.v(TAG, "rotate udfps location ROTATION_90")
- x = (location.sensorLocationY - location.sensorRadius - paddingX)
- y = (p.y - location.sensorLocationX - location.sensorRadius - paddingY)
- }
+ " isOccluded=${keyguardStateController.isOccluded}"
+ )
+ } else {
+ Log.v(TAG, "Rotate UDFPS bounds " + Surface.rotationToString(rot))
+ RotationUtils.rotateBounds(
+ rotatedSensorBounds,
+ overlayParams.naturalDisplayWidth,
+ overlayParams.naturalDisplayHeight,
+ rot
+ )
}
- Surface.ROTATION_270 -> {
- if (!shouldRotate(animation)) {
- Log.v(TAG, "skip rotating udfps location ROTATION_270" +
- " animation=$animation" +
- " isGoingToSleep=${keyguardUpdateMonitor.isGoingToSleep}" +
- " isOccluded=${keyguardStateController.isOccluded}")
- } else {
- Log.v(TAG, "rotate udfps location ROTATION_270")
- x = (p.x - location.sensorLocationY - location.sensorRadius - paddingX)
- y = (location.sensorLocationX - location.sensorRadius - paddingY)
- }
- }
- else -> {}
}
- // avoid announcing window title
- accessibilityTitle = " "
+ x = rotatedSensorBounds.left - paddingX
+ y = rotatedSensorBounds.top - paddingY
+ height = rotatedSensorBounds.height() + 2 * paddingX
+ width = rotatedSensorBounds.width() + 2 * paddingY
return this
}
@@ -363,5 +353,5 @@
@ShowReason
private fun Int.isImportantForAccessibility() =
this == REASON_ENROLL_FIND_SENSOR ||
- this == REASON_ENROLL_ENROLLING ||
- this == BiometricOverlayConstants.REASON_AUTH_BP
+ this == REASON_ENROLL_ENROLLING ||
+ this == BiometricOverlayConstants.REASON_AUTH_BP
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java
index 6afe420..dbfce2e 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapter.java
@@ -139,6 +139,9 @@
child.measure(
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(clampedSpacerHeight, MeasureSpec.EXACTLY));
+ } else if (child.getId() == R.id.description) {
+ //skip description view and compute later
+ continue;
} else {
child.measure(
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
@@ -150,9 +153,27 @@
}
}
+ //re-calculate the height of description
+ View description = mView.findViewById(R.id.description);
+ totalHeight += measureDescription(description, displayHeight, width, totalHeight);
+
return new AuthDialog.LayoutParams(width, totalHeight);
}
+ private int measureDescription(View description, int displayHeight, int currWidth,
+ int currHeight) {
+ //description view should be measured in AuthBiometricFingerprintView#onMeasureInternal
+ //so we could getMeasuredHeight in onMeasureInternalPortrait directly.
+ int newHeight = description.getMeasuredHeight() + currHeight;
+ int limit = (int) (displayHeight * 0.75);
+ if (newHeight > limit) {
+ description.measure(
+ MeasureSpec.makeMeasureSpec(currWidth, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(limit - currHeight, MeasureSpec.EXACTLY));
+ }
+ return description.getMeasuredHeight();
+ }
+
@NonNull
private AuthDialog.LayoutParams onMeasureInternalLandscape(int width, int height) {
final WindowMetrics windowMetrics = mWindowManager.getMaximumWindowMetrics();
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollView.java
index 93df2cf..69c37b2 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollView.java
@@ -17,7 +17,7 @@
package com.android.systemui.biometrics;
import android.content.Context;
-import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
+import android.graphics.Rect;
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
@@ -61,13 +61,11 @@
return mFingerprintDrawable;
}
- void updateSensorLocation(@NonNull FingerprintSensorPropertiesInternal sensorProps) {
+ void updateSensorLocation(@NonNull Rect sensorBounds) {
View fingerprintAccessibilityView = findViewById(R.id.udfps_enroll_accessibility_view);
- final int sensorHeight = sensorProps.getLocation().sensorRadius * 2;
- final int sensorWidth = sensorHeight;
ViewGroup.LayoutParams params = fingerprintAccessibilityView.getLayoutParams();
- params.width = sensorWidth;
- params.height = sensorHeight;
+ params.width = sensorBounds.width();
+ params.height = sensorBounds.height();
fingerprintAccessibilityView.setLayoutParams(params);
fingerprintAccessibilityView.requestLayout();
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java
index 2ca103b..2ed60e5 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollViewController.java
@@ -56,11 +56,12 @@
@NonNull StatusBarStateController statusBarStateController,
@NonNull PanelExpansionStateManager panelExpansionStateManager,
@NonNull SystemUIDialogManager systemUIDialogManager,
- @NonNull DumpManager dumpManager) {
+ @NonNull DumpManager dumpManager,
+ float scaleFactor) {
super(view, statusBarStateController, panelExpansionStateManager, systemUIDialogManager,
dumpManager);
- mEnrollProgressBarRadius = getContext().getResources()
- .getInteger(R.integer.config_udfpsEnrollProgressBar);
+ mEnrollProgressBarRadius = (int) (scaleFactor * getContext().getResources().getInteger(
+ R.integer.config_udfpsEnrollProgressBar));
mEnrollHelper = enrollHelper;
mView.setEnrollHelper(mEnrollHelper);
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java
index 67d0db2..842791f 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java
@@ -128,10 +128,6 @@
if (mAnimatingBetweenAodAndLockscreen && !mPauseAuth) {
mBgProtection.setAlpha(1f - mInterpolatedDarkAmount);
-
- mLockScreenFp.setTranslationX(mBurnInOffsetX);
- mLockScreenFp.setTranslationY(mBurnInOffsetY);
- mLockScreenFp.setProgress(1f - mInterpolatedDarkAmount);
mLockScreenFp.setAlpha(1f - mInterpolatedDarkAmount);
} else if (mInterpolatedDarkAmount == 0f) {
mBgProtection.setAlpha(mAlpha / 255f);
@@ -140,6 +136,9 @@
mBgProtection.setAlpha(0f);
mLockScreenFp.setAlpha(0f);
}
+ mLockScreenFp.setTranslationX(mBurnInOffsetX);
+ mLockScreenFp.setTranslationY(mBurnInOffsetY);
+ mLockScreenFp.setProgress(1f - mInterpolatedDarkAmount);
mAodFp.setTranslationX(mBurnInOffsetX);
mAodFp.setTranslationY(mBurnInOffsetY);
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsOverlayParams.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsOverlayParams.kt
new file mode 100644
index 0000000..d725dfb
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsOverlayParams.kt
@@ -0,0 +1,43 @@
+package com.android.systemui.biometrics
+
+import android.graphics.Rect
+import android.view.Surface
+import android.view.Surface.Rotation
+
+/**
+ * Collection of parameters that define an under-display fingerprint sensor (UDFPS) overlay.
+ *
+ * @property sensorBounds coordinates of the bounding box around the sensor, in natural orientation,
+ * in pixels, for the current resolution.
+ * @property naturalDisplayWidth width of the physical display, in natural orientation, in pixels,
+ * for the current resolution.
+ * @property naturalDisplayHeight height of the physical display, in natural orientation, in pixels,
+ * for the current resolution.
+ * @property scaleFactor ratio of a dimension in the current resolution to the corresponding
+ * dimension in the native resolution.
+ * @property rotation current rotation of the display.
+ */
+
+data class UdfpsOverlayParams(
+ val sensorBounds: Rect = Rect(),
+ val naturalDisplayWidth: Int = 0,
+ val naturalDisplayHeight: Int = 0,
+ val scaleFactor: Float = 1f,
+ @Rotation val rotation: Int = Surface.ROTATION_0
+) {
+ /** See [android.view.DisplayInfo.logicalWidth] */
+ val logicalDisplayWidth
+ get() = if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) {
+ naturalDisplayHeight
+ } else {
+ naturalDisplayWidth
+ }
+
+ /** See [android.view.DisplayInfo.logicalHeight] */
+ val logicalDisplayHeight
+ get() = if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) {
+ naturalDisplayWidth
+ } else {
+ naturalDisplayHeight
+ }
+}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
index 75e6aa0..2aa345a 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
@@ -21,7 +21,6 @@
import android.graphics.Paint
import android.graphics.PointF
import android.graphics.RectF
-import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
@@ -39,6 +38,8 @@
attrs: AttributeSet?
) : FrameLayout(context, attrs), DozeReceiver, UdfpsIlluminator {
+ // sensorRect may be bigger than the sensor. True sensor dimensions are defined in
+ // overlayParams.sensorBounds
private val sensorRect = RectF()
private var hbmProvider: UdfpsHbmProvider? = null
private val debugTextPaint = Paint().apply {
@@ -62,8 +63,8 @@
/** View controller (can be different for enrollment, BiometricPrompt, Keyguard, etc.). */
var animationViewController: UdfpsAnimationViewController<*>? = null
- /** Properties used to obtain the sensor location. */
- var sensorProperties: FingerprintSensorPropertiesInternal? = null
+ /** Parameters that affect the position and size of the overlay. Visible for testing. */
+ var overlayParams = UdfpsOverlayParams()
/** Debug message. */
var debugMessage: String? = null
@@ -94,13 +95,12 @@
val paddingX = animationViewController?.paddingX ?: 0
val paddingY = animationViewController?.paddingY ?: 0
- val sensorRadius = sensorProperties?.location?.sensorRadius ?: 0
sensorRect.set(
paddingX.toFloat(),
paddingY.toFloat(),
- (2 * sensorRadius + paddingX).toFloat(),
- (2 * sensorRadius + paddingY).toFloat()
+ (overlayParams.sensorBounds.width() + paddingX).toFloat(),
+ (overlayParams.sensorBounds.height() + paddingY).toFloat()
)
animationViewController?.onSensorRectUpdated(RectF(sensorRect))
}
diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java
index b7c4009..eef9d5b 100644
--- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java
+++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java
@@ -137,7 +137,6 @@
private Runnable mOnSessionCompleteListener;
-
private InputMonitor mInputMonitor;
private InputEventReceiver mInputEventReceiver;
@@ -145,6 +144,7 @@
private BroadcastReceiver mScreenshotReceiver;
private boolean mBlockAttach = false;
+ private Animator mExitAnimator;
public ClipboardOverlayController(Context context,
BroadcastDispatcher broadcastDispatcher,
@@ -200,6 +200,7 @@
@Override
public void onSwipeDismissInitiated(Animator animator) {
mUiEventLogger.log(CLIPBOARD_OVERLAY_SWIPE_DISMISSED);
+ mExitAnimator = animator;
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
@@ -233,7 +234,6 @@
mWindow.setContentView(mContainer);
updateInsets(mWindowManager.getCurrentWindowMetrics().getWindowInsets());
mView.requestLayout();
- mView.post(this::animateIn);
});
mTimeoutHandler.setOnTimeoutRunnable(() -> {
@@ -273,6 +273,9 @@
}
void setClipData(ClipData clipData, String clipSource) {
+ if (mExitAnimator != null && mExitAnimator.isRunning()) {
+ mExitAnimator.cancel();
+ }
reset();
if (clipData == null || clipData.getItemCount() == 0) {
showTextPreview(mContext.getResources().getString(
@@ -305,6 +308,7 @@
} else {
mRemoteCopyChip.setVisibility(View.GONE);
}
+ withWindowAttached(() -> mContainer.post(this::animateIn));
mTimeoutHandler.resetTimeout();
}
@@ -411,7 +415,7 @@
private void showTextPreview(CharSequence text) {
mTextPreview.setVisibility(View.VISIBLE);
mImagePreview.setVisibility(View.GONE);
- mTextPreview.setText(text);
+ mTextPreview.setText(text.subSequence(0, Math.min(500, text.length())));
mEditChip.setVisibility(View.GONE);
}
@@ -428,10 +432,6 @@
}
private void showEditableImage(Uri uri) {
- mTextPreview.setVisibility(View.GONE);
- mImagePreview.setVisibility(View.VISIBLE);
- mEditChip.setAlpha(1f);
- mActionContainerBackground.setVisibility(View.VISIBLE);
ContentResolver resolver = mContext.getContentResolver();
try {
int size = mContext.getResources().getDimensionPixelSize(R.dimen.overlay_x_scale);
@@ -441,7 +441,14 @@
mImagePreview.setImageBitmap(thumbnail);
} catch (IOException e) {
Log.e(TAG, "Thumbnail loading failed", e);
+ showTextPreview(
+ mContext.getResources().getString(R.string.clipboard_overlay_text_copied));
+ return;
}
+ mTextPreview.setVisibility(View.GONE);
+ mImagePreview.setVisibility(View.VISIBLE);
+ mEditChip.setAlpha(1f);
+ mActionContainerBackground.setVisibility(View.VISIBLE);
View.OnClickListener listener = v -> editImage(uri);
mEditChip.setOnClickListener(listener);
mEditChip.setContentDescription(
@@ -472,12 +479,23 @@
private void animateOut() {
Animator anim = getExitAnimation();
anim.addListener(new AnimatorListenerAdapter() {
+ private boolean mCancelled;
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ super.onAnimationCancel(animation);
+ mCancelled = true;
+ }
+
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
- hideImmediate();
+ if (!mCancelled) {
+ hideImmediate();
+ }
}
});
+ mExitAnimator = anim;
anim.start();
}
@@ -630,6 +648,7 @@
private void reset() {
mView.setTranslationX(0);
mContainer.setAlpha(0);
+ mActionContainerBackground.setVisibility(View.GONE);
resetActionChips();
mTimeoutHandler.cancelTimeout();
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/AndroidInternalsModule.java b/packages/SystemUI/src/com/android/systemui/dagger/AndroidInternalsModule.java
index 48c54bc..0992882 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/AndroidInternalsModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/AndroidInternalsModule.java
@@ -19,9 +19,13 @@
import android.content.Context;
import com.android.internal.logging.MetricsLogger;
+import com.android.internal.logging.UiEventLogger;
+import com.android.internal.logging.UiEventLoggerImpl;
import com.android.internal.util.NotificationMessagingUtil;
import com.android.internal.widget.LockPatternUtils;
+import javax.inject.Singleton;
+
import dagger.Module;
import dagger.Provides;
@@ -32,14 +36,14 @@
public class AndroidInternalsModule {
/** */
@Provides
- @SysUISingleton
+ @Singleton
public LockPatternUtils provideLockPatternUtils(Context context) {
return new LockPatternUtils(context);
}
/** */
@Provides
- @SysUISingleton
+ @Singleton
public MetricsLogger provideMetricsLogger() {
return new MetricsLogger();
}
@@ -50,4 +54,10 @@
return new NotificationMessagingUtil(context);
}
+ /** Provides an instance of {@link com.android.internal.logging.UiEventLogger} */
+ @Provides
+ @Singleton
+ static UiEventLogger provideUiEventLogger() {
+ return new UiEventLoggerImpl();
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/DependencyProvider.java b/packages/SystemUI/src/com/android/systemui/dagger/DependencyProvider.java
index 31ad36f..19e98f2 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/DependencyProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/DependencyProvider.java
@@ -27,7 +27,6 @@
*/
@Deprecated
@Module(includes = {
- AndroidInternalsModule.class,
BroadcastDispatcherModule.class,
LeakModule.class,
NightDisplayListenerModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java b/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java
index e512b7c..5b6ddd8 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/FrameworkServicesModule.java
@@ -90,6 +90,7 @@
import com.android.systemui.Prefs;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.dagger.qualifiers.TestHarness;
import com.android.systemui.shared.system.PackageManagerWrapper;
import java.util.Optional;
@@ -445,6 +446,13 @@
@Provides
@Singleton
+ @TestHarness
+ static boolean provideIsTestHarness() {
+ return ActivityManager.isRunningInUserTestHarness();
+ }
+
+ @Provides
+ @Singleton
static TrustManager provideTrustManager(Context context) {
return context.getSystemService(TrustManager.class);
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java b/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java
index 620feec..ca725c0 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java
@@ -16,23 +16,15 @@
package com.android.systemui.dagger;
-import android.app.ActivityManager;
import android.content.Context;
import android.util.DisplayMetrics;
+import android.view.Display;
-import com.android.internal.logging.UiEventLogger;
-import com.android.internal.logging.UiEventLoggerImpl;
-import com.android.systemui.dagger.qualifiers.TestHarness;
-import com.android.systemui.dagger.qualifiers.UiBackground;
+import com.android.systemui.dagger.qualifiers.Application;
import com.android.systemui.plugins.PluginsModule;
import com.android.systemui.unfold.UnfoldTransitionModule;
import com.android.systemui.util.concurrency.GlobalConcurrencyModule;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-
-import javax.inject.Singleton;
-
import dagger.Module;
import dagger.Provides;
@@ -52,43 +44,29 @@
* Please use discretion when adding things to the global scope.
*/
@Module(includes = {
+ AndroidInternalsModule.class,
FrameworkServicesModule.class,
GlobalConcurrencyModule.class,
UnfoldTransitionModule.class,
PluginsModule.class,
})
public class GlobalModule {
+ /**
+ * TODO(b/229228871): This should be the default. No undecorated context should be available.
+ */
+ @Provides
+ @Application
+ public Context provideApplicationContext(Context context) {
+ return context.getApplicationContext();
+ }
- /** */
+ /**
+ * @deprecated Deprecdated because {@link Display#getMetrics} is deprecated.
+ */
@Provides
public DisplayMetrics provideDisplayMetrics(Context context) {
DisplayMetrics displayMetrics = new DisplayMetrics();
context.getDisplay().getMetrics(displayMetrics);
return displayMetrics;
}
-
- /** Provides an instance of {@link com.android.internal.logging.UiEventLogger} */
- @Provides
- @Singleton
- static UiEventLogger provideUiEventLogger() {
- return new UiEventLoggerImpl();
- }
-
- @Provides
- @TestHarness
- static boolean provideIsTestHarness() {
- return ActivityManager.isRunningInUserTestHarness();
- }
-
- /**
- * Provide an Executor specifically for running UI operations on a separate thread.
- *
- * Keep submitted runnables short and to the point, just as with any other UI code.
- */
- @Provides
- @Singleton
- @UiBackground
- public static Executor provideUiBackgroundExecutor() {
- return Executors.newSingleThreadExecutor();
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/qualifiers/Application.java b/packages/SystemUI/src/com/android/systemui/dagger/qualifiers/Application.java
new file mode 100644
index 0000000..21e53a5
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/dagger/qualifiers/Application.java
@@ -0,0 +1,35 @@
+/*
+ * 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.dagger.qualifiers;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import android.content.Context;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+
+import javax.inject.Qualifier;
+
+/**
+ * Used to qualify a context as {@link Context#getApplicationContext}
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+public @interface Application {
+}
diff --git a/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt b/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt
index 3731eca..b5a0cfc 100644
--- a/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt
+++ b/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt
@@ -68,6 +68,15 @@
reloadMeasures()
}
+ var physicalPixelDisplaySizeRatio: Float = 1f
+ set(value) {
+ if (field == value) {
+ return
+ }
+ field = value
+ reloadMeasures()
+ }
+
init {
reloadRes()
reloadMeasures()
@@ -134,6 +143,19 @@
bottomRoundedSize = Size(length, length)
}
}
+
+ if (physicalPixelDisplaySizeRatio != 1f) {
+ if (topRoundedSize.width != 0) {
+ topRoundedSize = Size(
+ (physicalPixelDisplaySizeRatio * topRoundedSize.width + 0.5f).toInt(),
+ (physicalPixelDisplaySizeRatio * topRoundedSize.height + 0.5f).toInt())
+ }
+ if (bottomRoundedSize.width != 0) {
+ bottomRoundedSize = Size(
+ (physicalPixelDisplaySizeRatio * bottomRoundedSize.width + 0.5f).toInt(),
+ (physicalPixelDisplaySizeRatio * bottomRoundedSize.height + 0.5f).toInt())
+ }
+ }
}
private fun getDrawable(
@@ -160,5 +182,6 @@
pw.println(" topRoundedSize(w,h)=(${topRoundedSize.width},${topRoundedSize.height})")
pw.println(" bottomRoundedSize(w,h)=(${bottomRoundedSize.width}," +
"${bottomRoundedSize.height})")
+ pw.println(" physicalPixelDisplaySizeRatio=$physicalPixelDisplaySizeRatio")
}
}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
index db225cf..96f77b3 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
@@ -38,7 +38,6 @@
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dreams.complication.Complication;
-import com.android.systemui.dreams.complication.DreamPreviewComplication;
import com.android.systemui.dreams.dagger.DreamOverlayComponent;
import com.android.systemui.dreams.touch.DreamOverlayTouchMonitor;
@@ -63,7 +62,6 @@
// content area).
private final DreamOverlayContainerViewController mDreamOverlayContainerViewController;
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
- private final DreamPreviewComplication mPreviewComplication;
private final UiEventLogger mUiEventLogger;
// A reference to the {@link Window} used to hold the dream overlay.
@@ -127,14 +125,12 @@
DreamOverlayComponent.Factory dreamOverlayComponentFactory,
DreamOverlayStateController stateController,
KeyguardUpdateMonitor keyguardUpdateMonitor,
- DreamPreviewComplication previewComplication,
UiEventLogger uiEventLogger) {
mContext = context;
mExecutor = executor;
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mKeyguardUpdateMonitor.registerCallback(mKeyguardCallback);
mStateController = stateController;
- mPreviewComplication = previewComplication;
mUiEventLogger = uiEventLogger;
final DreamOverlayComponent component =
@@ -159,9 +155,6 @@
windowManager.removeView(mWindow.getDecorView());
}
mStateController.setOverlayActive(false);
- mPreviewComplication.setDreamLabel(null);
- mStateController.removeComplication(mPreviewComplication);
- mStateController.setPreviewMode(false);
mDestroyed = true;
super.onDestroy();
}
@@ -177,11 +170,6 @@
return;
}
mStateController.setShouldShowComplications(shouldShowComplications());
- mStateController.setPreviewMode(isPreviewMode());
- if (isPreviewMode()) {
- mPreviewComplication.setDreamLabel(getDreamLabel());
- mStateController.addComplication(mPreviewComplication);
- }
addOverlayWindowLocked(layoutParams);
setCurrentState(Lifecycle.State.RESUMED);
mStateController.setOverlayActive(true);
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java
index 6860998..fc71e2f 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java
@@ -50,7 +50,6 @@
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
public static final int STATE_DREAM_OVERLAY_ACTIVE = 1 << 0;
- public static final int STATE_PREVIEW_MODE = 1 << 1;
private static final int OP_CLEAR_STATE = 1;
private static final int OP_SET_STATE = 2;
@@ -250,18 +249,4 @@
mCallbacks.forEach(Callback::onAvailableComplicationTypesChanged);
});
}
-
- /**
- * Sets whether the dream is running in preview mode.
- */
- public void setPreviewMode(boolean isPreviewMode) {
- modifyState(isPreviewMode ? OP_SET_STATE : OP_CLEAR_STATE, STATE_PREVIEW_MODE);
- }
-
- /**
- * Returns whether the dream is running in preview mode.
- */
- public boolean isPreviewMode() {
- return containsState(STATE_PREVIEW_MODE);
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamPreviewComplication.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamPreviewComplication.java
deleted file mode 100644
index cc2e571..0000000
--- a/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamPreviewComplication.java
+++ /dev/null
@@ -1,137 +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.dreams.complication;
-
-import static com.android.systemui.dreams.complication.dagger.DreamPreviewComplicationComponent.DREAM_LABEL;
-import static com.android.systemui.dreams.complication.dagger.DreamPreviewComplicationComponent.DreamPreviewComplicationModule.DREAM_PREVIEW_COMPLICATION_LAYOUT_PARAMS;
-import static com.android.systemui.dreams.complication.dagger.DreamPreviewComplicationComponent.DreamPreviewComplicationModule.DREAM_PREVIEW_COMPLICATION_VIEW;
-
-import android.graphics.drawable.BitmapDrawable;
-import android.graphics.drawable.Drawable;
-import android.text.TextUtils;
-import android.view.View;
-import android.widget.TextView;
-
-import androidx.annotation.Nullable;
-
-import com.android.systemui.dreams.complication.dagger.DreamPreviewComplicationComponent;
-import com.android.systemui.util.ViewController;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-/**
- * Preview complication shown when user is previewing a dream.
- */
-public class DreamPreviewComplication implements Complication {
- DreamPreviewComplicationComponent.Factory mComponentFactory;
- @Nullable
- private CharSequence mDreamLabel;
-
- /**
- * Default constructor for {@link DreamPreviewComplication}.
- */
- @Inject
- public DreamPreviewComplication(
- DreamPreviewComplicationComponent.Factory componentFactory) {
- mComponentFactory = componentFactory;
- }
-
- /**
- * Create {@link DreamPreviewViewHolder}.
- */
- @Override
- public ViewHolder createView(ComplicationViewModel model) {
- return mComponentFactory.create(model, mDreamLabel).getViewHolder();
- }
-
- /**
- * Sets the user-facing label for the current dream.
- */
- public void setDreamLabel(@Nullable CharSequence dreamLabel) {
- mDreamLabel = dreamLabel;
- }
-
- /**
- * ViewHolder to contain value/logic associated with a Preview Complication View.
- */
- public static class DreamPreviewViewHolder implements ViewHolder {
- private final TextView mView;
- private final ComplicationLayoutParams mLayoutParams;
- private final DreamPreviewViewController mViewController;
-
- @Inject
- DreamPreviewViewHolder(@Named(DREAM_PREVIEW_COMPLICATION_VIEW) TextView view,
- DreamPreviewViewController controller,
- @Named(DREAM_PREVIEW_COMPLICATION_LAYOUT_PARAMS)
- ComplicationLayoutParams layoutParams,
- @Named(DREAM_LABEL) @Nullable CharSequence dreamLabel) {
- mView = view;
- mLayoutParams = layoutParams;
- mViewController = controller;
- mViewController.init();
-
- if (!TextUtils.isEmpty(dreamLabel)) {
- mView.setText(dreamLabel);
- }
- for (Drawable drawable : mView.getCompoundDrawablesRelative()) {
- if (drawable instanceof BitmapDrawable) {
- drawable.setAutoMirrored(true);
- }
- }
- }
-
- @Override
- public View getView() {
- return mView;
- }
-
- @Override
- public ComplicationLayoutParams getLayoutParams() {
- return mLayoutParams;
- }
-
- @Override
- public int getCategory() {
- return CATEGORY_SYSTEM;
- }
- }
-
- /**
- * ViewController to contain value/logic associated with a Preview Complication View.
- */
- static class DreamPreviewViewController extends ViewController<TextView> {
- private final ComplicationViewModel mViewModel;
-
- @Inject
- DreamPreviewViewController(@Named(DREAM_PREVIEW_COMPLICATION_VIEW) TextView view,
- ComplicationViewModel viewModel) {
- super(view);
- mViewModel = viewModel;
- }
-
- @Override
- protected void onViewAttached() {
- mView.setOnClickListener(v -> mViewModel.exitDream());
- }
-
- @Override
- protected void onViewDetached() {
- mView.setOnClickListener(null);
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/dagger/DreamPreviewComplicationComponent.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/dagger/DreamPreviewComplicationComponent.java
deleted file mode 100644
index 502e31e..0000000
--- a/packages/SystemUI/src/com/android/systemui/dreams/complication/dagger/DreamPreviewComplicationComponent.java
+++ /dev/null
@@ -1,117 +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.dreams.complication.dagger;
-
-
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-import android.widget.TextView;
-
-import androidx.annotation.Nullable;
-
-import com.android.internal.util.Preconditions;
-import com.android.systemui.R;
-import com.android.systemui.dreams.complication.ComplicationLayoutParams;
-import com.android.systemui.dreams.complication.ComplicationViewModel;
-import com.android.systemui.dreams.complication.DreamPreviewComplication.DreamPreviewViewHolder;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-
-import javax.inject.Named;
-import javax.inject.Scope;
-
-import dagger.BindsInstance;
-import dagger.Module;
-import dagger.Provides;
-import dagger.Subcomponent;
-
-/**
- * {@link DreamPreviewComplicationComponent} is responsible for generating dependencies
- * surrounding the
- * Preview {@link com.android.systemui.dreams.complication.Complication}, such as the layout
- * details.
- */
-@Subcomponent(modules = {
- DreamPreviewComplicationComponent.DreamPreviewComplicationModule.class,
-})
-@DreamPreviewComplicationComponent.DreamPreviewComplicationScope
-public interface DreamPreviewComplicationComponent {
- String DREAM_LABEL = "dream_label";
-
- /**
- * Creates {@link DreamPreviewViewHolder}.
- */
- DreamPreviewViewHolder getViewHolder();
-
- @Documented
- @Retention(RUNTIME)
- @Scope
- @interface DreamPreviewComplicationScope {
- }
-
- /**
- * Generates {@link DreamPreviewComplicationComponent}.
- */
- @Subcomponent.Factory
- interface Factory {
- DreamPreviewComplicationComponent create(
- @BindsInstance ComplicationViewModel viewModel,
- @Named(DREAM_LABEL) @BindsInstance @Nullable CharSequence dreamLabel);
- }
-
- /**
- * Scoped values for {@link DreamPreviewComplicationComponent}.
- */
- @Module
- interface DreamPreviewComplicationModule {
- String DREAM_PREVIEW_COMPLICATION_VIEW = "preview_complication_view";
- String DREAM_PREVIEW_COMPLICATION_LAYOUT_PARAMS = "preview_complication_layout_params";
- // Order weight of insert into parent container
- int INSERT_ORDER_WEIGHT = 1000;
-
- /**
- * Provides the complication view.
- */
- @Provides
- @DreamPreviewComplicationScope
- @Named(DREAM_PREVIEW_COMPLICATION_VIEW)
- static TextView provideComplicationView(LayoutInflater layoutInflater) {
- return Preconditions.checkNotNull((TextView)
- layoutInflater.inflate(R.layout.dream_overlay_complication_preview,
- null, false),
- "R.layout.dream_overlay_complication_preview did not properly inflated");
- }
-
- /**
- * Provides the layout parameters for the complication view.
- */
- @Provides
- @DreamPreviewComplicationScope
- @Named(DREAM_PREVIEW_COMPLICATION_LAYOUT_PARAMS)
- static ComplicationLayoutParams provideLayoutParams() {
- return new ComplicationLayoutParams(0,
- ViewGroup.LayoutParams.WRAP_CONTENT,
- ComplicationLayoutParams.POSITION_TOP
- | ComplicationLayoutParams.POSITION_START,
- ComplicationLayoutParams.DIRECTION_DOWN,
- INSERT_ORDER_WEIGHT, /* snapToGuide= */ true);
- }
- }
-}
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 c7b02cd..c1dff24 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
@@ -19,7 +19,6 @@
import android.content.Context;
import com.android.settingslib.dream.DreamBackend;
-import com.android.systemui.dreams.complication.dagger.DreamPreviewComplicationComponent;
import com.android.systemui.dreams.complication.dagger.RegisteredComplicationsModule;
import dagger.Module;
@@ -33,7 +32,6 @@
},
subcomponents = {
DreamOverlayComponent.class,
- DreamPreviewComplicationComponent.class,
})
public interface DreamModule {
/**
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamsSmartspaceController.kt b/packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamsSmartspaceController.kt
index 9b99c52..a309547 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamsSmartspaceController.kt
+++ b/packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamsSmartspaceController.kt
@@ -98,6 +98,7 @@
view.setPrimaryTextColor(Color.WHITE)
smartspaceViews.add(view)
connectSession()
+ view.setDozeAmount(0f)
}
override fun onViewDetachedFromWindow(v: View) {
@@ -127,6 +128,7 @@
}
val view = buildView(parent)
+
connectSession()
return view
@@ -136,12 +138,13 @@
return if (plugin != null) {
var view = smartspaceViewComponentFactory.create(parent, plugin, stateChangeListener)
.getView()
-
- if (view is View) {
- return view
+ if (view !is View) {
+ return null
}
- return null
+ view.setIsDreaming(true)
+
+ return view
} else {
null
}
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.java b/packages/SystemUI/src/com/android/systemui/flags/Flags.java
index afa7d5e..e963c39 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.java
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.java
@@ -151,7 +151,7 @@
/***************************************/
// 900 - media
public static final BooleanFlag MEDIA_TAP_TO_TRANSFER = new BooleanFlag(900, true);
- public static final BooleanFlag MEDIA_SESSION_ACTIONS = new BooleanFlag(901, false);
+ public static final BooleanFlag MEDIA_SESSION_ACTIONS = new BooleanFlag(901, true);
public static final BooleanFlag MEDIA_NEARBY_DEVICES = new BooleanFlag(903, true);
public static final BooleanFlag MEDIA_MUTE_AWAIT = new BooleanFlag(904, true);
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 0f5022d..2e13732 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -119,6 +119,7 @@
import com.android.systemui.keyguard.dagger.KeyguardModule;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeDepthController;
@@ -2603,6 +2604,9 @@
finishSurfaceBehindRemoteAnimation(cancelled);
mSurfaceBehindRemoteAnimationRequested = false;
+
+ // The remote animation is over, so we're not going away anymore.
+ mKeyguardStateController.notifyKeyguardGoingAway(false);
});
mKeyguardUnlockAnimationControllerLazy.get().notifyFinishedKeyguardExitAnimation(
@@ -2621,6 +2625,7 @@
ActivityTaskManager.getService().keyguardGoingAway(
WindowManagerPolicyConstants.KEYGUARD_GOING_AWAY_FLAG_NO_WINDOW_ANIMATIONS
| WindowManagerPolicyConstants.KEYGUARD_GOING_AWAY_FLAG_WITH_WALLPAPER);
+ mKeyguardStateController.notifyKeyguardGoingAway(true);
} catch (RemoteException e) {
mSurfaceBehindRemoteAnimationRequested = false;
e.printStackTrace();
@@ -2784,6 +2789,13 @@
public void onWakeAndUnlocking() {
Trace.beginSection("KeyguardViewMediator#onWakeAndUnlocking");
mWakeAndUnlocking = true;
+
+ // We're going to animate in the Launcher, so ask WM to clear the task snapshot so we don't
+ // initially display an old snapshot with all of the icons visible. We're System UI, so
+ // we're allowed to pass in null to ask WM to find the home activity for us to prevent
+ // needing to IPC to Launcher.
+ ActivityManagerWrapper.getInstance().invalidateHomeTaskSnapshot(null /* homeActivity */);
+
keyguardDone();
Trace.endSection();
}
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 79ac9e8..2467169 100644
--- a/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java
+++ b/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java
@@ -176,7 +176,6 @@
return factory.create("MediaTttReceiver", 20);
}
-
/**
* Provides a logging buffer for logs related to the media mute-await connections. See
* {@link com.android.systemui.media.muteawait.MediaMuteAwaitConnectionManager}.
@@ -199,6 +198,26 @@
return factory.create("NearbyMediaDevicesLog", 20);
}
+ /**
+ * Provides a buffer for logs related to media view events
+ */
+ @Provides
+ @SysUISingleton
+ @MediaViewLog
+ public static LogBuffer provideMediaViewLogBuffer(LogBufferFactory factory) {
+ return factory.create("MediaView", 100);
+ }
+
+ /**
+ * Provides a buffer for media playback state changes
+ */
+ @Provides
+ @SysUISingleton
+ @MediaTimeoutListenerLog
+ public static LogBuffer providesMediaTimeoutListenerLogBuffer(LogBufferFactory factory) {
+ return factory.create("MediaTimeout", 100);
+ }
+
/** Allows logging buffers to be tweaked via adb on debug builds but not on prod builds. */
@Provides
@SysUISingleton
diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/MediaTimeoutListenerLog.java b/packages/SystemUI/src/com/android/systemui/log/dagger/MediaTimeoutListenerLog.java
new file mode 100644
index 0000000..53963fc
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/log/dagger/MediaTimeoutListenerLog.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.log.dagger;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import com.android.systemui.log.LogBuffer;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+
+import javax.inject.Qualifier;
+
+/**
+ * A {@link LogBuffer} for {@link com.android.systemui.media.MediaTimeoutLogger}
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+public @interface MediaTimeoutListenerLog {
+}
diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/MediaViewLog.java b/packages/SystemUI/src/com/android/systemui/log/dagger/MediaViewLog.java
new file mode 100644
index 0000000..75a34fc
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/log/dagger/MediaViewLog.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.log.dagger;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import com.android.systemui.log.LogBuffer;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+
+import javax.inject.Qualifier;
+
+/**
+ * A {@link LogBuffer} for {@link com.android.systemui.media.MediaViewLogger}
+ */
+@Qualifier
+@Documented
+@Retention(RUNTIME)
+public @interface MediaViewLog {
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/ColorSchemeTransition.kt b/packages/SystemUI/src/com/android/systemui/media/ColorSchemeTransition.kt
index 2ae1806..5a214d1 100644
--- a/packages/SystemUI/src/com/android/systemui/media/ColorSchemeTransition.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/ColorSchemeTransition.kt
@@ -95,66 +95,61 @@
val surfaceColor = colorTransitionFactory(
bgColor,
- { colorScheme -> colorScheme.accent2[9] }, // A2-800
- { surfaceColor ->
- val colorList = ColorStateList.valueOf(surfaceColor)
- mediaViewHolder.player.backgroundTintList = colorList
- mediaViewHolder.albumView.foregroundTintList = colorList
- mediaViewHolder.albumView.backgroundTintList = colorList
- mediaViewHolder.seamlessIcon.imageTintList = colorList
- mediaViewHolder.seamlessText.setTextColor(surfaceColor)
- mediaViewHolder.dismissText.setTextColor(surfaceColor)
- })
+ ::surfaceFromScheme
+ ) { surfaceColor ->
+ val colorList = ColorStateList.valueOf(surfaceColor)
+ mediaViewHolder.player.backgroundTintList = colorList
+ mediaViewHolder.albumView.foregroundTintList = colorList
+ mediaViewHolder.albumView.backgroundTintList = colorList
+ mediaViewHolder.seamlessIcon.imageTintList = colorList
+ mediaViewHolder.seamlessText.setTextColor(surfaceColor)
+ mediaViewHolder.gutsViewHolder.setSurfaceColor(surfaceColor)
+ }
val accentPrimary = colorTransitionFactory(
loadDefaultColor(R.attr.textColorPrimary),
- { colorScheme -> colorScheme.accent1[2] }, // A1-100
- { accentPrimary ->
- val accentColorList = ColorStateList.valueOf(accentPrimary)
- mediaViewHolder.actionPlayPause.backgroundTintList = accentColorList
- mediaViewHolder.seamlessButton.backgroundTintList = accentColorList
- mediaViewHolder.settings.imageTintList = accentColorList
- mediaViewHolder.cancelText.backgroundTintList = accentColorList
- mediaViewHolder.dismissText.backgroundTintList = accentColorList
- })
+ ::accentPrimaryFromScheme
+ ) { accentPrimary ->
+ val accentColorList = ColorStateList.valueOf(accentPrimary)
+ mediaViewHolder.actionPlayPause.backgroundTintList = accentColorList
+ mediaViewHolder.seamlessButton.backgroundTintList = accentColorList
+ mediaViewHolder.gutsViewHolder.setAccentPrimaryColor(accentPrimary)
+ }
val textPrimary = colorTransitionFactory(
loadDefaultColor(R.attr.textColorPrimary),
- { colorScheme -> colorScheme.neutral1[1] }, // N1-50
- { textPrimary ->
- mediaViewHolder.titleText.setTextColor(textPrimary)
- val textColorList = ColorStateList.valueOf(textPrimary)
- mediaViewHolder.seekBar.thumb.setTintList(textColorList)
- mediaViewHolder.seekBar.progressTintList = textColorList
- mediaViewHolder.longPressText.setTextColor(textColorList)
- mediaViewHolder.cancelText.setTextColor(textColorList)
- mediaViewHolder.scrubbingElapsedTimeView.setTextColor(textColorList)
- mediaViewHolder.scrubbingTotalTimeView.setTextColor(textColorList)
- for (button in mediaViewHolder.getTransparentActionButtons()) {
- button.imageTintList = textColorList
- }
- })
+ ::textPrimaryFromScheme
+ ) { textPrimary ->
+ mediaViewHolder.titleText.setTextColor(textPrimary)
+ val textColorList = ColorStateList.valueOf(textPrimary)
+ mediaViewHolder.seekBar.thumb.setTintList(textColorList)
+ mediaViewHolder.seekBar.progressTintList = textColorList
+ mediaViewHolder.scrubbingElapsedTimeView.setTextColor(textColorList)
+ mediaViewHolder.scrubbingTotalTimeView.setTextColor(textColorList)
+ for (button in mediaViewHolder.getTransparentActionButtons()) {
+ button.imageTintList = textColorList
+ }
+ mediaViewHolder.gutsViewHolder.setTextPrimaryColor(textPrimary)
+ }
val textPrimaryInverse = colorTransitionFactory(
loadDefaultColor(R.attr.textColorPrimaryInverse),
- { colorScheme -> colorScheme.neutral1[10] }, // N1-900
- { textPrimaryInverse ->
- mediaViewHolder.actionPlayPause.imageTintList =
- ColorStateList.valueOf(textPrimaryInverse)
- })
+ ::textPrimaryInverseFromScheme
+ ) { textPrimaryInverse ->
+ mediaViewHolder.actionPlayPause.imageTintList = ColorStateList.valueOf(textPrimaryInverse)
+ }
val textSecondary = colorTransitionFactory(
loadDefaultColor(R.attr.textColorSecondary),
- { colorScheme -> colorScheme.neutral2[3] }, // N2-200
- { textSecondary -> mediaViewHolder.artistText.setTextColor(textSecondary) })
+ ::textSecondaryFromScheme
+ ) { textSecondary -> mediaViewHolder.artistText.setTextColor(textSecondary) }
val textTertiary = colorTransitionFactory(
loadDefaultColor(R.attr.textColorTertiary),
- { colorScheme -> colorScheme.neutral2[5] }, // N2-400
- { textTertiary ->
- mediaViewHolder.seekBar.progressBackgroundTintList =
- ColorStateList.valueOf(textTertiary)
- })
+ ::textTertiaryFromScheme
+ ) { textTertiary ->
+ mediaViewHolder.seekBar.progressBackgroundTintList = ColorStateList.valueOf(textTertiary)
+ }
val colorTransitions = arrayOf(
surfaceColor, accentPrimary, textPrimary,
@@ -167,4 +162,4 @@
fun updateColorScheme(colorScheme: ColorScheme?) {
colorTransitions.forEach { it.updateColorScheme(colorScheme) }
}
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/GutsViewHolder.kt b/packages/SystemUI/src/com/android/systemui/media/GutsViewHolder.kt
new file mode 100644
index 0000000..1a48a84
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/GutsViewHolder.kt
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media
+
+import android.content.res.ColorStateList
+import android.util.Log
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageButton
+import android.widget.TextView
+import com.android.systemui.R
+import com.android.systemui.monet.ColorScheme
+
+/**
+ * A view holder for the guts menu of a media player. The guts are shown when the user long-presses
+ * on the media player.
+ *
+ * Both [MediaViewHolder] and [RecommendationViewHolder] use the same guts menu layout, so this
+ * class helps share logic between the two.
+ */
+class GutsViewHolder constructor(itemView: View) {
+ val gutsText: TextView = itemView.requireViewById(R.id.remove_text)
+ val cancel: View = itemView.requireViewById(R.id.cancel)
+ val cancelText: TextView = itemView.requireViewById(R.id.cancel_text)
+ val dismiss: ViewGroup = itemView.requireViewById(R.id.dismiss)
+ val dismissText: TextView = itemView.requireViewById(R.id.dismiss_text)
+ val settings: ImageButton = itemView.requireViewById(R.id.settings)
+
+ /** Marquees the main text of the guts menu. */
+ fun marquee(start: Boolean, delay: Long, tag: String) {
+ val gutsTextHandler = gutsText.handler
+ if (gutsTextHandler == null) {
+ Log.d(tag, "marquee while longPressText.getHandler() is null", Exception())
+ return
+ }
+ gutsTextHandler.postDelayed( { gutsText.isSelected = start }, delay)
+ }
+
+ /** Sets the right colors on all the guts views based on the given [ColorScheme]. */
+ fun setColors(colorScheme: ColorScheme) {
+ setSurfaceColor(surfaceFromScheme(colorScheme))
+ setTextPrimaryColor(textPrimaryFromScheme(colorScheme))
+ setAccentPrimaryColor(accentPrimaryFromScheme(colorScheme))
+ }
+
+ /** Sets the surface color on all guts views that use it. */
+ fun setSurfaceColor(surfaceColor: Int) {
+ dismissText.setTextColor(surfaceColor)
+ }
+
+ /** Sets the primary accent color on all guts views that use it. */
+ fun setAccentPrimaryColor(accentPrimary: Int) {
+ val accentColorList = ColorStateList.valueOf(accentPrimary)
+ settings.imageTintList = accentColorList
+ cancelText.backgroundTintList = accentColorList
+ dismissText.backgroundTintList = accentColorList
+ }
+
+ /** Sets the primary text color on all guts views that use it. */
+ fun setTextPrimaryColor(textPrimary: Int) {
+ val textColorList = ColorStateList.valueOf(textPrimary)
+ gutsText.setTextColor(textColorList)
+ cancelText.setTextColor(textColorList)
+ }
+
+ companion object {
+ val ids = setOf(
+ R.id.remove_text,
+ R.id.cancel,
+ R.id.dismiss,
+ R.id.settings
+ )
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
index ca25a18..7b72ab7 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
@@ -533,7 +533,9 @@
}
private fun recreatePlayers() {
- pageIndicator.tintList = ColorStateList.valueOf(R.color.material_dynamic_neutral_variant80)
+ pageIndicator.tintList = ColorStateList.valueOf(
+ context.getColor(R.color.media_paging_indicator)
+ )
MediaPlayerData.mediaData().forEach { (key, data, isSsMediaRec) ->
if (isSsMediaRec) {
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaColorSchemes.kt b/packages/SystemUI/src/com/android/systemui/media/MediaColorSchemes.kt
new file mode 100644
index 0000000..97c6014
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaColorSchemes.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media
+
+import com.android.systemui.monet.ColorScheme
+
+/** Returns the surface color for media controls based on the scheme. */
+internal fun surfaceFromScheme(scheme: ColorScheme) = scheme.accent2[9] // A2-800
+
+/** Returns the primary accent color for media controls based on the scheme. */
+internal fun accentPrimaryFromScheme(scheme: ColorScheme) = scheme.accent1[2] // A1-100
+
+/** Returns the primary text color for media controls based on the scheme. */
+internal fun textPrimaryFromScheme(scheme: ColorScheme) = scheme.neutral1[1] // N1-50
+
+/** Returns the inverse of the primary text color for media controls based on the scheme. */
+internal fun textPrimaryInverseFromScheme(scheme: ColorScheme) = scheme.neutral1[10] // N1-900
+
+/** Returns the secondary text color for media controls based on the scheme. */
+internal fun textSecondaryFromScheme(scheme: ColorScheme) = scheme.neutral2[3] // N2-200
+
+/** Returns the tertiary text color for media controls based on the scheme. */
+internal fun textTertiaryFromScheme(scheme: ColorScheme) = scheme.neutral2[5] // N2-400
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
index 48a63ed..d2c35bd 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
@@ -60,7 +60,6 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.jank.InteractionJankMonitor;
import com.android.internal.logging.InstanceId;
-import com.android.settingslib.Utils;
import com.android.settingslib.widget.AdaptiveIcon;
import com.android.systemui.ActivityIntentHelper;
import com.android.systemui.R;
@@ -176,9 +175,12 @@
private String mPackageName;
private boolean mIsScrubbing = false;
+ private boolean mIsSeekBarEnabled = false;
private final SeekBarViewModel.ScrubbingChangeListener mScrubbingChangeListener =
this::setIsScrubbing;
+ private final SeekBarViewModel.EnabledChangeListener mEnabledChangeListener =
+ this::setIsSeekBarEnabled;
/**
* Initialize a new control panel
@@ -235,8 +237,9 @@
public void onDestroy() {
if (mSeekBarObserver != null) {
mSeekBarViewModel.getProgress().removeObserver(mSeekBarObserver);
- mSeekBarViewModel.removeScrubbingChangeListener(mScrubbingChangeListener);
}
+ mSeekBarViewModel.removeScrubbingChangeListener(mScrubbingChangeListener);
+ mSeekBarViewModel.removeEnabledChangeListener(mEnabledChangeListener);
mSeekBarViewModel.onDestroy();
mMediaViewController.onDestroy();
}
@@ -283,7 +286,7 @@
}
/** Sets whether the user is touching the seek bar to change the track position. */
- public void setIsScrubbing(boolean isScrubbing) {
+ private void setIsScrubbing(boolean isScrubbing) {
if (mMediaData == null || mMediaData.getSemanticActions() == null) {
return;
}
@@ -295,6 +298,14 @@
updateDisplayForScrubbingChange(mMediaData.getSemanticActions()));
}
+ private void setIsSeekBarEnabled(boolean isSeekBarEnabled) {
+ if (isSeekBarEnabled == this.mIsSeekBarEnabled) {
+ return;
+ }
+ this.mIsSeekBarEnabled = isSeekBarEnabled;
+ updateSeekBarVisibility();
+ }
+
/**
* Get the context
*
@@ -313,6 +324,7 @@
mSeekBarViewModel.getProgress().observeForever(mSeekBarObserver);
mSeekBarViewModel.attachTouchHandlers(vh.getSeekBar());
mSeekBarViewModel.setScrubbingChangeListener(mScrubbingChangeListener);
+ mSeekBarViewModel.setEnabledChangeListener(mEnabledChangeListener);
mMediaViewController.attach(player, MediaViewController.TYPE.PLAYER);
vh.getPlayer().setOnLongClickListener(v -> {
@@ -324,17 +336,6 @@
return true;
}
});
- vh.getCancel().setOnClickListener(v -> {
- if (!mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) {
- closeGuts();
- }
- });
- vh.getSettings().setOnClickListener(v -> {
- if (!mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) {
- mLogger.logLongPressSettings(mUid, mPackageName, mInstanceId);
- mActivityStarter.startActivity(SETTINGS_INTENT, true /* dismissShade */);
- }
- });
TextView titleText = mMediaViewHolder.getTitleText();
TextView artistText = mMediaViewHolder.getArtistText();
@@ -379,17 +380,6 @@
return true;
}
});
- mRecommendationViewHolder.getCancel().setOnClickListener(v -> {
- if (!mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) {
- closeGuts();
- }
- });
- mRecommendationViewHolder.getSettings().setOnClickListener(v -> {
- if (!mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) {
- mLogger.logLongPressSettings(mUid, mPackageName, mInstanceId);
- mActivityStarter.startActivity(SETTINGS_INTENT, true /* dismissShade */);
- }
- });
}
/** Bind this player view based on the data given. */
@@ -449,9 +439,9 @@
mBackgroundExecutor.execute(() -> mSeekBarViewModel.updateController(controller));
bindOutputSwitcherChip(data);
- bindLongPressMenu(data);
- bindActionButtons(data);
+ bindGutsMenuForPlayer(data);
bindScrubbingTime(data);
+ bindActionButtons(data);
boolean isSongUpdated = bindSongMetadata(data);
bindArtworkAndColors(data, isSongUpdated);
@@ -519,24 +509,8 @@
});
}
- private void bindLongPressMenu(MediaData data) {
- boolean isDismissible = data.isClearable();
- String dismissText;
- if (isDismissible) {
- dismissText = mContext.getString(R.string.controls_media_close_session, data.getApp());
- } else {
- dismissText = mContext.getString(R.string.controls_media_active_session);
- }
- mMediaViewHolder.getLongPressText().setText(dismissText);
-
- // Dismiss button
- mMediaViewHolder.getDismissText().setAlpha(isDismissible ? 1 : DISABLED_ALPHA);
- mMediaViewHolder.getDismiss().setEnabled(isDismissible);
- mMediaViewHolder.getDismiss().setOnClickListener(v -> {
- if (mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) return;
- logSmartspaceCardReported(SMARTSPACE_CARD_DISMISS_EVENT);
- mLogger.logLongPressDismiss(mUid, mPackageName, mInstanceId);
-
+ private void bindGutsMenuForPlayer(MediaData data) {
+ Runnable onDismissClickedRunnable = () -> {
if (mKey != null) {
closeGuts();
if (!mMediaDataManagerLazy.get().dismissMediaData(mKey,
@@ -549,7 +523,13 @@
Log.w(TAG, "Dismiss media with null notification. Token uid="
+ data.getToken().getUid());
}
- });
+ };
+
+ bindGutsMenuCommon(
+ /* isDismissible= */ data.isClearable(),
+ data.getApp(),
+ mMediaViewHolder.getGutsViewHolder(),
+ onDismissClickedRunnable);
}
private boolean bindSongMetadata(MediaData data) {
@@ -735,13 +715,18 @@
/* showInCompact= */ false);
}
}
+
+ updateSeekBarVisibility();
+ }
+
+ private void updateSeekBarVisibility() {
+ ConstraintSet expandedSet = mMediaViewController.getExpandedLayout();
expandedSet.setVisibility(R.id.media_progress_bar, getSeekBarVisibility());
- expandedSet.setAlpha(R.id.media_progress_bar, mSeekBarViewModel.getEnabled() ? 1.0f : 0.0f);
+ expandedSet.setAlpha(R.id.media_progress_bar, mIsSeekBarEnabled ? 1.0f : 0.0f);
}
private int getSeekBarVisibility() {
- boolean seekbarEnabled = mSeekBarViewModel.getEnabled();
- if (seekbarEnabled) {
+ if (mIsSeekBarEnabled) {
return ConstraintSet.VISIBLE;
}
// If disabled and "neighbours" are visible, set progress bar to INVISIBLE instead of GONE
@@ -751,8 +736,7 @@
private boolean areAnyExpandedBottomActionsVisible() {
ConstraintSet expandedSet = mMediaViewController.getExpandedLayout();
- int[] referencedIds = mMediaViewHolder.getActionsTopBarrier().getReferencedIds();
- for (int id : referencedIds) {
+ for (int id : MediaViewHolder.Companion.getExpandedBottomActionIds()) {
if (expandedSet.getVisibility(id) == ConstraintSet.VISIBLE) {
return true;
}
@@ -872,7 +856,6 @@
}
/** Updates all the views that might change due to a scrubbing state change. */
- // TODO(b/209656742): Handle scenarios where actionPrev and/or actionNext aren't active.
private void updateDisplayForScrubbingChange(@NonNull MediaButton semanticActions) {
// Update visibilities of the scrubbing time views and the scrubbing-dependent buttons.
bindScrubbingTime(mMediaData);
@@ -957,8 +940,6 @@
mPackageName = data.getPackageName();
mInstanceId = data.getInstanceId();
TransitionLayout recommendationCard = mRecommendationViewHolder.getRecommendations();
- recommendationCard.setBackgroundTintList(
- Utils.getColorAttr(mContext, com.android.internal.R.attr.colorSurface));
List<SmartspaceAction> mediaRecommendationList = data.getRecommendations();
if (mediaRecommendationList == null || mediaRecommendationList.isEmpty()) {
@@ -982,6 +963,7 @@
Drawable icon = packageManager.getApplicationIcon(applicationInfo);
ImageView headerLogoImageView = mRecommendationViewHolder.getCardIcon();
headerLogoImageView.setImageDrawable(icon);
+ fetchAndUpdateRecommendationColors(icon);
// Set up media source app's label text.
CharSequence appName = getAppName(data.getCardAction());
@@ -1009,6 +991,9 @@
List<ViewGroup> mediaCoverContainers = mRecommendationViewHolder.getMediaCoverContainers();
int mediaRecommendationNum = Math.min(mediaRecommendationList.size(),
MEDIA_RECOMMENDATION_MAX_NUM);
+
+ boolean hasTitle = false;
+ boolean hasSubtitle = false;
int uiComponentIndex = 0;
for (int itemIndex = 0;
itemIndex < mediaRecommendationNum && uiComponentIndex < mediaRecommendationNum;
@@ -1054,37 +1039,35 @@
// Set up title
CharSequence title = recommendation.getTitle();
+ hasTitle |= !TextUtils.isEmpty(title);
TextView titleView =
mRecommendationViewHolder.getMediaTitles().get(uiComponentIndex);
titleView.setText(title);
- titleView.setTextColor(Utils.getColorAttrDefaultColor(
- mContext, com.android.internal.R.attr.textColorPrimary));
- // TODO(b/223603970): If none of them have titles, should we then hide the views?
// Set up subtitle
- CharSequence subtitle = recommendation.getSubtitle();
- TextView subtitleView =
- mRecommendationViewHolder.getMediaSubtitles().get(uiComponentIndex);
// It would look awkward to show a subtitle if we don't have a title.
boolean shouldShowSubtitleText = !TextUtils.isEmpty(title);
- CharSequence subtitleText = shouldShowSubtitleText ? subtitle : "";
- subtitleView.setText(subtitleText);
- subtitleView.setTextColor(Utils.getColorAttrDefaultColor(
- mContext, com.android.internal.R.attr.textColorSecondary));
- // TODO(b/223603970): If none of them have subtitles, should we then hide the views?
+ CharSequence subtitle = shouldShowSubtitleText ? recommendation.getSubtitle() : "";
+ hasSubtitle |= !TextUtils.isEmpty(subtitle);
+ TextView subtitleView =
+ mRecommendationViewHolder.getMediaSubtitles().get(uiComponentIndex);
+ subtitleView.setText(subtitle);
uiComponentIndex++;
}
-
mSmartspaceMediaItemsCount = uiComponentIndex;
- // Set up long press to show guts setting panel.
- mRecommendationViewHolder.getDismiss().setOnClickListener(v -> {
- if (mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) return;
- mLogger.logLongPressDismiss(mUid, mPackageName, mInstanceId);
- logSmartspaceCardReported(
- 761 // SMARTSPACE_CARD_DISMISS
- );
+ // If there's no subtitles and/or titles for any of the albums, hide those views.
+ ConstraintSet expandedSet = mMediaViewController.getExpandedLayout();
+ final boolean titlesVisible = hasTitle;
+ final boolean subtitlesVisible = hasSubtitle;
+ mRecommendationViewHolder.getMediaTitles().forEach((titleView) ->
+ setVisibleAndAlpha(expandedSet, titleView.getId(), titlesVisible));
+ mRecommendationViewHolder.getMediaSubtitles().forEach((subtitleView) ->
+ setVisibleAndAlpha(expandedSet, subtitleView.getId(), subtitlesVisible));
+
+ // Guts
+ Runnable onDismissClickedRunnable = () -> {
closeGuts();
mMediaDataManagerLazy.get().dismissSmartspaceRecommendation(
data.getTargetId(), MediaViewController.GUTS_ANIMATION_DURATION + 100L);
@@ -1104,7 +1087,12 @@
} else {
mBroadcastSender.sendBroadcast(dismissIntent);
}
- });
+ };
+ bindGutsMenuCommon(
+ /* isDismissible= */ true,
+ appName.toString(),
+ mRecommendationViewHolder.getGutsViewHolder(),
+ onDismissClickedRunnable);
mController = null;
if (mMetadataAnimationHandler == null || !mMetadataAnimationHandler.isRunning()) {
@@ -1112,6 +1100,74 @@
}
}
+ private void fetchAndUpdateRecommendationColors(Drawable appIcon) {
+ mBackgroundExecutor.execute(() -> {
+ ColorScheme colorScheme = new ColorScheme(
+ WallpaperColors.fromDrawable(appIcon), /* darkTheme= */ true);
+ mMainExecutor.execute(() -> setRecommendationColors(colorScheme));
+ });
+ }
+
+ private void setRecommendationColors(ColorScheme colorScheme) {
+ if (mRecommendationViewHolder == null) {
+ return;
+ }
+
+ int backgroundColor = MediaColorSchemesKt.surfaceFromScheme(colorScheme);
+ int textPrimaryColor = MediaColorSchemesKt.textPrimaryFromScheme(colorScheme);
+ int textSecondaryColor = MediaColorSchemesKt.textSecondaryFromScheme(colorScheme);
+
+ mRecommendationViewHolder.getRecommendations()
+ .setBackgroundTintList(ColorStateList.valueOf(backgroundColor));
+ mRecommendationViewHolder.getMediaTitles().forEach(
+ (title) -> title.setTextColor(textPrimaryColor));
+ mRecommendationViewHolder.getMediaSubtitles().forEach(
+ (subtitle) -> subtitle.setTextColor(textSecondaryColor));
+
+ mRecommendationViewHolder.getGutsViewHolder().setColors(colorScheme);
+ }
+
+ private void bindGutsMenuCommon(
+ boolean isDismissible,
+ String appName,
+ GutsViewHolder gutsViewHolder,
+ Runnable onDismissClickedRunnable) {
+ // Text
+ String text;
+ if (isDismissible) {
+ text = mContext.getString(R.string.controls_media_close_session, appName);
+ } else {
+ text = mContext.getString(R.string.controls_media_active_session);
+ }
+ gutsViewHolder.getGutsText().setText(text);
+
+ // Dismiss button
+ gutsViewHolder.getDismissText().setAlpha(isDismissible ? 1 : DISABLED_ALPHA);
+ gutsViewHolder.getDismiss().setEnabled(isDismissible);
+ gutsViewHolder.getDismiss().setOnClickListener(v -> {
+ if (mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) return;
+ logSmartspaceCardReported(SMARTSPACE_CARD_DISMISS_EVENT);
+ mLogger.logLongPressDismiss(mUid, mPackageName, mInstanceId);
+
+ onDismissClickedRunnable.run();
+ });
+
+ // Cancel button
+ gutsViewHolder.getCancel().setOnClickListener(v -> {
+ if (!mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) {
+ closeGuts();
+ }
+ });
+
+ // Settings button
+ gutsViewHolder.getSettings().setOnClickListener(v -> {
+ if (!mFalsingManager.isFalseTap(FalsingManager.LOW_PENALTY)) {
+ mLogger.logLongPressSettings(mUid, mPackageName, mInstanceId);
+ mActivityStarter.startActivity(SETTINGS_INTENT, /* dismissShade= */true);
+ }
+ });
+ }
+
/**
* Close the guts for this player.
*
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaTimeoutListener.kt b/packages/SystemUI/src/com/android/systemui/media/MediaTimeoutListener.kt
index 5175506..8c6710a 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaTimeoutListener.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaTimeoutListener.kt
@@ -19,7 +19,6 @@
import android.media.session.MediaController
import android.media.session.PlaybackState
import android.os.SystemProperties
-import android.util.Log
import com.android.internal.annotations.VisibleForTesting
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
@@ -28,9 +27,6 @@
import java.util.concurrent.TimeUnit
import javax.inject.Inject
-private const val DEBUG = true
-private const val TAG = "MediaTimeout"
-
@VisibleForTesting
val PAUSED_MEDIA_TIMEOUT = SystemProperties
.getLong("debug.sysui.media_timeout", TimeUnit.MINUTES.toMillis(10))
@@ -45,7 +41,8 @@
@SysUISingleton
class MediaTimeoutListener @Inject constructor(
private val mediaControllerFactory: MediaControllerFactory,
- @Main private val mainExecutor: DelayableExecutor
+ @Main private val mainExecutor: DelayableExecutor,
+ private val logger: MediaTimeoutLogger
) : MediaDataManager.Listener {
private val mediaListeners: MutableMap<String, PlaybackStateListener> = mutableMapOf()
@@ -75,9 +72,7 @@
}
// If listener was destroyed previously, we'll need to re-register it
- if (DEBUG) {
- Log.d(TAG, "Reusing destroyed listener $key")
- }
+ logger.logReuseListener(key)
reusedListener = it
}
@@ -86,16 +81,12 @@
val migrating = oldKey != null && key != oldKey
if (migrating) {
reusedListener = mediaListeners.remove(oldKey)
- if (reusedListener != null) {
- if (DEBUG) Log.d(TAG, "migrating key $oldKey to $key, for resumption")
- } else {
- Log.w(TAG, "Old key $oldKey for player $key doesn't exist. Continuing...")
- }
+ logger.logMigrateListener(oldKey, key, reusedListener != null)
}
reusedListener?.let {
val wasPlaying = it.playing ?: false
- if (DEBUG) Log.d(TAG, "updating listener for $key, was playing? $wasPlaying")
+ logger.logUpdateListener(key, wasPlaying)
it.mediaData = data
it.key = key
mediaListeners[key] = it
@@ -105,7 +96,7 @@
// until we're done.
mainExecutor.execute {
if (mediaListeners[key]?.playing == true) {
- if (DEBUG) Log.d(TAG, "deliver delayed playback state for $key")
+ logger.logDelayedUpdate(key)
timeoutCallback.invoke(key, false /* timedOut */)
}
}
@@ -169,10 +160,7 @@
}
override fun onSessionDestroyed() {
- if (DEBUG) {
- Log.d(TAG, "Session destroyed for $key")
- }
-
+ logger.logSessionDestroyed(key)
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
@@ -185,9 +173,7 @@
}
private fun processState(state: PlaybackState?, dispatchEvents: Boolean) {
- if (DEBUG) {
- Log.v(TAG, "processState $key: $state")
- }
+ logger.logPlaybackState(key, state)
val isPlaying = state != null && isPlayingState(state.state)
val resumptionChanged = resumption != mediaData.resumption
@@ -198,12 +184,10 @@
resumption = mediaData.resumption
if (!isPlaying) {
- if (DEBUG) {
- Log.v(TAG, "schedule timeout for $key playing $isPlaying, $resumption")
- }
+ logger.logScheduleTimeout(key, isPlaying, resumption!!)
if (cancellation != null && !resumptionChanged) {
// if the media changed resume state, we'll need to adjust the timeout length
- if (DEBUG) Log.d(TAG, "cancellation already exists, continuing.")
+ logger.logCancelIgnored(key)
return
}
expireMediaTimeout(key, "PLAYBACK STATE CHANGED - $state, $resumption")
@@ -214,9 +198,7 @@
}
cancellation = mainExecutor.executeDelayed({
cancellation = null
- if (DEBUG) {
- Log.v(TAG, "Execute timeout for $key")
- }
+ logger.logTimeout(key)
timedOut = true
// this event is async, so it's safe even when `dispatchEvents` is false
timeoutCallback(key, timedOut)
@@ -232,9 +214,7 @@
private fun expireMediaTimeout(mediaKey: String, reason: String) {
cancellation?.apply {
- if (DEBUG) {
- Log.v(TAG, "media timeout cancelled for $mediaKey, reason: $reason")
- }
+ logger.logTimeoutCancelled(mediaKey, reason)
run()
}
cancellation = null
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaTimeoutLogger.kt b/packages/SystemUI/src/com/android/systemui/media/MediaTimeoutLogger.kt
new file mode 100644
index 0000000..a865159
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaTimeoutLogger.kt
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media
+
+import android.media.session.PlaybackState
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.LogLevel
+import com.android.systemui.log.dagger.MediaTimeoutListenerLog
+import javax.inject.Inject
+
+private const val TAG = "MediaTimeout"
+
+/**
+ * A buffered log for [MediaTimeoutListener] events
+ */
+@SysUISingleton
+class MediaTimeoutLogger @Inject constructor(
+ @MediaTimeoutListenerLog private val buffer: LogBuffer
+) {
+ fun logReuseListener(key: String) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = key
+ },
+ {
+ "reuse listener: $str1"
+ }
+ )
+
+ fun logMigrateListener(oldKey: String?, newKey: String?, hadListener: Boolean) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = oldKey
+ str2 = newKey
+ bool1 = hadListener
+ },
+ {
+ "migrate from $str1 to $str2, had listener? $bool1"
+ }
+ )
+
+ fun logUpdateListener(key: String, wasPlaying: Boolean) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = key
+ bool1 = wasPlaying
+ },
+ {
+ "updating $str1, was playing? $bool1"
+ }
+ )
+
+ fun logDelayedUpdate(key: String) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = key
+ },
+ {
+ "deliver delayed playback state for $str1"
+ }
+ )
+
+ fun logSessionDestroyed(key: String) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = key
+ },
+ {
+ "session destroyed $str1"
+ }
+ )
+
+ fun logPlaybackState(key: String, state: PlaybackState?) = buffer.log(
+ TAG,
+ LogLevel.VERBOSE,
+ {
+ str1 = key
+ str2 = state?.toString()
+ },
+ {
+ "state update: key=$str1 state=$str2"
+ }
+ )
+
+ fun logScheduleTimeout(key: String, playing: Boolean, resumption: Boolean) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = key
+ bool1 = playing
+ bool2 = resumption
+ },
+ {
+ "schedule timeout $str1, playing=$bool1 resumption=$bool2"
+ }
+ )
+
+ fun logCancelIgnored(key: String) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = key
+ },
+ {
+ "cancellation already exists for $str1"
+ }
+ )
+
+ fun logTimeout(key: String) = buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = key
+ },
+ {
+ "execute timeout for $str1"
+ }
+ )
+
+ fun logTimeoutCancelled(key: String, reason: String) = buffer.log(
+ TAG,
+ LogLevel.VERBOSE,
+ {
+ str1 = key
+ str2 = reason
+ },
+ {
+ "media timeout cancelled for $str1, reason: $str2"
+ }
+ )
+}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaViewController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaViewController.kt
index 5210499..1437c96 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaViewController.kt
@@ -35,7 +35,8 @@
class MediaViewController @Inject constructor(
private val context: Context,
private val configurationController: ConfigurationController,
- private val mediaHostStatesManager: MediaHostStatesManager
+ private val mediaHostStatesManager: MediaHostStatesManager,
+ private val logger: MediaViewLogger
) {
/**
@@ -260,10 +261,7 @@
TYPE.PLAYER -> MediaViewHolder.controlsIds
TYPE.RECOMMENDATION -> RecommendationViewHolder.controlsIds
}
- val gutsIds = when (type) {
- TYPE.PLAYER -> MediaViewHolder.gutsIds
- TYPE.RECOMMENDATION -> RecommendationViewHolder.gutsIds
- }
+ val gutsIds = GutsViewHolder.ids
controlsIds.forEach { id ->
viewState.widgetStates.get(id)?.let { state ->
// Make sure to use the unmodified state if guts are not visible.
@@ -330,6 +328,7 @@
// is cheap
setGutsViewState(result)
viewStates[cacheKey] = result
+ logger.logMediaSize("measured new viewState", result.width, result.height)
} else {
// This is an interpolated state
val startState = state.copy().also { it.expansion = 0.0f }
@@ -344,6 +343,7 @@
startViewState,
endViewState,
state.expansion)
+ logger.logMediaSize("interpolated viewState", result.width, result.height)
}
if (state.squishFraction < 1f) {
return squishViewState(result, state.squishFraction)
@@ -371,6 +371,7 @@
*/
fun attach(transitionLayout: TransitionLayout, type: TYPE) {
updateMediaViewControllerType(type)
+ logger.logMediaLocation("attach", currentStartLocation, currentEndLocation)
this.transitionLayout = transitionLayout
layoutController.attach(transitionLayout)
if (currentEndLocation == -1) {
@@ -409,6 +410,7 @@
currentEndLocation = endLocation
currentStartLocation = startLocation
currentTransitionProgress = transitionProgress
+ logger.logMediaLocation("setCurrentState", startLocation, endLocation)
val shouldAnimate = animateNextStateChange && !applyImmediately
@@ -461,6 +463,7 @@
result = layoutController.getInterpolatedState(startViewState, endViewState,
transitionProgress, tmpState)
}
+ logger.logMediaSize("setCurrentState", result.width, result.height)
layoutController.setState(result, applyImmediately, shouldAnimate, animationDuration,
animationDelay)
}
@@ -478,6 +481,7 @@
result.height = Math.max(it.measuredHeight, result.height)
result.width = Math.max(it.measuredWidth, result.width)
}
+ logger.logMediaSize("update to carousel", result.width, result.height)
return result
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaViewHolder.kt b/packages/SystemUI/src/com/android/systemui/media/MediaViewHolder.kt
index 8964d71..5c93cda 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaViewHolder.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaViewHolder.kt
@@ -16,7 +16,6 @@
package com.android.systemui.media
-import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -56,13 +55,7 @@
val scrubbingTotalTimeView: TextView =
itemView.requireViewById(R.id.media_scrubbing_total_time)
- // Settings screen
- val longPressText = itemView.requireViewById<TextView>(R.id.remove_text)
- val cancel = itemView.requireViewById<View>(R.id.cancel)
- val cancelText = itemView.requireViewById<TextView>(R.id.cancel_text)
- val dismiss = itemView.requireViewById<ViewGroup>(R.id.dismiss)
- val dismissText = itemView.requireViewById<TextView>(R.id.dismiss_text)
- val settings = itemView.requireViewById<ImageButton>(R.id.settings)
+ val gutsViewHolder = GutsViewHolder(itemView)
// Action Buttons
val actionPlayPause = itemView.requireViewById<ImageButton>(R.id.actionPlayPause)
@@ -79,9 +72,9 @@
init {
(player.background as IlluminationDrawable).let {
it.registerLightSource(seamless)
- it.registerLightSource(cancel)
- it.registerLightSource(dismiss)
- it.registerLightSource(settings)
+ it.registerLightSource(gutsViewHolder.cancel)
+ it.registerLightSource(gutsViewHolder.dismiss)
+ it.registerLightSource(gutsViewHolder.settings)
it.registerLightSource(actionPlayPause)
it.registerLightSource(actionNext)
it.registerLightSource(actionPrev)
@@ -122,12 +115,7 @@
}
fun marquee(start: Boolean, delay: Long) {
- val longPressTextHandler = longPressText.getHandler()
- if (longPressTextHandler == null) {
- Log.d(TAG, "marquee while longPressText.getHandler() is null", Exception())
- return
- }
- longPressTextHandler.postDelayed({ longPressText.setSelected(start) }, delay)
+ gutsViewHolder.marquee(start, delay, TAG)
}
companion object {
@@ -172,12 +160,7 @@
R.id.media_scrubbing_elapsed_time,
R.id.media_scrubbing_total_time
)
- val gutsIds = setOf(
- R.id.remove_text,
- R.id.cancel,
- R.id.dismiss,
- R.id.settings
- )
+
// Buttons used for notification-based actions
val genericButtonIds = setOf(
@@ -187,5 +170,17 @@
R.id.action3,
R.id.action4
)
+
+ val expandedBottomActionIds = setOf(
+ R.id.actionPrev,
+ R.id.actionNext,
+ R.id.action0,
+ R.id.action1,
+ R.id.action2,
+ R.id.action3,
+ R.id.action4,
+ R.id.media_scrubbing_elapsed_time,
+ R.id.media_scrubbing_total_time
+ )
}
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaViewLogger.kt b/packages/SystemUI/src/com/android/systemui/media/MediaViewLogger.kt
new file mode 100644
index 0000000..73868189
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaViewLogger.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media
+
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.LogLevel
+import com.android.systemui.log.dagger.MediaViewLog
+import javax.inject.Inject
+
+private const val TAG = "MediaView"
+
+/**
+ * A buffered log for media view events that are too noisy for regular logging
+ */
+@SysUISingleton
+class MediaViewLogger @Inject constructor(
+ @MediaViewLog private val buffer: LogBuffer
+) {
+ fun logMediaSize(reason: String, width: Int, height: Int) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = reason
+ int1 = width
+ int2 = height
+ },
+ {
+ "size ($str1): $int1 x $int2"
+ }
+ )
+ }
+
+ fun logMediaLocation(reason: String, startLocation: Int, endLocation: Int) {
+ buffer.log(
+ TAG,
+ LogLevel.DEBUG,
+ {
+ str1 = reason
+ int1 = startLocation
+ int2 = endLocation
+ },
+ {
+ "location ($str1): $int1 -> $int2"
+ }
+ )
+ }
+}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt b/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt
index a839840..52ac4e0 100644
--- a/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt
@@ -24,6 +24,8 @@
import com.android.systemui.R
import com.android.systemui.util.animation.TransitionLayout
+private const val TAG = "RecommendationViewHolder"
+
/** ViewHolder for a Smartspace media recommendation. */
class RecommendationViewHolder private constructor(itemView: View) {
@@ -52,26 +54,19 @@
itemView.requireViewById(R.id.media_subtitle3)
)
- // Settings/Guts screen
- val longPressText = itemView.requireViewById<TextView>(R.id.remove_text)
- val cancel = itemView.requireViewById<View>(R.id.cancel)
- val dismiss = itemView.requireViewById<ViewGroup>(R.id.dismiss)
- val dismissLabel = dismiss.getChildAt(0)
- val settings = itemView.requireViewById<View>(R.id.settings)
- val settingsText = itemView.requireViewById<TextView>(R.id.settings_text)
+ val gutsViewHolder = GutsViewHolder(itemView)
init {
(recommendations.background as IlluminationDrawable).let { background ->
mediaCoverContainers.forEach { background.registerLightSource(it) }
- background.registerLightSource(cancel)
- background.registerLightSource(dismiss)
- background.registerLightSource(dismissLabel)
- background.registerLightSource(settings)
+ background.registerLightSource(gutsViewHolder.cancel)
+ background.registerLightSource(gutsViewHolder.dismiss)
+ background.registerLightSource(gutsViewHolder.settings)
}
}
fun marquee(start: Boolean, delay: Long) {
- longPressText.getHandler().postDelayed({ longPressText.setSelected(start) }, delay)
+ gutsViewHolder.marquee(start, delay, TAG)
}
companion object {
@@ -104,14 +99,12 @@
R.id.media_cover1_container,
R.id.media_cover2_container,
R.id.media_cover3_container,
- )
-
- // Res Ids for the components on the guts panel.
- val gutsIds = setOf(
- R.id.remove_text,
- R.id.cancel,
- R.id.dismiss,
- R.id.settings
+ R.id.media_title1,
+ R.id.media_title2,
+ R.id.media_title3,
+ R.id.media_subtitle1,
+ R.id.media_subtitle2,
+ R.id.media_subtitle3
)
}
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/SeekBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/media/SeekBarViewModel.kt
index 5218492..0359c63 100644
--- a/packages/SystemUI/src/com/android/systemui/media/SeekBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/SeekBarViewModel.kt
@@ -76,7 +76,11 @@
) {
private var _data = Progress(false, false, false, false, null, 0)
set(value) {
+ val enabledChanged = value.enabled != field.enabled
field = value
+ if (enabledChanged) {
+ enabledChangeListener?.onEnabledChanged(value.enabled)
+ }
_progress.postValue(value)
}
private val _progress = MutableLiveData<Progress>().apply {
@@ -122,6 +126,7 @@
}
private var scrubbingChangeListener: ScrubbingChangeListener? = null
+ private var enabledChangeListener: EnabledChangeListener? = null
/** Set to true when the user is touching the seek bar to change the position. */
private var scrubbing = false
@@ -136,8 +141,6 @@
lateinit var logSeek: () -> Unit
- fun getEnabled() = _data.enabled
-
/**
* Event indicating that the user has started interacting with the seek bar.
*/
@@ -148,13 +151,21 @@
}
/**
- * Event indicating that the user has moved the seek bar but hasn't yet finished the gesture.
+ * Event indicating that the user has moved the seek bar.
+ *
* @param position Current location in the track.
*/
@AnyThread
fun onSeekProgress(position: Long) = bgExecutor.execute {
if (scrubbing) {
+ // The user hasn't yet finished their touch gesture, so only update the data for visual
+ // feedback and don't update [controller] yet.
_data = _data.copy(elapsedTime = position.toInt())
+ } else {
+ // The seek progress came from an a11y action and we should immediately update to the
+ // new position. (a11y actions to change the seekbar position don't trigger
+ // SeekBar.OnSeekBarChangeListener.onStartTrackingTouch or onStopTrackingTouch.)
+ onSeek(position)
}
}
@@ -189,6 +200,9 @@
/**
* Updates media information.
+ *
+ * This function makes a binder call, so it must happen on a worker thread.
+ *
* @param mediaController controller for media session
*/
@WorkerThread
@@ -232,6 +246,7 @@
cancel?.run()
cancel = null
scrubbingChangeListener = null
+ enabledChangeListener = null
}
@WorkerThread
@@ -279,11 +294,26 @@
}
}
+ fun setEnabledChangeListener(listener: EnabledChangeListener) {
+ enabledChangeListener = listener
+ }
+
+ fun removeEnabledChangeListener(listener: EnabledChangeListener) {
+ if (listener == enabledChangeListener) {
+ enabledChangeListener = null
+ }
+ }
+
/** Listener interface to be notified when the user starts or stops scrubbing. */
interface ScrubbingChangeListener {
fun onScrubbingChanged(scrubbing: Boolean)
}
+ /** Listener interface to be notified when the seekbar's enabled status changes. */
+ interface EnabledChangeListener {
+ fun onEnabledChanged(enabled: Boolean)
+ }
+
private class SeekBarChangeListener(
val viewModel: SeekBarViewModel
) : SeekBar.OnSeekBarChangeListener {
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java
index bde772d..e5e7eb6 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java
@@ -19,7 +19,10 @@
import static android.view.WindowInsets.Type.navigationBars;
import static android.view.WindowInsets.Type.statusBars;
+import android.annotation.NonNull;
import android.app.WallpaperColors;
+import android.bluetooth.BluetoothLeBroadcast;
+import android.bluetooth.BluetoothLeBroadcastMetadata;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@@ -59,6 +62,9 @@
import com.android.systemui.broadcast.BroadcastSender;
import com.android.systemui.statusbar.phone.SystemUIDialog;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
/**
* Base dialog for media output UI
*/
@@ -69,6 +75,7 @@
private static final String EMPTY_TITLE = " ";
private static final String PREF_NAME = "MediaOutputDialog";
private static final String PREF_IS_LE_BROADCAST_FIRST_LAUNCH = "PrefIsLeBroadcastFirstLaunch";
+ private static final boolean DEBUG = true;
private final Handler mMainThreadHandler = new Handler(Looper.getMainLooper());
private final RecyclerView.LayoutManager mLayoutManager;
@@ -91,6 +98,7 @@
private Button mAppButton;
private int mListMaxHeight;
private WallpaperColors mWallpaperColors;
+ private Executor mExecutor;
MediaOutputBaseAdapter mAdapter;
@@ -103,6 +111,79 @@
}
};
+ private final BluetoothLeBroadcast.Callback mBroadcastCallback =
+ new BluetoothLeBroadcast.Callback() {
+ @Override
+ public void onBroadcastStarted(int reason, int broadcastId) {
+ if (DEBUG) {
+ Log.d(TAG, "onBroadcastStarted(), reason = " + reason
+ + ", broadcastId = " + broadcastId);
+ }
+ mMainThreadHandler.post(() -> startLeBroadcastDialog());
+ }
+
+ @Override
+ public void onBroadcastStartFailed(int reason) {
+ if (DEBUG) {
+ Log.d(TAG, "onBroadcastStartFailed(), reason = " + reason);
+ }
+ handleLeBroadcastStartFailed();
+ }
+
+ @Override
+ public void onBroadcastMetadataChanged(int broadcastId,
+ @NonNull BluetoothLeBroadcastMetadata metadata) {
+ if (DEBUG) {
+ Log.d(TAG, "onBroadcastMetadataChanged(), broadcastId = " + broadcastId
+ + ", metadata = " + metadata);
+ }
+ mMainThreadHandler.post(() -> refresh());
+ }
+
+ @Override
+ public void onBroadcastStopped(int reason, int broadcastId) {
+ if (DEBUG) {
+ Log.d(TAG, "onBroadcastStopped(), reason = " + reason
+ + ", broadcastId = " + broadcastId);
+ }
+ mMainThreadHandler.post(() -> refresh());
+ }
+
+ @Override
+ public void onBroadcastStopFailed(int reason) {
+ if (DEBUG) {
+ Log.d(TAG, "onBroadcastStopFailed(), reason = " + reason);
+ }
+ mMainThreadHandler.post(() -> refresh());
+ }
+
+ @Override
+ public void onBroadcastUpdated(int reason, int broadcastId) {
+ if (DEBUG) {
+ Log.d(TAG, "onBroadcastUpdated(), reason = " + reason
+ + ", broadcastId = " + broadcastId);
+ }
+ mMainThreadHandler.post(() -> refresh());
+ }
+
+ @Override
+ public void onBroadcastUpdateFailed(int reason, int broadcastId) {
+ if (DEBUG) {
+ Log.d(TAG, "onBroadcastUpdateFailed(), reason = " + reason
+ + ", broadcastId = " + broadcastId);
+ }
+ mMainThreadHandler.post(() -> refresh());
+ }
+
+ @Override
+ public void onPlaybackStarted(int reason, int broadcastId) {
+ }
+
+ @Override
+ public void onPlaybackStopped(int reason, int broadcastId) {
+ }
+ };
+
public MediaOutputBaseDialog(Context context, BroadcastSender broadcastSender,
MediaOutputController mediaOutputController) {
super(context, R.style.Theme_SystemUI_Dialog_Media);
@@ -114,6 +195,7 @@
mLayoutManager = new LinearLayoutManager(mContext);
mListMaxHeight = context.getResources().getDimensionPixelSize(
R.dimen.media_output_dialog_list_max_height);
+ mExecutor = Executors.newSingleThreadExecutor();
}
@Override
@@ -171,11 +253,18 @@
public void onStart() {
super.onStart();
mMediaOutputController.start(this);
+ if(isBroadcastSupported()) {
+ mMediaOutputController.registerLeBroadcastServiceCallBack(mExecutor,
+ mBroadcastCallback);
+ }
}
@Override
public void onStop() {
super.onStop();
+ if(isBroadcastSupported()) {
+ mMediaOutputController.unregisterLeBroadcastServiceCallBack(mBroadcastCallback);
+ }
mMediaOutputController.stop();
}
@@ -254,35 +343,12 @@
mAdapter.notifyDataSetChanged();
}
}
- // Show when remote media session is available
+ // Show when remote media session is available or
+ // when the device supports BT LE audio + media is playing
mStopButton.setVisibility(getStopButtonVisibility());
- if (isBroadcastSupported() && mMediaOutputController.isPlaying()) {
- mStopButton.setText(R.string.media_output_broadcast);
- mStopButton.setOnClickListener(v -> {
- SharedPreferences sharedPref = mContext.getSharedPreferences(PREF_NAME,
- Context.MODE_PRIVATE);
-
- if (sharedPref != null
- && sharedPref.getBoolean(PREF_IS_LE_BROADCAST_FIRST_LAUNCH, true)) {
- Log.d(TAG, "PREF_IS_LE_BROADCAST_FIRST_LAUNCH: true");
-
- mMediaOutputController.launchLeBroadcastNotifyDialog(mDialogView,
- mBroadcastSender,
- MediaOutputController.BroadcastNotifyDialog.ACTION_FIRST_LAUNCH);
- SharedPreferences.Editor editor = sharedPref.edit();
- editor.putBoolean(PREF_IS_LE_BROADCAST_FIRST_LAUNCH, false);
- editor.apply();
- } else {
- mMediaOutputController.launchMediaOutputBroadcastDialog(mDialogView,
- mBroadcastSender);
- }
- });
- } else {
- mStopButton.setOnClickListener(v -> {
- mMediaOutputController.releaseSession();
- dismiss();
- });
- }
+ mStopButton.setEnabled(true);
+ mStopButton.setText(getStopButtonText());
+ mStopButton.setOnClickListener(v -> onStopButtonClick());
}
private Drawable resizeDrawable(Drawable drawable, int size) {
@@ -301,6 +367,56 @@
Bitmap.createScaledBitmap(bitmap, size, size, false));
}
+ protected void handleLeBroadcastStartFailed() {
+ mStopButton.setText(R.string.media_output_broadcast_start_failed);
+ mStopButton.setEnabled(false);
+ mMainThreadHandler.postDelayed(() -> refresh(), 3000);
+ }
+
+ protected void startLeBroadcast() {
+ mStopButton.setText(R.string.media_output_broadcast_starting);
+ mStopButton.setEnabled(false);
+ if (!mMediaOutputController.startBluetoothLeBroadcast()) {
+ // If the system can't execute "broadcast start", then UI shows the error.
+ handleLeBroadcastStartFailed();
+ }
+ }
+
+ protected boolean startLeBroadcastDialogForFirstTime(){
+ SharedPreferences sharedPref = mContext.getSharedPreferences(PREF_NAME,
+ Context.MODE_PRIVATE);
+ if (sharedPref != null
+ && sharedPref.getBoolean(PREF_IS_LE_BROADCAST_FIRST_LAUNCH, true)) {
+ Log.d(TAG, "PREF_IS_LE_BROADCAST_FIRST_LAUNCH: true");
+
+ mMediaOutputController.launchLeBroadcastNotifyDialog(mDialogView,
+ mBroadcastSender,
+ MediaOutputController.BroadcastNotifyDialog.ACTION_FIRST_LAUNCH,
+ (d, w) -> {
+ startLeBroadcast();
+ });
+ SharedPreferences.Editor editor = sharedPref.edit();
+ editor.putBoolean(PREF_IS_LE_BROADCAST_FIRST_LAUNCH, false);
+ editor.apply();
+ return true;
+ }
+ return false;
+ }
+
+ protected void startLeBroadcastDialog() {
+ mMediaOutputController.launchMediaOutputBroadcastDialog(mDialogView,
+ mBroadcastSender);
+ refresh();
+ }
+
+ protected void stopLeBroadcast() {
+ mStopButton.setEnabled(false);
+ if (!mMediaOutputController.stopBluetoothLeBroadcast()) {
+ // If the system can't execute "broadcast stop", then UI does refresh.
+ mMainThreadHandler.post(() -> refresh());
+ }
+ }
+
abstract Drawable getAppSourceIcon();
abstract int getHeaderIconRes();
@@ -315,6 +431,15 @@
abstract int getStopButtonVisibility();
+ public CharSequence getStopButtonText() {
+ return mContext.getText(R.string.keyboard_key_media_stop);
+ }
+
+ public void onStopButtonClick() {
+ mMediaOutputController.releaseSession();
+ dismiss();
+ }
+
public boolean isBroadcastSupported() {
return false;
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialog.java
index 494dae0..9b3b3ce 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialog.java
@@ -142,8 +142,11 @@
mBroadcastNotify = getDialogView().requireViewById(R.id.broadcast_info);
mBroadcastNotify.setOnClickListener(v -> {
- mMediaOutputController.launchLeBroadcastNotifyDialog(null, null,
- MediaOutputController.BroadcastNotifyDialog.ACTION_BROADCAST_INFO_ICON);
+ mMediaOutputController.launchLeBroadcastNotifyDialog(
+ /* view= */ null,
+ /* broadcastSender= */ null,
+ MediaOutputController.BroadcastNotifyDialog.ACTION_BROADCAST_INFO_ICON,
+ /* onClickListener= */ null);
});
mBroadcastName = getDialogView().requireViewById(R.id.broadcast_name_summary);
mBroadcastNameEdit = getDialogView().requireViewById(R.id.broadcast_name_edit);
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
index ec2a950..0fbec3b 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
@@ -18,10 +18,13 @@
import static android.provider.Settings.ACTION_BLUETOOTH_PAIRING_SETTINGS;
+import android.annotation.CallbackExecutor;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.WallpaperColors;
+import android.bluetooth.BluetoothLeBroadcast;
import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -58,7 +61,7 @@
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.Utils;
import com.android.settingslib.bluetooth.BluetoothUtils;
-import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.media.BluetoothMediaDevice;
import com.android.settingslib.media.InfoMediaManager;
@@ -83,6 +86,7 @@
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.Executor;
import javax.inject.Inject;
@@ -642,17 +646,14 @@
}
void launchLeBroadcastNotifyDialog(View mediaOutputDialog, BroadcastSender broadcastSender,
- BroadcastNotifyDialog action) {
+ BroadcastNotifyDialog action, final DialogInterface.OnClickListener listener) {
final AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
switch (action) {
case ACTION_FIRST_LAUNCH:
builder.setTitle(R.string.media_output_first_broadcast_title);
builder.setMessage(R.string.media_output_first_notify_broadcast_message);
builder.setNegativeButton(android.R.string.cancel, null);
- builder.setPositiveButton(R.string.media_output_broadcast,
- (d, w) -> {
- launchMediaOutputBroadcastDialog(mediaOutputDialog, broadcastSender);
- });
+ builder.setPositiveButton(R.string.media_output_broadcast, listener);
break;
case ACTION_BROADCAST_INFO_ICON:
builder.setTitle(R.string.media_output_broadcast);
@@ -685,18 +686,64 @@
|| features.contains(MediaRoute2Info.FEATURE_REMOTE_GROUP_PLAYBACK));
}
- boolean isBluetoothLeDevice(@NonNull MediaDevice device) {
- if (device instanceof BluetoothMediaDevice) {
- final CachedBluetoothDevice cachedDevice =
- ((BluetoothMediaDevice) device).getCachedDevice();
- boolean isConnectedLeAudioDevice =
- (cachedDevice != null) ? cachedDevice.isConnectedLeAudioDevice() : false;
- if (DEBUG) {
- Log.d(TAG, "isConnectedLeAudioDevice=" + isConnectedLeAudioDevice);
- }
- return isConnectedLeAudioDevice;
+ boolean isBroadcastSupported() {
+ LocalBluetoothLeBroadcast broadcast =
+ mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
+ return broadcast != null ? true : false;
+ }
+
+ boolean isBluetoothLeBroadcastEnabled() {
+ LocalBluetoothLeBroadcast broadcast =
+ mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
+ if (broadcast == null) {
+ return false;
}
- return false;
+ return broadcast.isEnabled(null);
+ }
+
+ boolean startBluetoothLeBroadcast() {
+ LocalBluetoothLeBroadcast broadcast =
+ mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
+ if (broadcast == null) {
+ Log.d(TAG, "The broadcast profile is null");
+ return false;
+ }
+ broadcast.startBroadcast(getAppSourceName(), /*language*/ null);
+ return true;
+ }
+
+ boolean stopBluetoothLeBroadcast() {
+ LocalBluetoothLeBroadcast broadcast =
+ mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
+ if (broadcast == null) {
+ Log.d(TAG, "The broadcast profile is null");
+ return false;
+ }
+ broadcast.stopLatestBroadcast();
+ return true;
+ }
+
+ void registerLeBroadcastServiceCallBack(
+ @NonNull @CallbackExecutor Executor executor,
+ @NonNull BluetoothLeBroadcast.Callback callback) {
+ LocalBluetoothLeBroadcast broadcast =
+ mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
+ if (broadcast == null) {
+ Log.d(TAG, "The broadcast profile is null");
+ return;
+ }
+ broadcast.registerServiceCallBack(executor, callback);
+ }
+
+ void unregisterLeBroadcastServiceCallBack(
+ @NonNull BluetoothLeBroadcast.Callback callback) {
+ LocalBluetoothLeBroadcast broadcast =
+ mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
+ if (broadcast == null) {
+ Log.d(TAG, "The broadcast profile is null");
+ return;
+ }
+ broadcast.unregisterServiceCallBack(callback);
}
private boolean isPlayBackInfoLocal() {
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java
index fc10397..9248433 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java
@@ -27,7 +27,6 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEventLogger;
-import com.android.settingslib.media.MediaDevice;
import com.android.systemui.R;
import com.android.systemui.broadcast.BroadcastSender;
import com.android.systemui.dagger.SysUISingleton;
@@ -93,18 +92,41 @@
isActiveRemoteDevice = mMediaOutputController.isActiveRemoteDevice(
mMediaOutputController.getCurrentConnectedMediaDevice());
}
- boolean isBroadCastSupported = isBroadcastSupported();
+ boolean showBroadcastButton = isBroadcastSupported() && mMediaOutputController.isPlaying();
- return (isActiveRemoteDevice || isBroadCastSupported) ? View.VISIBLE : View.GONE;
+ return (isActiveRemoteDevice || showBroadcastButton) ? View.VISIBLE : View.GONE;
}
@Override
public boolean isBroadcastSupported() {
- MediaDevice device = mMediaOutputController.getCurrentConnectedMediaDevice();
- if (device == null) {
- return false;
+ return mMediaOutputController.isBroadcastSupported();
+ }
+
+ @Override
+ public CharSequence getStopButtonText() {
+ int resId = R.string.keyboard_key_media_stop;
+ if (isBroadcastSupported() && mMediaOutputController.isPlaying()
+ && !mMediaOutputController.isBluetoothLeBroadcastEnabled()) {
+ resId = R.string.media_output_broadcast;
}
- return mMediaOutputController.isBluetoothLeDevice(device);
+ return mContext.getText(resId);
+ }
+
+ @Override
+ public void onStopButtonClick() {
+ if (isBroadcastSupported() && mMediaOutputController.isPlaying()) {
+ if (!mMediaOutputController.isBluetoothLeBroadcastEnabled()) {
+ if (startLeBroadcastDialogForFirstTime()) {
+ return;
+ }
+ startLeBroadcast();
+ } else {
+ stopLeBroadcast();
+ }
+ } else {
+ mMediaOutputController.releaseSession();
+ dismiss();
+ }
}
@VisibleForTesting
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
index 740ecff..72488f3 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
@@ -197,7 +197,6 @@
private final Optional<Pip> mPipOptional;
private final Optional<Recents> mRecentsOptional;
private final DeviceConfigProxy mDeviceConfigProxy;
- private final NavigationBarTransitions mNavigationBarTransitions;
private final Optional<BackAnimation> mBackAnimation;
private final Handler mHandler;
private final NavigationBarOverlayController mNavbarOverlayController;
@@ -514,7 +513,6 @@
InputMethodManager inputMethodManager,
DeadZone deadZone,
DeviceConfigProxy deviceConfigProxy,
- NavigationBarTransitions navigationBarTransitions,
Optional<BackAnimation> backAnimation) {
super(navigationBarView);
mFrame = navigationBarFrame;
@@ -539,7 +537,6 @@
mRecentsOptional = recentsOptional;
mDeadZone = deadZone;
mDeviceConfigProxy = deviceConfigProxy;
- mNavigationBarTransitions = navigationBarTransitions;
mBackAnimation = backAnimation;
mHandler = mainHandler;
mNavbarOverlayController = navbarOverlayController;
@@ -564,7 +561,6 @@
public void onInit() {
// TODO: A great deal of this code should probably live in onViewAttached.
// It should also has corresponding cleanup in onViewDetached.
- mView.setBarTransitions(mNavigationBarTransitions);
mView.setTouchHandler(mTouchHandler);
mView.setNavBarMode(mNavBarMode);
mView.updateRotationButton();
@@ -636,7 +632,7 @@
mView.setOnVerticalChangedListener(this::onVerticalChanged);
mView.setOnTouchListener(this::onNavigationTouch);
if (mSavedState != null) {
- getBarTransitions().getLightTransitionsController().restoreState(mSavedState);
+ mView.getLightTransitionsController().restoreState(mSavedState);
}
setNavigationIconHints(mNavigationIconHints);
mView.setWindowVisible(isNavBarWindowVisible());
@@ -709,7 +705,8 @@
mView.getRotationButtonController();
rotationButtonController.setRotationCallback(null);
mView.setUpdateActiveTouchRegionsCallback(null);
- getBarTransitions().destroy();
+ mView.getBarTransitions().destroy();
+ mView.getLightTransitionsController().destroy(mContext);
mOverviewProxyService.removeCallback(mOverviewProxyListener);
mBroadcastDispatcher.unregisterReceiver(mBroadcastReceiver);
if (mOrientationHandle != null) {
@@ -735,7 +732,7 @@
outState.putInt(EXTRA_APPEARANCE, mAppearance);
outState.putInt(EXTRA_BEHAVIOR, mBehavior);
outState.putBoolean(EXTRA_TRANSIENT_STATE, mTransientShown);
- getBarTransitions().getLightTransitionsController().saveState(outState);
+ mView.getLightTransitionsController().saveState(outState);
}
/**
@@ -896,7 +893,7 @@
pw.println(" mTransientShown=" + mTransientShown);
pw.println(" mTransientShownFromGestureOnSystemBar="
+ mTransientShownFromGestureOnSystemBar);
- dumpBarTransitions(pw, "mNavigationBarView", getBarTransitions());
+ dumpBarTransitions(pw, "mNavigationBarView", mView.getBarTransitions());
mView.dump(pw);
}
@@ -1433,7 +1430,7 @@
mLightBarController = lightBarController;
if (mLightBarController != null) {
mLightBarController.setNavigationBar(
- getBarTransitions().getLightTransitionsController());
+ mView.getLightTransitionsController());
}
}
@@ -1475,7 +1472,7 @@
mCentralSurfacesOptionalLazy.get().map(CentralSurfaces::isDeviceInteractive)
.orElse(false)
&& mNavigationBarWindowState != WINDOW_STATE_HIDDEN;
- getBarTransitions().transitionTo(mTransitionMode, anim);
+ mView.getBarTransitions().transitionTo(mTransitionMode, anim);
}
public void disableAnimationsDuringHide(long delay) {
@@ -1495,11 +1492,11 @@
}
public NavigationBarTransitions getBarTransitions() {
- return mNavigationBarTransitions;
+ return mView.getBarTransitions();
}
public void finishBarAnimations() {
- getBarTransitions().finishAnimations();
+ mView.getBarTransitions().finishAnimations();
}
private WindowManager.LayoutParams getBarLayoutParams(int rotation) {
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarTransitions.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarTransitions.java
index e625501..58e07db 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarTransitions.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarTransitions.java
@@ -31,19 +31,17 @@
import com.android.systemui.Dependency;
import com.android.systemui.R;
-import com.android.systemui.navigationbar.NavigationBarComponent.NavigationBarScope;
import com.android.systemui.navigationbar.buttons.ButtonDispatcher;
+import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.BarTransitions;
import com.android.systemui.statusbar.phone.LightBarTransitionsController;
+import com.android.systemui.statusbar.policy.KeyguardStateController;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
-import javax.inject.Inject;
-
-/** */
-@NavigationBarScope
public final class NavigationBarTransitions extends BarTransitions implements
LightBarTransitionsController.DarkIntensityApplier {
@@ -83,13 +81,15 @@
}
};
- @Inject
- public NavigationBarTransitions(
- NavigationBarView view,
- LightBarTransitionsController.Factory lightBarTransitionsControllerFactory) {
+ public NavigationBarTransitions(NavigationBarView view, CommandQueue commandQueue) {
super(view, R.drawable.nav_background);
mView = view;
- mLightTransitionsController = lightBarTransitionsControllerFactory.create(this);
+ mLightTransitionsController = new LightBarTransitionsController(
+ view.getContext(),
+ this,
+ commandQueue,
+ Dependency.get(KeyguardStateController.class),
+ Dependency.get(StatusBarStateController.class));
mAllowAutoDimWallpaperNotVisible = view.getContext().getResources()
.getBoolean(R.bool.config_navigation_bar_enable_auto_dim_no_visible_wallpaper);
mDarkIntensityListeners = new ArrayList();
@@ -127,7 +127,6 @@
Display.DEFAULT_DISPLAY);
} catch (RemoteException e) {
}
- mLightTransitionsController.destroy();
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
index 8878c2d..abff914 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
@@ -85,6 +85,7 @@
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.WindowManagerWrapper;
+import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.AutoHideController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.LightBarTransitionsController;
@@ -139,7 +140,7 @@
private EdgeBackGestureHandler mEdgeBackGestureHandler;
private final DeadZone mDeadZone;
private boolean mDeadZoneConsuming = false;
- private NavigationBarTransitions mBarTransitions;
+ private final NavigationBarTransitions mBarTransitions;
@Nullable
private AutoHideController mAutoHideController;
@@ -369,6 +370,7 @@
mConfiguration.updateFrom(context.getResources().getConfiguration());
mScreenPinningNotify = new ScreenPinningNotify(mContext);
+ mBarTransitions = new NavigationBarTransitions(this, Dependency.get(CommandQueue.class));
mButtonDispatchers.put(R.id.back, new ButtonDispatcher(R.id.back));
mButtonDispatchers.put(R.id.home, new ButtonDispatcher(R.id.home));
@@ -416,14 +418,14 @@
}
}
- void setBarTransitions(NavigationBarTransitions navigationBarTransitions) {
- mBarTransitions = navigationBarTransitions;
- }
-
public void setAutoHideController(AutoHideController autoHideController) {
mAutoHideController = autoHideController;
}
+ public NavigationBarTransitions getBarTransitions() {
+ return mBarTransitions;
+ }
+
public LightBarTransitionsController getLightTransitionsController() {
return mBarTransitions.getLightTransitionsController();
}
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
index 363baaa..cdc6b3b 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
@@ -264,7 +264,7 @@
mWindowContext = null;
}
mAutoHideController.setNavigationBar(null);
- mLightBarTransitionsController.destroy();
+ mLightBarTransitionsController.destroy(mContext);
mLightBarController.setNavigationBar(null);
mPipOptional.ifPresent(this::removePipExclusionBoundsChangeListener);
mInitialized = false;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/FgsManagerController.kt b/packages/SystemUI/src/com/android/systemui/qs/FgsManagerController.kt
index 13340b7..3eb4b10 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/FgsManagerController.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/FgsManagerController.kt
@@ -422,6 +422,8 @@
PowerExemptionManager.REASON_ALLOWLISTED_PACKAGE,
PowerExemptionManager.REASON_DEVICE_OWNER,
+ PowerExemptionManager.REASON_DISALLOW_APPS_CONTROL,
+ PowerExemptionManager.REASON_DPO_PROTECTED_APP,
PowerExemptionManager.REASON_PROFILE_OWNER,
PowerExemptionManager.REASON_PROC_STATE_PERSISTENT,
PowerExemptionManager.REASON_PROC_STATE_PERSISTENT_UI,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java
index 292b911..bcd8e59 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java
@@ -138,6 +138,7 @@
private final NotifCollectionLogger mLogger;
private final Handler mMainHandler;
private final LogBufferEulogizer mEulogizer;
+ private final DumpManager mDumpManager;
private final Map<String, NotificationEntry> mNotificationSet = new ArrayMap<>();
private final Collection<NotificationEntry> mReadOnlyNotificationSet =
@@ -163,15 +164,13 @@
@Main Handler mainHandler,
LogBufferEulogizer logBufferEulogizer,
DumpManager dumpManager) {
- Assert.isMainThread();
mStatusBarService = statusBarService;
mClock = clock;
mNotifPipelineFlags = notifPipelineFlags;
mLogger = logger;
mMainHandler = mainHandler;
mEulogizer = logBufferEulogizer;
-
- dumpManager.registerDumpable(TAG, this);
+ mDumpManager = dumpManager;
}
/** Initializes the NotifCollection and registers it to receive notification events. */
@@ -181,7 +180,7 @@
throw new RuntimeException("attach() called twice");
}
mAttached = true;
-
+ mDumpManager.registerDumpable(TAG, this);
groupCoalescer.setNotificationHandler(mNotifHandler);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java
index 1155fe2..51af955 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java
@@ -91,6 +91,7 @@
private final SystemClock mSystemClock;
private final ShadeListBuilderLogger mLogger;
private final NotificationInteractionTracker mInteractionTracker;
+ private final DumpManager mDumpManager;
// used exclusivly by ShadeListBuilder#notifySectionEntriesUpdated
private final ArrayList<ListEntry> mTempSectionMembers = new ArrayList<>();
private final boolean mAlwaysLogList;
@@ -133,14 +134,12 @@
ShadeListBuilderLogger logger,
SystemClock systemClock
) {
- Assert.isMainThread();
mSystemClock = systemClock;
mLogger = logger;
mAlwaysLogList = flags.isDevLoggingEnabled();
mInteractionTracker = interactionTracker;
mChoreographer = pipelineChoreographer;
- dumpManager.registerDumpable(TAG, this);
-
+ mDumpManager = dumpManager;
setSectioners(Collections.emptyList());
}
@@ -150,6 +149,7 @@
*/
public void attach(NotifCollection collection) {
Assert.isMainThread();
+ mDumpManager.registerDumpable(TAG, this);
collection.addCollectionListener(mInteractionTracker);
collection.setBuildListener(mReadyForBuildListener);
mChoreographer.addOnEvalListener(this::buildList);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index 673c1a6..18877f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -233,9 +233,6 @@
LinearLayout.LayoutParams lp =
(LinearLayout.LayoutParams) mSystemIconsContainer.getLayoutParams();
- int marginStart = getResources().getDimensionPixelSize(
- R.dimen.system_icons_super_container_margin_start);
-
// Use status_bar_padding_end to replace original
// system_icons_super_container_avatarless_margin_end to prevent different end alignment
// between PhoneStatusBarView and KeyguardStatusBarView
@@ -248,8 +245,7 @@
// 1. status bar layout: mPadding(consider round_corner + privacy dot)
// 2. icon container: R.dimen.status_bar_padding_end
- if (marginEnd != lp.getMarginEnd() || marginStart != lp.getMarginStart()) {
- lp.setMarginStart(marginStart);
+ if (marginEnd != lp.getMarginEnd()) {
lp.setMarginEnd(marginEnd);
mSystemIconsContainer.setLayoutParams(lp);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java
index 16fddb42..b6ad9f7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java
@@ -93,8 +93,7 @@
mDisplayId = mContext.getDisplayId();
}
- /** Call to cleanup the LightBarTransitionsController when done with it. */
- public void destroy() {
+ public void destroy(Context context) {
mCommandQueue.removeCallback(this);
mStatusBarStateController.removeCallback(this);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java
index 050b670..233778d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java
@@ -16,6 +16,8 @@
package com.android.systemui.statusbar.policy;
+import android.app.IActivityTaskManager;
+
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.policy.KeyguardStateController.Callback;
@@ -234,6 +236,12 @@
default void onKeyguardFadingAwayChanged() {}
/**
+ * We've called {@link IActivityTaskManager#keyguardGoingAway}, which initiates the unlock
+ * sequence.
+ */
+ default void onKeyguardGoingAwayChanged() {}
+
+ /**
* Triggered when the keyguard dismiss amount has changed, via either a swipe gesture or an
* animation.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
index 2f56576..be5da37 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
@@ -323,6 +323,7 @@
Trace.traceCounter(Trace.TRACE_TAG_APP, "keyguardGoingAway",
keyguardGoingAway ? 1 : 0);
mKeyguardGoingAway = keyguardGoingAway;
+ new ArrayList<>(mCallbacks).forEach(Callback::onKeyguardGoingAwayChanged);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLightRevealOverlayAnimation.kt b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLightRevealOverlayAnimation.kt
index fc20ac2..8f2a432 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLightRevealOverlayAnimation.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLightRevealOverlayAnimation.kt
@@ -138,7 +138,7 @@
ensureOverlayRemoved()
- val newRoot = SurfaceControlViewHost(context, context.display!!, wwm)
+ val newRoot = SurfaceControlViewHost(context, context.display!!, wwm, false)
val newView =
LightRevealScrim(context, null).apply {
revealEffect = createLightRevealEffect()
diff --git a/packages/SystemUI/src/com/android/systemui/util/concurrency/GlobalConcurrencyModule.java b/packages/SystemUI/src/com/android/systemui/util/concurrency/GlobalConcurrencyModule.java
index 323db5c..bc9e596 100644
--- a/packages/SystemUI/src/com/android/systemui/util/concurrency/GlobalConcurrencyModule.java
+++ b/packages/SystemUI/src/com/android/systemui/util/concurrency/GlobalConcurrencyModule.java
@@ -21,9 +21,11 @@
import android.os.Looper;
import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.dagger.qualifiers.UiBackground;
import java.util.Optional;
import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
import javax.inject.Named;
import javax.inject.Singleton;
@@ -73,6 +75,18 @@
}
/**
+ * Provide an Executor specifically for running UI operations on a separate thread.
+ *
+ * Keep submitted runnables short and to the point, just as with any other UI code.
+ */
+ @Provides
+ @Singleton
+ @UiBackground
+ public static Executor provideUiBackgroundExecutor() {
+ return Executors.newSingleThreadExecutor();
+ }
+
+ /**
* Provide a Main-Thread Executor.
*/
@Provides
@@ -92,7 +106,6 @@
return new ExecutorImpl(looper);
}
-
/** */
@Binds
@Singleton
diff --git a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
index d8d73db..7c211b2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
@@ -213,6 +213,7 @@
mExecutor.runAllReady();
}
});
+ doReturn(1f).when(mScreenDecorations).getPhysicalPixelDisplaySizeRatio();
reset(mTunerService);
try {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MockMagnificationAnimationCallback.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MockMagnificationAnimationCallback.java
index 30bff09..89389b0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MockMagnificationAnimationCallback.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MockMagnificationAnimationCallback.java
@@ -44,11 +44,13 @@
@Override
public void onResult(boolean success) throws RemoteException {
- mCountDownLatch.countDown();
if (success) {
mSuccessCount.getAndIncrement();
} else {
mFailedCount.getAndIncrement();
}
+ // It should be put at the last line to avoid making CountDownLatch#await passed without
+ // updating values.
+ mCountDownLatch.countDown();
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
index 18ba7dc..b7d3459 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
@@ -80,7 +80,6 @@
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
@@ -319,7 +318,6 @@
verify(mSfVsyncFrameProvider, atLeastOnce()).postFrameCallback(any());
}
- @Ignore("b/224717753")
@Test
public void moveWindowMagnifierToPositionWithAnimation_expectedValuesAndInvokeCallback()
throws InterruptedException {
@@ -354,7 +352,6 @@
assertEquals(mWindowMagnificationController.getCenterY(), targetCenterY, 0);
}
- @Ignore("b/224717753")
@Test
public void moveWindowMagnifierToPositionMultipleTimes_expectedValuesAndInvokeCallback()
throws InterruptedException {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuTest.java
index e027a2b7..558261b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuTest.java
@@ -87,6 +87,17 @@
assertThat(mMenuView.isShowing()).isFalse();
}
+ @Test
+ public void showMenuView_emptyTarget_notShow() {
+ final List<String> emptyTargets = new ArrayList<>();
+ doReturn(emptyTargets).when(mAccessibilityManager).getAccessibilityShortcutTargets(
+ anyInt());
+
+ mMenu.show();
+
+ assertThat(mMenuView.isShowing()).isFalse();
+ }
+
@After
public void tearDown() {
mMenu.hide();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
index 28da2f1..eefc412 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
@@ -27,6 +27,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
@@ -46,6 +47,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
+import android.graphics.Point;
import android.hardware.biometrics.BiometricAuthenticator;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricManager;
@@ -185,6 +187,8 @@
when(mDialog1.getRequestId()).thenReturn(REQUEST_ID);
when(mDialog2.getRequestId()).thenReturn(REQUEST_ID);
+ when(mDisplayManager.getStableDisplaySize()).thenReturn(new Point());
+
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
final List<ComponentInfoInternal> componentInfo = new ArrayList<>();
@@ -599,15 +603,25 @@
}
@Test
+ public void testClientNotified_whenTaskStackChangesDuringShow() throws Exception {
+ switchTask("other_package");
+ showDialog(new int[] {1} /* sensorIds */, false /* credentialAllowed */);
+
+ mTestableLooper.processAllMessages();
+
+ assertNull(mAuthController.mCurrentDialog);
+ assertNull(mAuthController.mReceiver);
+ verify(mDialog1).dismissWithoutCallback(true /* animate */);
+ verify(mReceiver).onDialogDismissed(
+ eq(BiometricPrompt.DISMISSED_REASON_USER_CANCEL),
+ eq(null) /* credentialAttestation */);
+ }
+
+ @Test
public void testClientNotified_whenTaskStackChangesDuringAuthentication() throws Exception {
showDialog(new int[] {1} /* sensorIds */, false /* credentialAllowed */);
- List<ActivityManager.RunningTaskInfo> tasks = new ArrayList<>();
- ActivityManager.RunningTaskInfo taskInfo = mock(ActivityManager.RunningTaskInfo.class);
- taskInfo.topActivity = mock(ComponentName.class);
- when(taskInfo.topActivity.getPackageName()).thenReturn("other_package");
- tasks.add(taskInfo);
- when(mActivityTaskManager.getTasks(anyInt())).thenReturn(tasks);
+ switchTask("other_package");
mAuthController.mTaskStackListener.onTaskStackChanged();
mTestableLooper.processAllMessages();
@@ -663,7 +677,7 @@
public void testSubscribesToOrientationChangesWhenShowingDialog() {
showDialog(new int[]{1} /* sensorIds */, false /* credentialAllowed */);
- verify(mDisplayManager).registerDisplayListener(any(), eq(mHandler));
+ verify(mDisplayManager).registerDisplayListener(any(), eq(mHandler), anyLong());
mAuthController.hideAuthenticationDialog(REQUEST_ID);
verify(mDisplayManager).unregisterDisplayListener(any());
@@ -725,6 +739,16 @@
BIOMETRIC_MULTI_SENSOR_FINGERPRINT_AND_FACE);
}
+ private void switchTask(String packageName) {
+ final List<ActivityManager.RunningTaskInfo> tasks = new ArrayList<>();
+ final ActivityManager.RunningTaskInfo taskInfo =
+ mock(ActivityManager.RunningTaskInfo.class);
+ taskInfo.topActivity = mock(ComponentName.class);
+ when(taskInfo.topActivity.getPackageName()).thenReturn(packageName);
+ tasks.add(taskInfo);
+ when(mActivityTaskManager.getTasks(anyInt())).thenReturn(tasks);
+ }
+
private PromptInfo createTestPromptInfo() {
PromptInfo promptInfo = new PromptInfo();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt
index 5440b45..7f8656c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt
@@ -163,7 +163,7 @@
fun testFingerprintTrigger_KeyguardNotVisible_NotDreaming_NoRipple() {
// GIVEN fp exists & user doesn't need strong auth
val fpsLocation = PointF(5f, 5f)
- `when`(authController.udfpsSensorLocation).thenReturn(fpsLocation)
+ `when`(authController.udfpsLocation).thenReturn(fpsLocation)
controller.onViewAttached()
`when`(keyguardUpdateMonitor.userNeedsStrongAuth()).thenReturn(false)
@@ -185,7 +185,7 @@
fun testFingerprintTrigger_StrongAuthRequired_NoRipple() {
// GIVEN fp exists & keyguard is visible
val fpsLocation = PointF(5f, 5f)
- `when`(authController.udfpsSensorLocation).thenReturn(fpsLocation)
+ `when`(authController.udfpsLocation).thenReturn(fpsLocation)
controller.onViewAttached()
`when`(keyguardUpdateMonitor.isKeyguardVisible).thenReturn(true)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricDisplayListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricDisplayListenerTest.java
index 40f335d..69c7f36 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricDisplayListenerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricDisplayListenerTest.java
@@ -20,6 +20,7 @@
import static com.android.systemui.biometrics.BiometricDisplayListener.SensorType.UnderDisplayFingerprint;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.same;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
@@ -89,7 +90,8 @@
mContextSpy, mDisplayManager, mHandler, mUdfpsType, mOnChangedCallback);
listener.enable();
- verify(mDisplayManager).registerDisplayListener(any(), same(mHandler));
+ verify(mDisplayManager).registerDisplayListener(any(), same(mHandler),
+ eq(DisplayManager.EVENT_FLAG_DISPLAY_CHANGED));
}
@Test
@@ -113,7 +115,7 @@
when(mDisplay.getRotation()).thenReturn(Surface.ROTATION_90);
listener.enable();
verify(mDisplayManager).registerDisplayListener(mDisplayListenerCaptor.capture(),
- same(mHandler));
+ same(mHandler), eq(DisplayManager.EVENT_FLAG_DISPLAY_CHANGED));
// Rotate the device back to portrait and ensure the rotation is detected.
when(mDisplay.getRotation()).thenReturn(Surface.ROTATION_0);
@@ -150,8 +152,8 @@
// The listener should record the current rotation and register a display listener.
verify(mDisplay).getRotation();
- verify(mDisplayManager)
- .registerDisplayListener(mDisplayListenerCaptor.capture(), same(mHandler));
+ verify(mDisplayManager).registerDisplayListener(mDisplayListenerCaptor.capture(),
+ same(mHandler), eq(DisplayManager.EVENT_FLAG_DISPLAY_CHANGED));
// Test the first rotation since the listener was enabled.
mDisplayListenerCaptor.getValue().onDisplayChanged(123);
@@ -182,8 +184,8 @@
listener.enable();
// The listener should register a display listener.
- verify(mDisplayManager)
- .registerDisplayListener(mDisplayListenerCaptor.capture(), same(mHandler));
+ verify(mDisplayManager).registerDisplayListener(mDisplayListenerCaptor.capture(),
+ same(mHandler), eq(DisplayManager.EVENT_FLAG_DISPLAY_CHANGED));
// mOnChangedCallback should be invoked for all calls to onDisplayChanged.
mDisplayListenerCaptor.getValue().onDisplayChanged(123);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/SidefpsControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/SidefpsControllerTest.kt
index 839c0ab..e1a348e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/SidefpsControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/SidefpsControllerTest.kt
@@ -188,7 +188,7 @@
overlayController.show(SENSOR_ID, REASON_UNKNOWN)
executor.runAllReady()
- verify(displayManager).registerDisplayListener(any(), eq(handler))
+ verify(displayManager).registerDisplayListener(any(), eq(handler), anyLong())
overlayController.hide(SENSOR_ID)
executor.runAllReady()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt
index fd49766..a57b011 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt
@@ -16,6 +16,7 @@
package com.android.systemui.biometrics
+import android.graphics.Rect
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_BP
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_KEYGUARD
import android.hardware.biometrics.BiometricOverlayConstants.REASON_AUTH_OTHER
@@ -23,7 +24,6 @@
import android.hardware.biometrics.BiometricOverlayConstants.REASON_ENROLL_ENROLLING
import android.hardware.biometrics.BiometricOverlayConstants.REASON_ENROLL_FIND_SENSOR
import android.hardware.biometrics.BiometricOverlayConstants.ShowReason
-import android.hardware.biometrics.SensorLocationInternal
import android.hardware.fingerprint.FingerprintManager
import android.hardware.fingerprint.IUdfpsOverlayControllerCallback
import android.testing.AndroidTestingRunner
@@ -31,6 +31,8 @@
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
+import android.view.Surface
+import android.view.Surface.Rotation
import android.view.WindowManager
import android.view.accessibility.AccessibilityManager
import androidx.test.filters.SmallTest
@@ -53,8 +55,10 @@
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatchers.any
import org.mockito.ArgumentMatchers.eq
+import org.mockito.Captor
import org.mockito.Mock
import org.mockito.Mockito.mock
import org.mockito.Mockito.verify
@@ -63,13 +67,18 @@
private const val REQUEST_ID = 2L
+// Dimensions for the current display resolution.
+private const val DISPLAY_WIDTH = 1080
+private const val DISPLAY_HEIGHT = 1920
+private const val SENSOR_WIDTH = 30
+private const val SENSOR_HEIGHT = 60
+
@SmallTest
@RunWith(AndroidTestingRunner::class)
@RunWithLooper(setAsMainLooper = true)
class UdfpsControllerOverlayTest : SysuiTestCase() {
- @JvmField @Rule
- var rule = MockitoJUnit.rule()
+ @JvmField @Rule var rule = MockitoJUnit.rule()
@Mock private lateinit var fingerprintManager: FingerprintManager
@Mock private lateinit var inflater: LayoutInflater
@@ -85,18 +94,17 @@
@Mock private lateinit var configurationController: ConfigurationController
@Mock private lateinit var systemClock: SystemClock
@Mock private lateinit var keyguardStateController: KeyguardStateController
- @Mock
- private lateinit var unlockedScreenOffAnimationController: UnlockedScreenOffAnimationController
+ @Mock private lateinit var unlockedScreenOffAnimationController: UnlockedScreenOffAnimationController
@Mock private lateinit var hbmProvider: UdfpsHbmProvider
@Mock private lateinit var controllerCallback: IUdfpsOverlayControllerCallback
@Mock private lateinit var udfpsController: UdfpsController
@Mock private lateinit var udfpsView: UdfpsView
@Mock private lateinit var udfpsEnrollView: UdfpsEnrollView
@Mock private lateinit var activityLaunchAnimator: ActivityLaunchAnimator
+ @Captor private lateinit var layoutParamsCaptor: ArgumentCaptor<WindowManager.LayoutParams>
- private val sensorProps = SensorLocationInternal("", 10, 100, 20)
- .asFingerprintSensorProperties()
private val onTouch = { _: View, _: MotionEvent, _: Boolean -> true }
+ private var overlayParams: UdfpsOverlayParams = UdfpsOverlayParams()
private lateinit var controllerOverlay: UdfpsControllerOverlay
@Before
@@ -121,7 +129,7 @@
statusBarStateController, panelExpansionStateManager, statusBarKeyguardViewManager,
keyguardUpdateMonitor, dialogManager, dumpManager, transitionController,
configurationController, systemClock, keyguardStateController,
- unlockedScreenOffAnimationController, sensorProps, hbmProvider, REQUEST_ID, reason,
+ unlockedScreenOffAnimationController, hbmProvider, REQUEST_ID, reason,
controllerCallback, onTouch, activityLaunchAnimator)
block()
}
@@ -148,12 +156,96 @@
@Test
fun showUdfpsOverlay_other() = withReason(REASON_AUTH_OTHER) { showUdfpsOverlay() }
+ private fun withRotation(@Rotation rotation: Int, block: () -> Unit) {
+ // Sensor that's in the top left corner of the display in natural orientation.
+ val sensorBounds = Rect(0, 0, SENSOR_WIDTH, SENSOR_HEIGHT)
+ overlayParams = UdfpsOverlayParams(
+ sensorBounds,
+ DISPLAY_WIDTH,
+ DISPLAY_HEIGHT,
+ scaleFactor = 1f,
+ rotation
+ )
+ block()
+ }
+
+ @Test
+ fun showUdfpsOverlay_withRotation0() = withRotation(Surface.ROTATION_0) {
+ withReason(REASON_AUTH_BP) {
+ controllerOverlay.show(udfpsController, overlayParams)
+ verify(windowManager).addView(
+ eq(controllerOverlay.overlayView),
+ layoutParamsCaptor.capture()
+ )
+
+ // ROTATION_0 is the native orientation. Sensor should stay in the top left corner.
+ val lp = layoutParamsCaptor.value
+ assertThat(lp.x).isEqualTo(0)
+ assertThat(lp.y).isEqualTo(0)
+ assertThat(lp.width).isEqualTo(SENSOR_WIDTH)
+ assertThat(lp.height).isEqualTo(SENSOR_HEIGHT)
+ }
+ }
+
+ @Test
+ fun showUdfpsOverlay_withRotation180() = withRotation(Surface.ROTATION_180) {
+ withReason(REASON_AUTH_BP) {
+ controllerOverlay.show(udfpsController, overlayParams)
+ verify(windowManager).addView(
+ eq(controllerOverlay.overlayView),
+ layoutParamsCaptor.capture()
+ )
+
+ // ROTATION_180 is not supported. Sensor should stay in the top left corner.
+ val lp = layoutParamsCaptor.value
+ assertThat(lp.x).isEqualTo(0)
+ assertThat(lp.y).isEqualTo(0)
+ assertThat(lp.width).isEqualTo(SENSOR_WIDTH)
+ assertThat(lp.height).isEqualTo(SENSOR_HEIGHT)
+ }
+ }
+
+ @Test
+ fun showUdfpsOverlay_withRotation90() = withRotation(Surface.ROTATION_90) {
+ withReason(REASON_AUTH_BP) {
+ controllerOverlay.show(udfpsController, overlayParams)
+ verify(windowManager).addView(
+ eq(controllerOverlay.overlayView),
+ layoutParamsCaptor.capture()
+ )
+
+ // Sensor should be in the bottom left corner in ROTATION_90.
+ val lp = layoutParamsCaptor.value
+ assertThat(lp.x).isEqualTo(0)
+ assertThat(lp.y).isEqualTo(DISPLAY_WIDTH - SENSOR_WIDTH)
+ assertThat(lp.width).isEqualTo(SENSOR_HEIGHT)
+ assertThat(lp.height).isEqualTo(SENSOR_WIDTH)
+ }
+ }
+
+ @Test
+ fun showUdfpsOverlay_withRotation270() = withRotation(Surface.ROTATION_270) {
+ withReason(REASON_AUTH_BP) {
+ controllerOverlay.show(udfpsController, overlayParams)
+ verify(windowManager).addView(
+ eq(controllerOverlay.overlayView),
+ layoutParamsCaptor.capture()
+ )
+
+ // Sensor should be in the top right corner in ROTATION_270.
+ val lp = layoutParamsCaptor.value
+ assertThat(lp.x).isEqualTo(DISPLAY_HEIGHT - SENSOR_HEIGHT)
+ assertThat(lp.y).isEqualTo(0)
+ assertThat(lp.width).isEqualTo(SENSOR_HEIGHT)
+ assertThat(lp.height).isEqualTo(SENSOR_WIDTH)
+ }
+ }
+
private fun showUdfpsOverlay(isEnrollUseCase: Boolean = false) {
- val didShow = controllerOverlay.show(udfpsController)
+ val didShow = controllerOverlay.show(udfpsController, overlayParams)
verify(windowManager).addView(eq(controllerOverlay.overlayView), any())
verify(udfpsView).setHbmProvider(eq(hbmProvider))
- verify(udfpsView).sensorProperties = eq(sensorProps)
verify(udfpsView).animationViewController = any()
verify(udfpsView).addView(any())
@@ -162,7 +254,7 @@
assertThat(controllerOverlay.isHiding).isFalse()
assertThat(controllerOverlay.overlayView).isNotNull()
if (isEnrollUseCase) {
- verify(udfpsEnrollView).updateSensorLocation(eq(sensorProps))
+ verify(udfpsEnrollView).updateSensorLocation(eq(overlayParams.sensorBounds))
assertThat(controllerOverlay.enrollHelper).isNotNull()
} else {
assertThat(controllerOverlay.enrollHelper).isNull()
@@ -188,7 +280,7 @@
fun hideUdfpsOverlay_other() = withReason(REASON_AUTH_OTHER) { hideUdfpsOverlay() }
private fun hideUdfpsOverlay() {
- val didShow = controllerOverlay.show(udfpsController)
+ val didShow = controllerOverlay.show(udfpsController, overlayParams)
val view = controllerOverlay.overlayView
val didHide = controllerOverlay.hide()
@@ -209,13 +301,13 @@
@Test
fun canNotReshow() = withReason(REASON_AUTH_BP) {
- assertThat(controllerOverlay.show(udfpsController)).isTrue()
- assertThat(controllerOverlay.show(udfpsController)).isFalse()
+ assertThat(controllerOverlay.show(udfpsController, overlayParams)).isTrue()
+ assertThat(controllerOverlay.show(udfpsController, overlayParams)).isFalse()
}
@Test
fun forwardEnrollProgressEvents() = withReason(REASON_ENROLL_ENROLLING) {
- controllerOverlay.show(udfpsController)
+ controllerOverlay.show(udfpsController, overlayParams)
with(EnrollListener(controllerOverlay)) {
controllerOverlay.onEnrollmentProgress(/* remaining */20)
@@ -228,7 +320,7 @@
@Test
fun forwardEnrollHelpEvents() = withReason(REASON_ENROLL_ENROLLING) {
- controllerOverlay.show(udfpsController)
+ controllerOverlay.show(udfpsController, overlayParams)
with(EnrollListener(controllerOverlay)) {
controllerOverlay.onEnrollmentHelp()
@@ -240,7 +332,7 @@
@Test
fun forwardEnrollAcquiredEvents() = withReason(REASON_ENROLL_ENROLLING) {
- controllerOverlay.show(udfpsController)
+ controllerOverlay.show(udfpsController, overlayParams)
with(EnrollListener(controllerOverlay)) {
controllerOverlay.onEnrollmentProgress(/* remaining */ 1)
@@ -261,7 +353,7 @@
fun stopIlluminatingOnHide() = withReason(REASON_AUTH_BP) {
whenever(udfpsView.isIlluminationRequested).thenReturn(true)
- controllerOverlay.show(udfpsController)
+ controllerOverlay.show(udfpsController, overlayParams)
controllerOverlay.hide()
verify(udfpsView).stopIllumination()
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
index 5d624cd..80df1e3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
@@ -16,6 +16,9 @@
package com.android.systemui.biometrics;
+import static android.view.MotionEvent.ACTION_DOWN;
+import static android.view.MotionEvent.ACTION_MOVE;
+
import static junit.framework.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
@@ -28,11 +31,12 @@
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.content.res.TypedArray;
+import android.graphics.Rect;
import android.hardware.biometrics.BiometricOverlayConstants;
import android.hardware.biometrics.ComponentInfoInternal;
import android.hardware.biometrics.SensorProperties;
@@ -50,6 +54,7 @@
import android.testing.TestableLooper.RunWithLooper;
import android.view.LayoutInflater;
import android.view.MotionEvent;
+import android.view.Surface;
import android.view.View;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
@@ -67,7 +72,6 @@
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.LockscreenShadeTransitionController;
import com.android.systemui.statusbar.VibratorHelper;
-import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.SystemUIDialogManager;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
@@ -124,8 +128,6 @@
@Mock
private StatusBarStateController mStatusBarStateController;
@Mock
- private CentralSurfaces mCentralSurfaces;
- @Mock
private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
@Mock
private DumpManager mDumpManager;
@@ -174,18 +176,14 @@
private UdfpsFpmOtherView mFpmOtherView;
@Mock
private UdfpsKeyguardView mKeyguardView;
- private UdfpsAnimationViewController mUdfpsKeyguardViewController =
+ private final UdfpsAnimationViewController mUdfpsKeyguardViewController =
mock(UdfpsKeyguardViewController.class);
@Mock
- private TypedArray mBrightnessValues;
- @Mock
- private TypedArray mBrightnessBacklight;
- @Mock
private SystemUIDialogManager mSystemUIDialogManager;
@Mock
private ActivityLaunchAnimator mActivityLaunchAnimator;
@Mock
- private AlternateUdfpsTouchProvider mTouchProvider;
+ private AlternateUdfpsTouchProvider mAlternateTouchProvider;
// Capture listeners so that they can be used to send events
@Captor private ArgumentCaptor<IUdfpsOverlayController> mOverlayCaptor;
@@ -198,7 +196,6 @@
@Before
public void setUp() {
- setUpResources();
mExecution = new FakeExecution();
when(mLayoutInflater.inflate(R.layout.udfps_view, null, false))
@@ -260,22 +257,12 @@
mSystemUIDialogManager,
mLatencyTracker,
mActivityLaunchAnimator,
- Optional.of(mTouchProvider));
+ Optional.of(mAlternateTouchProvider));
verify(mFingerprintManager).setUdfpsOverlayController(mOverlayCaptor.capture());
mOverlayController = mOverlayCaptor.getValue();
verify(mScreenLifecycle).addObserver(mScreenObserverCaptor.capture());
mScreenObserver = mScreenObserverCaptor.getValue();
-
- assertEquals(TEST_UDFPS_SENSOR_ID, mUdfpsController.mSensorProps.sensorId);
- }
-
- private void setUpResources() {
- when(mBrightnessValues.length()).thenReturn(2);
- when(mBrightnessValues.getFloat(0, PowerManager.BRIGHTNESS_OFF_FLOAT)).thenReturn(1f);
- when(mBrightnessValues.getFloat(1, PowerManager.BRIGHTNESS_OFF_FLOAT)).thenReturn(2f);
- when(mBrightnessBacklight.length()).thenReturn(2);
- when(mBrightnessBacklight.getFloat(0, PowerManager.BRIGHTNESS_OFF_FLOAT)).thenReturn(1f);
- when(mBrightnessBacklight.getFloat(1, PowerManager.BRIGHTNESS_OFF_FLOAT)).thenReturn(2f);
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID, new UdfpsOverlayParams());
}
@Test
@@ -301,7 +288,7 @@
// WHEN ACTION_DOWN is received
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
- MotionEvent downEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0);
+ MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
downEvent.recycle();
@@ -362,7 +349,7 @@
// WHEN multiple touches are received
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
- MotionEvent downEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0);
+ MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
downEvent.recycle();
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
@@ -395,7 +382,7 @@
BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback);
mFgExecutor.runAllReady();
- verify(mDisplayManager).registerDisplayListener(any(), eq(mHandler));
+ verify(mDisplayManager).registerDisplayListener(any(), eq(mHandler), anyLong());
mOverlayController.hideUdfpsOverlay(TEST_UDFPS_SENSOR_ID);
mFgExecutor.runAllReady();
@@ -404,6 +391,175 @@
}
@Test
+ public void updateOverlayParams_recreatesOverlay_ifParamsChanged() throws Exception {
+ final Rect[] sensorBounds = new Rect[]{new Rect(10, 10, 20, 20), new Rect(5, 5, 25, 25)};
+ final int[] displayWidth = new int[]{1080, 1440};
+ final int[] displayHeight = new int[]{1920, 2560};
+ final float[] scaleFactor = new float[]{1f, displayHeight[1] / (float) displayHeight[0]};
+ final int[] rotation = new int[]{Surface.ROTATION_0, Surface.ROTATION_90};
+ final UdfpsOverlayParams oldParams = new UdfpsOverlayParams(sensorBounds[0],
+ displayWidth[0], displayHeight[0], scaleFactor[0], rotation[0]);
+
+ for (int i1 = 0; i1 <= 1; ++i1)
+ for (int i2 = 0; i2 <= 1; ++i2)
+ for (int i3 = 0; i3 <= 1; ++i3)
+ for (int i4 = 0; i4 <= 1; ++i4)
+ for (int i5 = 0; i5 <= 1; ++i5) {
+ final UdfpsOverlayParams newParams = new UdfpsOverlayParams(sensorBounds[i1],
+ displayWidth[i2], displayHeight[i3], scaleFactor[i4], rotation[i5]);
+
+ if (newParams.equals(oldParams)) {
+ continue;
+ }
+
+ // Initialize the overlay with old parameters.
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID, oldParams);
+
+ // Show the overlay.
+ reset(mWindowManager);
+ mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID,
+ BiometricOverlayConstants.REASON_ENROLL_ENROLLING,
+ mUdfpsOverlayControllerCallback);
+ mFgExecutor.runAllReady();
+ verify(mWindowManager).addView(any(), any());
+
+ // Update overlay parameters.
+ reset(mWindowManager);
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID, newParams);
+ mFgExecutor.runAllReady();
+
+ // Ensure the overlay was recreated.
+ verify(mWindowManager).removeView(any());
+ verify(mWindowManager).addView(any(), any());
+ }
+ }
+
+ @Test
+ public void updateOverlayParams_doesNothing_ifParamsDidntChange() throws Exception {
+ final Rect sensorBounds = new Rect(10, 10, 20, 20);
+ final int displayWidth = 1080;
+ final int displayHeight = 1920;
+ final float scaleFactor = 1f;
+ final int rotation = Surface.ROTATION_0;
+
+ // Initialize the overlay.
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID,
+ new UdfpsOverlayParams(sensorBounds, displayWidth, displayHeight, scaleFactor,
+ rotation));
+
+ // Show the overlay.
+ mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID,
+ BiometricOverlayConstants.REASON_ENROLL_ENROLLING, mUdfpsOverlayControllerCallback);
+ mFgExecutor.runAllReady();
+ verify(mWindowManager).addView(any(), any());
+
+ // Update overlay with the same parameters.
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID,
+ new UdfpsOverlayParams(sensorBounds, displayWidth, displayHeight, scaleFactor,
+ rotation));
+ mFgExecutor.runAllReady();
+
+ // Ensure the overlay was not recreated.
+ verify(mWindowManager, never()).removeView(any());
+ }
+
+ private static MotionEvent obtainMotionEvent(int action, float x, float y, float minor,
+ float major) {
+ MotionEvent.PointerProperties pp = new MotionEvent.PointerProperties();
+ pp.id = 1;
+ MotionEvent.PointerCoords pc = new MotionEvent.PointerCoords();
+ pc.x = x;
+ pc.y = y;
+ pc.touchMinor = minor;
+ pc.touchMajor = major;
+ return MotionEvent.obtain(0, 0, action, 1, new MotionEvent.PointerProperties[]{pp},
+ new MotionEvent.PointerCoords[]{pc}, 0, 0, 1f, 1f, 0, 0, 0, 0);
+ }
+
+ @Test
+ public void onTouch_propagatesTouchInNativeOrientationAndResolution() throws RemoteException {
+ final Rect sensorBounds = new Rect(1000, 1900, 1080, 1920); // Bottom right corner.
+ final int displayWidth = 1080;
+ final int displayHeight = 1920;
+ final float scaleFactor = 0.75f; // This means the native resolution is 1440x2560.
+ final float touchMinor = 10f;
+ final float touchMajor = 20f;
+
+ // Expecting a touch at the very bottom right corner in native orientation and resolution.
+ final int expectedX = (int) (displayWidth / scaleFactor);
+ final int expectedY = (int) (displayHeight / scaleFactor);
+ final float expectedMinor = touchMinor / scaleFactor;
+ final float expectedMajor = touchMajor / scaleFactor;
+
+ // Configure UdfpsView to accept the ACTION_DOWN event
+ when(mUdfpsView.isIlluminationRequested()).thenReturn(false);
+ when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true);
+
+ // Show the overlay.
+ mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, TEST_UDFPS_SENSOR_ID,
+ BiometricOverlayConstants.REASON_ENROLL_ENROLLING, mUdfpsOverlayControllerCallback);
+ mFgExecutor.runAllReady();
+ verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
+
+ // Test ROTATION_0
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID,
+ new UdfpsOverlayParams(sensorBounds, displayWidth, displayHeight, scaleFactor,
+ Surface.ROTATION_0));
+ MotionEvent event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor,
+ touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ event = obtainMotionEvent(ACTION_MOVE, displayWidth, displayHeight, touchMinor, touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
+ eq(expectedY), eq(expectedMinor), eq(expectedMajor));
+
+ // Test ROTATION_90
+ reset(mAlternateTouchProvider);
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID,
+ new UdfpsOverlayParams(sensorBounds, displayWidth, displayHeight, scaleFactor,
+ Surface.ROTATION_90));
+ event = obtainMotionEvent(ACTION_DOWN, displayHeight, 0, touchMinor, touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ event = obtainMotionEvent(ACTION_MOVE, displayHeight, 0, touchMinor, touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
+ eq(expectedY), eq(expectedMinor), eq(expectedMajor));
+
+ // Test ROTATION_270
+ reset(mAlternateTouchProvider);
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID,
+ new UdfpsOverlayParams(sensorBounds, displayWidth, displayHeight, scaleFactor,
+ Surface.ROTATION_270));
+ event = obtainMotionEvent(ACTION_DOWN, 0, displayWidth, touchMinor, touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ event = obtainMotionEvent(ACTION_MOVE, 0, displayWidth, touchMinor, touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
+ eq(expectedY), eq(expectedMinor), eq(expectedMajor));
+
+ // Test ROTATION_180
+ reset(mAlternateTouchProvider);
+ mUdfpsController.updateOverlayParams(TEST_UDFPS_SENSOR_ID,
+ new UdfpsOverlayParams(sensorBounds, displayWidth, displayHeight, scaleFactor,
+ Surface.ROTATION_180));
+ // ROTATION_180 is not supported. It should be treated like ROTATION_0.
+ event = obtainMotionEvent(ACTION_DOWN, displayWidth, displayHeight, touchMinor, touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ event = obtainMotionEvent(ACTION_MOVE, displayWidth, displayHeight, touchMinor, touchMajor);
+ mTouchListenerCaptor.getValue().onTouch(mUdfpsView, event);
+ event.recycle();
+ verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(expectedX),
+ eq(expectedY), eq(expectedMinor), eq(expectedMajor));
+ }
+
+ @Test
public void fingerDown() throws RemoteException {
// Configure UdfpsView to accept the ACTION_DOWN event
when(mUdfpsView.isIlluminationRequested()).thenReturn(false);
@@ -415,15 +571,17 @@
mFgExecutor.runAllReady();
// WHEN ACTION_DOWN is received
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
- MotionEvent downEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0);
+ MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
downEvent.recycle();
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
+
+ // FIX THIS TEST
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
moveEvent.recycle();
// THEN FingerprintManager is notified about onPointerDown
- verify(mTouchProvider).onPointerDown(eq(TEST_REQUEST_ID),
- eq(0), eq(0), eq(0f), eq(0f));
+ verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID), eq(0), eq(0), eq(0f),
+ eq(0f));
verify(mFingerprintManager, never()).onPointerDown(anyLong(), anyInt(), anyInt(), anyInt(),
anyFloat(), anyFloat());
verify(mLatencyTracker).onActionStart(eq(LatencyTracker.ACTION_UDFPS_ILLUMINATE));
@@ -434,7 +592,7 @@
mOnIlluminatedRunnableCaptor.getValue().run();
InOrder inOrder = inOrder(mFingerprintManager, mLatencyTracker);
inOrder.verify(mFingerprintManager).onUiReady(
- eq(TEST_REQUEST_ID), eq(mUdfpsController.mSensorProps.sensorId));
+ eq(TEST_REQUEST_ID), eq(mUdfpsController.mSensorId));
inOrder.verify(mLatencyTracker).onActionEnd(eq(LatencyTracker.ACTION_UDFPS_ILLUMINATE));
}
@@ -452,7 +610,7 @@
// AND onIlluminatedRunnable that notifies FingerprintManager is set
verify(mUdfpsView).startIllumination(mOnIlluminatedRunnableCaptor.capture());
mOnIlluminatedRunnableCaptor.getValue().run();
- verify(mTouchProvider).onPointerDown(eq(TEST_REQUEST_ID),
+ verify(mAlternateTouchProvider).onPointerDown(eq(TEST_REQUEST_ID),
eq(0), eq(0), eq(3f) /* minor */, eq(2f) /* major */);
verify(mFingerprintManager, never()).onPointerDown(anyLong(), anyInt(), anyInt(), anyInt(),
anyFloat(), anyFloat());
@@ -573,7 +731,7 @@
// WHEN ACTION_DOWN is received
verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());
- MotionEvent downEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0);
+ MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
downEvent.recycle();
MotionEvent moveEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, 0, 0);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsViewTest.kt
index 6d4cc4c..744af58 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsViewTest.kt
@@ -23,6 +23,7 @@
import android.testing.TestableLooper
import android.testing.ViewUtils
import android.view.LayoutInflater
+import android.view.Surface
import androidx.test.filters.SmallTest
import com.android.systemui.R
import com.android.systemui.SysuiTestCase
@@ -69,9 +70,8 @@
com.android.internal.R.integer.config_udfps_illumination_transition_ms, 0)
view = LayoutInflater.from(context).inflate(R.layout.udfps_view, null) as UdfpsView
view.animationViewController = animationViewController
- view.sensorProperties =
- SensorLocationInternal(DISPLAY_ID, SENSOR_X, SENSOR_Y, SENSOR_RADIUS)
- .asFingerprintSensorProperties()
+ val sensorBounds = SensorLocationInternal("", SENSOR_X, SENSOR_Y, SENSOR_RADIUS).rect
+ view.overlayParams = UdfpsOverlayParams(sensorBounds, 1920, 1080, 1f, Surface.ROTATION_0)
view.setHbmProvider(hbmProvider)
ViewUtils.attachView(view)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt b/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt
index adb9c4d..f933361 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/decor/RoundedCornerResDelegateTest.kt
@@ -133,6 +133,22 @@
assertEquals(Size(4, 4), roundedCornerResDelegate.bottomRoundedSize)
}
+ @Test
+ fun testPhysicalPixelDisplaySizeChanged() {
+ setupResources(
+ roundedTopDrawable = getTestsDrawable(R.drawable.rounded4px),
+ roundedBottomDrawable = getTestsDrawable(R.drawable.rounded4px))
+
+ roundedCornerResDelegate = RoundedCornerResDelegate(mContext.resources, null)
+ assertEquals(Size(4, 4), roundedCornerResDelegate.topRoundedSize)
+ assertEquals(Size(4, 4), roundedCornerResDelegate.bottomRoundedSize)
+
+ roundedCornerResDelegate.physicalPixelDisplaySizeRatio = 0.5f
+
+ assertEquals(Size(2, 2), roundedCornerResDelegate.topRoundedSize)
+ assertEquals(Size(2, 2), roundedCornerResDelegate.bottomRoundedSize)
+ }
+
private fun getTestsDrawable(@DrawableRes drawableId: Int): Drawable? {
return mContext.createPackageContext("com.android.systemui.tests", 0)
.getDrawable(drawableId)
@@ -153,7 +169,6 @@
res.addOverride(SystemUIR.array.config_roundedCornerDrawableArray, mockTypedArray)
res.addOverride(SystemUIR.array.config_roundedCornerTopDrawableArray, mockTypedArray)
res.addOverride(SystemUIR.array.config_roundedCornerBottomDrawableArray, mockTypedArray)
- res.addOverride(SystemUIR.array.config_roundedCornerMultipleRadiusArray, mockTypedArray)
res.addOverride(com.android.internal.R.dimen.rounded_corner_radius, radius ?: 0)
res.addOverride(com.android.internal.R.dimen.rounded_corner_radius_top, radiusTop ?: 0)
res.addOverride(com.android.internal.R.dimen.rounded_corner_radius_bottom,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java
index f567b55..9d4275e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java
@@ -41,7 +41,6 @@
import com.android.internal.logging.UiEventLogger;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.dreams.complication.DreamPreviewComplication;
import com.android.systemui.dreams.dagger.DreamOverlayComponent;
import com.android.systemui.dreams.touch.DreamOverlayTouchMonitor;
import com.android.systemui.util.concurrency.FakeExecutor;
@@ -100,9 +99,6 @@
DreamOverlayStateController mStateController;
@Mock
- DreamPreviewComplication mPreviewComplication;
-
- @Mock
ViewGroup mDreamOverlayContainerViewParent;
@Mock
@@ -133,7 +129,6 @@
mDreamOverlayComponentFactory,
mStateController,
mKeyguardUpdateMonitor,
- mPreviewComplication,
mUiEventLogger);
}
@@ -209,31 +204,6 @@
}
@Test
- public void testPreviewModeFalseByDefault() {
- mService.onBind(new Intent());
-
- assertThat(mService.isPreviewMode()).isFalse();
- }
-
- @Test
- public void testPreviewModeSetByIntentExtra() {
- final Intent intent = new Intent();
- intent.putExtra(DreamService.EXTRA_IS_PREVIEW, true);
- mService.onBind(intent);
-
- assertThat(mService.isPreviewMode()).isTrue();
- }
-
- @Test
- public void testDreamLabel() {
- final Intent intent = new Intent();
- intent.putExtra(DreamService.EXTRA_DREAM_LABEL, "TestDream");
- mService.onBind(intent);
-
- assertThat(mService.getDreamLabel()).isEqualTo("TestDream");
- }
-
- @Test
public void testDestroy() {
mService.onDestroy();
mMainExecutor.runAllReady();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java
index 3ce9889..fb64c7b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java
@@ -83,38 +83,6 @@
}
@Test
- public void testStateChange_isPreviewMode() {
- final DreamOverlayStateController stateController = new DreamOverlayStateController(
- mExecutor);
- stateController.addCallback(mCallback);
- stateController.setPreviewMode(true);
- mExecutor.runAllReady();
-
- verify(mCallback).onStateChanged();
- assertThat(stateController.isPreviewMode()).isTrue();
-
- Mockito.clearInvocations(mCallback);
- stateController.setPreviewMode(true);
- mExecutor.runAllReady();
- verify(mCallback, never()).onStateChanged();
- }
-
- @Test
- public void testPreviewModeFalseByDefault() {
- final DreamOverlayStateController stateController = new DreamOverlayStateController(
- mExecutor);
- assertThat(stateController.isPreviewMode()).isFalse();
- }
-
- @Test
- public void testPreviewModeSetToTrue() {
- final DreamOverlayStateController stateController = new DreamOverlayStateController(
- mExecutor);
- stateController.setPreviewMode(true);
- assertThat(stateController.isPreviewMode()).isTrue();
- }
-
- @Test
public void testCallback() {
final DreamOverlayStateController stateController = new DreamOverlayStateController(
mExecutor);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java
index 5ed1d65..4d0feff 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/LockIconViewControllerTest.java
@@ -399,7 +399,7 @@
/* resetLockoutRequiresHwToken */ false,
List.of(new SensorLocationInternal("" /* displayId */,
(int) udfpsLocation.x, (int) udfpsLocation.y, radius)));
- when(mAuthController.getUdfpsSensorLocation()).thenReturn(udfpsLocation);
+ when(mAuthController.getUdfpsLocation()).thenReturn(udfpsLocation);
when(mAuthController.getUdfpsProps()).thenReturn(List.of(fpProps));
return new Pair(radius, udfpsLocation);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt
index 33db993..6a9c3e3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt
@@ -25,7 +25,6 @@
import android.content.Intent
import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
-import android.graphics.Color
import android.graphics.drawable.Animatable2
import android.graphics.drawable.AnimatedVectorDrawable
import android.graphics.drawable.GradientDrawable
@@ -35,7 +34,6 @@
import android.media.session.MediaSession
import android.media.session.PlaybackState
import android.os.Bundle
-import android.os.Handler
import android.provider.Settings.ACTION_MEDIA_CONTROLS_SETTINGS
import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
@@ -111,6 +109,7 @@
@Mock private lateinit var activityStarter: ActivityStarter
@Mock private lateinit var broadcastSender: BroadcastSender
+ @Mock private lateinit var gutsViewHolder: GutsViewHolder
@Mock private lateinit var viewHolder: MediaViewHolder
@Mock private lateinit var view: TransitionLayout
@Mock private lateinit var seekBarViewModel: SeekBarViewModel
@@ -145,8 +144,7 @@
private lateinit var scrubbingElapsedTimeView: TextView
private lateinit var scrubbingTotalTimeView: TextView
private lateinit var actionsTopBarrier: Barrier
- @Mock private lateinit var longPressText: TextView
- @Mock private lateinit var handler: Handler
+ @Mock private lateinit var gutsText: TextView
@Mock private lateinit var mockAnimator: AnimatorSet
private lateinit var settings: ImageButton
private lateinit var cancel: View
@@ -228,6 +226,7 @@
}
}
+ initGutsViewHolderMocks()
initMediaViewHolderMocks()
// Create media session
@@ -272,6 +271,20 @@
)
}
+ private fun initGutsViewHolderMocks() {
+ settings = ImageButton(context)
+ cancel = View(context)
+ cancelText = TextView(context)
+ dismiss = FrameLayout(context)
+ dismissText = TextView(context)
+ whenever(gutsViewHolder.gutsText).thenReturn(gutsText)
+ whenever(gutsViewHolder.settings).thenReturn(settings)
+ whenever(gutsViewHolder.cancel).thenReturn(cancel)
+ whenever(gutsViewHolder.cancelText).thenReturn(cancelText)
+ whenever(gutsViewHolder.dismiss).thenReturn(dismiss)
+ whenever(gutsViewHolder.dismissText).thenReturn(dismissText)
+ }
+
/**
* Initialize elements in media view holder
*/
@@ -291,12 +304,7 @@
seamlessButton = View(context)
seamlessIcon = ImageView(context)
seamlessText = TextView(context)
- seekBar = SeekBar(context)
- settings = ImageButton(context)
- cancel = View(context)
- cancelText = TextView(context)
- dismiss = FrameLayout(context)
- dismissText = TextView(context)
+ seekBar = SeekBar(context).also { it.id = R.id.media_progress_bar }
action0 = ImageButton(context).also { it.setId(R.id.action0) }
action1 = ImageButton(context).also { it.setId(R.id.action1) }
@@ -341,6 +349,8 @@
whenever(viewHolder.scrubbingElapsedTimeView).thenReturn(scrubbingElapsedTimeView)
whenever(viewHolder.scrubbingTotalTimeView).thenReturn(scrubbingTotalTimeView)
+ whenever(viewHolder.gutsViewHolder).thenReturn(gutsViewHolder)
+
// Transition View
whenever(view.parent).thenReturn(transitionParent)
whenever(view.rootView).thenReturn(transitionParent)
@@ -363,15 +373,6 @@
whenever(viewHolder.action4).thenReturn(action4)
whenever(viewHolder.getAction(R.id.action4)).thenReturn(action4)
- // Long press menu
- whenever(viewHolder.longPressText).thenReturn(longPressText)
- whenever(longPressText.handler).thenReturn(handler)
- whenever(viewHolder.settings).thenReturn(settings)
- whenever(viewHolder.cancel).thenReturn(cancel)
- whenever(viewHolder.cancelText).thenReturn(cancelText)
- whenever(viewHolder.dismiss).thenReturn(dismiss)
- whenever(viewHolder.dismissText).thenReturn(dismissText)
-
whenever(viewHolder.actionsTopBarrier).thenReturn(actionsTopBarrier)
}
@@ -404,10 +405,7 @@
listOf(recSubtitle1, recSubtitle2, recSubtitle3)
)
- // Long press menu
- whenever(recommendationViewHolder.settings).thenReturn(settings)
- whenever(recommendationViewHolder.cancel).thenReturn(cancel)
- whenever(recommendationViewHolder.dismiss).thenReturn(dismiss)
+ whenever(recommendationViewHolder.gutsViewHolder).thenReturn(gutsViewHolder)
val actionIcon = Icon.createWithResource(context, R.drawable.ic_android)
whenever(smartspaceAction.icon).thenReturn(actionIcon)
@@ -539,8 +537,8 @@
}
@Test
- fun bind_seekBarDisabled_seekBarVisibilityIsSetToInvisible() {
- whenever(seekBarViewModel.getEnabled()).thenReturn(false)
+ fun bind_seekBarDisabled_hasActions_seekBarVisibilityIsSetToInvisible() {
+ useRealConstraintSets()
val icon = context.getDrawable(android.R.drawable.ic_media_play)
val semanticActions = MediaButton(
@@ -550,21 +548,84 @@
val state = mediaData.copy(semanticActions = semanticActions)
player.attachPlayer(viewHolder)
+ getEnabledChangeListener().onEnabledChanged(enabled = false)
+
player.bindPlayer(state, PACKAGE)
- verify(expandedSet).setVisibility(R.id.media_progress_bar, ConstraintSet.INVISIBLE)
+ assertThat(expandedSet.getVisibility(seekBar.id)).isEqualTo(ConstraintSet.INVISIBLE)
}
@Test
fun bind_seekBarDisabled_noActions_seekBarVisibilityIsSetToGone() {
- whenever(seekBarViewModel.getEnabled()).thenReturn(false)
+ useRealConstraintSets()
+
+ val state = mediaData.copy(semanticActions = MediaButton())
+ player.attachPlayer(viewHolder)
+ getEnabledChangeListener().onEnabledChanged(enabled = false)
+
+ player.bindPlayer(state, PACKAGE)
+
+ assertThat(expandedSet.getVisibility(seekBar.id)).isEqualTo(ConstraintSet.GONE)
+ }
+
+ @Test
+ fun bind_seekBarEnabled_seekBarVisible() {
+ useRealConstraintSets()
+
+ val state = mediaData.copy(semanticActions = MediaButton())
+ player.attachPlayer(viewHolder)
+ getEnabledChangeListener().onEnabledChanged(enabled = true)
+
+ player.bindPlayer(state, PACKAGE)
+
+ assertThat(expandedSet.getVisibility(seekBar.id)).isEqualTo(ConstraintSet.VISIBLE)
+ }
+
+ @Test
+ fun seekBarChangesToEnabledAfterBind_seekBarChangesToVisible() {
+ useRealConstraintSets()
+
+ val state = mediaData.copy(semanticActions = MediaButton())
+ player.attachPlayer(viewHolder)
+ player.bindPlayer(state, PACKAGE)
+
+ getEnabledChangeListener().onEnabledChanged(enabled = true)
+
+ assertThat(expandedSet.getVisibility(seekBar.id)).isEqualTo(ConstraintSet.VISIBLE)
+ }
+
+ @Test
+ fun seekBarChangesToDisabledAfterBind_noActions_seekBarChangesToGone() {
+ useRealConstraintSets()
val state = mediaData.copy(semanticActions = MediaButton())
player.attachPlayer(viewHolder)
+ getEnabledChangeListener().onEnabledChanged(enabled = true)
player.bindPlayer(state, PACKAGE)
- verify(expandedSet).setVisibility(R.id.media_progress_bar, ConstraintSet.INVISIBLE)
+ getEnabledChangeListener().onEnabledChanged(enabled = false)
+
+ assertThat(expandedSet.getVisibility(seekBar.id)).isEqualTo(ConstraintSet.GONE)
+ }
+
+ @Test
+ fun seekBarChangesToDisabledAfterBind_hasActions_seekBarChangesToInvisible() {
+ useRealConstraintSets()
+
+ val icon = context.getDrawable(android.R.drawable.ic_media_play)
+ val semanticActions = MediaButton(
+ nextOrCustom = MediaAction(icon, Runnable {}, "next", null)
+ )
+ val state = mediaData.copy(semanticActions = semanticActions)
+
+ player.attachPlayer(viewHolder)
+ getEnabledChangeListener().onEnabledChanged(enabled = true)
+ player.bindPlayer(state, PACKAGE)
+
+ getEnabledChangeListener().onEnabledChanged(enabled = false)
+
+ assertThat(expandedSet.getVisibility(seekBar.id)).isEqualTo(ConstraintSet.INVISIBLE)
}
@Test
@@ -905,8 +966,10 @@
assertThat(seamless.isEnabled()).isFalse()
}
+ /* ***** Guts tests for the player ***** */
+
@Test
- fun longClick_gutsClosed() {
+ fun player_longClickWhenGutsClosed_gutsOpens() {
player.attachPlayer(viewHolder)
player.bindPlayer(mediaData, KEY)
whenever(mediaViewController.isGutsVisible).thenReturn(false)
@@ -920,7 +983,7 @@
}
@Test
- fun longClick_gutsOpen() {
+ fun player_longClickWhenGutsOpen_gutsCloses() {
player.attachPlayer(viewHolder)
whenever(mediaViewController.isGutsVisible).thenReturn(true)
@@ -933,8 +996,9 @@
}
@Test
- fun cancelButtonClick_animation() {
+ fun player_cancelButtonClick_animation() {
player.attachPlayer(viewHolder)
+ player.bindPlayer(mediaData, KEY)
cancel.callOnClick()
@@ -942,7 +1006,7 @@
}
@Test
- fun settingsButtonClick() {
+ fun player_settingsButtonClick() {
player.attachPlayer(viewHolder)
player.bindPlayer(mediaData, KEY)
@@ -956,7 +1020,7 @@
}
@Test
- fun dismissButtonClick() {
+ fun player_dismissButtonClick() {
val mediaKey = "key for dismissal"
player.attachPlayer(viewHolder)
val state = mediaData.copy(notificationKey = KEY)
@@ -969,7 +1033,7 @@
}
@Test
- fun dismissButtonDisabled() {
+ fun player_dismissButtonDisabled() {
val mediaKey = "key for dismissal"
player.attachPlayer(viewHolder)
val state = mediaData.copy(isClearable = false, notificationKey = KEY)
@@ -979,7 +1043,7 @@
}
@Test
- fun dismissButtonClick_notInManager() {
+ fun player_dismissButtonClick_notInManager() {
val mediaKey = "key for dismissal"
whenever(mediaDataManager.dismissMediaData(eq(mediaKey), anyLong())).thenReturn(false)
@@ -994,6 +1058,76 @@
verify(mediaCarouselController).removePlayer(eq(mediaKey), eq(false), eq(false))
}
+ /* ***** END guts tests for the player ***** */
+
+ /* ***** Guts tests for the recommendations ***** */
+
+ @Test
+ fun recommendations_longClickWhenGutsClosed_gutsOpens() {
+ player.attachRecommendation(recommendationViewHolder)
+ player.bindRecommendation(smartspaceData)
+ whenever(mediaViewController.isGutsVisible).thenReturn(false)
+
+ val captor = ArgumentCaptor.forClass(View.OnLongClickListener::class.java)
+ verify(viewHolder.player).onLongClickListener = captor.capture()
+
+ captor.value.onLongClick(viewHolder.player)
+ verify(mediaViewController).openGuts()
+ verify(logger).logLongPressOpen(anyInt(), eq(PACKAGE), eq(instanceId))
+ }
+
+ @Test
+ fun recommendations_longClickWhenGutsOpen_gutsCloses() {
+ player.attachRecommendation(recommendationViewHolder)
+ player.bindRecommendation(smartspaceData)
+ whenever(mediaViewController.isGutsVisible).thenReturn(true)
+
+ val captor = ArgumentCaptor.forClass(View.OnLongClickListener::class.java)
+ verify(viewHolder.player).onLongClickListener = captor.capture()
+
+ captor.value.onLongClick(viewHolder.player)
+ verify(mediaViewController, never()).openGuts()
+ verify(mediaViewController).closeGuts(false)
+ }
+
+ @Test
+ fun recommendations_cancelButtonClick_animation() {
+ player.attachRecommendation(recommendationViewHolder)
+ player.bindRecommendation(smartspaceData)
+
+ cancel.callOnClick()
+
+ verify(mediaViewController).closeGuts(false)
+ }
+
+ @Test
+ fun recommendations_settingsButtonClick() {
+ player.attachRecommendation(recommendationViewHolder)
+ player.bindRecommendation(smartspaceData)
+
+ settings.callOnClick()
+ verify(logger).logLongPressSettings(anyInt(), eq(PACKAGE), eq(instanceId))
+
+ val captor = ArgumentCaptor.forClass(Intent::class.java)
+ verify(activityStarter).startActivity(captor.capture(), eq(true))
+
+ assertThat(captor.value.action).isEqualTo(ACTION_MEDIA_CONTROLS_SETTINGS)
+ }
+
+ @Test
+ fun recommendations_dismissButtonClick() {
+ val mediaKey = "key for dismissal"
+ player.attachRecommendation(recommendationViewHolder)
+ player.bindRecommendation(smartspaceData.copy(targetId = mediaKey))
+
+ assertThat(dismiss.isEnabled).isEqualTo(true)
+ dismiss.callOnClick()
+ verify(logger).logLongPressDismiss(anyInt(), eq(PACKAGE), eq(instanceId))
+ verify(mediaDataManager).dismissSmartspaceRecommendation(eq(mediaKey), anyLong())
+ }
+
+ /* ***** END guts tests for the recommendations ***** */
+
@Test
fun actionPlayPauseClick_isLogged() {
val semanticActions = MediaButton(
@@ -1267,22 +1401,23 @@
val subtitle1 = "Subtitle1"
val subtitle2 = "Subtitle2"
val subtitle3 = "Subtitle3"
+ val icon = Icon.createWithResource(context, R.drawable.ic_1x_mobiledata)
val data = smartspaceData.copy(
recommendations = listOf(
SmartspaceAction.Builder("id1", title1)
.setSubtitle(subtitle1)
- .setIcon(Icon.createWithResource(context, R.drawable.ic_1x_mobiledata))
+ .setIcon(icon)
.setExtras(Bundle.EMPTY)
.build(),
SmartspaceAction.Builder("id2", title2)
.setSubtitle(subtitle2)
- .setIcon(Icon.createWithResource(context, R.drawable.ic_alarm))
+ .setIcon(icon)
.setExtras(Bundle.EMPTY)
.build(),
SmartspaceAction.Builder("id3", title3)
.setSubtitle(subtitle3)
- .setIcon(Icon.createWithResource(context, R.drawable.ic_3g_mobiledata))
+ .setIcon(icon)
.setExtras(Bundle.EMPTY)
.build()
)
@@ -1315,6 +1450,155 @@
assertThat(recSubtitle1.text).isEqualTo("")
}
+ @Test
+ fun bindRecommendation_someHaveTitles_allTitleViewsShown() {
+ useRealConstraintSets()
+ player.attachRecommendation(recommendationViewHolder)
+
+ val icon = Icon.createWithResource(context, R.drawable.ic_1x_mobiledata)
+ val data = smartspaceData.copy(
+ recommendations = listOf(
+ SmartspaceAction.Builder("id1", "")
+ .setSubtitle("fake subtitle")
+ .setIcon(icon)
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id2", "title2")
+ .setSubtitle("fake subtitle")
+ .setIcon(icon)
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id3", "")
+ .setSubtitle("fake subtitle")
+ .setIcon(icon)
+ .setExtras(Bundle.EMPTY)
+ .build()
+ )
+ )
+ player.bindRecommendation(data)
+
+ assertThat(expandedSet.getVisibility(recTitle1.id)).isEqualTo(ConstraintSet.VISIBLE)
+ assertThat(expandedSet.getVisibility(recTitle2.id)).isEqualTo(ConstraintSet.VISIBLE)
+ assertThat(expandedSet.getVisibility(recTitle3.id)).isEqualTo(ConstraintSet.VISIBLE)
+ }
+
+ @Test
+ fun bindRecommendation_someHaveSubtitles_allSubtitleViewsShown() {
+ useRealConstraintSets()
+ player.attachRecommendation(recommendationViewHolder)
+
+ val icon = Icon.createWithResource(context, R.drawable.ic_1x_mobiledata)
+ val data = smartspaceData.copy(
+ recommendations = listOf(
+ SmartspaceAction.Builder("id1", "")
+ .setSubtitle("")
+ .setIcon(icon)
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id2", "title2")
+ .setSubtitle("")
+ .setIcon(icon)
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id3", "title3")
+ .setSubtitle("subtitle3")
+ .setIcon(icon)
+ .setExtras(Bundle.EMPTY)
+ .build()
+ )
+ )
+ player.bindRecommendation(data)
+
+ assertThat(expandedSet.getVisibility(recSubtitle1.id)).isEqualTo(ConstraintSet.VISIBLE)
+ assertThat(expandedSet.getVisibility(recSubtitle2.id)).isEqualTo(ConstraintSet.VISIBLE)
+ assertThat(expandedSet.getVisibility(recSubtitle3.id)).isEqualTo(ConstraintSet.VISIBLE)
+ }
+
+ @Test
+ fun bindRecommendation_noneHaveSubtitles_subtitleViewsGone() {
+ useRealConstraintSets()
+ player.attachRecommendation(recommendationViewHolder)
+ val data = smartspaceData.copy(
+ recommendations = listOf(
+ SmartspaceAction.Builder("id1", "title1")
+ .setSubtitle("")
+ .setIcon(Icon.createWithResource(context, R.drawable.ic_1x_mobiledata))
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id2", "title2")
+ .setSubtitle("")
+ .setIcon(Icon.createWithResource(context, R.drawable.ic_alarm))
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id3", "title3")
+ .setSubtitle("")
+ .setIcon(Icon.createWithResource(context, R.drawable.ic_3g_mobiledata))
+ .setExtras(Bundle.EMPTY)
+ .build()
+ )
+ )
+
+ player.bindRecommendation(data)
+
+ assertThat(expandedSet.getVisibility(recSubtitle1.id)).isEqualTo(ConstraintSet.GONE)
+ assertThat(expandedSet.getVisibility(recSubtitle2.id)).isEqualTo(ConstraintSet.GONE)
+ assertThat(expandedSet.getVisibility(recSubtitle3.id)).isEqualTo(ConstraintSet.GONE)
+ }
+
+ @Test
+ fun bindRecommendation_noneHaveTitles_titleAndSubtitleViewsGone() {
+ useRealConstraintSets()
+ player.attachRecommendation(recommendationViewHolder)
+ val data = smartspaceData.copy(
+ recommendations = listOf(
+ SmartspaceAction.Builder("id1", "")
+ .setSubtitle("subtitle1")
+ .setIcon(Icon.createWithResource(context, R.drawable.ic_1x_mobiledata))
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id2", "")
+ .setSubtitle("subtitle2")
+ .setIcon(Icon.createWithResource(context, R.drawable.ic_alarm))
+ .setExtras(Bundle.EMPTY)
+ .build(),
+ SmartspaceAction.Builder("id3", "")
+ .setSubtitle("subtitle3")
+ .setIcon(Icon.createWithResource(context, R.drawable.ic_3g_mobiledata))
+ .setExtras(Bundle.EMPTY)
+ .build()
+ )
+ )
+
+ player.bindRecommendation(data)
+
+ assertThat(expandedSet.getVisibility(recTitle1.id)).isEqualTo(ConstraintSet.GONE)
+ assertThat(expandedSet.getVisibility(recTitle2.id)).isEqualTo(ConstraintSet.GONE)
+ assertThat(expandedSet.getVisibility(recTitle3.id)).isEqualTo(ConstraintSet.GONE)
+ assertThat(expandedSet.getVisibility(recSubtitle1.id)).isEqualTo(ConstraintSet.GONE)
+ assertThat(expandedSet.getVisibility(recSubtitle2.id)).isEqualTo(ConstraintSet.GONE)
+ assertThat(expandedSet.getVisibility(recSubtitle3.id)).isEqualTo(ConstraintSet.GONE)
+ }
+
private fun getScrubbingChangeListener(): SeekBarViewModel.ScrubbingChangeListener =
withArgCaptor { verify(seekBarViewModel).setScrubbingChangeListener(capture()) }
+
+ private fun getEnabledChangeListener(): SeekBarViewModel.EnabledChangeListener =
+ withArgCaptor { verify(seekBarViewModel).setEnabledChangeListener(capture()) }
+
+ /**
+ * Update our test to use real ConstraintSets instead of mocks.
+ *
+ * Some item visibilities, such as the seekbar visibility, are dependent on other action's
+ * visibilities. If we use mocks for the ConstraintSets, then action visibility changes are
+ * just thrown away instead of being saved for reference later. This method sets us up to use
+ * ConstraintSets so that we do save visibility changes.
+ *
+ * TODO(b/229740380): Can/should we use real expanded and collapsed sets for all tests?
+ */
+ private fun useRealConstraintSets() {
+ expandedSet = ConstraintSet()
+ collapsedSet = ConstraintSet()
+ whenever(mediaViewController.expandedLayout).thenReturn(expandedSet)
+ whenever(mediaViewController.collapsedLayout).thenReturn(collapsedSet)
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/MediaTimeoutListenerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/MediaTimeoutListenerTest.kt
index 9116983..60cbb17 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/MediaTimeoutListenerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/MediaTimeoutListenerTest.kt
@@ -24,6 +24,7 @@
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.concurrency.FakeExecutor
+import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.capture
import com.android.systemui.util.mockito.eq
import com.android.systemui.util.time.FakeSystemClock
@@ -33,7 +34,6 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
-import org.mockito.ArgumentMatchers.any
import org.mockito.ArgumentMatchers.anyBoolean
import org.mockito.ArgumentMatchers.anyString
import org.mockito.Captor
@@ -62,6 +62,7 @@
@Mock private lateinit var mediaControllerFactory: MediaControllerFactory
@Mock private lateinit var mediaController: MediaController
+ @Mock private lateinit var logger: MediaTimeoutLogger
private lateinit var executor: FakeExecutor
@Mock private lateinit var timeoutCallback: (String, Boolean) -> Unit
@Captor private lateinit var mediaCallbackCaptor: ArgumentCaptor<MediaController.Callback>
@@ -77,7 +78,7 @@
fun setup() {
`when`(mediaControllerFactory.create(any())).thenReturn(mediaController)
executor = FakeExecutor(FakeSystemClock())
- mediaTimeoutListener = MediaTimeoutListener(mediaControllerFactory, executor)
+ mediaTimeoutListener = MediaTimeoutListener(mediaControllerFactory, executor, logger)
mediaTimeoutListener.timeoutCallback = timeoutCallback
// Create a media session and notification for testing.
@@ -112,8 +113,9 @@
`when`(mediaController.playbackState).thenReturn(playingState)
mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
verify(mediaController).registerCallback(capture(mediaCallbackCaptor))
+ verify(logger).logPlaybackState(eq(KEY), eq(playingState))
- // Ignores is same key
+ // Ignores if same key
clearInvocations(mediaController)
mediaTimeoutListener.onMediaDataLoaded(KEY, KEY, mediaData)
verify(mediaController, never()).registerCallback(anyObject())
@@ -125,6 +127,7 @@
verify(mediaController).registerCallback(capture(mediaCallbackCaptor))
assertThat(executor.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)
}
@@ -153,6 +156,7 @@
@Test
fun testOnMediaDataLoaded_migratesKeys() {
+ val newKey = "NEWKEY"
// From not playing
mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
clearInvocations(mediaController)
@@ -161,9 +165,10 @@
val playingState = mock(android.media.session.PlaybackState::class.java)
`when`(playingState.state).thenReturn(PlaybackState.STATE_PLAYING)
`when`(mediaController.playbackState).thenReturn(playingState)
- mediaTimeoutListener.onMediaDataLoaded("NEWKEY", KEY, mediaData)
+ mediaTimeoutListener.onMediaDataLoaded(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)
@@ -171,6 +176,7 @@
@Test
fun testOnMediaDataLoaded_migratesKeys_noTimeoutExtension() {
+ val newKey = "NEWKEY"
// From not playing
mediaTimeoutListener.onMediaDataLoaded(KEY, null, mediaData)
clearInvocations(mediaController)
@@ -179,11 +185,12 @@
val playingState = mock(android.media.session.PlaybackState::class.java)
`when`(playingState.state).thenReturn(PlaybackState.STATE_PAUSED)
`when`(mediaController.playbackState).thenReturn(playingState)
- mediaTimeoutListener.onMediaDataLoaded("NEWKEY", KEY, mediaData)
+ mediaTimeoutListener.onMediaDataLoaded(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)
+ verify(logger).logUpdateListener(eq(newKey), eq(false))
}
@Test
@@ -205,6 +212,7 @@
mediaCallbackCaptor.value.onPlaybackStateChanged(PlaybackState.Builder()
.setState(PlaybackState.STATE_PLAYING, 0L, 0f).build())
assertThat(executor.numPending()).isEqualTo(0)
+ verify(logger).logTimeoutCancelled(eq(KEY), any())
}
@Test
@@ -249,6 +257,7 @@
// THEN the controller is unregistered and timeout run
verify(mediaController).unregisterCallback(anyObject())
assertThat(executor.numPending()).isEqualTo(0)
+ verify(logger).logSessionDestroyed(eq(KEY))
}
@Test
@@ -270,6 +279,7 @@
runAllReady()
}
verify(timeoutCallback).invoke(eq(KEY), eq(false))
+ verify(logger).logReuseListener(eq(KEY))
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/MediaViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/MediaViewControllerTest.kt
index b7d5ba1..604e1f3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/MediaViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/MediaViewControllerTest.kt
@@ -12,6 +12,8 @@
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.MockitoAnnotations
/**
* Tests for {@link MediaViewController}.
@@ -20,16 +22,25 @@
@RunWith(AndroidTestingRunner::class)
@TestableLooper.RunWithLooper
class MediaViewControllerTest : SysuiTestCase() {
+ @Mock
+ private lateinit var logger: MediaViewLogger
+
private val configurationController =
com.android.systemui.statusbar.phone.ConfigurationControllerImpl(context)
private val mediaHostStatesManager = MediaHostStatesManager()
- private val mediaViewController =
- MediaViewController(context, configurationController, mediaHostStatesManager)
+ private lateinit var mediaViewController: MediaViewController
private val mediaHostStateHolder = MediaHost.MediaHostStateHolder()
private var transitionLayout = TransitionLayout(context, /* attrs */ null, /* defStyleAttr */ 0)
@Before
fun setUp() {
+ MockitoAnnotations.initMocks(this)
+ mediaViewController = MediaViewController(
+ context,
+ configurationController,
+ mediaHostStatesManager,
+ logger
+ )
mediaViewController.attach(transitionLayout, MediaViewController.TYPE.PLAYER)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/SeekBarViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/SeekBarViewModelTest.kt
index afc9c81..82aa612 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/SeekBarViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/SeekBarViewModelTest.kt
@@ -375,16 +375,20 @@
}
@Test
- fun onProgressChangedFromUserWithoutStartTrackingTouch() {
- // WHEN user starts dragging the seek bar
+ fun onProgressChangedFromUserWithoutStartTrackingTouch_transportUpdated() {
+ whenever(mockController.transportControls).thenReturn(mockTransport)
+ viewModel.updateController(mockController)
val pos = 42
val bar = SeekBar(context)
+
+ // WHEN we get an onProgressChanged event without an onStartTrackingTouch event
with(viewModel.seekBarListener) {
onProgressChanged(bar, pos, true)
}
fakeExecutor.runAllReady()
- // THEN then elapsed time should not be updated
- assertThat(viewModel.progress.value!!.elapsedTime).isNull()
+
+ // THEN we immediately update the transport
+ verify(mockTransport).seekTo(pos.toLong())
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
index 380fa6d..7c53388 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
@@ -18,6 +18,7 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
@@ -26,18 +27,23 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
+import android.media.session.MediaController;
import android.media.session.MediaSessionManager;
+import android.media.session.PlaybackState;
import android.os.Bundle;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
+import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.graphics.drawable.IconCompat;
import androidx.test.filters.SmallTest;
+import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
+import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.animation.DialogLaunchAnimator;
@@ -50,6 +56,8 @@
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Optional;
@SmallTest
@@ -61,8 +69,14 @@
// Mock
private MediaOutputBaseAdapter mMediaOutputBaseAdapter = mock(MediaOutputBaseAdapter.class);
+ private MediaController mMediaController = mock(MediaController.class);
+ private PlaybackState mPlaybackState = mock(PlaybackState.class);
private MediaSessionManager mMediaSessionManager = mock(MediaSessionManager.class);
private LocalBluetoothManager mLocalBluetoothManager = mock(LocalBluetoothManager.class);
+ private final LocalBluetoothProfileManager mLocalBluetoothProfileManager = mock(
+ LocalBluetoothProfileManager.class);
+ private final LocalBluetoothLeBroadcast mLocalBluetoothLeBroadcast = mock(
+ LocalBluetoothLeBroadcast.class);
private ActivityStarter mStarter = mock(ActivityStarter.class);
private BroadcastSender mBroadcastSender = mock(BroadcastSender.class);
private NotificationEntryManager mNotificationEntryManager =
@@ -71,15 +85,26 @@
NearbyMediaDevicesManager.class);
private final DialogLaunchAnimator mDialogLaunchAnimator = mock(DialogLaunchAnimator.class);
+ private List<MediaController> mMediaControllers = new ArrayList<>();
private MediaOutputBaseDialogImpl mMediaOutputBaseDialogImpl;
private MediaOutputController mMediaOutputController;
private int mHeaderIconRes;
private IconCompat mIconCompat;
private CharSequence mHeaderTitle;
private CharSequence mHeaderSubtitle;
+ private String mStopText;
+ private boolean mIsBroadcasting;
@Before
public void setUp() {
+ when(mLocalBluetoothManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager);
+ when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(null);
+ when(mMediaController.getPlaybackState()).thenReturn(mPlaybackState);
+ when(mPlaybackState.getState()).thenReturn(PlaybackState.STATE_NONE);
+ when(mMediaController.getPackageName()).thenReturn(TEST_PACKAGE);
+ mMediaControllers.add(mMediaController);
+ when(mMediaSessionManager.getActiveSessions(any())).thenReturn(mMediaControllers);
+
mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE,
mMediaSessionManager, mLocalBluetoothManager, mStarter,
mNotificationEntryManager, mDialogLaunchAnimator,
@@ -173,6 +198,59 @@
verify(mMediaOutputBaseAdapter).notifyDataSetChanged();
}
+ @Test
+ public void onStart_isBroadcasting_verifyRegisterLeBroadcastServiceCallBack() {
+ when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
+ mLocalBluetoothLeBroadcast);
+ mIsBroadcasting = true;
+
+ mMediaOutputBaseDialogImpl.onStart();
+
+ verify(mLocalBluetoothLeBroadcast).registerServiceCallBack(any(), any());
+ }
+
+ @Test
+ public void onStart_notBroadcasting_noRegisterLeBroadcastServiceCallBack() {
+ when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
+ mLocalBluetoothLeBroadcast);
+ mIsBroadcasting = false;
+
+ mMediaOutputBaseDialogImpl.onStart();
+
+ verify(mLocalBluetoothLeBroadcast, never()).registerServiceCallBack(any(), any());
+ }
+
+ @Test
+ public void onStart_isBroadcasting_verifyUnregisterLeBroadcastServiceCallBack() {
+ when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
+ mLocalBluetoothLeBroadcast);
+ mIsBroadcasting = true;
+
+ mMediaOutputBaseDialogImpl.onStop();
+
+ verify(mLocalBluetoothLeBroadcast).unregisterServiceCallBack(any());
+ }
+
+ @Test
+ public void onStop_notBroadcasting_noUnregisterLeBroadcastServiceCallBack() {
+ when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
+ mLocalBluetoothLeBroadcast);
+ mIsBroadcasting = false;
+
+ mMediaOutputBaseDialogImpl.onStop();
+
+ verify(mLocalBluetoothLeBroadcast, never()).unregisterServiceCallBack(any());
+ }
+
+ @Test
+ public void refresh_checkStopText() {
+ mStopText = "test_string";
+ mMediaOutputBaseDialogImpl.refresh();
+ final Button stop = mMediaOutputBaseDialogImpl.mDialogView.requireViewById(R.id.stop);
+
+ assertThat(stop.getText().toString()).isEqualTo(mStopText);
+ }
+
class MediaOutputBaseDialogImpl extends MediaOutputBaseDialog {
MediaOutputBaseDialogImpl(Context context, BroadcastSender broadcastSender,
@@ -216,5 +294,15 @@
int getStopButtonVisibility() {
return 0;
}
+
+ @Override
+ public boolean isBroadcastSupported() {
+ return mIsBroadcasting;
+ }
+
+ @Override
+ public CharSequence getStopButtonText() {
+ return mStopText;
+ }
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
index db56f87..e6ad6ed 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
@@ -18,13 +18,16 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.media.MediaRoute2Info;
+import android.media.session.MediaController;
import android.media.session.MediaSessionManager;
+import android.media.session.PlaybackState;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
@@ -32,7 +35,9 @@
import androidx.test.filters.SmallTest;
import com.android.internal.logging.UiEventLogger;
+import com.android.settingslib.bluetooth.LocalBluetoothLeBroadcast;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
+import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
import com.android.settingslib.media.LocalMediaManager;
import com.android.settingslib.media.MediaDevice;
import com.android.systemui.SysuiTestCase;
@@ -60,7 +65,13 @@
// Mock
private final MediaSessionManager mMediaSessionManager = mock(MediaSessionManager.class);
+ private MediaController mMediaController = mock(MediaController.class);
+ private PlaybackState mPlaybackState = mock(PlaybackState.class);
private final LocalBluetoothManager mLocalBluetoothManager = mock(LocalBluetoothManager.class);
+ private final LocalBluetoothProfileManager mLocalBluetoothProfileManager = mock(
+ LocalBluetoothProfileManager.class);
+ private final LocalBluetoothLeBroadcast mLocalBluetoothLeBroadcast = mock(
+ LocalBluetoothLeBroadcast.class);
private final ActivityStarter mStarter = mock(ActivityStarter.class);
private final BroadcastSender mBroadcastSender = mock(BroadcastSender.class);
private final LocalMediaManager mLocalMediaManager = mock(LocalMediaManager.class);
@@ -72,12 +83,21 @@
private final NearbyMediaDevicesManager mNearbyMediaDevicesManager = mock(
NearbyMediaDevicesManager.class);
+ private List<MediaController> mMediaControllers = new ArrayList<>();
private MediaOutputDialog mMediaOutputDialog;
private MediaOutputController mMediaOutputController;
private final List<String> mFeatures = new ArrayList<>();
@Before
public void setUp() {
+ when(mLocalBluetoothManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager);
+ when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(null);
+ when(mMediaController.getPlaybackState()).thenReturn(mPlaybackState);
+ when(mPlaybackState.getState()).thenReturn(PlaybackState.STATE_NONE);
+ when(mMediaController.getPackageName()).thenReturn(TEST_PACKAGE);
+ mMediaControllers.add(mMediaController);
+ when(mMediaSessionManager.getActiveSessions(any())).thenReturn(mMediaControllers);
+
mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE,
mMediaSessionManager, mLocalBluetoothManager, mStarter,
mNotificationEntryManager, mDialogLaunchAnimator,
@@ -116,6 +136,13 @@
mFeatures.add(MediaRoute2Info.FEATURE_REMOTE_GROUP_PLAYBACK);
assertThat(mMediaOutputDialog.getStopButtonVisibility()).isEqualTo(View.VISIBLE);
+
+ mFeatures.clear();
+ when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
+ mLocalBluetoothLeBroadcast);
+ when(mLocalBluetoothLeBroadcast.isEnabled(any())).thenReturn(false);
+ when(mPlaybackState.getState()).thenReturn(PlaybackState.STATE_PLAYING);
+ assertThat(mMediaOutputDialog.getStopButtonVisibility()).isEqualTo(View.VISIBLE);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java
index 4a740f6..f5b006d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java
@@ -205,9 +205,10 @@
when(mNavigationBarView.getAccessibilityButton()).thenReturn(mAccessibilityButton);
when(mNavigationBarView.getImeSwitchButton()).thenReturn(mImeSwitchButton);
when(mNavigationBarView.getBackButton()).thenReturn(mBackButton);
+ when(mNavigationBarView.getBarTransitions()).thenReturn(mNavigationBarTransitions);
when(mNavigationBarView.getRotationButtonController())
.thenReturn(mRotationButtonController);
- when(mNavigationBarTransitions.getLightTransitionsController())
+ when(mNavigationBarView.getLightTransitionsController())
.thenReturn(mLightBarTransitionsController);
when(mStatusBarKeyguardViewManager.isNavBarVisible()).thenReturn(true);
setupSysuiDependency();
@@ -458,7 +459,6 @@
mInputMethodManager,
mDeadZone,
mDeviceConfigProxyFake,
- mNavigationBarTransitions,
Optional.of(mock(BackAnimation.class))));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTransitionsTest.java b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTransitionsTest.java
index 084eca8..6a2a78b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTransitionsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTransitionsTest.java
@@ -21,6 +21,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@@ -36,8 +37,8 @@
import com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.recents.OverviewProxyService;
+import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.BarTransitions;
-import com.android.systemui.statusbar.phone.LightBarTransitionsController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import org.junit.Before;
@@ -52,10 +53,6 @@
public class NavigationBarTransitionsTest extends SysuiTestCase {
@Mock
- LightBarTransitionsController.Factory mLightBarTransitionsFactory;
- @Mock
- LightBarTransitionsController mLightBarTransitions;
- @Mock
EdgeBackGestureHandler.Factory mEdgeBackGestureHandlerFactory;
@Mock
EdgeBackGestureHandler mEdgeBackGestureHandler;
@@ -79,11 +76,10 @@
.when(mDependency.injectMockDependency(NavigationModeController.class))
.getCurrentUserContext();
- when(mLightBarTransitionsFactory.create(any())).thenReturn(mLightBarTransitions);
NavigationBarView navBar = spy(new NavigationBarView(mContext, null));
when(navBar.getCurrentView()).thenReturn(navBar);
when(navBar.findViewById(anyInt())).thenReturn(navBar);
- mTransitions = new NavigationBarTransitions(navBar, mLightBarTransitionsFactory);
+ mTransitions = new NavigationBarTransitions(navBar, mock(CommandQueue.class));
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt
index 57803e8..8340900 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt
@@ -136,6 +136,8 @@
override fun setPrimaryTextColor(color: Int) {}
+ override fun setIsDreaming(isDreaming: Boolean) {}
+
override fun setDozeAmount(amount: Float) {}
override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {}
@@ -173,6 +175,7 @@
stateChangeListener.onViewAttachedToWindow(mockView)
verify(smartspaceManager).createSmartspaceSession(any())
+ verify(mockView).setDozeAmount(0f)
stateChangeListener.onViewDetachedFromWindow(mockView)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt
index 188baaf..ce58a6c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt
@@ -544,6 +544,9 @@
override fun setPrimaryTextColor(color: Int) {
}
+ override fun setIsDreaming(isDreaming: Boolean) {
+ }
+
override fun setDozeAmount(amount: Float) {
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
index 1f90d0c..87ca1aa 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
@@ -47,7 +47,7 @@
}
@Test
- fun testUpTranslationSetToDefaultValue() {
+ fun resetViewStates_defaultHun_yTranslationIsInset() {
whenever(notificationRow.isPinned).thenReturn(true)
whenever(notificationRow.isHeadsUp).thenReturn(true)
@@ -57,7 +57,7 @@
}
@Test
- fun testHeadsUpTranslationChangesBasedOnStackMargin() {
+ fun resetViewStates_stackMargin_changesHunYTranslation() {
whenever(notificationRow.isPinned).thenReturn(true)
whenever(notificationRow.isHeadsUp).thenReturn(true)
val minHeadsUpTranslation = context.resources
@@ -72,7 +72,7 @@
}
@Test
- fun resetViewStates_childIsEmptyShadeView_viewIsCenteredVertically() {
+ fun resetViewStates_emptyShadeView_isCenteredVertically() {
stackScrollAlgorithm.initView(context)
val emptyShadeView = EmptyShadeView(context, /* attrs= */ null).apply {
layout(/* l= */ 0, /* t= */ 0, /* r= */ 100, /* b= */ 100)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/DeviceFoldStateProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/DeviceFoldStateProviderTest.kt
index 05a8f0a..1f1f88b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/DeviceFoldStateProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/DeviceFoldStateProviderTest.kt
@@ -203,6 +203,43 @@
}
@Test
+ fun testUnfoldedOpenedHingeAngleEmitted_isFinishedOpeningIsFalse() {
+ setFoldState(folded = false)
+
+ sendHingeAngleEvent(10)
+
+ assertThat(foldStateProvider.isFinishedOpening).isFalse()
+ }
+
+ @Test
+ fun testFoldedHalfOpenHingeAngleEmitted_isFinishedOpeningIsFalse() {
+ setFoldState(folded = true)
+
+ sendHingeAngleEvent(10)
+
+ assertThat(foldStateProvider.isFinishedOpening).isFalse()
+ }
+
+ @Test
+ fun testFoldedFullyOpenHingeAngleEmitted_isFinishedOpeningIsTrue() {
+ setFoldState(folded = false)
+
+ sendHingeAngleEvent(180)
+
+ assertThat(foldStateProvider.isFinishedOpening).isTrue()
+ }
+
+ @Test
+ fun testUnfoldedHalfOpenOpened_afterTimeout_isFinishedOpeningIsTrue() {
+ setFoldState(folded = false)
+
+ sendHingeAngleEvent(10)
+ simulateTimeout(HALF_OPENED_TIMEOUT_MILLIS)
+
+ assertThat(foldStateProvider.isFinishedOpening).isTrue()
+ }
+
+ @Test
fun startClosingEvent_afterTimeout_abortEmitted() {
sendHingeAngleEvent(90)
sendHingeAngleEvent(80)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/unfold/util/TestFoldStateProvider.kt b/packages/SystemUI/tests/src/com/android/systemui/unfold/util/TestFoldStateProvider.kt
index dd307b4..8f851ec 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/unfold/util/TestFoldStateProvider.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/unfold/util/TestFoldStateProvider.kt
@@ -16,6 +16,7 @@
package com.android.systemui.unfold.util
import com.android.systemui.unfold.updates.FOLD_UPDATE_FINISH_FULL_OPEN
+import com.android.systemui.unfold.updates.FOLD_UPDATE_FINISH_HALF_OPEN
import com.android.systemui.unfold.updates.FoldStateProvider
import com.android.systemui.unfold.updates.FoldStateProvider.FoldUpdate
import com.android.systemui.unfold.updates.FoldStateProvider.FoldUpdatesListener
@@ -31,10 +32,10 @@
listeners.clear()
}
- private var _isFullyOpened: Boolean = false
+ private var _isFinishedOpening: Boolean = false
- override val isFullyOpened: Boolean
- get() = _isFullyOpened
+ override val isFinishedOpening: Boolean
+ get() = _isFinishedOpening
override fun addCallback(listener: FoldUpdatesListener) {
listeners += listener
@@ -45,8 +46,8 @@
}
fun sendFoldUpdate(@FoldUpdate update: Int) {
- if (update == FOLD_UPDATE_FINISH_FULL_OPEN) {
- _isFullyOpened = true
+ if (update == FOLD_UPDATE_FINISH_FULL_OPEN || update == FOLD_UPDATE_FINISH_HALF_OPEN) {
+ _isFinishedOpening = true
}
listeners.forEach { it.onFoldUpdate(update) }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
index ca67bd2..193879e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
@@ -133,6 +133,7 @@
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.TaskStackListenerImpl;
+import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.onehanded.OneHandedController;
import com.google.common.collect.ImmutableList;
@@ -367,6 +368,7 @@
mPositioner,
mock(DisplayController.class),
mOneHandedOptional,
+ mock(DragAndDropController.class),
syncExecutor,
mock(Handler.class),
mTaskViewTransitions,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java
index ce7924a..02d8691 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java
@@ -116,6 +116,7 @@
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.TaskStackListenerImpl;
+import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.onehanded.OneHandedController;
import org.junit.Before;
@@ -332,6 +333,7 @@
mPositioner,
mock(DisplayController.class),
mOneHandedOptional,
+ mock(DragAndDropController.class),
syncExecutor,
mock(Handler.class),
mTaskViewTransitions,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java
index 83f5987..9646edf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java
@@ -35,6 +35,7 @@
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.TaskStackListenerImpl;
+import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.onehanded.OneHandedController;
import java.util.Optional;
@@ -59,6 +60,7 @@
BubblePositioner positioner,
DisplayController displayController,
Optional<OneHandedController> oneHandedOptional,
+ DragAndDropController dragAndDropController,
ShellExecutor shellMainExecutor,
Handler shellMainHandler,
TaskViewTransitions taskViewTransitions,
@@ -66,8 +68,8 @@
super(context, data, Runnable::run, floatingContentCoordinator, dataRepository,
statusBarService, windowManager, windowManagerShellWrapper, launcherApps,
bubbleLogger, taskStackListener, shellTaskOrganizer, positioner, displayController,
- oneHandedOptional, shellMainExecutor, shellMainHandler, taskViewTransitions,
- syncQueue);
+ oneHandedOptional, dragAndDropController, shellMainExecutor, shellMainHandler,
+ taskViewTransitions, syncQueue);
setInflateSynchronously(true);
initialize();
}
diff --git a/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java b/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java
index c9903ea..e27b7a6 100644
--- a/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java
+++ b/packages/services/CameraExtensionsProxy/src/com/android/cameraextensions/CameraExtensionsProxyService.java
@@ -19,6 +19,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.graphics.Camera;
import android.graphics.GraphicBuffer;
import android.graphics.Rect;
import android.hardware.HardwareBuffer;
@@ -752,13 +753,65 @@
public ISessionProcessorImpl getSessionProcessor() {
return new SessionProcessorImplStub(mAdvancedExtender.createSessionProcessor());
}
+
+ @Override
+ public CameraMetadataNative getAvailableCaptureRequestKeys(String cameraId) {
+ if (RESULT_API_SUPPORTED) {
+ List<CaptureRequest.Key> supportedCaptureKeys =
+ mAdvancedExtender.getAvailableCaptureRequestKeys();
+
+ if ((supportedCaptureKeys != null) && !supportedCaptureKeys.isEmpty()) {
+ CameraMetadataNative ret = new CameraMetadataNative();
+ long vendorId = mMetadataVendorIdMap.containsKey(cameraId) ?
+ mMetadataVendorIdMap.get(cameraId) : Long.MAX_VALUE;
+ ret.setVendorId(vendorId);
+ int requestKeyTags [] = new int[supportedCaptureKeys.size()];
+ int i = 0;
+ for (CaptureRequest.Key key : supportedCaptureKeys) {
+ requestKeyTags[i++] = CameraMetadataNative.getTag(key.getName(), vendorId);
+ }
+ ret.set(CameraCharacteristics.REQUEST_AVAILABLE_REQUEST_KEYS, requestKeyTags);
+
+ return ret;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public CameraMetadataNative getAvailableCaptureResultKeys(String cameraId) {
+ if (RESULT_API_SUPPORTED) {
+ List<CaptureResult.Key> supportedResultKeys =
+ mAdvancedExtender.getAvailableCaptureResultKeys();
+
+ if ((supportedResultKeys != null) && !supportedResultKeys.isEmpty()) {
+ CameraMetadataNative ret = new CameraMetadataNative();
+ long vendorId = mMetadataVendorIdMap.containsKey(cameraId) ?
+ mMetadataVendorIdMap.get(cameraId) : Long.MAX_VALUE;
+ ret.setVendorId(vendorId);
+ int resultKeyTags [] = new int[supportedResultKeys.size()];
+ int i = 0;
+ for (CaptureResult.Key key : supportedResultKeys) {
+ resultKeyTags[i++] = CameraMetadataNative.getTag(key.getName(), vendorId);
+ }
+ ret.set(CameraCharacteristics.REQUEST_AVAILABLE_RESULT_KEYS, resultKeyTags);
+
+ return ret;
+ }
+ }
+
+ return null;
+ }
}
private class CaptureCallbackStub implements SessionProcessorImpl.CaptureCallback {
private final ICaptureCallback mCaptureCallback;
+ private final String mCameraId;
- private CaptureCallbackStub(ICaptureCallback captureCallback) {
+ private CaptureCallbackStub(ICaptureCallback captureCallback, String cameraId) {
mCaptureCallback = captureCallback;
+ mCameraId = cameraId;
}
@Override
@@ -820,6 +873,29 @@
}
}
}
+
+ @Override
+ public void onCaptureCompleted(long timestamp, int requestId,
+ Map<CaptureResult.Key, Object> result) {
+
+ if (result == null) {
+ Log.e(TAG, "Invalid capture result received!");
+ }
+
+ CameraMetadataNative captureResults = new CameraMetadataNative();
+ if (mMetadataVendorIdMap.containsKey(mCameraId)) {
+ captureResults.setVendorId(mMetadataVendorIdMap.get(mCameraId));
+ }
+ for (Map.Entry<CaptureResult.Key, Object> entry : result.entrySet()) {
+ captureResults.set(entry.getKey(), entry.getValue());
+ }
+
+ try {
+ mCaptureCallback.onCaptureCompleted(timestamp, requestId, captureResults);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to notify capture complete due to remote exception!");
+ }
+ }
}
private class RequestCallbackStub extends IRequestCallback.Stub {
@@ -1124,7 +1200,7 @@
@Override
public int startRepeating(ICaptureCallback callback) {
- return mSessionProcessor.startRepeating(new CaptureCallbackStub(callback));
+ return mSessionProcessor.startRepeating(new CaptureCallbackStub(callback, mCameraId));
}
@Override
@@ -1133,12 +1209,29 @@
}
@Override
- public int startCapture(ICaptureCallback callback, int jpegRotation, int jpegQuality) {
+ public void setParameters(CaptureRequest captureRequest) {
HashMap<CaptureRequest.Key<?>, Object> paramMap = new HashMap<>();
- paramMap.put(CaptureRequest.JPEG_ORIENTATION, jpegRotation);
- paramMap.put(CaptureRequest.JPEG_QUALITY, jpegQuality);
+ for (CaptureRequest.Key captureRequestKey : captureRequest.getKeys()) {
+ paramMap.put(captureRequestKey, captureRequest.get(captureRequestKey));
+ }
+
mSessionProcessor.setParameters(paramMap);
- return mSessionProcessor.startCapture(new CaptureCallbackStub(callback));
+ }
+
+ @Override
+ public int startTrigger(CaptureRequest captureRequest, ICaptureCallback callback) {
+ HashMap<CaptureRequest.Key<?>, Object> triggerMap = new HashMap<>();
+ for (CaptureRequest.Key captureRequestKey : captureRequest.getKeys()) {
+ triggerMap.put(captureRequestKey, captureRequest.get(captureRequestKey));
+ }
+
+ return mSessionProcessor.startTrigger(triggerMap,
+ new CaptureCallbackStub(callback, mCameraId));
+ }
+
+ @Override
+ public int startCapture(ICaptureCallback callback) {
+ return mSessionProcessor.startCapture(new CaptureCallbackStub(callback, mCameraId));
}
}
diff --git a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
index 562d11a..649328d 100644
--- a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
+++ b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
@@ -84,16 +84,15 @@
import android.view.accessibility.AccessibilityWindowInfo;
import android.view.accessibility.IAccessibilityInteractionConnectionCallback;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputBinding;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.compat.IPlatformCompat;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSessionCallback;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
import com.android.internal.os.SomeArgs;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.function.pooled.PooledLambda;
-import com.android.internal.view.IInputContext;
-import com.android.internal.view.IInputMethodSession;
-import com.android.internal.view.IInputSessionWithIdCallback;
import com.android.server.LocalServices;
import com.android.server.accessibility.AccessibilityWindowManager.RemoteAccessibilityConnection;
import com.android.server.accessibility.magnification.MagnificationProcessor;
@@ -1655,21 +1654,22 @@
mInvocationHandler.createImeSessionLocked();
}
- public void setImeSessionEnabledLocked(IInputMethodSession session, boolean enabled) {
+ public void setImeSessionEnabledLocked(IAccessibilityInputMethodSession session,
+ boolean enabled) {
mInvocationHandler.setImeSessionEnabledLocked(session, enabled);
}
- public void bindInputLocked(InputBinding binding) {
- mInvocationHandler.bindInputLocked(binding);
+ public void bindInputLocked() {
+ mInvocationHandler.bindInputLocked();
}
public void unbindInputLocked() {
mInvocationHandler.unbindInputLocked();
}
- public void startInputLocked(IBinder startInputToken, IInputContext inputContext,
+ public void startInputLocked(IRemoteAccessibilityInputConnection connection,
EditorInfo editorInfo, boolean restarting) {
- mInvocationHandler.startInputLocked(startInputToken, inputContext, editorInfo, restarting);
+ mInvocationHandler.startInputLocked(connection, editorInfo, restarting);
}
@@ -1827,7 +1827,8 @@
}
}
- private void setImeSessionEnabledInternal(IInputMethodSession session, boolean enabled) {
+ private void setImeSessionEnabledInternal(IAccessibilityInputMethodSession session,
+ boolean enabled) {
final IAccessibilityServiceClient listener = getServiceInterfaceSafely();
if (listener != null && session != null) {
try {
@@ -1842,14 +1843,14 @@
}
}
- private void bindInputInternal(InputBinding binding) {
+ private void bindInputInternal() {
final IAccessibilityServiceClient listener = getServiceInterfaceSafely();
if (listener != null) {
try {
if (svcClientTracingEnabled()) {
- logTraceSvcClient("bindInput", binding.toString());
+ logTraceSvcClient("bindInput", "");
}
- listener.bindInput(binding);
+ listener.bindInput();
} catch (RemoteException re) {
Slog.e(LOG_TAG,
"Error binding input to " + mService, re);
@@ -1872,16 +1873,16 @@
}
}
- private void startInputInternal(IBinder startInputToken, IInputContext inputContext,
+ private void startInputInternal(IRemoteAccessibilityInputConnection connection,
EditorInfo editorInfo, boolean restarting) {
final IAccessibilityServiceClient listener = getServiceInterfaceSafely();
if (listener != null) {
try {
if (svcClientTracingEnabled()) {
- logTraceSvcClient("startInput", startInputToken + " "
- + inputContext + " " + editorInfo + restarting);
+ logTraceSvcClient("startInput", "editorInfo=" + editorInfo
+ + " restarting=" + restarting);
}
- listener.startInput(startInputToken, inputContext, editorInfo, restarting);
+ listener.startInput(connection, editorInfo, restarting);
} catch (RemoteException re) {
Slog.e(LOG_TAG,
"Error starting input to " + mService, re);
@@ -2141,12 +2142,12 @@
break;
case MSG_SET_IME_SESSION_ENABLED:
final boolean enabled = (message.arg1 != 0);
- final IInputMethodSession session = (IInputMethodSession) message.obj;
+ final IAccessibilityInputMethodSession session =
+ (IAccessibilityInputMethodSession) message.obj;
setImeSessionEnabledInternal(session, enabled);
break;
case MSG_BIND_INPUT:
- final InputBinding binding = (InputBinding) message.obj;
- bindInputInternal(binding);
+ bindInputInternal();
break;
case MSG_UNBIND_INPUT:
unbindInputInternal();
@@ -2154,10 +2155,11 @@
case MSG_START_INPUT:
final boolean restarting = (message.arg1 != 0);
final SomeArgs args = (SomeArgs) message.obj;
- final IBinder startInputToken = (IBinder) args.arg1;
- final IInputContext inputContext = (IInputContext) args.arg2;
- final EditorInfo editorInfo = (EditorInfo) args.arg3;
- startInputInternal(startInputToken, inputContext, editorInfo, restarting);
+ final IRemoteAccessibilityInputConnection connection =
+ (IRemoteAccessibilityInputConnection) args.arg1;
+ final EditorInfo editorInfo = (EditorInfo) args.arg2;
+ startInputInternal(connection, editorInfo, restarting);
+ args.recycle();
break;
default: {
throw new IllegalArgumentException("Unknown message: " + type);
@@ -2227,14 +2229,15 @@
msg.sendToTarget();
}
- public void setImeSessionEnabledLocked(IInputMethodSession session, boolean enabled) {
+ public void setImeSessionEnabledLocked(IAccessibilityInputMethodSession session,
+ boolean enabled) {
final Message msg = obtainMessage(MSG_SET_IME_SESSION_ENABLED, (enabled ? 1 : 0),
0, session);
msg.sendToTarget();
}
- public void bindInputLocked(InputBinding binding) {
- final Message msg = obtainMessage(MSG_BIND_INPUT, binding);
+ public void bindInputLocked() {
+ final Message msg = obtainMessage(MSG_BIND_INPUT);
msg.sendToTarget();
}
@@ -2243,12 +2246,12 @@
msg.sendToTarget();
}
- public void startInputLocked(IBinder startInputToken, IInputContext inputContext,
+ public void startInputLocked(
+ IRemoteAccessibilityInputConnection connection,
EditorInfo editorInfo, boolean restarting) {
final SomeArgs args = SomeArgs.obtain();
- args.arg1 = startInputToken;
- args.arg2 = inputContext;
- args.arg3 = editorInfo;
+ args.arg1 = connection;
+ args.arg2 = editorInfo;
final Message msg = obtainMessage(MSG_START_INPUT, restarting ? 1 : 0, 0, args);
msg.sendToTarget();
}
@@ -2402,10 +2405,11 @@
}
}
- private static final class AccessibilityCallback extends IInputSessionWithIdCallback.Stub {
+ private static final class AccessibilityCallback
+ extends IAccessibilityInputMethodSessionCallback.Stub {
@Override
- public void sessionCreated(IInputMethodSession session, int id) {
- Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.sessionCreated");
+ public void sessionCreated(IAccessibilityInputMethodSession session, int id) {
+ Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "AACS.sessionCreated");
final long ident = Binder.clearCallingIdentity();
try {
InputMethodManagerInternal.get().onSessionForAccessibilityCreated(id, session);
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index ac0c051..cbeb01a 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -118,7 +118,6 @@
import android.view.accessibility.IAccessibilityManagerClient;
import android.view.accessibility.IWindowMagnificationConnection;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputBinding;
import com.android.internal.R;
import com.android.internal.accessibility.AccessibilityShortcutController;
@@ -128,12 +127,12 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.content.PackageMonitor;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.IntPair;
-import com.android.internal.view.IInputContext;
-import com.android.internal.view.IInputMethodSession;
import com.android.server.AccessibilityManagerInternal;
import com.android.server.LocalServices;
import com.android.server.SystemService;
@@ -281,9 +280,8 @@
private Point mTempPoint = new Point();
private boolean mIsAccessibilityButtonShown;
- private InputBinding mInputBinding;
- IBinder mStartInputToken;
- IInputContext mInputContext;
+ private boolean mInputBound;
+ IRemoteAccessibilityInputConnection mRemoteInputConnection;
EditorInfo mEditorInfo;
boolean mRestarting;
boolean mInputSessionRequested;
@@ -322,7 +320,7 @@
}
@Override
- public void setImeSessionEnabled(SparseArray<IInputMethodSession> sessions,
+ public void setImeSessionEnabled(SparseArray<IAccessibilityInputMethodSession> sessions,
boolean enabled) {
mService.scheduleSetImeSessionEnabled(sessions, enabled);
}
@@ -333,8 +331,8 @@
}
@Override
- public void bindInput(InputBinding binding) {
- mService.scheduleBindInput(binding);
+ public void bindInput() {
+ mService.scheduleBindInput();
}
@Override
@@ -343,9 +341,10 @@
}
@Override
- public void startInput(IBinder startInputToken, IInputContext inputContext,
+ public void startInput(
+ IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
EditorInfo editorInfo, boolean restarting) {
- mService.scheduleStartInput(startInputToken, inputContext, editorInfo, restarting);
+ mService.scheduleStartInput(remoteAccessibilityInputConnection, editorInfo, restarting);
}
}
@@ -4350,10 +4349,9 @@
private void bindAndStartInputForConnection(AbstractAccessibilityServiceConnection connection) {
synchronized (mLock) {
- if (mInputBinding != null) {
- connection.bindInputLocked(mInputBinding);
- connection.startInputLocked(mStartInputToken, mInputContext, mEditorInfo,
- mRestarting);
+ if (mInputBound) {
+ connection.bindInputLocked();
+ connection.startInputLocked(mRemoteInputConnection, mEditorInfo, mRestarting);
}
}
}
@@ -4396,23 +4394,20 @@
/**
* Bind input for accessibility services which request ime capabilities.
- *
- * @param binding Information given to an accessibility service about a client connecting to it.
*/
- public void scheduleBindInput(InputBinding binding) {
- mMainHandler.sendMessage(obtainMessage(AccessibilityManagerService::bindInput, this,
- binding));
+ public void scheduleBindInput() {
+ mMainHandler.sendMessage(obtainMessage(AccessibilityManagerService::bindInput, this));
}
- private void bindInput(InputBinding binding) {
+ private void bindInput() {
synchronized (mLock) {
// Keep records of these in case new Accessibility Services are enabled.
- mInputBinding = binding;
+ mInputBound = true;
AccessibilityUserState userState = getCurrentUserStateLocked();
for (int i = userState.mBoundServices.size() - 1; i >= 0; i--) {
final AccessibilityServiceConnection service = userState.mBoundServices.get(i);
if (service.requestImeApis()) {
- service.bindInputLocked(binding);
+ service.bindInputLocked();
}
}
}
@@ -4427,6 +4422,7 @@
private void unbindInput() {
synchronized (mLock) {
+ mInputBound = false;
AccessibilityUserState userState = getCurrentUserStateLocked();
for (int i = userState.mBoundServices.size() - 1; i >= 0; i--) {
final AccessibilityServiceConnection service = userState.mBoundServices.get(i);
@@ -4440,25 +4436,24 @@
/**
* Start input for accessibility services which request ime capabilities.
*/
- public void scheduleStartInput(IBinder startInputToken, IInputContext inputContext,
+ public void scheduleStartInput(IRemoteAccessibilityInputConnection connection,
EditorInfo editorInfo, boolean restarting) {
mMainHandler.sendMessage(obtainMessage(AccessibilityManagerService::startInput, this,
- startInputToken, inputContext, editorInfo, restarting));
+ connection, editorInfo, restarting));
}
- private void startInput(IBinder startInputToken, IInputContext inputContext,
- EditorInfo editorInfo, boolean restarting) {
+ private void startInput(IRemoteAccessibilityInputConnection connection, EditorInfo editorInfo,
+ boolean restarting) {
synchronized (mLock) {
// Keep records of these in case new Accessibility Services are enabled.
- mStartInputToken = startInputToken;
- mInputContext = inputContext;
+ mRemoteInputConnection = connection;
mEditorInfo = editorInfo;
mRestarting = restarting;
AccessibilityUserState userState = getCurrentUserStateLocked();
for (int i = userState.mBoundServices.size() - 1; i >= 0; i--) {
final AccessibilityServiceConnection service = userState.mBoundServices.get(i);
if (service.requestImeApis()) {
- service.startInputLocked(startInputToken, inputContext, editorInfo, restarting);
+ service.startInputLocked(connection, editorInfo, restarting);
}
}
}
@@ -4492,13 +4487,14 @@
* @param sessions Sessions to enable or disable.
* @param enabled True if enable the sessions or false if disable the sessions.
*/
- public void scheduleSetImeSessionEnabled(SparseArray<IInputMethodSession> sessions,
+ public void scheduleSetImeSessionEnabled(SparseArray<IAccessibilityInputMethodSession> sessions,
boolean enabled) {
mMainHandler.sendMessage(obtainMessage(AccessibilityManagerService::setImeSessionEnabled,
this, sessions, enabled));
}
- private void setImeSessionEnabled(SparseArray<IInputMethodSession> sessions, boolean enabled) {
+ private void setImeSessionEnabled(SparseArray<IAccessibilityInputMethodSession> sessions,
+ boolean enabled) {
synchronized (mLock) {
AccessibilityUserState userState = getCurrentUserStateLocked();
for (int i = userState.mBoundServices.size() - 1; i >= 0; i--) {
diff --git a/services/cloudsearch/java/com/android/server/cloudsearch/RemoteCloudSearchService.java b/services/cloudsearch/java/com/android/server/cloudsearch/RemoteCloudSearchService.java
index eb16d3b..d1c0482 100644
--- a/services/cloudsearch/java/com/android/server/cloudsearch/RemoteCloudSearchService.java
+++ b/services/cloudsearch/java/com/android/server/cloudsearch/RemoteCloudSearchService.java
@@ -35,6 +35,7 @@
private static final String TAG = "RemoteCloudSearchService";
+ private static final long TIMEOUT_IDLE_BOUND_TIMEOUT_MS = 10 * DateUtils.MINUTE_IN_MILLIS;
private static final long TIMEOUT_REMOTE_REQUEST_MILLIS = 2 * DateUtils.SECOND_IN_MILLIS;
private final RemoteCloudSearchServiceCallbacks mCallback;
@@ -57,7 +58,7 @@
@Override
protected long getTimeoutIdleBindMillis() {
- return PERMANENT_BOUND_TIMEOUT_MS;
+ return TIMEOUT_IDLE_BOUND_TIMEOUT_MS;
}
@Override
diff --git a/services/core/java/com/android/server/AccessibilityManagerInternal.java b/services/core/java/com/android/server/AccessibilityManagerInternal.java
index 28f6db1..6ca32af 100644
--- a/services/core/java/com/android/server/AccessibilityManagerInternal.java
+++ b/services/core/java/com/android/server/AccessibilityManagerInternal.java
@@ -17,28 +17,26 @@
package com.android.server;
import android.annotation.NonNull;
-import android.os.IBinder;
import android.util.ArraySet;
import android.util.SparseArray;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputBinding;
-import com.android.internal.view.IInputContext;
-import com.android.internal.view.IInputMethodSession;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
/**
* Accessibility manager local system service interface.
*/
public abstract class AccessibilityManagerInternal {
/** Enable or disable the sessions. */
- public abstract void setImeSessionEnabled(SparseArray<IInputMethodSession> sessions,
- boolean enabled);
+ public abstract void setImeSessionEnabled(
+ SparseArray<IAccessibilityInputMethodSession> sessions, boolean enabled);
/** Unbind input for all accessibility services which require ime capabilities. */
public abstract void unbindInput();
/** Bind input for all accessibility services which require ime capabilities. */
- public abstract void bindInput(InputBinding binding);
+ public abstract void bindInput();
/**
* Request input session from all accessibility services which require ime capabilities and
@@ -47,12 +45,13 @@
public abstract void createImeSession(ArraySet<Integer> ignoreSet);
/** Start input for all accessibility services which require ime capabilities. */
- public abstract void startInput(IBinder startInputToken, IInputContext inputContext,
+ public abstract void startInput(
+ IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
EditorInfo editorInfo, boolean restarting);
private static final AccessibilityManagerInternal NOP = new AccessibilityManagerInternal() {
@Override
- public void setImeSessionEnabled(SparseArray<IInputMethodSession> sessions,
+ public void setImeSessionEnabled(SparseArray<IAccessibilityInputMethodSession> sessions,
boolean enabled) {
}
@@ -61,7 +60,7 @@
}
@Override
- public void bindInput(InputBinding binding) {
+ public void bindInput() {
}
@Override
@@ -69,7 +68,7 @@
}
@Override
- public void startInput(IBinder startInputToken, IInputContext inputContext,
+ public void startInput(IRemoteAccessibilityInputConnection remoteAccessibility,
EditorInfo editorInfo, boolean restarting) {
}
};
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index 991c7a9..8f37823 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -3742,6 +3742,16 @@
Context.APP_OPS_SERVICE);
appOps.checkPackage(callingUid, callingPkg);
+ try {
+ final PackageManager.Property noAppStorageProp = mContext.getPackageManager()
+ .getProperty(PackageManager.PROPERTY_NO_APP_DATA_STORAGE, callingPkg);
+ if (noAppStorageProp != null && noAppStorageProp.getBoolean()) {
+ throw new SecurityException(callingPkg + " should not have " + appPath);
+ }
+ } catch (PackageManager.NameNotFoundException ignore) {
+ // Property not found
+ }
+
File appFile = null;
try {
appFile = new File(appPath).getCanonicalFile();
diff --git a/services/core/java/com/android/server/VcnManagementService.java b/services/core/java/com/android/server/VcnManagementService.java
index eefeee3..f26d9f9 100644
--- a/services/core/java/com/android/server/VcnManagementService.java
+++ b/services/core/java/com/android/server/VcnManagementService.java
@@ -52,6 +52,7 @@
import android.net.vcn.VcnUnderlyingNetworkPolicy;
import android.net.wifi.WifiInfo;
import android.os.Binder;
+import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
@@ -82,6 +83,7 @@
import com.android.server.vcn.VcnNetworkProvider;
import com.android.server.vcn.util.PersistableBundleUtils;
+import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
import java.io.PrintWriter;
@@ -162,7 +164,8 @@
public static final boolean VDBG = false; // STOPSHIP: if true
@VisibleForTesting(visibility = Visibility.PRIVATE)
- static final String VCN_CONFIG_FILE = "/data/system/vcn/configs.xml";
+ static final String VCN_CONFIG_FILE =
+ new File(Environment.getDataSystemDirectory(), "vcn/configs.xml").getPath();
/* Binder context for this service */
@NonNull private final Context mContext;
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 8dd65b7..b9a55f9 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -10850,7 +10850,7 @@
"Native",
"System", "Persistent", "Persistent Service", "Foreground",
"Visible", "Perceptible", "Perceptible Low", "Perceptible Medium",
- "Heavy Weight", "Backup",
+ "Backup", "Heavy Weight",
"A Services", "Home",
"Previous", "B Services", "Cached"
};
@@ -10858,7 +10858,7 @@
"native",
"sys", "pers", "persvc", "fore",
"vis", "percept", "perceptl", "perceptm",
- "heavy", "backup",
+ "backup", "heavy",
"servicea", "home",
"prev", "serviceb", "cached"
};
diff --git a/services/core/java/com/android/server/am/AppBatteryTracker.java b/services/core/java/com/android/server/am/AppBatteryTracker.java
index 8c42d4d..9ce2751 100644
--- a/services/core/java/com/android/server/am/AppBatteryTracker.java
+++ b/services/core/java/com/android/server/am/AppBatteryTracker.java
@@ -269,10 +269,10 @@
AppBackgroundRestrictionsInfo.LEVEL_UNKNOWN, // RestrictionLevel
AppBackgroundRestrictionsInfo.THRESHOLD_UNKNOWN,
AppBackgroundRestrictionsInfo.UNKNOWN_TRACKER,
- null /*byte[] fgs_tracker_info*/,
- getBatteryTrackerInfoProtoLocked(uid) /*byte[] battery_tracker_info*/,
- null /*byte[] broadcast_events_tracker_info*/,
- null /*byte[] bind_service_events_tracker_info*/,
+ null, // FgsTrackerInfo
+ getTrackerInfoForStatsd(uid),
+ null, // BroadcastEventsTrackerInfo
+ null, // BindServiceEventsTrackerInfo
AppBackgroundRestrictionsInfo.REASON_UNKNOWN, // ExemptionReason
AppBackgroundRestrictionsInfo.UNKNOWN, // OptimizationLevel
AppBackgroundRestrictionsInfo.SDK_UNKNOWN, // TargetSdk
@@ -282,14 +282,14 @@
}
/**
- * Get the BatteryTrackerInfo proto of a UID.
- * @param uid
- * @return byte array of the proto.
+ * Get the BatteryTrackerInfo object of the given uid.
+ * @return byte array of the proto object.
*/
- @NonNull byte[] getBatteryTrackerInfoProtoLocked(int uid) {
+ @Override
+ byte[] getTrackerInfoForStatsd(int uid) {
final ImmutableBatteryUsage temp = mUidBatteryUsageInWindow.get(uid);
if (temp == null) {
- return new byte[0];
+ return null;
}
final BatteryUsage bgUsage = temp.calcPercentage(uid, mInjector.getPolicy());
final double allUsage = bgUsage.mPercentage[BatteryUsage.BATTERY_USAGE_INDEX_UNSPECIFIED]
@@ -301,10 +301,12 @@
bgUsage.mPercentage[BatteryUsage.BATTERY_USAGE_INDEX_BACKGROUND];
final double usageFgs =
bgUsage.mPercentage[BatteryUsage.BATTERY_USAGE_INDEX_FOREGROUND_SERVICE];
- Slog.d(TAG, "getBatteryTrackerInfoProtoLocked uid:" + uid
- + " allUsage:" + String.format("%4.2f%%", allUsage)
- + " usageBackground:" + String.format("%4.2f%%", usageBackground)
- + " usageFgs:" + String.format("%4.2f%%", usageFgs));
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER_VERBOSE) {
+ Slog.d(TAG, "getBatteryTrackerInfoProtoLocked uid:" + uid
+ + " allUsage:" + String.format("%4.2f%%", allUsage)
+ + " usageBackground:" + String.format("%4.2f%%", usageBackground)
+ + " usageFgs:" + String.format("%4.2f%%", usageFgs));
+ }
final ProtoOutputStream proto = new ProtoOutputStream();
proto.write(AppBackgroundRestrictionsInfo.BatteryTrackerInfo.BATTERY_24H,
allUsage * 10000);
@@ -1671,6 +1673,7 @@
if (pair != null) {
final long[] ts = pair.first;
final int restrictedLevel = ts[TIME_STAMP_INDEX_RESTRICTED_BUCKET] > 0
+ && mTracker.mAppRestrictionController.isAutoRestrictAbusiveAppEnabled()
? RESTRICTION_LEVEL_RESTRICTED_BUCKET
: RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
if (maxLevel > RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
diff --git a/services/core/java/com/android/server/am/AppErrors.java b/services/core/java/com/android/server/am/AppErrors.java
index 97dd323..36c40a1 100644
--- a/services/core/java/com/android/server/am/AppErrors.java
+++ b/services/core/java/com/android/server/am/AppErrors.java
@@ -577,12 +577,14 @@
mPackageWatchdog.onPackageFailure(r.getPackageListWithVersionCode(),
PackageWatchdog.FAILURE_REASON_APP_CRASH);
- mService.mProcessList.noteAppKill(r, (crashInfo != null
- && "Native crash".equals(crashInfo.exceptionClassName))
- ? ApplicationExitInfo.REASON_CRASH_NATIVE
- : ApplicationExitInfo.REASON_CRASH,
- ApplicationExitInfo.SUBREASON_UNKNOWN,
- "crash");
+ synchronized (mService) {
+ mService.mProcessList.noteAppKill(r, (crashInfo != null
+ && "Native crash".equals(crashInfo.exceptionClassName))
+ ? ApplicationExitInfo.REASON_CRASH_NATIVE
+ : ApplicationExitInfo.REASON_CRASH,
+ ApplicationExitInfo.SUBREASON_UNKNOWN,
+ "crash");
+ }
}
final int relaunchReason = r != null
diff --git a/services/core/java/com/android/server/am/AppRestrictionController.java b/services/core/java/com/android/server/am/AppRestrictionController.java
index d70404f..7b763b7 100644
--- a/services/core/java/com/android/server/am/AppRestrictionController.java
+++ b/services/core/java/com/android/server/am/AppRestrictionController.java
@@ -61,6 +61,8 @@
import static android.os.PowerExemptionManager.REASON_DENIED;
import static android.os.PowerExemptionManager.REASON_DEVICE_DEMO_MODE;
import static android.os.PowerExemptionManager.REASON_DEVICE_OWNER;
+import static android.os.PowerExemptionManager.REASON_DISALLOW_APPS_CONTROL;
+import static android.os.PowerExemptionManager.REASON_DPO_PROTECTED_APP;
import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_PLATFORM_VPN;
import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_VPN;
import static android.os.PowerExemptionManager.REASON_PROC_STATE_PERSISTENT;
@@ -328,6 +330,8 @@
})
@interface TrackerType {}
+ private final TrackerInfo mEmptyTrackerInfo = new TrackerInfo();
+
private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -914,7 +918,7 @@
final int curBucket = mInjector.getAppStandbyInternal().getAppStandbyBucket(
packageName, UserHandle.getUserId(uid), now, false);
if (applyLevel) {
- applyRestrictionLevel(packageName, uid, curLevel, TRACKER_TYPE_UNKNOWN,
+ applyRestrictionLevel(packageName, uid, curLevel, mEmptyTrackerInfo,
curBucket, true, reason & REASON_MAIN_MASK, reason & REASON_SUB_MASK);
} else {
pkgSettings.update(curLevel,
@@ -1059,6 +1063,13 @@
DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "auto_restricted_bucket_on_bg_restricted";
/**
+ * Whether or not to move the app to restricted standby level automatically
+ * when system detects it's abusive.
+ */
+ static final String KEY_BG_AUTO_RESTRICT_ABUSIVE_APPS =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "auto_restrict_abusive_apps";
+
+ /**
* The minimal interval in ms before posting a notification again on abusive behaviors
* of a certain package.
*/
@@ -1103,6 +1114,11 @@
DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "prompt_abusive_apps_to_bg_restricted";
/**
+ * Default value to {@link #mBgAutoRestrictAbusiveApps}.
+ */
+ static final boolean DEFAULT_BG_AUTO_RESTRICT_ABUSIVE_APPS = true;
+
+ /**
* Default value to {@link #mBgAutoRestrictedBucket}.
*/
static final boolean DEFAULT_BG_AUTO_RESTRICTED_BUCKET_ON_BG_RESTRICTION = false;
@@ -1134,6 +1150,8 @@
volatile boolean mBgAutoRestrictedBucket;
+ volatile boolean mBgAutoRestrictAbusiveApps;
+
volatile boolean mRestrictedBucketEnabled;
volatile long mBgAbusiveNotificationMinIntervalMs;
@@ -1180,6 +1198,9 @@
case KEY_BG_AUTO_RESTRICTED_BUCKET_ON_BG_RESTRICTION:
updateBgAutoRestrictedBucketChanged();
break;
+ case KEY_BG_AUTO_RESTRICT_ABUSIVE_APPS:
+ updateBgAutoRestrictAbusiveApps();
+ break;
case KEY_BG_ABUSIVE_NOTIFICATION_MINIMAL_INTERVAL:
updateBgAbusiveNotificationMinimalInterval();
break;
@@ -1228,6 +1249,7 @@
void updateDeviceConfig() {
updateBgAutoRestrictedBucketChanged();
+ updateBgAutoRestrictAbusiveApps();
updateBgAbusiveNotificationMinimalInterval();
updateBgLongFgsNotificationMinimalInterval();
updateBgPromptFgsWithNotiToBgRestricted();
@@ -1247,6 +1269,13 @@
}
}
+ private void updateBgAutoRestrictAbusiveApps() {
+ mBgAutoRestrictAbusiveApps = DeviceConfig.getBoolean(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_AUTO_RESTRICT_ABUSIVE_APPS,
+ DEFAULT_BG_AUTO_RESTRICT_ABUSIVE_APPS);
+ }
+
private void updateBgAbusiveNotificationMinimalInterval() {
mBgAbusiveNotificationMinIntervalMs = DeviceConfig.getLong(
DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
@@ -1309,6 +1338,10 @@
pw.print('=');
pw.println(mBgAutoRestrictedBucket);
pw.print(prefix);
+ pw.print(KEY_BG_AUTO_RESTRICT_ABUSIVE_APPS);
+ pw.print('=');
+ pw.println(mBgAutoRestrictAbusiveApps);
+ pw.print(prefix);
pw.print(KEY_BG_ABUSIVE_NOTIFICATION_MINIMAL_INTERVAL);
pw.print('=');
pw.println(mBgAbusiveNotificationMinIntervalMs);
@@ -1331,6 +1364,25 @@
}
}
+ /**
+ * A helper object which holds an app state tracker's type and its relevant info used for
+ * logging atoms to statsd.
+ */
+ private class TrackerInfo {
+ final int mType; // tracker type
+ final byte[] mInfo; // tracker info proto object for statsd
+
+ TrackerInfo() {
+ mType = TRACKER_TYPE_UNKNOWN;
+ mInfo = null;
+ }
+
+ TrackerInfo(int type, byte[] info) {
+ mType = type;
+ mInfo = info;
+ }
+ }
+
private final ConstantsObserver mConstantsObserver;
private final AppStateTracker.BackgroundRestrictedAppListener mBackgroundRestrictionListener =
@@ -1578,7 +1630,7 @@
Slog.e(TAG, "Unable to find " + info.mPackageName + "/u" + userId);
continue;
}
- final Pair<Integer, Integer> levelTypePair = calcAppRestrictionLevel(
+ final Pair<Integer, TrackerInfo> levelTypePair = calcAppRestrictionLevel(
userId, uid, info.mPackageName, info.mStandbyBucket, false, false);
if (DEBUG_BG_RESTRICTION_CONTROLLER) {
Slog.i(TAG, "Proposed restriction level of " + info.mPackageName + "/"
@@ -1602,8 +1654,8 @@
final long now = SystemClock.elapsedRealtime();
for (String pkg: packages) {
final int curBucket = appStandbyInternal.getAppStandbyBucket(pkg, userId, now, false);
- final Pair<Integer, Integer> levelTypePair = calcAppRestrictionLevel(userId, uid, pkg,
- curBucket, allowRequestBgRestricted, true);
+ final Pair<Integer, TrackerInfo> levelTypePair = calcAppRestrictionLevel(userId, uid,
+ pkg, curBucket, allowRequestBgRestricted, true);
if (DEBUG_BG_RESTRICTION_CONTROLLER) {
Slog.i(TAG, "Proposed restriction level of " + pkg + "/"
+ UserHandle.formatUid(uid) + ": "
@@ -1614,14 +1666,14 @@
}
}
- private Pair<Integer, Integer> calcAppRestrictionLevel(@UserIdInt int userId, int uid,
+ private Pair<Integer, TrackerInfo> calcAppRestrictionLevel(@UserIdInt int userId, int uid,
String packageName, @UsageStatsManager.StandbyBuckets int standbyBucket,
boolean allowRequestBgRestricted, boolean calcTrackers) {
if (mInjector.getAppHibernationInternal().isHibernatingForUser(packageName, userId)) {
- return new Pair<>(RESTRICTION_LEVEL_HIBERNATION, TRACKER_TYPE_UNKNOWN);
+ return new Pair<>(RESTRICTION_LEVEL_HIBERNATION, mEmptyTrackerInfo);
}
@RestrictionLevel int level;
- @TrackerType int trackerType = TRACKER_TYPE_UNKNOWN;
+ TrackerInfo trackerInfo = null;
switch (standbyBucket) {
case STANDBY_BUCKET_EXEMPTED:
level = RESTRICTION_LEVEL_EXEMPTED;
@@ -1637,22 +1689,22 @@
default:
if (mInjector.getAppStateTracker()
.isAppBackgroundRestricted(uid, packageName)) {
- return new Pair<>(RESTRICTION_LEVEL_BACKGROUND_RESTRICTED, trackerType);
+ return new Pair<>(RESTRICTION_LEVEL_BACKGROUND_RESTRICTED, mEmptyTrackerInfo);
}
level = mConstantsObserver.mRestrictedBucketEnabled
&& standbyBucket == STANDBY_BUCKET_RESTRICTED
? RESTRICTION_LEVEL_RESTRICTED_BUCKET
: RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
if (calcTrackers) {
- Pair<Integer, Integer> levelTypePair = calcAppRestrictionLevelFromTackers(
+ Pair<Integer, TrackerInfo> levelTypePair = calcAppRestrictionLevelFromTackers(
uid, packageName, RESTRICTION_LEVEL_MAX);
@RestrictionLevel int l = levelTypePair.first;
if (l == RESTRICTION_LEVEL_EXEMPTED) {
return new Pair<>(RESTRICTION_LEVEL_EXEMPTED, levelTypePair.second);
}
- level = Math.max(l, level);
- if (l == level) {
- trackerType = levelTypePair.second;
+ if (l > level) {
+ level = l;
+ trackerInfo = levelTypePair.second;
}
if (level == RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
// This level can't be entered without user consent
@@ -1664,29 +1716,29 @@
levelTypePair = calcAppRestrictionLevelFromTackers(uid, packageName,
RESTRICTION_LEVEL_BACKGROUND_RESTRICTED);
level = levelTypePair.first;
- trackerType = levelTypePair.second;
+ trackerInfo = levelTypePair.second;
}
}
break;
}
- return new Pair<>(level, trackerType);
+ return new Pair<>(level, trackerInfo);
}
/**
* Ask each of the trackers for their proposed restriction levels for the given uid/package,
- * and return the most restrictive level along with the type of tracker which applied this
- * restriction level as a {@code Pair<@RestrictionLevel, @TrackerType>}.
+ * and return the most restrictive level along with the type of tracker and its relevant info
+ * which applied this restriction level as a {@code Pair<@RestrictionLevel, TrackerInfo>}.
*
* <p>Note, it's different from the {@link #getRestrictionLevel} where it returns the least
* restrictive level. We're returning the most restrictive level here because each tracker
* monitors certain dimensions of the app, the abusive behaviors could be detected in one or
* more of these dimensions, but not necessarily all of them. </p>
*/
- private Pair<Integer, Integer> calcAppRestrictionLevelFromTackers(int uid, String packageName,
- @RestrictionLevel int maxLevel) {
+ private Pair<Integer, TrackerInfo> calcAppRestrictionLevelFromTackers(int uid,
+ String packageName, @RestrictionLevel int maxLevel) {
@RestrictionLevel int level = RESTRICTION_LEVEL_UNKNOWN;
@RestrictionLevel int prevLevel = level;
- @TrackerType int trackerType = TRACKER_TYPE_UNKNOWN;
+ BaseAppStateTracker resultTracker = null;
final boolean isRestrictedBucketEnabled = mConstantsObserver.mRestrictedBucketEnabled;
for (int i = mAppStateTrackers.size() - 1; i >= 0; i--) {
@RestrictionLevel int l = mAppStateTrackers.get(i).getPolicy()
@@ -1696,11 +1748,15 @@
}
level = Math.max(level, l);
if (level != prevLevel) {
- trackerType = mAppStateTrackers.get(i).getType();
+ resultTracker = mAppStateTrackers.get(i);
prevLevel = level;
}
}
- return new Pair<>(level, trackerType);
+ final TrackerInfo trackerInfo = resultTracker == null
+ ? mEmptyTrackerInfo
+ : new TrackerInfo(resultTracker.getType(),
+ resultTracker.getTrackerInfoForStatsd(uid));
+ return new Pair<>(level, trackerInfo);
}
private static @RestrictionLevel int standbyBucketToRestrictionLevel(
@@ -1745,6 +1801,14 @@
}
/**
+ * @return Whether or not to move the app to restricted level automatically
+ * when system detects it's abusive.
+ */
+ boolean isAutoRestrictAbusiveAppEnabled() {
+ return mConstantsObserver.mBgAutoRestrictAbusiveApps;
+ }
+
+ /**
* @return The total foreground service durations for the given package/uid with given
* foreground service type, or the total durations regardless the type if the given type is 0.
*/
@@ -2017,7 +2081,7 @@
}
private void applyRestrictionLevel(String pkgName, int uid,
- @RestrictionLevel int level, @TrackerType int trackerType,
+ @RestrictionLevel int level, TrackerInfo trackerInfo,
int curBucket, boolean allowUpdateBucket, int reason, int subReason) {
int curLevel;
int prevReason;
@@ -2098,14 +2162,17 @@
reason, subReason);
}
+ if (trackerInfo == null) {
+ trackerInfo = mEmptyTrackerInfo;
+ }
FrameworkStatsLog.write(FrameworkStatsLog.APP_BACKGROUND_RESTRICTIONS_INFO, uid,
getRestrictionLevelStatsd(level),
getThresholdStatsd(reason),
- getTrackerTypeStatsd(trackerType),
- null, // FgsTrackerInfo
- null, // BatteryTrackerInfo
- null, // BroadcastEventsTrackerInfo
- null, // BindServiceEventsTrackerInfo
+ getTrackerTypeStatsd(trackerInfo.mType),
+ trackerInfo.mType == TRACKER_TYPE_FGS ? trackerInfo.mInfo : null,
+ trackerInfo.mType == TRACKER_TYPE_BATTERY ? trackerInfo.mInfo : null,
+ trackerInfo.mType == TRACKER_TYPE_BROADCAST_EVENTS ? trackerInfo.mInfo : null,
+ trackerInfo.mType == TRACKER_TYPE_BIND_SERVICE_EVENTS ? trackerInfo.mInfo : null,
getExemptionReasonStatsd(uid, level),
getOptimizationLevelStatsd(level),
getTargetSdkStatsd(pkgName),
@@ -2127,7 +2194,7 @@
// The app could fall into the background restricted with user consent only,
// so set the reason to it.
applyRestrictionLevel(pkgName, uid, RESTRICTION_LEVEL_BACKGROUND_RESTRICTED,
- TRACKER_TYPE_UNKNOWN, curBucket, true, REASON_MAIN_FORCED_BY_USER,
+ mEmptyTrackerInfo, curBucket, true, REASON_MAIN_FORCED_BY_USER,
REASON_SUB_FORCED_USER_FLAG_INTERACTION);
mBgHandler.obtainMessage(BgHandler.MSG_CANCEL_REQUEST_BG_RESTRICTED, uid, 0, pkgName)
.sendToTarget();
@@ -2140,7 +2207,7 @@
? STANDBY_BUCKET_EXEMPTED
: (lastLevel == RESTRICTION_LEVEL_RESTRICTED_BUCKET
? STANDBY_BUCKET_RESTRICTED : STANDBY_BUCKET_RARE);
- final Pair<Integer, Integer> levelTypePair = calcAppRestrictionLevel(
+ final Pair<Integer, TrackerInfo> levelTypePair = calcAppRestrictionLevel(
UserHandle.getUserId(uid), uid, pkgName, tentativeBucket, false, true);
applyRestrictionLevel(pkgName, uid, levelTypePair.first, levelTypePair.second,
@@ -2184,7 +2251,7 @@
@UserIdInt int userId) {
final int uid = mInjector.getPackageManagerInternal().getPackageUid(
packageName, STOCK_PM_FLAGS, userId);
- final Pair<Integer, Integer> levelTypePair = calcAppRestrictionLevel(
+ final Pair<Integer, TrackerInfo> levelTypePair = calcAppRestrictionLevel(
userId, uid, packageName, bucket, false, false);
applyRestrictionLevel(packageName, uid, levelTypePair.first, levelTypePair.second,
bucket, false, REASON_MAIN_DEFAULT, REASON_SUB_DEFAULT_UNDEFINED);
@@ -2616,6 +2683,11 @@
if (UserManager.isDeviceInDemoMode(mContext)) {
return REASON_DEVICE_DEMO_MODE;
}
+ final int userId = UserHandle.getUserId(uid);
+ if (mInjector.getUserManagerInternal()
+ .hasUserRestriction(UserManager.DISALLOW_APPS_CONTROL, userId)) {
+ return REASON_DISALLOW_APPS_CONTROL;
+ }
if (am.isDeviceOwner(uid)) {
return REASON_DEVICE_OWNER;
}
@@ -2631,6 +2703,7 @@
final String[] packages = mInjector.getPackageManager().getPackagesForUid(uid);
if (packages != null) {
final AppOpsManager appOpsManager = mInjector.getAppOpsManager();
+ final PackageManagerInternal pm = mInjector.getPackageManagerInternal();
for (String pkg : packages) {
if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_VPN,
uid, pkg) == AppOpsManager.MODE_ALLOWED) {
@@ -2646,6 +2719,8 @@
return REASON_SYSTEM_ALLOW_LISTED;
} else if (mConstantsObserver.mBgRestrictionExemptedPackages.contains(pkg)) {
return REASON_ALLOWLISTED_PACKAGE;
+ } else if (pm.isPackageStateProtected(pkg, userId)) {
+ return REASON_DPO_PROTECTED_APP;
}
}
}
diff --git a/services/core/java/com/android/server/am/BaseAppStateTimeSlotEventsTracker.java b/services/core/java/com/android/server/am/BaseAppStateTimeSlotEventsTracker.java
index b8aee13..a12d7de 100644
--- a/services/core/java/com/android/server/am/BaseAppStateTimeSlotEventsTracker.java
+++ b/services/core/java/com/android/server/am/BaseAppStateTimeSlotEventsTracker.java
@@ -301,6 +301,7 @@
@RestrictionLevel int maxLevel) {
synchronized (mLock) {
final int level = mExcessiveEventPkgs.get(packageName, uid) == null
+ || !mTracker.mAppRestrictionController.isAutoRestrictAbusiveAppEnabled()
? RESTRICTION_LEVEL_ADAPTIVE_BUCKET
: RESTRICTION_LEVEL_RESTRICTED_BUCKET;
if (maxLevel > RESTRICTION_LEVEL_RESTRICTED_BUCKET) {
diff --git a/services/core/java/com/android/server/am/BaseAppStateTracker.java b/services/core/java/com/android/server/am/BaseAppStateTracker.java
index 5afceca..8d60910 100644
--- a/services/core/java/com/android/server/am/BaseAppStateTracker.java
+++ b/services/core/java/com/android/server/am/BaseAppStateTracker.java
@@ -169,6 +169,13 @@
}
/**
+ * Return the relevant info object for the tracker for the given uid, used for statsd.
+ */
+ byte[] getTrackerInfoForStatsd(int uid) {
+ return null;
+ }
+
+ /**
* Return the policy holder of this tracker.
*/
T getPolicy() {
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index eb7897b..7253b49 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -2025,7 +2025,7 @@
mHandler.post(() -> {
synchronized (mStats) {
mStats.noteBluetoothScanStoppedFromSourceLocked(localWs, isUnoptimized,
- uptime, elapsedRealtime);
+ elapsedRealtime, uptime);
}
});
}
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index 361629b..3e97b91 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -69,6 +69,7 @@
import static android.app.AppOpsManager.makeKey;
import static android.app.AppOpsManager.modeToName;
import static android.app.AppOpsManager.opAllowSystemBypassRestriction;
+import static android.app.AppOpsManager.opRestrictsRead;
import static android.app.AppOpsManager.opToName;
import static android.app.AppOpsManager.opToPublicName;
import static android.app.AppOpsManager.resolveFirstUnrestrictedUidState;
@@ -2875,6 +2876,10 @@
// features may require permissions our remote caller does not have.
final long identity = Binder.clearCallingIdentity();
try {
+ if (shouldIgnoreCallback(switchedCode, callback.mCallingPid,
+ callback.mCallingUid)) {
+ continue;
+ }
callback.mCallback.opChanged(switchedCode, uid, packageName);
} catch (RemoteException e) {
/* ignore */
@@ -4205,6 +4210,9 @@
for (int i = 0; i < callbackCount; i++) {
final ActiveCallback callback = callbacks.valueAt(i);
try {
+ if (shouldIgnoreCallback(code, callback.mCallingPid, callback.mCallingUid)) {
+ continue;
+ }
callback.mCallback.opActiveChanged(code, uid, packageName, attributionTag,
active, attributionFlags, attributionChainId);
} catch (RemoteException e) {
@@ -4258,6 +4266,9 @@
for (int i = 0; i < callbackCount; i++) {
final StartedCallback callback = callbacks.valueAt(i);
try {
+ if (shouldIgnoreCallback(code, callback.mCallingPid, callback.mCallingUid)) {
+ continue;
+ }
callback.mCallback.opStarted(code, uid, packageName, attributionTag, flags,
result, startedType, attributionFlags, attributionChainId);
} catch (RemoteException e) {
@@ -4306,6 +4317,9 @@
for (int i = 0; i < callbackCount; i++) {
final NotedCallback callback = callbacks.valueAt(i);
try {
+ if (shouldIgnoreCallback(code, callback.mCallingPid, callback.mCallingUid)) {
+ continue;
+ }
callback.mCallback.opNoted(code, uid, packageName, attributionTag, flags,
result);
} catch (RemoteException e) {
@@ -4370,8 +4384,20 @@
Binder.getCallingPid(), Binder.getCallingUid(), null);
}
+ private boolean shouldIgnoreCallback(int op, int watcherPid, int watcherUid) {
+ // If it's a restricted read op, ignore it if watcher doesn't have manage ops permission,
+ // as watcher should not use this to signal if the value is changed.
+ return opRestrictsRead(op) && mContext.checkPermission(Manifest.permission.MANAGE_APPOPS,
+ watcherPid, watcherUid) != PackageManager.PERMISSION_GRANTED;
+ }
+
private void verifyIncomingOp(int op) {
if (op >= 0 && op < AppOpsManager._NUM_OP) {
+ // Enforce manage appops permission if it's a restricted read op.
+ if (opRestrictsRead(op)) {
+ mContext.enforcePermission(Manifest.permission.MANAGE_APPOPS,
+ Binder.getCallingPid(), Binder.getCallingUid(), "verifyIncomingOp");
+ }
return;
}
throw new IllegalArgumentException("Bad operation #" + op);
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
index 1a482e4..0b3c18b 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
@@ -656,6 +656,9 @@
audioDevice = AudioSystem.DEVICE_IN_BLE_HEADSET;
}
break;
+ case BluetoothProfile.LE_AUDIO_BROADCAST:
+ audioDevice = AudioSystem.DEVICE_OUT_BLE_BROADCAST;
+ break;
default: throw new IllegalArgumentException("Invalid profile " + d.mInfo.getProfile());
}
return new BtDeviceInfo(d, device, state, audioDevice, codec);
diff --git a/services/core/java/com/android/server/audio/AudioDeviceInventory.java b/services/core/java/com/android/server/audio/AudioDeviceInventory.java
index 69b75e6..e145270 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceInventory.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceInventory.java
@@ -370,6 +370,7 @@
}
break;
case BluetoothProfile.LE_AUDIO:
+ case BluetoothProfile.LE_AUDIO_BROADCAST:
if (switchToUnavailable) {
makeLeAudioDeviceUnavailable(address, btInfo.mAudioSystemDevice);
} else if (switchToAvailable) {
@@ -847,7 +848,10 @@
disconnectHearingAid();
break;
case BluetoothProfile.LE_AUDIO:
- disconnectLeAudio();
+ disconnectLeAudioUnicast();
+ break;
+ case BluetoothProfile.LE_AUDIO_BROADCAST:
+ disconnectLeAudioBroadcast();
break;
default:
// Not a valid profile to disconnect
@@ -857,28 +861,39 @@
}
}
- /*package*/ void disconnectLeAudio() {
+ /*package*/ void disconnectLeAudio(int device) {
+ if (device != AudioSystem.DEVICE_OUT_BLE_HEADSET ||
+ device != AudioSystem.DEVICE_OUT_BLE_BROADCAST) {
+ Log.e(TAG, "disconnectLeAudio: Can't disconnect not LE Audio device " + device);
+ return;
+ }
+
synchronized (mDevicesLock) {
final ArraySet<String> toRemove = new ArraySet<>();
- // Disconnect ALL DEVICE_OUT_BLE_HEADSET devices
+ // Disconnect ALL DEVICE_OUT_BLE_HEADSET or DEVICE_OUT_BLE_BROADCAST devices
mConnectedDevices.values().forEach(deviceInfo -> {
- if (deviceInfo.mDeviceType == AudioSystem.DEVICE_OUT_BLE_HEADSET) {
+ if (deviceInfo.mDeviceType == device) {
toRemove.add(deviceInfo.mDeviceAddress);
}
});
new MediaMetrics.Item(mMetricsId + "disconnectLeAudio")
.record();
if (toRemove.size() > 0) {
- final int delay = checkSendBecomingNoisyIntentInt(
- AudioSystem.DEVICE_OUT_BLE_HEADSET, 0, AudioSystem.DEVICE_NONE);
toRemove.stream().forEach(deviceAddress ->
- makeLeAudioDeviceUnavailable(deviceAddress,
- AudioSystem.DEVICE_OUT_BLE_HEADSET)
+ makeLeAudioDeviceUnavailable(deviceAddress, device)
);
}
}
}
+ /*package*/ void disconnectLeAudioUnicast() {
+ disconnectLeAudio(AudioSystem.DEVICE_OUT_BLE_HEADSET);
+ }
+
+ /*package*/ void disconnectLeAudioBroadcast() {
+ disconnectLeAudio(AudioSystem.DEVICE_OUT_BLE_BROADCAST);
+ }
+
// must be called before removing the device from mConnectedDevices
// musicDevice argument is used when not AudioSystem.DEVICE_NONE instead of querying
// from AudioSystem
@@ -908,7 +923,9 @@
int delay;
synchronized (mDevicesLock) {
if (!info.mSupprNoisy
- && ((info.mProfile == BluetoothProfile.LE_AUDIO && info.mIsLeOutput)
+ && (((info.mProfile == BluetoothProfile.LE_AUDIO
+ || info.mProfile == BluetoothProfile.LE_AUDIO_BROADCAST)
+ && info.mIsLeOutput)
|| info.mProfile == BluetoothProfile.HEARING_AID
|| info.mProfile == BluetoothProfile.A2DP)) {
@AudioService.ConnectionState int asState =
@@ -1162,8 +1179,7 @@
return;
}
- final int leAudioVolIndex = mDeviceBroker.getVssVolumeForDevice(streamType,
- AudioSystem.DEVICE_OUT_BLE_HEADSET);
+ final int leAudioVolIndex = mDeviceBroker.getVssVolumeForDevice(streamType, device);
final int maxIndex = mDeviceBroker.getMaxVssVolumeForStream(streamType);
mDeviceBroker.postSetLeAudioVolumeIndex(leAudioVolIndex, maxIndex, streamType);
mDeviceBroker.postApplyVolumeOnDevice(streamType, device, "makeLeAudioDeviceAvailable");
@@ -1215,6 +1231,7 @@
BECOMING_NOISY_INTENT_DEVICES_SET.add(AudioSystem.DEVICE_OUT_LINE);
BECOMING_NOISY_INTENT_DEVICES_SET.add(AudioSystem.DEVICE_OUT_HEARING_AID);
BECOMING_NOISY_INTENT_DEVICES_SET.add(AudioSystem.DEVICE_OUT_BLE_HEADSET);
+ BECOMING_NOISY_INTENT_DEVICES_SET.add(AudioSystem.DEVICE_OUT_BLE_BROADCAST);
BECOMING_NOISY_INTENT_DEVICES_SET.addAll(AudioSystem.DEVICE_OUT_ALL_A2DP_SET);
BECOMING_NOISY_INTENT_DEVICES_SET.addAll(AudioSystem.DEVICE_OUT_ALL_USB_SET);
BECOMING_NOISY_INTENT_DEVICES_SET.addAll(AudioSystem.DEVICE_OUT_ALL_BLE_SET);
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index b1b5d3f..1357ed2 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -3228,7 +3228,8 @@
dispatchAbsoluteVolumeChanged(streamType, info, newIndex);
}
- if (device == AudioSystem.DEVICE_OUT_BLE_HEADSET
+ if ((device == AudioSystem.DEVICE_OUT_BLE_HEADSET
+ || device == AudioSystem.DEVICE_OUT_BLE_BROADCAST)
&& streamType == getBluetoothContextualVolumeStream()
&& (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) == 0) {
if (DEBUG_VOL) {
@@ -3891,7 +3892,8 @@
dispatchAbsoluteVolumeChanged(streamType, info, index);
}
- if (device == AudioSystem.DEVICE_OUT_BLE_HEADSET
+ if ((device == AudioSystem.DEVICE_OUT_BLE_HEADSET
+ || device == AudioSystem.DEVICE_OUT_BLE_BROADCAST)
&& streamType == getBluetoothContextualVolumeStream()
&& (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) == 0) {
if (DEBUG_VOL) {
@@ -6832,6 +6834,7 @@
BluetoothProfile.A2DP,
BluetoothProfile.A2DP_SINK,
BluetoothProfile.LE_AUDIO,
+ BluetoothProfile.LE_AUDIO_BROADCAST,
})
@Retention(RetentionPolicy.SOURCE)
public @interface BtProfile {}
@@ -6853,6 +6856,7 @@
final int profile = info.getProfile();
if (profile != BluetoothProfile.A2DP && profile != BluetoothProfile.A2DP_SINK
&& profile != BluetoothProfile.LE_AUDIO
+ && profile != BluetoothProfile.LE_AUDIO_BROADCAST
&& profile != BluetoothProfile.HEARING_AID) {
throw new IllegalArgumentException("Illegal BluetoothProfile profile for device "
+ previousDevice + " -> " + newDevice + ". Got: " + profile);
diff --git a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
index 6d68772..1002229 100644
--- a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
@@ -105,7 +105,7 @@
mIsStrongBiometric = isStrongBiometric;
mOperationId = operationId;
mRequireConfirmation = requireConfirmation;
- mActivityTaskManager = ActivityTaskManager.getInstance();
+ mActivityTaskManager = getActivityTaskManager();
mBiometricManager = context.getSystemService(BiometricManager.class);
mTaskStackListener = taskStackListener;
mLockoutTracker = lockoutTracker;
@@ -133,6 +133,10 @@
return mStartTimeMs;
}
+ protected ActivityTaskManager getActivityTaskManager() {
+ return ActivityTaskManager.getInstance();
+ }
+
@Override
public void binderDied() {
final boolean clearListener = !isBiometricPrompt();
@@ -310,45 +314,50 @@
sendCancelOnly(listener);
}
});
- } else {
- // Allow system-defined limit of number of attempts before giving up
- final @LockoutTracker.LockoutMode int lockoutMode =
- handleFailedAttempt(getTargetUserId());
- if (lockoutMode != LockoutTracker.LOCKOUT_NONE) {
- markAlreadyDone();
+ } else { // not authenticated
+ if (isBackgroundAuth) {
+ Slog.e(TAG, "cancelling due to background auth");
+ cancel();
+ } else {
+ // Allow system-defined limit of number of attempts before giving up
+ final @LockoutTracker.LockoutMode int lockoutMode =
+ handleFailedAttempt(getTargetUserId());
+ if (lockoutMode != LockoutTracker.LOCKOUT_NONE) {
+ markAlreadyDone();
+ }
+
+ final CoexCoordinator coordinator = CoexCoordinator.getInstance();
+ coordinator.onAuthenticationRejected(SystemClock.uptimeMillis(), this, lockoutMode,
+ new CoexCoordinator.Callback() {
+ @Override
+ public void sendAuthenticationResult(boolean addAuthTokenIfStrong) {
+ if (listener != null) {
+ try {
+ listener.onAuthenticationFailed(getSensorId());
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Unable to notify listener", e);
+ }
+ }
+ }
+
+ @Override
+ public void sendHapticFeedback() {
+ if (listener != null && mShouldVibrate) {
+ vibrateError();
+ }
+ }
+
+ @Override
+ public void handleLifecycleAfterAuth() {
+ AuthenticationClient.this.handleLifecycleAfterAuth(false /* authenticated */);
+ }
+
+ @Override
+ public void sendAuthenticationCanceled() {
+ sendCancelOnly(listener);
+ }
+ });
}
-
- final CoexCoordinator coordinator = CoexCoordinator.getInstance();
- coordinator.onAuthenticationRejected(SystemClock.uptimeMillis(), this, lockoutMode,
- new CoexCoordinator.Callback() {
- @Override
- public void sendAuthenticationResult(boolean addAuthTokenIfStrong) {
- if (listener != null) {
- try {
- listener.onAuthenticationFailed(getSensorId());
- } catch (RemoteException e) {
- Slog.e(TAG, "Unable to notify listener", e);
- }
- }
- }
-
- @Override
- public void sendHapticFeedback() {
- if (listener != null && mShouldVibrate) {
- vibrateError();
- }
- }
-
- @Override
- public void handleLifecycleAfterAuth() {
- AuthenticationClient.this.handleLifecycleAfterAuth(false /* authenticated */);
- }
-
- @Override
- public void sendAuthenticationCanceled() {
- sendCancelOnly(listener);
- }
- });
}
}
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 97efc78..a26535f 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
@@ -344,12 +344,12 @@
provider.second.getSensorProperties(sensorId);
if (!isKeyguard && !Utils.isSettings(getContext(), opPackageName)
&& sensorProps != null && sensorProps.isAnyUdfpsType()) {
- final long identity2 = Binder.clearCallingIdentity();
try {
return authenticateWithPrompt(operationId, sensorProps, userId, receiver,
- ignoreEnrollmentState);
- } finally {
- Binder.restoreCallingIdentity(identity2);
+ opPackageName, ignoreEnrollmentState);
+ } catch (PackageManager.NameNotFoundException e) {
+ Slog.e(TAG, "Invalid package", e);
+ return -1;
}
}
return provider.second.scheduleAuthenticate(provider.first, token, operationId, userId,
@@ -362,12 +362,15 @@
@NonNull final FingerprintSensorPropertiesInternal props,
final int userId,
final IFingerprintServiceReceiver receiver,
- boolean ignoreEnrollmentState) {
+ final String opPackageName,
+ boolean ignoreEnrollmentState) throws PackageManager.NameNotFoundException {
final Context context = getUiContext();
+ final Context promptContext = context.createPackageContextAsUser(
+ opPackageName, 0 /* flags */, UserHandle.getUserHandleForUid(userId));
final Executor executor = context.getMainExecutor();
- final BiometricPrompt biometricPrompt = new BiometricPrompt.Builder(context)
+ final BiometricPrompt biometricPrompt = new BiometricPrompt.Builder(promptContext)
.setTitle(context.getString(R.string.biometric_dialog_default_title))
.setSubtitle(context.getString(R.string.fingerprint_dialog_default_subtitle))
.setNegativeButton(
@@ -381,8 +384,7 @@
Slog.e(TAG, "Remote exception in negative button onClick()", e);
}
})
- .setAllowedSensorIds(new ArrayList<>(
- Collections.singletonList(props.sensorId)))
+ .setIsForLegacyFingerprintManager(props.sensorId)
.setIgnoreEnrollmentState(ignoreEnrollmentState)
.build();
@@ -436,8 +438,8 @@
}
};
- return biometricPrompt.authenticateUserForOperation(
- new CancellationSignal(), executor, promptCallback, userId, operationId);
+ return biometricPrompt.authenticateForOperation(
+ new CancellationSignal(), executor, promptCallback, operationId);
}
@Override
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index d9e4828..68a53f1 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -85,6 +85,7 @@
import android.net.ipsec.ike.IkeSession;
import android.net.ipsec.ike.IkeSessionCallback;
import android.net.ipsec.ike.IkeSessionParams;
+import android.net.ipsec.ike.IkeTunnelConnectionParams;
import android.net.ipsec.ike.exceptions.IkeProtocolException;
import android.os.Binder;
import android.os.Build.VERSION_CODES;
@@ -2267,6 +2268,11 @@
profile.setAllowedAlgorithms(Ikev2VpnProfile.DEFAULT_ALGORITHMS);
startVpnProfilePrivileged(profile, VpnConfig.LEGACY_VPN);
return;
+ case VpnProfile.TYPE_IKEV2_FROM_IKE_TUN_CONN_PARAMS:
+ // All the necessary IKE options should come from IkeTunnelConnectionParams in the
+ // profile.
+ startVpnProfilePrivileged(profile, VpnConfig.LEGACY_VPN);
+ return;
case VpnProfile.TYPE_L2TP_IPSEC_PSK:
racoon = new String[] {
iface, profile.server, "udppsk", profile.ipsecIdentifier,
@@ -2709,10 +2715,23 @@
resetIkeState();
mActiveNetwork = network;
- final IkeSessionParams ikeSessionParams =
- VpnIkev2Utils.buildIkeSessionParams(mContext, mProfile, network);
- final ChildSessionParams childSessionParams =
- VpnIkev2Utils.buildChildSessionParams(mProfile.getAllowedAlgorithms());
+ // Get Ike options from IkeTunnelConnectionParams if it's available in the
+ // profile.
+ final IkeTunnelConnectionParams ikeTunConnParams =
+ mProfile.getIkeTunnelConnectionParams();
+ final IkeSessionParams ikeSessionParams;
+ final ChildSessionParams childSessionParams;
+ if (ikeTunConnParams != null) {
+ final IkeSessionParams.Builder builder = new IkeSessionParams.Builder(
+ ikeTunConnParams.getIkeSessionParams()).setNetwork(network);
+ ikeSessionParams = builder.build();
+ childSessionParams = ikeTunConnParams.getTunnelModeChildSessionParams();
+ } else {
+ ikeSessionParams = VpnIkev2Utils.buildIkeSessionParams(
+ mContext, mProfile, network);
+ childSessionParams = VpnIkev2Utils.buildChildSessionParams(
+ mProfile.getAllowedAlgorithms());
+ }
// TODO: Remove the need for adding two unused addresses with
// IPsec tunnels.
@@ -3233,6 +3252,7 @@
case VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS:
case VpnProfile.TYPE_IKEV2_IPSEC_PSK:
case VpnProfile.TYPE_IKEV2_IPSEC_RSA:
+ case VpnProfile.TYPE_IKEV2_FROM_IKE_TUN_CONN_PARAMS:
if (!mContext.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_IPSEC_TUNNELS)) {
throw new UnsupportedOperationException(
@@ -3406,6 +3426,7 @@
case VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS:
case VpnProfile.TYPE_IKEV2_IPSEC_PSK:
case VpnProfile.TYPE_IKEV2_IPSEC_RSA:
+ case VpnProfile.TYPE_IKEV2_FROM_IKE_TUN_CONN_PARAMS:
mVpnRunner =
new IkeV2VpnRunner(Ikev2VpnProfile.fromVpnProfile(profile));
mVpnRunner.start();
diff --git a/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java b/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java
index d0e39cc..03e18a0 100644
--- a/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java
+++ b/services/core/java/com/android/server/devicestate/DeviceStateManagerService.java
@@ -43,6 +43,7 @@
import android.util.Slog;
import android.util.SparseArray;
+import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.DumpUtils;
@@ -59,7 +60,9 @@
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.Optional;
+import java.util.Set;
import java.util.WeakHashMap;
/**
@@ -139,6 +142,8 @@
@GuardedBy("mLock")
private final SparseArray<ProcessRecord> mProcessRecords = new SparseArray<>();
+ private Set<Integer> mDeviceStatesAvailableForAppRequests;
+
public DeviceStateManagerService(@NonNull Context context) {
this(context, DeviceStatePolicy.Provider
.fromResources(context.getResources())
@@ -164,6 +169,10 @@
public void onStart() {
publishBinderService(Context.DEVICE_STATE_SERVICE, mBinderService);
publishLocalService(DeviceStateManagerInternal.class, new LocalService());
+
+ synchronized (mLock) {
+ readStatesAvailableForRequestFromApps();
+ }
}
@VisibleForTesting
@@ -626,21 +635,78 @@
/**
* Allow top processes to request or cancel a device state change. If the calling process ID is
- * not the top app, then check if this process holds the CONTROL_DEVICE_STATE permission.
- * @param callingPid
+ * not the top app, then check if this process holds the
+ * {@link android.Manifest.permission.CONTROL_DEVICE_STATE} permission. If the calling process
+ * is the top app, check to verify they are requesting a state we've deemed to be able to be
+ * available for an app process to request. States that can be requested are based around
+ * features that we've created that require specific device state overrides.
+ * @param callingPid Process ID that is requesting this state change
+ * @param state state that is being requested.
*/
- private void checkCanControlDeviceState(int callingPid) {
- // Allow top processes to request a device state change
- // If the calling process ID is not the top app, then we check if this process
- // holds a permission to CONTROL_DEVICE_STATE
+ private void assertCanRequestDeviceState(int callingPid, int state) {
+ final WindowProcessController topApp = mActivityTaskManagerInternal.getTopApp();
+ if (topApp == null || topApp.getPid() != callingPid
+ || !isStateAvailableForAppRequests(state)) {
+ getContext().enforceCallingOrSelfPermission(CONTROL_DEVICE_STATE,
+ "Permission required to request device state, "
+ + "or the call must come from the top app "
+ + "and be a device state that is available for apps to request.");
+ }
+ }
+
+ /**
+ * Checks if the process can control the device state. If the calling process ID is
+ * not the top app, then check if this process holds the CONTROL_DEVICE_STATE permission.
+ *
+ * @param callingPid Process ID that is requesting this state change
+ */
+ private void assertCanControlDeviceState(int callingPid) {
final WindowProcessController topApp = mActivityTaskManagerInternal.getTopApp();
if (topApp == null || topApp.getPid() != callingPid) {
getContext().enforceCallingOrSelfPermission(CONTROL_DEVICE_STATE,
"Permission required to request device state, "
- + "or the call must come from the top focused app.");
+ + "or the call must come from the top app.");
}
}
+ private boolean isStateAvailableForAppRequests(int state) {
+ synchronized (mLock) {
+ return mDeviceStatesAvailableForAppRequests.contains(state);
+ }
+ }
+
+ /**
+ * Adds device state values that are available to be requested by the top level app.
+ */
+ @GuardedBy("mLock")
+ private void readStatesAvailableForRequestFromApps() {
+ mDeviceStatesAvailableForAppRequests = new HashSet<>();
+ String[] availableAppStatesConfigIdentifiers = getContext().getResources()
+ .getStringArray(R.array.config_deviceStatesAvailableForAppRequests);
+ for (int i = 0; i < availableAppStatesConfigIdentifiers.length; i++) {
+ String identifierToFetch = availableAppStatesConfigIdentifiers[i];
+ int configValueIdentifier = getContext().getResources()
+ .getIdentifier(identifierToFetch, "integer", "android");
+ int state = getContext().getResources().getInteger(configValueIdentifier);
+ if (isValidState(state)) {
+ mDeviceStatesAvailableForAppRequests.add(state);
+ } else {
+ Slog.e(TAG, "Invalid device state was found in the configuration file. State id: "
+ + state);
+ }
+ }
+ }
+
+ @GuardedBy("mLock")
+ private boolean isValidState(int state) {
+ for (int i = 0; i < mDeviceStates.size(); i++) {
+ if (state == mDeviceStates.valueAt(i).getIdentifier()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private final class DeviceStateProviderListener implements DeviceStateProvider.Listener {
@Override
public void onSupportedDeviceStatesChanged(DeviceState[] newDeviceStates) {
@@ -777,7 +843,7 @@
// Allow top processes to request a device state change
// If the calling process ID is not the top app, then we check if this process
// holds a permission to CONTROL_DEVICE_STATE
- checkCanControlDeviceState(callingPid);
+ assertCanRequestDeviceState(callingPid, state);
if (token == null) {
throw new IllegalArgumentException("Request token must not be null.");
@@ -797,7 +863,7 @@
// Allow top processes to cancel a device state change
// If the calling process ID is not the top app, then we check if this process
// holds a permission to CONTROL_DEVICE_STATE
- checkCanControlDeviceState(callingPid);
+ assertCanControlDeviceState(callingPid);
final long callingIdentity = Binder.clearCallingIdentity();
try {
diff --git a/services/core/java/com/android/server/display/AutomaticBrightnessController.java b/services/core/java/com/android/server/display/AutomaticBrightnessController.java
index 54e83ec..4bba686 100644
--- a/services/core/java/com/android/server/display/AutomaticBrightnessController.java
+++ b/services/core/java/com/android/server/display/AutomaticBrightnessController.java
@@ -46,6 +46,7 @@
import com.android.internal.display.BrightnessSynchronizer;
import com.android.internal.os.BackgroundThread;
import com.android.server.EventLogTags;
+import com.android.server.display.DisplayPowerController.BrightnessEvent;
import java.io.PrintWriter;
@@ -147,6 +148,9 @@
// The currently accepted nominal ambient light level.
private float mAmbientLux;
+ // The last ambient lux value prior to passing the darkening or brightening threshold.
+ private float mPreThresholdLux;
+
// True if mAmbientLux holds a valid value.
private boolean mAmbientLuxValid;
@@ -154,6 +158,9 @@
private float mAmbientBrighteningThreshold;
private float mAmbientDarkeningThreshold;
+ // The last brightness value prior to passing the darkening or brightening threshold.
+ private float mPreThresholdBrightness;
+
// The screen brightness threshold at which to brighten or darken the screen.
private float mScreenBrighteningThreshold;
private float mScreenDarkeningThreshold;
@@ -325,6 +332,21 @@
}
public float getAutomaticScreenBrightness() {
+ return getAutomaticScreenBrightness(null);
+ }
+
+ float getAutomaticScreenBrightness(BrightnessEvent brightnessEvent) {
+ if (brightnessEvent != null) {
+ brightnessEvent.lux =
+ mAmbientLuxValid ? mAmbientLux : PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ brightnessEvent.preThresholdLux = mPreThresholdLux;
+ brightnessEvent.preThresholdBrightness = mPreThresholdBrightness;
+ brightnessEvent.recommendedBrightness = mScreenAutoBrightness;
+ brightnessEvent.flags |= (!mAmbientLuxValid ? BrightnessEvent.FLAG_INVALID_LUX : 0)
+ | (mDisplayPolicy == DisplayPowerRequest.POLICY_DOZE
+ ? BrightnessEvent.FLAG_DOZE_SCALE : 0);
+ }
+
if (!mAmbientLuxValid) {
return PowerManager.BRIGHTNESS_INVALID_FLOAT;
}
@@ -506,6 +528,8 @@
pw.println(" mCurrentLightSensorRate=" + mCurrentLightSensorRate);
pw.println(" mAmbientLux=" + mAmbientLux);
pw.println(" mAmbientLuxValid=" + mAmbientLuxValid);
+ pw.println(" mPreThesholdLux=" + mPreThresholdLux);
+ pw.println(" mPreThesholdBrightness=" + mPreThresholdBrightness);
pw.println(" mAmbientBrighteningThreshold=" + mAmbientBrighteningThreshold);
pw.println(" mAmbientDarkeningThreshold=" + mAmbientDarkeningThreshold);
pw.println(" mScreenBrighteningThreshold=" + mScreenBrighteningThreshold);
@@ -574,7 +598,11 @@
} else if (mLightSensorEnabled) {
mLightSensorEnabled = false;
mAmbientLuxValid = !mResetAmbientLuxAfterWarmUpConfig;
+ if (!mAmbientLuxValid) {
+ mPreThresholdLux = PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ }
mScreenAutoBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ mPreThresholdBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
mRecentLightSamples = 0;
mAmbientLightRingBuffer.clear();
mCurrentLightSensorRate = -1;
@@ -790,6 +818,7 @@
|| (slowAmbientLux <= mAmbientDarkeningThreshold
&& fastAmbientLux <= mAmbientDarkeningThreshold
&& nextDarkenTransition <= time)) {
+ mPreThresholdLux = mAmbientLux;
setAmbientLux(fastAmbientLux);
if (mLoggingEnabled) {
Slog.d(TAG, "updateAmbientLux: "
@@ -834,11 +863,11 @@
// If screenAutoBrightness is set, we should have screen{Brightening,Darkening}Threshold,
// in which case we ignore the new screen brightness if it doesn't differ enough from the
// previous one.
- if (!Float.isNaN(mScreenAutoBrightness)
- && !isManuallySet
+ boolean withinThreshold = !Float.isNaN(mScreenAutoBrightness)
&& newScreenAutoBrightness > mScreenDarkeningThreshold
- && newScreenAutoBrightness < mScreenBrighteningThreshold
- && currentBrightnessWithinAllowedRange) {
+ && newScreenAutoBrightness < mScreenBrighteningThreshold;
+
+ if (withinThreshold && !isManuallySet && currentBrightnessWithinAllowedRange) {
if (mLoggingEnabled) {
Slog.d(TAG, "ignoring newScreenAutoBrightness: "
+ mScreenDarkeningThreshold + " < " + newScreenAutoBrightness
@@ -853,6 +882,9 @@
+ "mScreenAutoBrightness=" + mScreenAutoBrightness + ", "
+ "newScreenAutoBrightness=" + newScreenAutoBrightness);
}
+ if (!withinThreshold) {
+ mPreThresholdBrightness = mScreenAutoBrightness;
+ }
mScreenAutoBrightness = newScreenAutoBrightness;
mScreenBrighteningThreshold = clampScreenBrightness(
mScreenBrightnessThresholds.getBrighteningThreshold(newScreenAutoBrightness));
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index 67268e2..698f41f 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -216,9 +216,6 @@
private final float mScreenBrightnessDefault;
- // Previously logged screen brightness. Used for autobrightness event dumpsys.
- private float mPreviousScreenBrightness = Float.NaN;
-
// The minimum allowed brightness while in VR.
private final float mScreenBrightnessForVrRangeMinimum;
@@ -394,8 +391,11 @@
private final Runnable mOnBrightnessChangeRunnable;
- // Used for keeping record in dumpsys for when and to which brightness auto adaptions were made.
- private RingBuffer<AutobrightnessEvent> mAutobrightnessEventRingBuffer;
+ private final BrightnessEvent mLastBrightnessEvent;
+ private final BrightnessEvent mTempBrightnessEvent;
+
+ // Keeps a record of brightness changes for dumpsys.
+ private RingBuffer<BrightnessEvent> mBrightnessEventRingBuffer;
// A record of state for skipping brightness ramps.
private int mSkipRampState = RAMP_STATE_SKIP_NONE;
@@ -455,6 +455,8 @@
// PowerManager.BRIGHTNESS_INVALID_FLOAT when there's no temporary adjustment set.
private float mTemporaryAutoBrightnessAdjustment;
+ private boolean mIsRbcActive;
+
// Animators.
private ObjectAnimator mColorFadeOnAnimator;
private ObjectAnimator mColorFadeOffAnimator;
@@ -481,6 +483,8 @@
mUniqueDisplayId = logicalDisplay.getPrimaryDisplayDeviceLocked().getUniqueId();
mDisplayStatsId = mUniqueDisplayId.hashCode();
mHandler = new DisplayControllerHandler(handler.getLooper());
+ mLastBrightnessEvent = new BrightnessEvent(mDisplayId);
+ mTempBrightnessEvent = new BrightnessEvent(mDisplayId);
if (mDisplayId == Display.DEFAULT_DISPLAY) {
mBatteryStats = BatteryStatsService.getService();
@@ -634,8 +638,8 @@
for (int i = 0; i < mNitsRange.length; i++) {
adjustedNits[i] = mCdsi.getReduceBrightColorsAdjustedBrightnessNits(mNitsRange[i]);
}
- mAutomaticBrightnessController.recalculateSplines(mCdsi.isReduceBrightColorsActivated(),
- adjustedNits);
+ mIsRbcActive = mCdsi.isReduceBrightColorsActivated();
+ mAutomaticBrightnessController.recalculateSplines(mIsRbcActive, adjustedNits);
// If rbc is turned on, off or there is a change in strength, we want to reset the short
@@ -991,8 +995,8 @@
mDisplayDeviceConfig.getAmbientHorizonShort(),
mDisplayDeviceConfig.getAmbientHorizonLong());
- mAutobrightnessEventRingBuffer =
- new RingBuffer<>(AutobrightnessEvent.class, RINGBUFFER_MAX);
+ mBrightnessEventRingBuffer =
+ new RingBuffer<>(BrightnessEvent.class, RINGBUFFER_MAX);
} else {
mUseSoftwareAutoBrightnessConfig = false;
}
@@ -1088,6 +1092,7 @@
boolean mustInitialize = false;
int brightnessAdjustmentFlags = 0;
mBrightnessReasonTemp.set(null);
+ mTempBrightnessEvent.reset();
synchronized (mLock) {
if (mStopped) {
return;
@@ -1314,7 +1319,8 @@
if (Float.isNaN(brightnessState)) {
float newAutoBrightnessAdjustment = autoBrightnessAdjustment;
if (autoBrightnessEnabled) {
- brightnessState = mAutomaticBrightnessController.getAutomaticScreenBrightness();
+ brightnessState = mAutomaticBrightnessController.getAutomaticScreenBrightness(
+ mTempBrightnessEvent);
newAutoBrightnessAdjustment =
mAutomaticBrightnessController.getAutomaticScreenBrightnessAdjustment();
}
@@ -1376,6 +1382,7 @@
// we broadcast this change through setting.
final float unthrottledBrightnessState = brightnessState;
if (mBrightnessThrottler.isThrottled()) {
+ mTempBrightnessEvent.thermalMax = mBrightnessThrottler.getBrightnessCap();
brightnessState = Math.min(brightnessState, mBrightnessThrottler.getBrightnessCap());
mBrightnessReasonTemp.addModifier(BrightnessReason.MODIFIER_THROTTLED);
if (!mAppliedThrottling) {
@@ -1567,13 +1574,35 @@
Slog.v(TAG, "Brightness [" + brightnessState + "] manual adjustment.");
}
- // Add any automatic changes to autobrightness ringbuffer for dumpsys.
- if (mBrightnessReason.reason == BrightnessReason.REASON_AUTOMATIC
- && !BrightnessSynchronizer.floatEquals(
- mPreviousScreenBrightness, brightnessState)) {
- mPreviousScreenBrightness = brightnessState;
- mAutobrightnessEventRingBuffer.append(new AutobrightnessEvent(
- System.currentTimeMillis(), brightnessState));
+
+ // Log brightness events when a detail of significance has changed. Generally this is the
+ // brightness itself changing, but also includes data like HBM cap, thermal throttling
+ // brightness cap, RBC state, etc.
+ mTempBrightnessEvent.time = System.currentTimeMillis();
+ mTempBrightnessEvent.brightness = brightnessState;
+ mTempBrightnessEvent.reason.set(mBrightnessReason);
+ mTempBrightnessEvent.hbmMax = mHbmController.getCurrentBrightnessMax();
+ mTempBrightnessEvent.hbmMode = mHbmController.getHighBrightnessMode();
+ mTempBrightnessEvent.flags |= (mIsRbcActive ? BrightnessEvent.FLAG_RBC : 0);
+ // Temporary is what we use during slider interactions. We avoid logging those so that
+ // we don't spam logcat when the slider is being used.
+ boolean tempToTempTransition =
+ mTempBrightnessEvent.reason.reason == BrightnessReason.REASON_TEMPORARY
+ && mLastBrightnessEvent.reason.reason == BrightnessReason.REASON_TEMPORARY;
+ if ((!mTempBrightnessEvent.equalsMainData(mLastBrightnessEvent) && !tempToTempTransition)
+ || brightnessAdjustmentFlags != 0) {
+ mLastBrightnessEvent.copyFrom(mTempBrightnessEvent);
+ BrightnessEvent newEvent = new BrightnessEvent(mTempBrightnessEvent);
+
+ // Adjustment flags (and user-set flag) only get added after the equality checks since
+ // they are transient.
+ newEvent.adjustmentFlags = brightnessAdjustmentFlags;
+ newEvent.flags |= (userSetBrightnessChanged ? BrightnessEvent.FLAG_USER_SET : 0);
+ Slog.i(TAG, newEvent.toString(/* includeTime= */ false));
+
+ if (mBrightnessEventRingBuffer != null) {
+ mBrightnessEventRingBuffer.append(newEvent);
+ }
}
// Update display white-balance.
@@ -2482,6 +2511,7 @@
pw.println(" mPendingScreenOff=" + mPendingScreenOff);
pw.println(" mReportedToPolicy="
+ reportedToPolicyToString(mReportedScreenStateToPolicy));
+ pw.println(" mIsRbcActive=" + mIsRbcActive);
if (mScreenBrightnessRampAnimator != null) {
pw.println(" mScreenBrightnessRampAnimator.isAnimating()="
@@ -2503,7 +2533,7 @@
if (mAutomaticBrightnessController != null) {
mAutomaticBrightnessController.dump(pw);
- dumpAutobrightnessEvents(pw);
+ dumpBrightnessEvents(pw);
}
if (mHbmController != null) {
@@ -2560,16 +2590,16 @@
}
}
- private void dumpAutobrightnessEvents(PrintWriter pw) {
- int size = mAutobrightnessEventRingBuffer.size();
+ private void dumpBrightnessEvents(PrintWriter pw) {
+ int size = mBrightnessEventRingBuffer.size();
if (size < 1) {
pw.println("No Automatic Brightness Adjustments");
return;
}
pw.println("Automatic Brightness Adjustments Last " + size + " Events: ");
- AutobrightnessEvent[] eventArray = mAutobrightnessEventRingBuffer.toArray();
- for (int i = 0; i < mAutobrightnessEventRingBuffer.size(); i++) {
+ BrightnessEvent[] eventArray = mBrightnessEventRingBuffer.toArray();
+ for (int i = 0; i < mBrightnessEventRingBuffer.size(); i++) {
pw.println(" " + eventArray[i].toString());
}
}
@@ -2646,18 +2676,115 @@
}
}
- private static class AutobrightnessEvent {
- final long mTime;
- final float mBrightness;
+ class BrightnessEvent {
+ static final int FLAG_RBC = 0x1;
+ static final int FLAG_INVALID_LUX = 0x2;
+ static final int FLAG_DOZE_SCALE = 0x3;
+ static final int FLAG_USER_SET = 0x4;
- AutobrightnessEvent(long time, float brightness) {
- mTime = time;
- mBrightness = brightness;
+ public final BrightnessReason reason = new BrightnessReason();
+
+ public int displayId;
+ public float lux;
+ public float preThresholdLux;
+ public long time;
+ public float brightness;
+ public float recommendedBrightness;
+ public float preThresholdBrightness;
+ public float hbmMax;
+ public float thermalMax;
+ public int hbmMode;
+ public int flags;
+ public int adjustmentFlags;
+
+ BrightnessEvent(BrightnessEvent that) {
+ copyFrom(that);
+ }
+
+ BrightnessEvent(int displayId) {
+ this.displayId = displayId;
+ reset();
+ }
+
+ void copyFrom(BrightnessEvent that) {
+ displayId = that.displayId;
+ time = that.time;
+ lux = that.lux;
+ preThresholdLux = that.preThresholdLux;
+ brightness = that.brightness;
+ recommendedBrightness = that.recommendedBrightness;
+ preThresholdBrightness = that.preThresholdBrightness;
+ hbmMax = that.hbmMax;
+ thermalMax = that.thermalMax;
+ flags = that.flags;
+ hbmMode = that.hbmMode;
+ reason.set(that.reason);
+ adjustmentFlags = that.adjustmentFlags;
+ }
+
+ void reset() {
+ time = SystemClock.uptimeMillis();
+ brightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ recommendedBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ lux = 0;
+ preThresholdLux = 0;
+ preThresholdBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ hbmMax = PowerManager.BRIGHTNESS_MAX;
+ thermalMax = PowerManager.BRIGHTNESS_MAX;
+ flags = 0;
+ hbmMode = BrightnessInfo.HIGH_BRIGHTNESS_MODE_OFF;
+ reason.set(null);
+ adjustmentFlags = 0;
+ }
+
+ boolean equalsMainData(BrightnessEvent that) {
+ // This equals comparison purposefully ignores time since it is regularly changing and
+ // we don't want to log a brightness event just because the time changed.
+ return displayId == that.displayId
+ && Float.floatToRawIntBits(brightness)
+ == Float.floatToRawIntBits(that.brightness)
+ && Float.floatToRawIntBits(recommendedBrightness)
+ == Float.floatToRawIntBits(that.recommendedBrightness)
+ && Float.floatToRawIntBits(preThresholdBrightness)
+ == Float.floatToRawIntBits(that.preThresholdBrightness)
+ && Float.floatToRawIntBits(lux) == Float.floatToRawIntBits(that.lux)
+ && Float.floatToRawIntBits(preThresholdLux)
+ == Float.floatToRawIntBits(that.preThresholdLux)
+ && Float.floatToRawIntBits(hbmMax) == Float.floatToRawIntBits(that.hbmMax)
+ && hbmMode == that.hbmMode
+ && Float.floatToRawIntBits(thermalMax)
+ == Float.floatToRawIntBits(that.thermalMax)
+ && flags == that.flags
+ && adjustmentFlags == that.adjustmentFlags
+ && reason.equals(that.reason);
+ }
+
+ public String toString(boolean includeTime) {
+ return (includeTime ? TimeUtils.formatForLogging(time) + " - " : "")
+ + "BrightnessEvent: "
+ + "disp=" + displayId
+ + ", brt=" + brightness + ((flags & FLAG_USER_SET) != 0 ? "(user_set)" : "")
+ + ", rcmdBrt=" + recommendedBrightness
+ + ", preBrt=" + preThresholdBrightness
+ + ", lux=" + lux
+ + ", preLux=" + preThresholdLux
+ + ", hbmMax=" + hbmMax
+ + ", hbmMode=" + BrightnessInfo.hbmToString(hbmMode)
+ + ", thrmMax=" + thermalMax
+ + ", flags=" + flagsToString()
+ + ", reason=" + reason.toString(adjustmentFlags);
}
@Override
public String toString() {
- return TimeUtils.formatForLogging(mTime) + " - Brightness: " + mBrightness;
+ return toString(/* includeTime */ true);
+ }
+
+ private String flagsToString() {
+ return ((flags & FLAG_USER_SET) != 0 ? "user_set " : "")
+ + ((flags & FLAG_RBC) != 0 ? "rbc " : "")
+ + ((flags & FLAG_INVALID_LUX) != 0 ? "invalid_lux " : "")
+ + ((flags & FLAG_DOZE_SCALE) != 0 ? "doze_scale " : "");
}
}
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 982ac3c..fa2f500 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -22,6 +22,8 @@
import android.app.ActivityThread;
import android.content.Context;
import android.content.res.Resources;
+import android.graphics.Point;
+import android.hardware.display.DisplayManager;
import android.hardware.sidekick.SidekickInternal;
import android.os.Build;
import android.os.Handler;
@@ -677,11 +679,16 @@
if (DisplayCutout.getMaskBuiltInDisplayCutout(res, mInfo.uniqueId)) {
mInfo.flags |= DisplayDeviceInfo.FLAG_MASK_DISPLAY_CUTOUT;
}
+
+ final Point stableDisplaySize = getOverlayContext()
+ .getSystemService(DisplayManager.class).getStableDisplaySize();
mInfo.displayCutout = DisplayCutout.fromResourcesRectApproximation(res,
- mInfo.uniqueId, mInfo.width, mInfo.height);
+ mInfo.uniqueId, stableDisplaySize.x, stableDisplaySize.y, mInfo.width,
+ mInfo.height);
mInfo.roundedCorners = RoundedCorners.fromResources(
- res, mInfo.uniqueId, mInfo.width, mInfo.height);
+ res, mInfo.uniqueId, stableDisplaySize.x, stableDisplaySize.y, mInfo.width,
+ mInfo.height);
mInfo.installOrientation = mStaticDisplayInfo.installOrientation;
if (mStaticDisplayInfo.isInternal) {
diff --git a/services/core/java/com/android/server/dreams/DreamController.java b/services/core/java/com/android/server/dreams/DreamController.java
index 4a1a950..4e4f454 100644
--- a/services/core/java/com/android/server/dreams/DreamController.java
+++ b/services/core/java/com/android/server/dreams/DreamController.java
@@ -140,7 +140,6 @@
intent.setComponent(name);
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
intent.putExtra(DreamService.EXTRA_DREAM_OVERLAY_COMPONENT, overlayComponentName);
- intent.putExtra(DreamService.EXTRA_IS_PREVIEW, isPreviewMode);
try {
if (!mContext.bindServiceAsUser(intent, mCurrentDream,
Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE,
diff --git a/services/core/java/com/android/server/infra/AbstractMasterSystemService.java b/services/core/java/com/android/server/infra/AbstractMasterSystemService.java
index 34e3ce1..b813995 100644
--- a/services/core/java/com/android/server/infra/AbstractMasterSystemService.java
+++ b/services/core/java/com/android/server/infra/AbstractMasterSystemService.java
@@ -948,7 +948,7 @@
pw.println(": ");
final List<S> services = mServicesCacheList.valueAt(i);
for (int j = 0; j < services.size(); j++) {
- S service = services.get(i);
+ S service = services.get(j);
synchronized (service.mLock) {
service.dumpLocked(prefix2, pw);
}
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
index 0de523c..c4ff4ac 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
@@ -313,6 +313,7 @@
mSupportsStylusHw);
mService.scheduleNotifyImeUidToAudioService(mCurMethodUid);
mService.reRequestCurrentClientSessionLocked();
+ mService.performOnCreateInlineSuggestionsRequestLocked();
}
// reset Handwriting event receiver.
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java
index a2d3588..b978131 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java
@@ -24,9 +24,9 @@
import android.view.inputmethod.InlineSuggestionsRequest;
import android.view.inputmethod.InputMethodInfo;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
import com.android.internal.inputmethod.SoftInputShowHideReason;
import com.android.internal.view.IInlineSuggestionsRequestCallback;
-import com.android.internal.view.IInputMethodSession;
import com.android.internal.view.InlineSuggestionsRequestInfo;
import com.android.server.LocalServices;
@@ -164,7 +164,7 @@
* @param session The session passed back from the accessibility service.
*/
public abstract void onSessionForAccessibilityCreated(int accessibilityConnectionId,
- IInputMethodSession session);
+ IAccessibilityInputMethodSession session);
/**
* Unbind the accessibility service with the specified accessibilityConnectionId from current
@@ -240,7 +240,7 @@
@Override
public void onSessionForAccessibilityCreated(int accessibilityConnectionId,
- IInputMethodSession session) {
+ IAccessibilityInputMethodSession session) {
}
@Override
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 3c31405..ce8b9fa 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -155,8 +155,10 @@
import com.android.internal.content.PackageMonitor;
import com.android.internal.infra.AndroidFuture;
import com.android.internal.inputmethod.DirectBootAwareness;
+import com.android.internal.inputmethod.IAccessibilityInputMethodSession;
import com.android.internal.inputmethod.IInputContentUriToken;
import com.android.internal.inputmethod.IInputMethodPrivilegedOperations;
+import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
import com.android.internal.inputmethod.ImeTracing;
import com.android.internal.inputmethod.InputBindResult;
import com.android.internal.inputmethod.InputMethodDebug;
@@ -286,6 +288,30 @@
@NonNull
private final Set<String> mNonPreemptibleInputMethods;
+ private static final class CreateInlineSuggestionsRequest {
+ @NonNull final InlineSuggestionsRequestInfo mRequestInfo;
+ @NonNull final IInlineSuggestionsRequestCallback mCallback;
+ @NonNull final String mPackageName;
+
+ CreateInlineSuggestionsRequest(
+ @NonNull InlineSuggestionsRequestInfo requestInfo,
+ @NonNull IInlineSuggestionsRequestCallback callback,
+ @NonNull String packageName) {
+ mRequestInfo = requestInfo;
+ mCallback = callback;
+ mPackageName = packageName;
+ }
+ }
+
+ /**
+ * If a request to create inline autofill suggestions comes in while the IME is unbound
+ * due to {@link #mPreventImeStartupUnlessTextEditor}, this is where it is stored, so
+ * that it may be fulfilled once the IME rebinds.
+ */
+ @GuardedBy("ImfLock.class")
+ @Nullable
+ private CreateInlineSuggestionsRequest mPendingInlineSuggestionsRequest;
+
@UserIdInt
private int mLastSwitchUserId;
@@ -398,7 +424,7 @@
// Id of the accessibility service.
final int mId;
- public IInputMethodSession mSession;
+ public IAccessibilityInputMethodSession mSession;
@Override
public String toString() {
@@ -410,7 +436,7 @@
}
AccessibilitySessionState(ClientState client, int id,
- IInputMethodSession session) {
+ IAccessibilityInputMethodSession session) {
mClient = client;
mId = id;
mSession = session;
@@ -590,6 +616,11 @@
IInputContext mCurInputContext;
/**
+ * The {@link IRemoteAccessibilityInputConnection} last provided by the current client.
+ */
+ @Nullable IRemoteAccessibilityInputConnection mCurRemoteAccessibilityInputConnection;
+
+ /**
* The attributes last provided by the current client.
*/
EditorInfo mCurAttribute;
@@ -2137,16 +2168,24 @@
private void onCreateInlineSuggestionsRequestLocked(@UserIdInt int userId,
InlineSuggestionsRequestInfo requestInfo, IInlineSuggestionsRequestCallback callback,
boolean touchExplorationEnabled) {
+ clearPendingInlineSuggestionsRequestLocked();
final InputMethodInfo imi = mMethodMap.get(getSelectedMethodIdLocked());
try {
- IInputMethodInvoker curMethod = getCurMethodLocked();
- if (userId == mSettings.getCurrentUserId() && curMethod != null
+ if (userId == mSettings.getCurrentUserId()
&& imi != null && isInlineSuggestionsEnabled(imi, touchExplorationEnabled)) {
- final IInlineSuggestionsRequestCallback callbackImpl =
- new InlineSuggestionsRequestCallbackDecorator(callback,
- imi.getPackageName(), mCurTokenDisplayId, getCurTokenLocked(),
- this);
- curMethod.onCreateInlineSuggestionsRequest(requestInfo, callbackImpl);
+ mPendingInlineSuggestionsRequest = new CreateInlineSuggestionsRequest(
+ requestInfo, callback, imi.getPackageName());
+ if (getCurMethodLocked() != null) {
+ // In the normal case when the IME is connected, we can make the request here.
+ performOnCreateInlineSuggestionsRequestLocked();
+ } else {
+ // Otherwise, the next time the IME connection is established,
+ // InputMethodBindingController.mMainConnection#onServiceConnected() will call
+ // into #performOnCreateInlineSuggestionsRequestLocked() to make the request.
+ if (DEBUG) {
+ Slog.d(TAG, "IME not connected. Delaying inline suggestions request.");
+ }
+ }
} else {
callback.onInlineSuggestionsUnsupported();
}
@@ -2155,6 +2194,34 @@
}
}
+ @GuardedBy("ImfLock.class")
+ void performOnCreateInlineSuggestionsRequestLocked() {
+ if (mPendingInlineSuggestionsRequest == null) {
+ return;
+ }
+ IInputMethodInvoker curMethod = getCurMethodLocked();
+ if (DEBUG) {
+ Slog.d(TAG, "Performing onCreateInlineSuggestionsRequest. mCurMethod = " + curMethod);
+ }
+ if (curMethod != null) {
+ final IInlineSuggestionsRequestCallback callback =
+ new InlineSuggestionsRequestCallbackDecorator(
+ mPendingInlineSuggestionsRequest.mCallback,
+ mPendingInlineSuggestionsRequest.mPackageName,
+ mCurTokenDisplayId, getCurTokenLocked(), this);
+ curMethod.onCreateInlineSuggestionsRequest(
+ mPendingInlineSuggestionsRequest.mRequestInfo, callback);
+ } else {
+ Slog.w(TAG, "No IME connected! Abandoning inline suggestions creation request.");
+ }
+ clearPendingInlineSuggestionsRequestLocked();
+ }
+
+ @GuardedBy("ImfLock.class")
+ private void clearPendingInlineSuggestionsRequestLocked() {
+ mPendingInlineSuggestionsRequest = null;
+ }
+
private static boolean isInlineSuggestionsEnabled(InputMethodInfo imi,
boolean touchExplorationEnabled) {
return imi.isInlineSuggestionsEnabled()
@@ -2567,7 +2634,7 @@
final InputMethodInfo curInputMethodInfo = mMethodMap.get(curId);
final boolean suppressesSpellChecker =
curInputMethodInfo != null && curInputMethodInfo.suppressesSpellChecker();
- final SparseArray<IInputMethodSession> accessibilityInputMethodSessions =
+ final SparseArray<IAccessibilityInputMethodSession> accessibilityInputMethodSessions =
createAccessibilityInputMethodSessions(mCurClient.mAccessibilitySessions);
return new InputBindResult(InputBindResult.ResultCode.SUCCESS_WITH_IME_SESSION,
session.session, accessibilityInputMethodSessions,
@@ -2606,7 +2673,7 @@
InputBindResult attachNewAccessibilityLocked(@StartInputReason int startInputReason,
boolean initial, int id) {
if (!mBoundToAccessibility) {
- AccessibilityManagerInternal.get().bindInput(mCurClient.binding);
+ AccessibilityManagerInternal.get().bindInput();
mBoundToAccessibility = true;
}
@@ -2620,14 +2687,14 @@
if (startInputReason != StartInputReason.SESSION_CREATED_BY_ACCESSIBILITY) {
final Binder startInputToken = new Binder();
setEnabledSessionForAccessibilityLocked(mCurClient.mAccessibilitySessions);
- AccessibilityManagerInternal.get().startInput(startInputToken, mCurInputContext,
+ AccessibilityManagerInternal.get().startInput(mCurRemoteAccessibilityInputConnection,
mCurAttribute, !initial /* restarting */);
}
if (accessibilitySession != null) {
final SessionState session = mCurClient.curSession;
IInputMethodSession imeSession = session == null ? null : session.session;
- final SparseArray<IInputMethodSession> accessibilityInputMethodSessions =
+ final SparseArray<IAccessibilityInputMethodSession> accessibilityInputMethodSessions =
createAccessibilityInputMethodSessions(mCurClient.mAccessibilitySessions);
return new InputBindResult(
InputBindResult.ResultCode.SUCCESS_WITH_ACCESSIBILITY_SESSION,
@@ -2638,9 +2705,9 @@
return null;
}
- private SparseArray<IInputMethodSession> createAccessibilityInputMethodSessions(
+ private SparseArray<IAccessibilityInputMethodSession> createAccessibilityInputMethodSessions(
SparseArray<AccessibilitySessionState> accessibilitySessions) {
- final SparseArray<IInputMethodSession> accessibilityInputMethodSessions =
+ final SparseArray<IAccessibilityInputMethodSession> accessibilityInputMethodSessions =
new SparseArray<>();
if (accessibilitySessions != null) {
for (int i = 0; i < accessibilitySessions.size(); i++) {
@@ -2662,8 +2729,10 @@
@GuardedBy("ImfLock.class")
@NonNull
private InputBindResult startInputUncheckedLocked(@NonNull ClientState cs,
- IInputContext inputContext, @NonNull EditorInfo attribute,
- @StartInputFlags int startInputFlags, @StartInputReason int startInputReason,
+ IInputContext inputContext,
+ @Nullable IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
+ @NonNull EditorInfo attribute, @StartInputFlags int startInputFlags,
+ @StartInputReason int startInputReason,
int unverifiedTargetSdkVersion) {
// If no method is currently selected, do nothing.
final String selectedMethodId = getSelectedMethodIdLocked();
@@ -2707,6 +2776,7 @@
advanceSequenceNumberLocked();
mCurClient = cs;
mCurInputContext = inputContext;
+ mCurRemoteAccessibilityInputConnection = remoteAccessibilityInputConnection;
mCurVirtualDisplayToScreenMatrix =
getVirtualDisplayToScreenMatrixLocked(cs.selfReportedDisplayId,
mDisplayIdToShowIme);
@@ -3709,10 +3779,11 @@
@StartInputReason int startInputReason, IInputMethodClient client, IBinder windowToken,
@StartInputFlags int startInputFlags, @SoftInputModeFlags int softInputMode,
int windowFlags, @Nullable EditorInfo attribute, IInputContext inputContext,
+ IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
int unverifiedTargetSdkVersion) {
return startInputOrWindowGainedFocusInternal(startInputReason, client, windowToken,
startInputFlags, softInputMode, windowFlags, attribute, inputContext,
- unverifiedTargetSdkVersion);
+ remoteAccessibilityInputConnection, unverifiedTargetSdkVersion);
}
@NonNull
@@ -3720,6 +3791,7 @@
@StartInputReason int startInputReason, IInputMethodClient client, IBinder windowToken,
@StartInputFlags int startInputFlags, @SoftInputModeFlags int softInputMode,
int windowFlags, @Nullable EditorInfo attribute, @Nullable IInputContext inputContext,
+ @Nullable IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
int unverifiedTargetSdkVersion) {
if (windowToken == null) {
Slog.e(TAG, "windowToken cannot be null.");
@@ -3756,7 +3828,8 @@
try {
result = startInputOrWindowGainedFocusInternalLocked(startInputReason,
client, windowToken, startInputFlags, softInputMode, windowFlags,
- attribute, inputContext, unverifiedTargetSdkVersion, userId);
+ attribute, inputContext, remoteAccessibilityInputConnection,
+ unverifiedTargetSdkVersion, userId);
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -3782,7 +3855,9 @@
@StartInputReason int startInputReason, IInputMethodClient client,
@NonNull IBinder windowToken, @StartInputFlags int startInputFlags,
@SoftInputModeFlags int softInputMode, int windowFlags, EditorInfo attribute,
- IInputContext inputContext, int unverifiedTargetSdkVersion, @UserIdInt int userId) {
+ IInputContext inputContext,
+ @Nullable IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
+ int unverifiedTargetSdkVersion, @UserIdInt int userId) {
if (DEBUG) {
Slog.v(TAG, "startInputOrWindowGainedFocusInternalLocked: reason="
+ InputMethodDebug.startInputReasonToString(startInputReason)
@@ -3875,7 +3950,8 @@
+ InputMethodDebug.startInputReasonToString(startInputReason));
}
if (attribute != null) {
- return startInputUncheckedLocked(cs, inputContext, attribute, startInputFlags,
+ return startInputUncheckedLocked(cs, inputContext,
+ remoteAccessibilityInputConnection, attribute, startInputFlags,
startInputReason, unverifiedTargetSdkVersion);
}
return new InputBindResult(
@@ -3916,8 +3992,8 @@
// UI for input.
if (isTextEditor && attribute != null
&& shouldRestoreImeVisibility(windowToken, softInputMode)) {
- res = startInputUncheckedLocked(cs, inputContext, attribute, startInputFlags,
- startInputReason, unverifiedTargetSdkVersion);
+ res = startInputUncheckedLocked(cs, inputContext, remoteAccessibilityInputConnection,
+ attribute, startInputFlags, startInputReason, unverifiedTargetSdkVersion);
showCurrentInputLocked(windowToken, InputMethodManager.SHOW_IMPLICIT, null,
SoftInputShowHideReason.SHOW_RESTORE_IME_VISIBILITY);
return res;
@@ -3955,8 +4031,9 @@
// is more room for the target window + IME.
if (DEBUG) Slog.v(TAG, "Unspecified window will show input");
if (attribute != null) {
- res = startInputUncheckedLocked(cs, inputContext, attribute,
- startInputFlags, startInputReason, unverifiedTargetSdkVersion);
+ res = startInputUncheckedLocked(cs, inputContext,
+ remoteAccessibilityInputConnection, attribute, startInputFlags,
+ startInputReason, unverifiedTargetSdkVersion);
didStart = true;
}
showCurrentInputLocked(windowToken, InputMethodManager.SHOW_IMPLICIT, null,
@@ -3986,8 +4063,9 @@
if (isSoftInputModeStateVisibleAllowed(
unverifiedTargetSdkVersion, startInputFlags)) {
if (attribute != null) {
- res = startInputUncheckedLocked(cs, inputContext, attribute,
- startInputFlags, startInputReason, unverifiedTargetSdkVersion);
+ res = startInputUncheckedLocked(cs, inputContext,
+ remoteAccessibilityInputConnection, attribute, startInputFlags,
+ startInputReason, unverifiedTargetSdkVersion);
didStart = true;
}
showCurrentInputLocked(windowToken, InputMethodManager.SHOW_IMPLICIT, null,
@@ -4005,8 +4083,9 @@
unverifiedTargetSdkVersion, startInputFlags)) {
if (!sameWindowFocused) {
if (attribute != null) {
- res = startInputUncheckedLocked(cs, inputContext, attribute,
- startInputFlags, startInputReason, unverifiedTargetSdkVersion);
+ res = startInputUncheckedLocked(cs, inputContext,
+ remoteAccessibilityInputConnection, attribute, startInputFlags,
+ startInputReason, unverifiedTargetSdkVersion);
didStart = true;
}
showCurrentInputLocked(windowToken, InputMethodManager.SHOW_IMPLICIT, null,
@@ -4034,7 +4113,8 @@
SoftInputShowHideReason.HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR);
}
}
- res = startInputUncheckedLocked(cs, inputContext, attribute, startInputFlags,
+ res = startInputUncheckedLocked(cs, inputContext,
+ remoteAccessibilityInputConnection, attribute, startInputFlags,
startInputReason, unverifiedTargetSdkVersion);
} else {
res = InputBindResult.NULL_EDITOR_INFO;
@@ -4790,7 +4870,7 @@
void setEnabledSessionForAccessibilityLocked(
SparseArray<AccessibilitySessionState> accessibilitySessions) {
// mEnabledAccessibilitySessions could the same object as accessibilitySessions.
- SparseArray<IInputMethodSession> disabledSessions = new SparseArray<>();
+ SparseArray<IAccessibilityInputMethodSession> disabledSessions = new SparseArray<>();
for (int i = 0; i < mEnabledAccessibilitySessions.size(); i++) {
if (!accessibilitySessions.contains(mEnabledAccessibilitySessions.keyAt(i))) {
AccessibilitySessionState sessionState = mEnabledAccessibilitySessions.valueAt(i);
@@ -4804,7 +4884,7 @@
AccessibilityManagerInternal.get().setImeSessionEnabled(disabledSessions,
false);
}
- SparseArray<IInputMethodSession> enabledSessions = new SparseArray<>();
+ SparseArray<IAccessibilityInputMethodSession> enabledSessions = new SparseArray<>();
for (int i = 0; i < accessibilitySessions.size(); i++) {
if (!mEnabledAccessibilitySessions.contains(accessibilitySessions.keyAt(i))) {
AccessibilitySessionState sessionState = accessibilitySessions.valueAt(i);
@@ -5649,7 +5729,7 @@
@Override
public void onSessionForAccessibilityCreated(int accessibilityConnectionId,
- IInputMethodSession session) {
+ IAccessibilityInputMethodSession session) {
synchronized (ImfLock.class) {
if (mCurClient != null) {
clearClientSessionForAccessibilityLocked(mCurClient, accessibilityConnectionId);
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
index de8e06a..111621d 100644
--- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
@@ -1058,31 +1058,35 @@
}
int msgVersion = 0;
- int callbacksCount = mCallbacksList.beginBroadcast();
- if (DEBUG_LOG_ENABLED) {
- Log.v(TAG, "Sending message " + msgType + " version " + msgVersion + " from hubHandle "
- + contextHubHandle + ", appInstance " + appInstance + ", callBackCount "
- + callbacksCount);
- }
-
- if (callbacksCount < 1) {
+ // Synchronize access to mCallbacksList to prevent more than one outstanding broadcast as
+ // that will cause a crash.
+ synchronized (mCallbacksList) {
+ int callbacksCount = mCallbacksList.beginBroadcast();
if (DEBUG_LOG_ENABLED) {
- Log.v(TAG, "No message callbacks registered.");
+ Log.v(TAG, "Sending message " + msgType + " version " + msgVersion
+ + " from hubHandle " + contextHubHandle + ", appInstance " + appInstance
+ + ", callBackCount " + callbacksCount);
}
- return 0;
- }
- ContextHubMessage msg = new ContextHubMessage(msgType, msgVersion, data);
- for (int i = 0; i < callbacksCount; ++i) {
- IContextHubCallback callback = mCallbacksList.getBroadcastItem(i);
- try {
- callback.onMessageReceipt(contextHubHandle, appInstance, msg);
- } catch (RemoteException e) {
- Log.i(TAG, "Exception (" + e + ") calling remote callback (" + callback + ").");
- continue;
+ if (callbacksCount < 1) {
+ if (DEBUG_LOG_ENABLED) {
+ Log.v(TAG, "No message callbacks registered.");
+ }
+ return 0;
}
+
+ ContextHubMessage msg = new ContextHubMessage(msgType, msgVersion, data);
+ for (int i = 0; i < callbacksCount; ++i) {
+ IContextHubCallback callback = mCallbacksList.getBroadcastItem(i);
+ try {
+ callback.onMessageReceipt(contextHubHandle, appInstance, msg);
+ } catch (RemoteException e) {
+ Log.i(TAG, "Exception (" + e + ") calling remote callback (" + callback + ").");
+ continue;
+ }
+ }
+ mCallbacksList.finishBroadcast();
}
- mCallbacksList.finishBroadcast();
return 0;
}
diff --git a/services/core/java/com/android/server/location/gnss/NtpTimeHelper.java b/services/core/java/com/android/server/location/gnss/NtpTimeHelper.java
index 4a66516..8732065 100644
--- a/services/core/java/com/android/server/location/gnss/NtpTimeHelper.java
+++ b/services/core/java/com/android/server/location/gnss/NtpTimeHelper.java
@@ -73,7 +73,6 @@
private final WakeLock mWakeLock;
private final Handler mHandler;
- @GuardedBy("this")
private final InjectNtpTimeCallback mCallback;
// flags to trigger NTP when network becomes available
@@ -129,6 +128,8 @@
return;
}
if (!isNetworkConnected()) {
+ // try to inject the cached NTP time
+ injectCachedNtpTime();
// try again when network is up
mInjectNtpTimeState = STATE_PENDING_NETWORK;
return;
@@ -157,23 +158,7 @@
// only update when NTP time is fresh
// If refreshSuccess is false, cacheAge does not drop down.
- ntpResult = mNtpTime.getCachedTimeResult();
- if (ntpResult != null && ntpResult.getAgeMillis() < NTP_INTERVAL) {
- long time = ntpResult.getTimeMillis();
- long timeReference = ntpResult.getElapsedRealtimeMillis();
- long certainty = ntpResult.getCertaintyMillis();
-
- if (DEBUG) {
- long now = System.currentTimeMillis();
- Log.d(TAG, "NTP server returned: "
- + time + " (" + new Date(time) + ")"
- + " ntpResult: " + ntpResult
- + " system time offset: " + (time - now));
- }
-
- // Ok to cast to int, as can't rollover in practice
- mHandler.post(() -> mCallback.injectTime(time, timeReference, (int) certainty));
-
+ if (injectCachedNtpTime()) {
delay = NTP_INTERVAL;
mNtpBackOff.reset();
} else {
@@ -201,4 +186,26 @@
// release wake lock held by task
mWakeLock.release();
}
+
+ /** Returns true if successfully inject cached NTP time. */
+ private synchronized boolean injectCachedNtpTime() {
+ NtpTrustedTime.TimeResult ntpResult = mNtpTime.getCachedTimeResult();
+ if (ntpResult == null || ntpResult.getAgeMillis() >= NTP_INTERVAL) {
+ return false;
+ }
+
+ long time = ntpResult.getTimeMillis();
+ long timeReference = ntpResult.getElapsedRealtimeMillis();
+ long certainty = ntpResult.getCertaintyMillis();
+
+ if (DEBUG) {
+ long now = System.currentTimeMillis();
+ Log.d(TAG, "NTP server returned: " + time + " (" + new Date(time) + ")"
+ + " ntpResult: " + ntpResult + " system time offset: " + (time - now));
+ }
+
+ // Ok to cast to int, as can't rollover in practice
+ mHandler.post(() -> mCallback.injectTime(time, timeReference, (int) certainty));
+ return true;
+ }
}
diff --git a/services/core/java/com/android/server/pm/AppsFilterImpl.java b/services/core/java/com/android/server/pm/AppsFilterImpl.java
index dff7100..c447880 100644
--- a/services/core/java/com/android/server/pm/AppsFilterImpl.java
+++ b/services/core/java/com/android/server/pm/AppsFilterImpl.java
@@ -61,6 +61,7 @@
import com.android.server.pm.pkg.component.ParsedIntentInfo;
import com.android.server.pm.pkg.component.ParsedMainComponent;
import com.android.server.pm.pkg.component.ParsedProvider;
+import com.android.server.pm.snapshot.PackageDataSnapshot;
import com.android.server.utils.Snappable;
import com.android.server.utils.SnapshotCache;
import com.android.server.utils.Watchable;
@@ -179,7 +180,6 @@
private final boolean mSystemAppsQueryable;
private final FeatureConfig mFeatureConfig;
private final OverlayReferenceMapper mOverlayReferenceMapper;
- private final StateProvider mStateProvider;
private SigningDetails mSystemSigningDetails;
@GuardedBy("mLock")
@@ -192,7 +192,8 @@
/**
* This structure maps uid -> uid and indicates whether access from the first should be
* filtered to the second. It's essentially a cache of the
- * {@link #shouldFilterApplicationInternal(int, Object, PackageStateInternal, int)} call.
+ * {@link #shouldFilterApplicationInternal(PackageDataSnapshot, int, Object,
+ * PackageStateInternal, int)} call.
* NOTE: It can only be relied upon after the system is ready to avoid unnecessary update on
* initial scam and is empty until {@link #mSystemReady} is true.
*/
@@ -282,8 +283,7 @@
}
@VisibleForTesting(visibility = PRIVATE)
- AppsFilterImpl(StateProvider stateProvider,
- FeatureConfig featureConfig,
+ AppsFilterImpl(FeatureConfig featureConfig,
String[] forceQueryableList,
boolean systemAppsQueryable,
@Nullable OverlayReferenceMapper.Provider overlayProvider,
@@ -293,7 +293,6 @@
mSystemAppsQueryable = systemAppsQueryable;
mOverlayReferenceMapper = new OverlayReferenceMapper(true /*deferRebuild*/,
overlayProvider);
- mStateProvider = stateProvider;
mBackgroundExecutor = backgroundExecutor;
mShouldFilterCache = new WatchedSparseBooleanMatrix();
mShouldFilterCacheSnapshot = new SnapshotCache.Auto<>(
@@ -352,7 +351,6 @@
mSystemAppsQueryable = orig.mSystemAppsQueryable;
mFeatureConfig = orig.mFeatureConfig;
mOverlayReferenceMapper = orig.mOverlayReferenceMapper;
- mStateProvider = orig.mStateProvider;
mSystemSigningDetails = orig.mSystemSigningDetails;
synchronized (orig.mCacheLock) {
mShouldFilterCache = orig.mShouldFilterCacheSnapshot.snapshot();
@@ -361,7 +359,7 @@
mBackgroundExecutor = null;
mSnapshot = new SnapshotCache.Sealed<>();
- mSystemReady = true;
+ mSystemReady = orig.mSystemReady;
}
/**
@@ -373,23 +371,6 @@
return mSnapshot.snapshot();
}
- /**
- * Provides system state to AppsFilter via {@link CurrentStateCallback} after properly guarding
- * the data with the package lock.
- *
- * Don't call {@link #runWithState} with {@link #mCacheLock} held.
- */
- @VisibleForTesting(visibility = PRIVATE)
- public interface StateProvider {
- void runWithState(CurrentStateCallback callback);
-
- interface CurrentStateCallback {
- void currentState(ArrayMap<String, ? extends PackageStateInternal> settings,
- Collection<SharedUserSetting> sharedUserSettings,
- UserInfo[] users);
- }
- }
-
@VisibleForTesting(visibility = PRIVATE)
public interface FeatureConfig {
@@ -517,12 +498,13 @@
@Override
public void onCompatChange(String packageName) {
- AndroidPackage pkg = mPmInternal.getPackage(packageName);
+ PackageDataSnapshot snapshot = mPmInternal.snapshot();
+ AndroidPackage pkg = snapshot.getPackage(packageName);
if (pkg == null) {
return;
}
updateEnabledState(pkg);
- mAppsFilter.updateShouldFilterCacheForPackage(packageName);
+ mAppsFilter.updateShouldFilterCacheForPackage(snapshot, packageName);
}
private void updateEnabledState(@NonNull AndroidPackage pkg) {
@@ -574,14 +556,7 @@
forcedQueryablePackageNames[i] = forcedQueryablePackageNames[i].intern();
}
}
- final StateProvider stateProvider = command -> {
- synchronized (injector.getLock()) {
- command.currentState(injector.getSettings().getPackagesLocked().untrackedStorage(),
- injector.getSettings().getAllSharedUsersLPw(),
- injector.getUserManagerInternal().getUserInfos());
- }
- };
- AppsFilterImpl appsFilter = new AppsFilterImpl(stateProvider, featureConfig,
+ AppsFilterImpl appsFilter = new AppsFilterImpl(featureConfig,
forcedQueryablePackageNames, forceSystemAppsQueryable, null,
injector.getBackgroundExecutor());
featureConfig.setAppsFilter(appsFilter);
@@ -754,12 +729,11 @@
return changed;
}
- public void onSystemReady() {
+ public void onSystemReady(PackageManagerInternal pmInternal) {
mOverlayReferenceMapper.rebuildIfDeferred();
mFeatureConfig.onSystemReady();
- updateEntireShouldFilterCacheAsync();
- onChanged();
+ updateEntireShouldFilterCacheAsync(pmInternal);
mSystemReady = true;
}
@@ -769,39 +743,41 @@
* @param newPkgSetting the new setting being added
* @param isReplace if the package is being replaced and may need extra cleanup.
*/
- public void addPackage(PackageStateInternal newPkgSetting, boolean isReplace) {
+ public void addPackage(PackageDataSnapshot snapshot, PackageStateInternal newPkgSetting,
+ boolean isReplace) {
if (DEBUG_TRACING) {
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "filter.addPackage");
}
try {
if (isReplace) {
// let's first remove any prior rules for this package
- removePackage(newPkgSetting, true /*isReplace*/);
+ removePackage(snapshot, newPkgSetting, true /*isReplace*/);
}
- mStateProvider.runWithState((settings, sharedUserSettings, users) -> {
- ArraySet<String> additionalChangedPackages =
- addPackageInternal(newPkgSetting, settings);
- if (mSystemReady) {
- updateShouldFilterCacheForPackage(null, newPkgSetting,
+ final ArrayMap<String, ? extends PackageStateInternal> settings =
+ snapshot.getPackageStates();
+ final UserInfo[] users = snapshot.getUserInfos();
+ final ArraySet<String> additionalChangedPackages =
+ addPackageInternal(newPkgSetting, settings);
+ if (mSystemReady) {
+ synchronized (mCacheLock) {
+ updateShouldFilterCacheForPackage(snapshot, null, newPkgSetting,
settings, users, USER_ALL, settings.size());
if (additionalChangedPackages != null) {
for (int index = 0; index < additionalChangedPackages.size(); index++) {
String changedPackage = additionalChangedPackages.valueAt(index);
- PackageStateInternal changedPkgSetting =
- settings.get(changedPackage);
+ PackageStateInternal changedPkgSetting = settings.get(changedPackage);
if (changedPkgSetting == null) {
// It's possible for the overlay mapper to know that an actor
// package changed via an explicit reference, even if the actor
// isn't installed, so skip if that's the case.
continue;
}
-
- updateShouldFilterCacheForPackage(null, changedPkgSetting,
+ updateShouldFilterCacheForPackage(snapshot, null, changedPkgSetting,
settings, users, USER_ALL, settings.size());
}
}
- } // else, rebuild entire cache when system is ready
- });
+ }
+ } // else, rebuild entire cache when system is ready
} finally {
onChanged();
if (DEBUG_TRACING) {
@@ -941,30 +917,32 @@
}
}
- private void updateEntireShouldFilterCache() {
- updateEntireShouldFilterCache(USER_ALL);
+ private void updateEntireShouldFilterCache(PackageDataSnapshot snapshot) {
+ updateEntireShouldFilterCache(snapshot, USER_ALL);
}
- private void updateEntireShouldFilterCache(int subjectUserId) {
- mStateProvider.runWithState((settings, sharedUserSettings, users) -> {
- int userId = USER_NULL;
- for (int u = 0; u < users.length; u++) {
- if (subjectUserId == users[u].id) {
- userId = subjectUserId;
- break;
- }
+ private void updateEntireShouldFilterCache(PackageDataSnapshot snapshot, int subjectUserId) {
+ final ArrayMap<String, ? extends PackageStateInternal> settings =
+ snapshot.getPackageStates();
+ final UserInfo[] users = snapshot.getUserInfos();
+ int userId = USER_NULL;
+ for (int u = 0; u < users.length; u++) {
+ if (subjectUserId == users[u].id) {
+ userId = subjectUserId;
+ break;
}
- if (userId == USER_NULL) {
- Slog.e(TAG, "We encountered a new user that isn't a member of known users, "
- + "updating the whole cache");
- userId = USER_ALL;
- }
- updateEntireShouldFilterCacheInner(settings, users, userId);
- });
+ }
+ if (userId == USER_NULL) {
+ Slog.e(TAG, "We encountered a new user that isn't a member of known users, "
+ + "updating the whole cache");
+ userId = USER_ALL;
+ }
+ updateEntireShouldFilterCacheInner(snapshot, settings, users, userId);
+
onChanged();
}
- private void updateEntireShouldFilterCacheInner(
+ private void updateEntireShouldFilterCacheInner(PackageDataSnapshot snapshot,
ArrayMap<String, ? extends PackageStateInternal> settings,
UserInfo[] users,
int subjectUserId) {
@@ -973,67 +951,42 @@
mShouldFilterCache.clear();
}
mShouldFilterCache.setCapacity(users.length * settings.size());
- }
- for (int i = settings.size() - 1; i >= 0; i--) {
- updateShouldFilterCacheForPackage(
- null /*skipPackage*/, settings.valueAt(i), settings, users,
- subjectUserId, i);
+ for (int i = settings.size() - 1; i >= 0; i--) {
+ updateShouldFilterCacheForPackage(snapshot,
+ null /*skipPackage*/, settings.valueAt(i), settings, users,
+ subjectUserId, i);
+ }
}
}
- private void updateEntireShouldFilterCacheAsync() {
+ private void updateEntireShouldFilterCacheAsync(PackageManagerInternal pmInternal) {
mBackgroundExecutor.execute(() -> {
- final ArrayMap<String, PackageStateInternal> settingsCopy = new ArrayMap<>();
- final Collection<SharedUserSetting> sharedUserSettingsCopy = new ArraySet<>();
final ArrayMap<String, AndroidPackage> packagesCache = new ArrayMap<>();
final UserInfo[][] usersRef = new UserInfo[1][];
- mStateProvider.runWithState((settings, sharedUserSettings, users) -> {
- packagesCache.ensureCapacity(settings.size());
- settingsCopy.putAll(settings);
- usersRef[0] = users;
- // store away the references to the immutable packages, since settings are retained
- // during updates.
- for (int i = 0, max = settings.size(); i < max; i++) {
- final AndroidPackage pkg = settings.valueAt(i).getPkg();
- packagesCache.put(settings.keyAt(i), pkg);
- }
- sharedUserSettingsCopy.addAll(sharedUserSettings);
- });
+ final PackageDataSnapshot snapshot = pmInternal.snapshot();
+ final ArrayMap<String, ? extends PackageStateInternal> settings =
+ snapshot.getPackageStates();
+ final UserInfo[] users = snapshot.getUserInfos();
- boolean[] changed = new boolean[1];
- // We have a cache, let's make sure the world hasn't changed out from under us.
- mStateProvider.runWithState((settings, sharedUserSettings, users) -> {
- if (settings.size() != settingsCopy.size()) {
- changed[0] = true;
- return;
- }
- for (int i = 0, max = settings.size(); i < max; i++) {
- final AndroidPackage pkg = settings.valueAt(i).getPkg();
- if (!Objects.equals(pkg, packagesCache.get(settings.keyAt(i)))) {
- changed[0] = true;
- return;
- }
- }
- });
- if (changed[0]) {
- // Something has changed, just update the cache inline with the lock held
- updateEntireShouldFilterCache();
- if (DEBUG_LOGGING) {
- Slog.i(TAG, "Rebuilding cache with lock due to package change.");
- }
- } else {
- updateEntireShouldFilterCacheInner(settingsCopy,
- usersRef[0], USER_ALL);
- onChanged();
+ packagesCache.ensureCapacity(settings.size());
+ usersRef[0] = users;
+ // store away the references to the immutable packages, since settings are retained
+ // during updates.
+ for (int i = 0, max = settings.size(); i < max; i++) {
+ final AndroidPackage pkg = settings.valueAt(i).getPkg();
+ packagesCache.put(settings.keyAt(i), pkg);
}
+
+ updateEntireShouldFilterCacheInner(snapshot, settings, usersRef[0], USER_ALL);
+ onChanged();
});
}
- public void onUserCreated(int newUserId) {
+ public void onUserCreated(PackageDataSnapshot snapshot, int newUserId) {
if (!mSystemReady) {
return;
}
- updateEntireShouldFilterCache(newUserId);
+ updateEntireShouldFilterCache(snapshot, newUserId);
}
public void onUserDeleted(@UserIdInt int userId) {
@@ -1044,19 +997,24 @@
onChanged();
}
- private void updateShouldFilterCacheForPackage(String packageName) {
- mStateProvider.runWithState((settings, sharedUserSettings, users) -> {
- if (!mSystemReady) {
- return;
- }
- updateShouldFilterCacheForPackage(null /* skipPackage */,
+ private void updateShouldFilterCacheForPackage(PackageDataSnapshot snapshot,
+ String packageName) {
+ if (!mSystemReady) {
+ return;
+ }
+ final ArrayMap<String, ? extends PackageStateInternal> settings =
+ snapshot.getPackageStates();
+ final UserInfo[] users = snapshot.getUserInfos();
+ synchronized (mCacheLock) {
+ updateShouldFilterCacheForPackage(snapshot, null /* skipPackage */,
settings.get(packageName), settings, users, USER_ALL,
settings.size() /*maxIndex*/);
- });
+ }
onChanged();
}
- private void updateShouldFilterCacheForPackage(
+ @GuardedBy("mCacheLock")
+ private void updateShouldFilterCacheForPackage(PackageDataSnapshot snapshot,
@Nullable String skipPackageName, PackageStateInternal subjectSetting, ArrayMap<String,
? extends PackageStateInternal> allSettings, UserInfo[] allUsers, int subjectUserId,
int maxIndex) {
@@ -1072,31 +1030,30 @@
}
if (subjectUserId == USER_ALL) {
for (int su = 0; su < allUsers.length; su++) {
- updateShouldFilterCacheForUser(subjectSetting, allUsers, otherSetting,
+ updateShouldFilterCacheForUser(snapshot, subjectSetting, allUsers, otherSetting,
allUsers[su].id);
}
} else {
- updateShouldFilterCacheForUser(subjectSetting, allUsers, otherSetting,
+ updateShouldFilterCacheForUser(snapshot, subjectSetting, allUsers, otherSetting,
subjectUserId);
}
}
}
- private void updateShouldFilterCacheForUser(
+ @GuardedBy("mCacheLock")
+ private void updateShouldFilterCacheForUser(PackageDataSnapshot snapshot,
PackageStateInternal subjectSetting, UserInfo[] allUsers,
PackageStateInternal otherSetting, int subjectUserId) {
for (int ou = 0; ou < allUsers.length; ou++) {
int otherUser = allUsers[ou].id;
int subjectUid = UserHandle.getUid(subjectUserId, subjectSetting.getAppId());
int otherUid = UserHandle.getUid(otherUser, otherSetting.getAppId());
- final boolean shouldFilterSubjectToOther = shouldFilterApplicationInternal(
+ final boolean shouldFilterSubjectToOther = shouldFilterApplicationInternal(snapshot,
subjectUid, subjectSetting, otherSetting, otherUser);
- final boolean shouldFilterOtherToSubject = shouldFilterApplicationInternal(
+ final boolean shouldFilterOtherToSubject = shouldFilterApplicationInternal(snapshot,
otherUid, otherSetting, subjectSetting, subjectUserId);
- synchronized (mCacheLock) {
- mShouldFilterCache.put(subjectUid, otherUid, shouldFilterSubjectToOther);
- mShouldFilterCache.put(otherUid, subjectUid, shouldFilterOtherToSubject);
- }
+ mShouldFilterCache.put(subjectUid, otherUid, shouldFilterSubjectToOther);
+ mShouldFilterCache.put(otherUid, subjectUid, shouldFilterOtherToSubject);
}
}
@@ -1182,11 +1139,13 @@
}
/**
- * See {@link AppsFilterSnapshot#getVisibilityAllowList(PackageStateInternal, int[], ArrayMap)}
+ * See {@link AppsFilterSnapshot#getVisibilityAllowList(PackageDataSnapshot,
+ * PackageStateInternal, int[], ArrayMap)}
*/
@Override
@Nullable
- public SparseArray<int[]> getVisibilityAllowList(PackageStateInternal setting, int[] users,
+ public SparseArray<int[]> getVisibilityAllowList(PackageDataSnapshot snapshot,
+ PackageStateInternal setting, int[] users,
ArrayMap<String, ? extends PackageStateInternal> existingSettings) {
synchronized (mLock) {
if (mForceQueryable.contains(setting.getAppId())) {
@@ -1211,7 +1170,8 @@
continue;
}
final int existingUid = UserHandle.getUid(userId, existingAppId);
- if (!shouldFilterApplication(existingUid, existingSetting, setting, userId)) {
+ if (!shouldFilterApplication(snapshot, existingUid, existingSetting, setting,
+ userId)) {
if (buffer == null) {
buffer = new int[appIds.length];
}
@@ -1232,19 +1192,21 @@
*/
@VisibleForTesting(visibility = PRIVATE)
@Nullable
- SparseArray<int[]> getVisibilityAllowList(PackageStateInternal setting, int[] users,
+ SparseArray<int[]> getVisibilityAllowList(PackageDataSnapshot snapshot,
+ PackageStateInternal setting, int[] users,
WatchedArrayMap<String, ? extends PackageStateInternal> existingSettings) {
- return getVisibilityAllowList(setting, users, existingSettings.untrackedStorage());
+ return getVisibilityAllowList(snapshot, setting, users,
+ existingSettings.untrackedStorage());
}
/**
- * Equivalent to calling {@link #addPackage(PackageStateInternal, boolean)} with
- * {@code isReplace} equal to {@code false}.
+ * Equivalent to calling {@link #addPackage(PackageDataSnapshot, PackageStateInternal, boolean)}
+ * with {@code isReplace} equal to {@code false}.
*
- * @see AppsFilterImpl#addPackage(PackageStateInternal, boolean)
+ * @see AppsFilterImpl#addPackage(PackageDataSnapshot, PackageStateInternal, boolean)
*/
- public void addPackage(PackageStateInternal newPkgSetting) {
- addPackage(newPkgSetting, false /* isReplace */);
+ public void addPackage(PackageDataSnapshot snapshot, PackageStateInternal newPkgSetting) {
+ addPackage(snapshot, newPkgSetting, false /* isReplace */);
}
/**
@@ -1253,119 +1215,122 @@
* @param setting the setting of the package being removed.
* @param isReplace if the package is being replaced.
*/
- public void removePackage(PackageStateInternal setting, boolean isReplace) {
- mStateProvider.runWithState((settings, sharedUserSettings, users) -> {
- final ArraySet<String> additionalChangedPackages;
- final int userCount = users.length;
- synchronized (mLock) {
- for (int u = 0; u < userCount; u++) {
- final int userId = users[u].id;
- final int removingUid = UserHandle.getUid(userId, setting.getAppId());
- mImplicitlyQueryable.remove(removingUid);
- for (int i = mImplicitlyQueryable.size() - 1; i >= 0; i--) {
- mImplicitlyQueryable.remove(mImplicitlyQueryable.keyAt(i),
- removingUid);
- }
-
- if (isReplace) {
- continue;
- }
-
- mRetainedImplicitlyQueryable.remove(removingUid);
- for (int i = mRetainedImplicitlyQueryable.size() - 1; i >= 0; i--) {
- mRetainedImplicitlyQueryable.remove(
- mRetainedImplicitlyQueryable.keyAt(i), removingUid);
- }
+ public void removePackage(PackageDataSnapshot snapshot, PackageStateInternal setting,
+ boolean isReplace) {
+ final ArraySet<String> additionalChangedPackages;
+ final ArrayMap<String, ? extends PackageStateInternal> settings =
+ snapshot.getPackageStates();
+ final UserInfo[] users = snapshot.getUserInfos();
+ final Collection<SharedUserSetting> sharedUserSettings = snapshot.getAllSharedUsers();
+ final int userCount = users.length;
+ synchronized (mLock) {
+ for (int u = 0; u < userCount; u++) {
+ final int userId = users[u].id;
+ final int removingUid = UserHandle.getUid(userId, setting.getAppId());
+ mImplicitlyQueryable.remove(removingUid);
+ for (int i = mImplicitlyQueryable.size() - 1; i >= 0; i--) {
+ mImplicitlyQueryable.remove(mImplicitlyQueryable.keyAt(i),
+ removingUid);
}
- if (!mQueriesViaComponentRequireRecompute) {
- mQueriesViaComponent.remove(setting.getAppId());
- for (int i = mQueriesViaComponent.size() - 1; i >= 0; i--) {
- mQueriesViaComponent.remove(mQueriesViaComponent.keyAt(i),
- setting.getAppId());
- }
- }
- mQueriesViaPackage.remove(setting.getAppId());
- for (int i = mQueriesViaPackage.size() - 1; i >= 0; i--) {
- mQueriesViaPackage.remove(mQueriesViaPackage.keyAt(i),
- setting.getAppId());
- }
- mQueryableViaUsesLibrary.remove(setting.getAppId());
- for (int i = mQueryableViaUsesLibrary.size() - 1; i >= 0; i--) {
- mQueryableViaUsesLibrary.remove(mQueryableViaUsesLibrary.keyAt(i),
- setting.getAppId());
+ if (isReplace) {
+ continue;
}
- mForceQueryable.remove(setting.getAppId());
-
- if (setting.getPkg() != null
- && !setting.getPkg().getProtectedBroadcasts().isEmpty()) {
- final String removingPackageName = setting.getPkg().getPackageName();
- final ArrayList<String> protectedBroadcasts = new ArrayList<>();
- protectedBroadcasts.addAll(mProtectedBroadcasts.untrackedStorage());
- collectProtectedBroadcasts(settings, removingPackageName);
- if (!mProtectedBroadcasts.containsAll(protectedBroadcasts)) {
- mQueriesViaComponentRequireRecompute = true;
- }
+ mRetainedImplicitlyQueryable.remove(removingUid);
+ for (int i = mRetainedImplicitlyQueryable.size() - 1; i >= 0; i--) {
+ mRetainedImplicitlyQueryable.remove(
+ mRetainedImplicitlyQueryable.keyAt(i), removingUid);
}
}
- additionalChangedPackages = mOverlayReferenceMapper.removePkg(setting.getPackageName());
- mFeatureConfig.updatePackageState(setting, true /*removed*/);
-
- // After removing all traces of the package, if it's part of a shared user,
- // re-add other
- // shared user members to re-establish visibility between them and other
- // packages.
- // NOTE: this must come after all removals from data structures but before we
- // update the
- // cache
- if (setting.hasSharedUser()) {
- final ArraySet<? extends PackageStateInternal> sharedUserPackages =
- getSharedUserPackages(setting.getSharedUserAppId(), sharedUserSettings);
- for (int i = sharedUserPackages.size() - 1; i >= 0; i--) {
- if (sharedUserPackages.valueAt(i) == setting) {
- continue;
- }
- addPackageInternal(
- sharedUserPackages.valueAt(i), settings);
+ if (!mQueriesViaComponentRequireRecompute) {
+ mQueriesViaComponent.remove(setting.getAppId());
+ for (int i = mQueriesViaComponent.size() - 1; i >= 0; i--) {
+ mQueriesViaComponent.remove(mQueriesViaComponent.keyAt(i),
+ setting.getAppId());
}
}
+ mQueriesViaPackage.remove(setting.getAppId());
+ for (int i = mQueriesViaPackage.size() - 1; i >= 0; i--) {
+ mQueriesViaPackage.remove(mQueriesViaPackage.keyAt(i),
+ setting.getAppId());
+ }
+ mQueryableViaUsesLibrary.remove(setting.getAppId());
+ for (int i = mQueryableViaUsesLibrary.size() - 1; i >= 0; i--) {
+ mQueryableViaUsesLibrary.remove(mQueryableViaUsesLibrary.keyAt(i),
+ setting.getAppId());
+ }
- removeAppIdFromVisibilityCache(setting.getAppId());
- if (mSystemReady && setting.hasSharedUser()) {
- final ArraySet<? extends PackageStateInternal> sharedUserPackages =
- getSharedUserPackages(setting.getSharedUserAppId(), sharedUserSettings);
- for (int i = sharedUserPackages.size() - 1; i >= 0; i--) {
- PackageStateInternal siblingSetting =
- sharedUserPackages.valueAt(i);
- if (siblingSetting == setting) {
- continue;
- }
- updateShouldFilterCacheForPackage(
+ mForceQueryable.remove(setting.getAppId());
+
+ if (setting.getPkg() != null
+ && !setting.getPkg().getProtectedBroadcasts().isEmpty()) {
+ final String removingPackageName = setting.getPkg().getPackageName();
+ final ArrayList<String> protectedBroadcasts = new ArrayList<>();
+ protectedBroadcasts.addAll(mProtectedBroadcasts.untrackedStorage());
+ collectProtectedBroadcasts(settings, removingPackageName);
+ if (!mProtectedBroadcasts.containsAll(protectedBroadcasts)) {
+ mQueriesViaComponentRequireRecompute = true;
+ }
+ }
+ }
+
+ additionalChangedPackages = mOverlayReferenceMapper.removePkg(setting.getPackageName());
+ mFeatureConfig.updatePackageState(setting, true /*removed*/);
+
+ // After removing all traces of the package, if it's part of a shared user, re-add other
+ // shared user members to re-establish visibility between them and other packages.
+ // NOTE: this must come after all removals from data structures but before we update the
+ // cache
+ if (setting.hasSharedUser()) {
+ final ArraySet<? extends PackageStateInternal> sharedUserPackages =
+ getSharedUserPackages(setting.getSharedUserAppId(), sharedUserSettings);
+ for (int i = sharedUserPackages.size() - 1; i >= 0; i--) {
+ if (sharedUserPackages.valueAt(i) == setting) {
+ continue;
+ }
+ addPackageInternal(
+ sharedUserPackages.valueAt(i), settings);
+ }
+ }
+
+ removeAppIdFromVisibilityCache(setting.getAppId());
+ if (mSystemReady && setting.hasSharedUser()) {
+ final ArraySet<? extends PackageStateInternal> sharedUserPackages =
+ getSharedUserPackages(setting.getSharedUserAppId(), sharedUserSettings);
+ for (int i = sharedUserPackages.size() - 1; i >= 0; i--) {
+ PackageStateInternal siblingSetting =
+ sharedUserPackages.valueAt(i);
+ if (siblingSetting == setting) {
+ continue;
+ }
+ synchronized (mCacheLock) {
+ updateShouldFilterCacheForPackage(snapshot,
setting.getPackageName(), siblingSetting, settings,
users, USER_ALL, settings.size());
}
}
+ }
- if (mSystemReady) {
- if (additionalChangedPackages != null) {
- for (int index = 0; index < additionalChangedPackages.size(); index++) {
- String changedPackage = additionalChangedPackages.valueAt(index);
- PackageStateInternal changedPkgSetting = settings.get(changedPackage);
- if (changedPkgSetting == null) {
- // It's possible for the overlay mapper to know that an actor
- // package changed via an explicit reference, even if the actor
- // isn't installed, so skip if that's the case.
- continue;
- }
-
- updateShouldFilterCacheForPackage(null, changedPkgSetting,
+ if (mSystemReady) {
+ if (additionalChangedPackages != null) {
+ for (int index = 0; index < additionalChangedPackages.size(); index++) {
+ String changedPackage = additionalChangedPackages.valueAt(index);
+ PackageStateInternal changedPkgSetting = settings.get(changedPackage);
+ if (changedPkgSetting == null) {
+ // It's possible for the overlay mapper to know that an actor
+ // package changed via an explicit reference, even if the actor
+ // isn't installed, so skip if that's the case.
+ continue;
+ }
+ synchronized (mCacheLock) {
+ updateShouldFilterCacheForPackage(snapshot, null, changedPkgSetting,
settings, users, USER_ALL, settings.size());
}
}
}
- });
+ }
onChanged();
}
@@ -1382,12 +1347,12 @@
/**
* See
- * {@link AppsFilterSnapshot#shouldFilterApplication(int, Object, PackageStateInternal,
- * int)}
+ * {@link AppsFilterSnapshot#shouldFilterApplication(PackageDataSnapshot, int, Object,
+ * PackageStateInternal, int)}
*/
@Override
- public boolean shouldFilterApplication(int callingUid, @Nullable Object callingSetting,
- PackageStateInternal targetPkgSetting, int userId) {
+ public boolean shouldFilterApplication(PackageDataSnapshot snapshot, int callingUid,
+ @Nullable Object callingSetting, PackageStateInternal targetPkgSetting, int userId) {
if (DEBUG_TRACING) {
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "shouldFilterApplication");
}
@@ -1405,7 +1370,7 @@
return false;
}
} else {
- if (!shouldFilterApplicationInternal(
+ if (!shouldFilterApplicationInternal(snapshot,
callingUid, callingSetting, targetPkgSetting, userId)) {
return false;
}
@@ -1440,8 +1405,8 @@
}
}
- private boolean shouldFilterApplicationInternal(int callingUid, Object callingSetting,
- PackageStateInternal targetPkgSetting, int targetUserId) {
+ private boolean shouldFilterApplicationInternal(PackageDataSnapshot snapshot, int callingUid,
+ Object callingSetting, PackageStateInternal targetPkgSetting, int targetUserId) {
if (DEBUG_TRACING) {
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "shouldFilterApplicationInternal");
}
@@ -1467,9 +1432,8 @@
final PackageStateInternal packageState = (PackageStateInternal) callingSetting;
if (packageState.hasSharedUser()) {
callingPkgSetting = null;
- mStateProvider.runWithState((settings, sharedUserSettings, users) ->
- callingSharedPkgSettings.addAll(getSharedUserPackages(
- packageState.getSharedUserAppId(), sharedUserSettings)));
+ callingSharedPkgSettings.addAll(getSharedUserPackages(
+ packageState.getSharedUserAppId(), snapshot.getAllSharedUsers()));
} else {
callingPkgSetting = packageState;
@@ -1600,11 +1564,7 @@
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mQueriesViaComponent");
}
if (mQueriesViaComponentRequireRecompute) {
- final ArrayMap<String, PackageStateInternal> settingsCopy = new ArrayMap<>();
- mStateProvider.runWithState((settings, sharedUserSettings, users) -> {
- settingsCopy.putAll(settings);
- });
- recomputeComponentVisibility(settingsCopy);
+ recomputeComponentVisibility(snapshot.getPackageStates());
onChanged();
}
synchronized (mLock) {
diff --git a/services/core/java/com/android/server/pm/AppsFilterSnapshot.java b/services/core/java/com/android/server/pm/AppsFilterSnapshot.java
index cb8c649..de037f3 100644
--- a/services/core/java/com/android/server/pm/AppsFilterSnapshot.java
+++ b/services/core/java/com/android/server/pm/AppsFilterSnapshot.java
@@ -25,6 +25,7 @@
import com.android.internal.util.function.QuadFunction;
import com.android.server.pm.parsing.pkg.AndroidPackage;
import com.android.server.pm.pkg.PackageStateInternal;
+import com.android.server.pm.snapshot.PackageDataSnapshot;
import java.io.PrintWriter;
@@ -40,27 +41,30 @@
* If the setting is visible to all UIDs, null is returned. If an app is not visible to any
* applications, the int array will be empty.
*
+ * @param snapshot the snapshot of the computer that contains all package information
* @param users the set of users that should be evaluated for this calculation
* @param existingSettings the set of all package settings that currently exist on device
* @return a SparseArray mapping userIds to a sorted int array of appIds that may view the
* provided setting or null if the app is visible to all and no allow list should be
* applied.
*/
- SparseArray<int[]> getVisibilityAllowList(PackageStateInternal setting, int[] users,
+ SparseArray<int[]> getVisibilityAllowList(PackageDataSnapshot snapshot,
+ PackageStateInternal setting, int[] users,
ArrayMap<String, ? extends PackageStateInternal> existingSettings);
/**
* Returns true if the calling package should not be able to see the target package, false if no
* filtering should be done.
*
+ * @param snapshot the snapshot of the computer that contains all package information
* @param callingUid the uid of the caller attempting to access a package
* @param callingSetting the setting attempting to access a package or null if it could not be
* found
* @param targetPkgSetting the package being accessed
* @param userId the user in which this access is being attempted
*/
- boolean shouldFilterApplication(int callingUid, @Nullable Object callingSetting,
- PackageStateInternal targetPkgSetting, int userId);
+ boolean shouldFilterApplication(PackageDataSnapshot snapshot, int callingUid,
+ @Nullable Object callingSetting, PackageStateInternal targetPkgSetting, int userId);
/**
* Returns whether the querying package is allowed to see the target package.
diff --git a/services/core/java/com/android/server/pm/Computer.java b/services/core/java/com/android/server/pm/Computer.java
index c259797..db48a1f 100644
--- a/services/core/java/com/android/server/pm/Computer.java
+++ b/services/core/java/com/android/server/pm/Computer.java
@@ -59,6 +59,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
+import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -128,6 +129,7 @@
*/
ActivityInfo getActivityInfoInternal(ComponentName component, long flags,
int filterCallingUid, int userId);
+ @Override
AndroidPackage getPackage(String packageName);
AndroidPackage getPackage(int uid);
ApplicationInfo generateApplicationInfoFromSettings(String packageName, long flags,
@@ -289,6 +291,7 @@
PreferredIntentResolver getPreferredActivities(@UserIdInt int userId);
@NonNull
+ @Override
ArrayMap<String, ? extends PackageStateInternal> getPackageStates();
@Nullable
@@ -602,4 +605,12 @@
@NonNull
List<? extends PackageStateInternal> getVolumePackages(@NonNull String volumeUuid);
+
+ @Override
+ @NonNull
+ UserInfo[] getUserInfos();
+
+ @Override
+ @NonNull
+ Collection<SharedUserSetting> getAllSharedUsers();
}
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 80d61b5..bf9f4fa 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -1348,7 +1348,7 @@
PackageStateInternal resolvedSetting =
getPackageStateInternal(info.activityInfo.packageName, 0);
if (resolveForStart
- || !mAppsFilter.shouldFilterApplication(
+ || !mAppsFilter.shouldFilterApplication(this,
filterCallingUid, callingSetting, resolvedSetting, userId)) {
continue;
}
@@ -1382,7 +1382,7 @@
mSettings.getSettingBase(UserHandle.getAppId(filterCallingUid));
PackageStateInternal resolvedSetting =
getPackageStateInternal(info.serviceInfo.packageName, 0);
- if (!mAppsFilter.shouldFilterApplication(
+ if (!mAppsFilter.shouldFilterApplication(this,
filterCallingUid, callingSetting, resolvedSetting, userId)) {
continue;
}
@@ -2730,7 +2730,7 @@
}
int appId = UserHandle.getAppId(callingUid);
final SettingBase callingPs = mSettings.getSettingBase(appId);
- return mAppsFilter.shouldFilterApplication(callingUid, callingPs, ps, userId);
+ return mAppsFilter.shouldFilterApplication(this, callingUid, callingPs, ps, userId);
}
/**
@@ -5036,7 +5036,7 @@
if (setting == null) {
return null;
}
- return mAppsFilter.getVisibilityAllowList(setting, userIds, getPackageStates());
+ return mAppsFilter.getVisibilityAllowList(this, setting, userIds, getPackageStates());
}
@Nullable
@@ -5323,7 +5323,7 @@
if (ps == null) {
return null;
}
- final SparseArray<int[]> visibilityAllowList = mAppsFilter.getVisibilityAllowList(ps,
+ final SparseArray<int[]> visibilityAllowList = mAppsFilter.getVisibilityAllowList(this, ps,
new int[]{userId}, getPackageStates());
return visibilityAllowList != null ? visibilityAllowList.get(userId) : null;
}
@@ -5823,4 +5823,16 @@
public List<? extends PackageStateInternal> getVolumePackages(@NonNull String volumeUuid) {
return mSettings.getVolumePackages(volumeUuid);
}
+
+ @Override
+ @NonNull
+ public Collection<SharedUserSetting> getAllSharedUsers() {
+ return mSettings.getAllSharedUsers();
+ }
+
+ @Override
+ @NonNull
+ public UserInfo[] getUserInfos() {
+ return mInjector.getUserManagerInternal().getUserInfos();
+ }
}
diff --git a/services/core/java/com/android/server/pm/DeletePackageHelper.java b/services/core/java/com/android/server/pm/DeletePackageHelper.java
index d3d291e..cb38d52 100644
--- a/services/core/java/com/android/server/pm/DeletePackageHelper.java
+++ b/services/core/java/com/android/server/pm/DeletePackageHelper.java
@@ -543,8 +543,9 @@
synchronized (mPm.mLock) {
if (outInfo != null) {
outInfo.mUid = ps.getAppId();
- outInfo.mBroadcastAllowList = mPm.mAppsFilter.getVisibilityAllowList(ps,
- allUserHandles, mPm.mSettings.getPackagesLocked());
+ outInfo.mBroadcastAllowList = mPm.mAppsFilter.getVisibilityAllowList(
+ mPm.snapshotComputer(), ps, allUserHandles,
+ mPm.mSettings.getPackagesLocked());
}
}
diff --git a/services/core/java/com/android/server/pm/DexOptHelper.java b/services/core/java/com/android/server/pm/DexOptHelper.java
index 249099d..b76140c 100644
--- a/services/core/java/com/android/server/pm/DexOptHelper.java
+++ b/services/core/java/com/android/server/pm/DexOptHelper.java
@@ -432,8 +432,8 @@
// Whoever is calling forceDexOpt wants a compiled package.
// Don't use profiles since that may cause compilation to be skipped.
final int res = performDexOptInternalWithDependenciesLI(pkg, packageState,
- new DexoptOptions(packageName,
- getDefaultCompilerFilter(),
+ new DexoptOptions(packageName, REASON_CMDLINE,
+ getDefaultCompilerFilter(), null /* splitName */,
DexoptOptions.DEXOPT_FORCE | DexoptOptions.DEXOPT_BOOT_COMPLETE));
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index bbdb7eb..8bd1da9 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -464,9 +464,9 @@
KeySetManagerService ksms = mPm.mSettings.getKeySetManagerService();
ksms.addScannedPackageLPw(pkg);
- mPm.mComponentResolver.addAllComponents(pkg, chatty, mPm.mSetupWizardPackage,
- mPm.snapshotComputer());
- mPm.mAppsFilter.addPackage(pkgSetting, isReplace);
+ final Computer snapshot = mPm.snapshotComputer();
+ mPm.mComponentResolver.addAllComponents(pkg, chatty, mPm.mSetupWizardPackage, snapshot);
+ mPm.mAppsFilter.addPackage(snapshot, pkgSetting, isReplace);
mPm.addAllPackageProperties(pkg);
if (oldPkgSetting == null || oldPkgSetting.getPkg() == null) {
@@ -1916,7 +1916,7 @@
.setLastUpdateTime(System.currentTimeMillis());
res.mRemovedInfo.mBroadcastAllowList = mPm.mAppsFilter.getVisibilityAllowList(
- reconciledPkg.mPkgSetting, request.mAllUsers,
+ mPm.snapshotComputer(), reconciledPkg.mPkgSetting, request.mAllUsers,
mPm.mSettings.getPackagesLocked());
if (reconciledPkg.mPrepareResult.mSystem) {
// Remove existing system package
@@ -2712,9 +2712,9 @@
// Send to all running apps.
final SparseArray<int[]> newBroadcastAllowList;
synchronized (mPm.mLock) {
- newBroadcastAllowList = mPm.mAppsFilter.getVisibilityAllowList(
- mPm.snapshotComputer()
- .getPackageStateInternal(packageName, Process.SYSTEM_UID),
+ final Computer snapshot = mPm.snapshotComputer();
+ newBroadcastAllowList = mPm.mAppsFilter.getVisibilityAllowList(snapshot,
+ snapshot.getPackageStateInternal(packageName, Process.SYSTEM_UID),
updateUserIds, mPm.mSettings.getPackagesLocked());
}
mPm.sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName,
diff --git a/services/core/java/com/android/server/pm/Installer.java b/services/core/java/com/android/server/pm/Installer.java
index 2a66e02..320b06f 100644
--- a/services/core/java/com/android/server/pm/Installer.java
+++ b/services/core/java/com/android/server/pm/Installer.java
@@ -629,12 +629,17 @@
}
}
- public boolean dumpProfiles(int uid, String packageName, String profileName, String codePath)
+ /**
+ * Dumps profiles associated with a package in a human readable format.
+ */
+ public boolean dumpProfiles(int uid, String packageName, String profileName, String codePath,
+ boolean dumpClassesAndMethods)
throws InstallerException {
if (!checkBeforeRemote()) return false;
BlockGuard.getVmPolicy().onPathAccess(codePath);
try {
- return mInstalld.dumpProfiles(uid, packageName, profileName, codePath);
+ return mInstalld.dumpProfiles(uid, packageName, profileName, codePath,
+ dumpClassesAndMethods);
} catch (Exception e) {
throw InstallerException.from(e);
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index ffd924e..88564aa 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -1430,7 +1430,7 @@
(i, pm) -> new Settings(Environment.getDataDirectory(),
RuntimePermissionsPersistence.createInstance(),
i.getPermissionManagerServiceInternal(),
- domainVerificationService, lock),
+ domainVerificationService, backgroundHandler, lock),
(i, pm) -> AppsFilterImpl.create(i,
i.getLocalService(PackageManagerInternal.class)),
(i, pm) -> (PlatformCompat) ServiceManager.getService("platform_compat"),
@@ -2992,7 +2992,7 @@
if (ArrayUtils.isEmpty(userIds) && ArrayUtils.isEmpty(instantUserIds)) {
return;
}
- SparseArray<int[]> broadcastAllowList = mAppsFilter.getVisibilityAllowList(
+ SparseArray<int[]> broadcastAllowList = mAppsFilter.getVisibilityAllowList(snapshot,
snapshot.getPackageStateInternal(packageName, Process.SYSTEM_UID),
userIds, snapshot.getPackageStates());
mHandler.post(() -> mBroadcastHelper.sendPackageAddedForNewUsers(
@@ -4013,7 +4013,7 @@
.getUriFor(Secure.INSTANT_APPS_ENABLED), false, co, UserHandle.USER_ALL);
co.onChange(true);
- mAppsFilter.onSystemReady();
+ mAppsFilter.onSystemReady(LocalServices.getService(PackageManagerInternal.class));
// Disable any carrier apps. We do this very early in boot to prevent the apps from being
// disabled after already being started.
@@ -4226,7 +4226,7 @@
synchronized (mLock) {
scheduleWritePackageRestrictions(userId);
scheduleWritePackageListLocked(userId);
- mAppsFilter.onUserCreated(userId);
+ mAppsFilter.onUserCreated(snapshotComputer(), userId);
}
}
@@ -4665,7 +4665,7 @@
}
@Override
- public void dumpProfiles(String packageName) {
+ public void dumpProfiles(String packageName, boolean dumpClassesAndMethods) {
/* Only the shell, root, or the app user should be able to dump profiles. */
final int callingUid = Binder.getCallingUid();
final Computer snapshot = snapshotComputer();
@@ -4683,7 +4683,7 @@
synchronized (mInstallLock) {
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dump profiles");
- mArtManagerService.dumpProfiles(pkg);
+ mArtManagerService.dumpProfiles(pkg, dumpClassesAndMethods);
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
}
}
@@ -5751,7 +5751,7 @@
targetPackageState = snapshotComputer().getPackageStateInternal(targetPackage);
mSettings.addInstallerPackageNames(targetPackageState.getInstallSource());
}
- mAppsFilter.addPackage(targetPackageState);
+ mAppsFilter.addPackage(snapshotComputer(), targetPackageState);
scheduleWriteSettings();
}
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index 7b06593..78a600e 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -1994,8 +1994,23 @@
}
private int runDumpProfiles() throws RemoteException {
+ final PrintWriter pw = getOutPrintWriter();
+ boolean dumpClassesAndMethods = false;
+
+ String opt;
+ while ((opt = getNextOption()) != null) {
+ switch (opt) {
+ case "--dump-classes-and-methods":
+ dumpClassesAndMethods = true;
+ break;
+ default:
+ pw.println("Error: Unknown option: " + opt);
+ return 1;
+ }
+ }
+
String packageName = getNextArg();
- mInterface.dumpProfiles(packageName);
+ mInterface.dumpProfiles(packageName, dumpClassesAndMethods);
return 0;
}
@@ -4164,9 +4179,12 @@
pw.println(" reconcile-secondary-dex-files TARGET-PACKAGE");
pw.println(" Reconciles the package secondary dex files with the generated oat files.");
pw.println("");
- pw.println(" dump-profiles TARGET-PACKAGE");
+ pw.println(" dump-profiles [--dump-classes-and-methods] TARGET-PACKAGE");
pw.println(" Dumps method/class profile files to");
- pw.println(" " + ART_PROFILE_SNAPSHOT_DEBUG_LOCATION + "TARGET-PACKAGE.txt");
+ pw.println(" " + ART_PROFILE_SNAPSHOT_DEBUG_LOCATION
+ + "TARGET-PACKAGE-primary.prof.txt.");
+ pw.println(" --dump-classes-and-methods: passed along to the profman binary to");
+ pw.println(" switch to the format used by 'profman --create-profile-from'.");
pw.println("");
pw.println(" snapshot-profile TARGET-PACKAGE [--code-path path]");
pw.println(" Take a snapshot of the package profiles to");
diff --git a/services/core/java/com/android/server/pm/PackageUsage.java b/services/core/java/com/android/server/pm/PackageUsage.java
index f0b200c..734e1eb 100644
--- a/services/core/java/com/android/server/pm/PackageUsage.java
+++ b/services/core/java/com/android/server/pm/PackageUsage.java
@@ -66,7 +66,8 @@
out.write(sb.toString().getBytes(StandardCharsets.US_ASCII));
for (PackageSetting pkgSetting : pkgSettings.values()) {
- if (pkgSetting.getPkgState().getLatestPackageUseTimeInMills() == 0L) {
+ if (pkgSetting == null || pkgSetting.getPkgState() == null
+ || pkgSetting.getPkgState().getLatestPackageUseTimeInMills() == 0L) {
continue;
}
sb.setLength(0);
diff --git a/services/core/java/com/android/server/pm/ReconcilePackageUtils.java b/services/core/java/com/android/server/pm/ReconcilePackageUtils.java
index 0b69cd3..5fc916f 100644
--- a/services/core/java/com/android/server/pm/ReconcilePackageUtils.java
+++ b/services/core/java/com/android/server/pm/ReconcilePackageUtils.java
@@ -18,6 +18,7 @@
import static android.content.pm.PackageManager.INSTALL_FAILED_UPDATE_INCOMPATIBLE;
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES;
+import static android.content.pm.SigningDetails.CapabilityMergeRule.MERGE_RESTRICTED_CAPABILITY;
import static com.android.server.pm.PackageManagerService.SCAN_BOOTING;
import static com.android.server.pm.PackageManagerService.SCAN_DONT_KILL_APP;
@@ -176,6 +177,19 @@
SigningDetails mergedDetails = sharedSigningDetails.mergeLineageWith(
signingDetails);
if (mergedDetails != sharedSigningDetails) {
+ // Use the restricted merge rule with the signing lineages from the
+ // other packages in the sharedUserId to ensure if any revoke a
+ // capability from a previous signer then this is reflected in the
+ // shared lineage.
+ for (AndroidPackage androidPackage : sharedUserSetting.getPackages()) {
+ if (androidPackage.getPackageName() != null
+ && !androidPackage.getPackageName().equals(
+ parsedPackage.getPackageName())) {
+ mergedDetails = mergedDetails.mergeLineageWith(
+ androidPackage.getSigningDetails(),
+ MERGE_RESTRICTED_CAPABILITY);
+ }
+ }
sharedUserSetting.signatures.mSigningDetails =
mergedDetails;
}
diff --git a/services/core/java/com/android/server/pm/RemovePackageHelper.java b/services/core/java/com/android/server/pm/RemovePackageHelper.java
index baa3a9d..65d3430 100644
--- a/services/core/java/com/android/server/pm/RemovePackageHelper.java
+++ b/services/core/java/com/android/server/pm/RemovePackageHelper.java
@@ -274,8 +274,9 @@
synchronized (mPm.mLock) {
mPm.mDomainVerificationManager.clearPackage(deletedPs.getPackageName());
mPm.mSettings.getKeySetManagerService().removeAppKeySetDataLPw(packageName);
- mPm.mAppsFilter.removePackage(mPm.snapshotComputer()
- .getPackageStateInternal(packageName), false /* isReplace */);
+ final Computer snapshot = mPm.snapshotComputer();
+ mPm.mAppsFilter.removePackage(snapshot,
+ snapshot.getPackageStateInternal(packageName), false /* isReplace */);
removedAppId = mPm.mSettings.removePackageLPw(packageName);
if (outInfo != null) {
outInfo.mRemovedAppId = removedAppId;
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index e6d59d4..a1b4b30 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -360,6 +360,8 @@
private static final String ATTR_VALUE = "value";
private static final String ATTR_FIRST_INSTALL_TIME = "first-install-time";
+ private final Handler mHandler;
+
private final PackageManagerTracedLock mLock;
@Watched(manual = true)
@@ -583,6 +585,8 @@
"Settings.mInstallerPackages");
mKeySetManagerService = new KeySetManagerService(mPackages);
+ // Test-only handler working on background thread.
+ mHandler = new Handler(BackgroundThread.getHandler().getLooper());
mLock = new PackageManagerTracedLock();
mPackages.putAll(pkgSettings);
mAppIds = new AppIdSettingMap();
@@ -607,6 +611,7 @@
Settings(File dataDir, RuntimePermissionsPersistence runtimePermissionsPersistence,
LegacyPermissionDataProvider permissionDataProvider,
@NonNull DomainVerificationManagerInternal domainVerificationManager,
+ @NonNull Handler handler,
@NonNull PackageManagerTracedLock lock) {
mPackages = new WatchedArrayMap<>();
mPackagesSnapshot =
@@ -620,6 +625,7 @@
"Settings.mInstallerPackages");
mKeySetManagerService = new KeySetManagerService(mPackages);
+ mHandler = handler;
mLock = lock;
mAppIds = new AppIdSettingMap();
mPermissions = new LegacyPermissionSettings(lock);
@@ -627,10 +633,8 @@
runtimePermissionsPersistence, new Consumer<Integer>() {
@Override
public void accept(Integer userId) {
- synchronized (mLock) {
- mRuntimePermissionsPersistence.writeStateForUserSync(userId,
- mPermissionDataProvider, mPackages, mSharedUsers);
- }
+ mRuntimePermissionsPersistence.writeStateForUser(userId,
+ mPermissionDataProvider, mPackages, mSharedUsers, mHandler, mLock);
}
});
mPermissionDataProvider = permissionDataProvider;
@@ -679,6 +683,7 @@
// needed by the read-only methods. Note especially that the lock
// is not required because this clone is meant to support lock-free
// read-only methods.
+ mHandler = null;
mLock = null;
mRuntimePermissionsPersistence = r.mRuntimePermissionsPersistence;
mSettingsFilename = null;
@@ -5286,8 +5291,8 @@
public void writePermissionStateForUserLPr(int userId, boolean sync) {
if (sync) {
- mRuntimePermissionsPersistence.writeStateForUserSync(userId, mPermissionDataProvider,
- mPackages, mSharedUsers);
+ mRuntimePermissionsPersistence.writeStateForUser(userId, mPermissionDataProvider,
+ mPackages, mSharedUsers, /*handler=*/null, mLock);
} else {
mRuntimePermissionsPersistence.writeStateForUserAsync(userId);
}
@@ -5373,9 +5378,14 @@
private String mExtendedFingerprint;
+ @GuardedBy("mPersistenceLock")
private final RuntimePermissionsPersistence mPersistence;
+ private final Object mPersistenceLock = new Object();
- private final Handler mHandler = new MyHandler();
+ // Low-priority handlers running on SystemBg thread.
+ private final Handler mAsyncHandler = new MyHandler();
+ private final Handler mPersistenceHandler = new Handler(
+ BackgroundThread.getHandler().getLooper());
private final Object mLock = new Object();
@@ -5398,6 +5408,11 @@
// The mapping keys are user ids.
private final SparseBooleanArray mPermissionUpgradeNeeded = new SparseBooleanArray();
+ @GuardedBy("mLock")
+ // Staging area for states prepared to be written.
+ private final SparseArray<RuntimePermissionsState> mPendingStatesToWrite =
+ new SparseArray<>();
+
// This is a hack to allow this class to invoke a write using Settings's data structures,
// to facilitate moving to a finer scoped lock without a significant refactor.
private final Consumer<Integer> mInvokeWriteUserStateAsyncCallback;
@@ -5462,7 +5477,7 @@
final long currentTimeMillis = SystemClock.uptimeMillis();
if (mWriteScheduled.get(userId)) {
- mHandler.removeMessages(userId);
+ mAsyncHandler.removeMessages(userId);
// If enough time passed, write without holding off anymore.
final long lastNotWrittenMutationTimeMillis = mLastNotWrittenMutationTimesMillis
@@ -5471,7 +5486,7 @@
- lastNotWrittenMutationTimeMillis;
if (timeSinceLastNotWrittenMutationMillis
>= MAX_WRITE_PERMISSIONS_DELAY_MILLIS) {
- mHandler.obtainMessage(userId).sendToTarget();
+ mAsyncHandler.obtainMessage(userId).sendToTarget();
return;
}
@@ -5481,67 +5496,110 @@
final long writeDelayMillis = Math.min(WRITE_PERMISSIONS_DELAY_MILLIS,
maxDelayMillis);
- Message message = mHandler.obtainMessage(userId);
- mHandler.sendMessageDelayed(message, writeDelayMillis);
+ Message message = mAsyncHandler.obtainMessage(userId);
+ mAsyncHandler.sendMessageDelayed(message, writeDelayMillis);
} else {
mLastNotWrittenMutationTimesMillis.put(userId, currentTimeMillis);
- Message message = mHandler.obtainMessage(userId);
- mHandler.sendMessageDelayed(message, WRITE_PERMISSIONS_DELAY_MILLIS);
+ Message message = mAsyncHandler.obtainMessage(userId);
+ mAsyncHandler.sendMessageDelayed(message, WRITE_PERMISSIONS_DELAY_MILLIS);
mWriteScheduled.put(userId, true);
}
}
}
- public void writeStateForUserSync(int userId, @NonNull LegacyPermissionDataProvider
+ public void writeStateForUser(int userId, @NonNull LegacyPermissionDataProvider
legacyPermissionDataProvider,
@NonNull WatchedArrayMap<String, ? extends PackageStateInternal> packageStates,
- @NonNull WatchedArrayMap<String, SharedUserSetting> sharedUsers) {
+ @NonNull WatchedArrayMap<String, SharedUserSetting> sharedUsers,
+ @Nullable Handler pmHandler, @NonNull Object pmLock) {
+ final int version;
+ final String fingerprint;
synchronized (mLock) {
- mHandler.removeMessages(userId);
+ mAsyncHandler.removeMessages(userId);
mWriteScheduled.delete(userId);
- legacyPermissionDataProvider.writeLegacyPermissionStateTEMP();
+ version = mVersions.get(userId, INITIAL_VERSION);
+ fingerprint = mFingerprints.get(userId);
+ }
- int version = mVersions.get(userId, INITIAL_VERSION);
+ Runnable writer = () -> {
+ final RuntimePermissionsState runtimePermissions;
+ synchronized (pmLock) {
+ legacyPermissionDataProvider.writeLegacyPermissionStateTEMP();
- String fingerprint = mFingerprints.get(userId);
+ Map<String, List<RuntimePermissionsState.PermissionState>> packagePermissions =
+ new ArrayMap<>();
+ int packagesSize = packageStates.size();
+ for (int i = 0; i < packagesSize; i++) {
+ String packageName = packageStates.keyAt(i);
+ PackageStateInternal packageState = packageStates.valueAt(i);
+ if (!packageState.hasSharedUser()) {
+ List<RuntimePermissionsState.PermissionState> permissions =
+ getPermissionsFromPermissionsState(
+ packageState.getLegacyPermissionState(), userId);
+ if (permissions.isEmpty()
+ && !packageState.isInstallPermissionsFixed()) {
+ // Storing an empty state means the package is known to the
+ // system and its install permissions have been granted and fixed.
+ // If this is not the case, we should not store anything.
+ continue;
+ }
+ packagePermissions.put(packageName, permissions);
+ }
+ }
- Map<String, List<RuntimePermissionsState.PermissionState>> packagePermissions =
- new ArrayMap<>();
- int packagesSize = packageStates.size();
- for (int i = 0; i < packagesSize; i++) {
- String packageName = packageStates.keyAt(i);
- PackageStateInternal packageState = packageStates.valueAt(i);
- if (!packageState.hasSharedUser()) {
+ Map<String, List<RuntimePermissionsState.PermissionState>>
+ sharedUserPermissions =
+ new ArrayMap<>();
+ final int sharedUsersSize = sharedUsers.size();
+ for (int i = 0; i < sharedUsersSize; i++) {
+ String sharedUserName = sharedUsers.keyAt(i);
+ SharedUserSetting sharedUserSetting = sharedUsers.valueAt(i);
List<RuntimePermissionsState.PermissionState> permissions =
getPermissionsFromPermissionsState(
- packageState.getLegacyPermissionState(), userId);
- if (permissions.isEmpty() && !packageState.isInstallPermissionsFixed()) {
- // Storing an empty state means the package is known to the system and
- // its install permissions have been granted and fixed. If this is not
- // the case, we should not store anything.
- continue;
- }
- packagePermissions.put(packageName, permissions);
+ sharedUserSetting.getLegacyPermissionState(), userId);
+ sharedUserPermissions.put(sharedUserName, permissions);
}
+
+ runtimePermissions = new RuntimePermissionsState(version,
+ fingerprint, packagePermissions, sharedUserPermissions);
}
-
- Map<String, List<RuntimePermissionsState.PermissionState>> sharedUserPermissions =
- new ArrayMap<>();
- final int sharedUsersSize = sharedUsers.size();
- for (int i = 0; i < sharedUsersSize; i++) {
- String sharedUserName = sharedUsers.keyAt(i);
- SharedUserSetting sharedUserSetting = sharedUsers.valueAt(i);
- List<RuntimePermissionsState.PermissionState> permissions =
- getPermissionsFromPermissionsState(
- sharedUserSetting.getLegacyPermissionState(), userId);
- sharedUserPermissions.put(sharedUserName, permissions);
+ synchronized (mLock) {
+ mPendingStatesToWrite.put(userId, runtimePermissions);
}
+ if (pmHandler != null) {
+ // Async version.
+ mPersistenceHandler.post(() -> writePendingStates());
+ } else {
+ // Sync version.
+ writePendingStates();
+ }
+ };
- RuntimePermissionsState runtimePermissions = new RuntimePermissionsState(version,
- fingerprint, packagePermissions, sharedUserPermissions);
+ if (pmHandler != null) {
+ // Async version, use pmHandler.
+ pmHandler.post(writer);
+ } else {
+ // Sync version, use caller's thread.
+ writer.run();
+ }
+ }
- mPersistence.writeForUser(runtimePermissions, UserHandle.of(userId));
+ private void writePendingStates() {
+ while (true) {
+ final RuntimePermissionsState runtimePermissions;
+ final int userId;
+ synchronized (mLock) {
+ if (mPendingStatesToWrite.size() == 0) {
+ break;
+ }
+ userId = mPendingStatesToWrite.keyAt(0);
+ runtimePermissions = mPendingStatesToWrite.valueAt(0);
+ mPendingStatesToWrite.removeAt(0);
+ }
+ synchronized (mPersistenceLock) {
+ mPersistence.writeForUser(runtimePermissions, UserHandle.of(userId));
+ }
}
}
@@ -5563,7 +5621,7 @@
private void onUserRemoved(int userId) {
synchronized (mLock) {
// Make sure we do not
- mHandler.removeMessages(userId);
+ mAsyncHandler.removeMessages(userId);
mPermissionUpgradeNeeded.delete(userId);
mVersions.delete(userId);
@@ -5572,7 +5630,7 @@
}
public void deleteUserRuntimePermissionsFile(int userId) {
- synchronized (mLock) {
+ synchronized (mPersistenceLock) {
mPersistence.deleteForUser(UserHandle.of(userId));
}
}
@@ -5581,16 +5639,17 @@
@NonNull WatchedArrayMap<String, PackageSetting> packageSettings,
@NonNull WatchedArrayMap<String, SharedUserSetting> sharedUsers,
@NonNull File userRuntimePermissionsFile) {
+ final RuntimePermissionsState runtimePermissions;
+ synchronized (mPersistenceLock) {
+ runtimePermissions = mPersistence.readForUser(UserHandle.of(userId));
+ }
+ if (runtimePermissions == null) {
+ readLegacyStateForUserSync(userId, userRuntimePermissionsFile, packageSettings,
+ sharedUsers);
+ writeStateForUserAsync(userId);
+ return;
+ }
synchronized (mLock) {
- RuntimePermissionsState runtimePermissions = mPersistence.readForUser(UserHandle.of(
- userId));
- if (runtimePermissions == null) {
- readLegacyStateForUserSync(userId, userRuntimePermissionsFile, packageSettings,
- sharedUsers);
- writeStateForUserAsync(userId);
- return;
- }
-
// If the runtime permissions file exists but the version is not set this is
// an upgrade from P->Q. Hence mark it with the special UPGRADE_VERSION.
int version = runtimePermissions.getVersion();
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
index b3723fb..f57eaae 100644
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
@@ -894,8 +894,12 @@
// Get the list of all dynamic shortcuts in this package.
final ArrayList<ShortcutInfo> shortcuts = new ArrayList<>();
+ // Pass callingLauncher to ensure pinned flag marked by system ui, e.g. ShareSheet, are
+ // included in the result
findAll(shortcuts, ShortcutInfo::isNonManifestVisible,
- ShortcutInfo.CLONE_REMOVE_FOR_APP_PREDICTION);
+ ShortcutInfo.CLONE_REMOVE_FOR_APP_PREDICTION,
+ mShortcutUser.mService.mContext.getPackageName(),
+ 0, /*getPinnedByAnyLauncher=*/ false);
final List<ShortcutManager.ShareShortcutInfo> result = new ArrayList<>();
for (int i = 0; i < shortcuts.size(); i++) {
diff --git a/services/core/java/com/android/server/pm/SuspendPackageHelper.java b/services/core/java/com/android/server/pm/SuspendPackageHelper.java
index 860c54c..29c926c 100644
--- a/services/core/java/com/android/server/pm/SuspendPackageHelper.java
+++ b/services/core/java/com/android/server/pm/SuspendPackageHelper.java
@@ -598,7 +598,7 @@
final String pkgName = pkgList[i];
final int uid = uidList[i];
SparseArray<int[]> allowList = mInjector.getAppsFilter().getVisibilityAllowList(
- snapshot.getPackageStateInternal(pkgName, SYSTEM_UID),
+ snapshot, snapshot.getPackageStateInternal(pkgName, SYSTEM_UID),
userIds, snapshot.getPackageStates());
if (allowList == null) {
allowList = new SparseArray<>(0);
diff --git a/services/core/java/com/android/server/pm/UserSystemPackageInstaller.java b/services/core/java/com/android/server/pm/UserSystemPackageInstaller.java
index 9fb1f8f..60864a3 100644
--- a/services/core/java/com/android/server/pm/UserSystemPackageInstaller.java
+++ b/services/core/java/com/android/server/pm/UserSystemPackageInstaller.java
@@ -95,7 +95,7 @@
* </code></pre>
*/
class UserSystemPackageInstaller {
- private static final String TAG = "UserManagerService";
+ private static final String TAG = UserSystemPackageInstaller.class.getSimpleName();
private static final boolean DEBUG = false;
diff --git a/services/core/java/com/android/server/pm/dex/ArtManagerService.java b/services/core/java/com/android/server/pm/dex/ArtManagerService.java
index 4fae6b8..0e46b0f 100644
--- a/services/core/java/com/android/server/pm/dex/ArtManagerService.java
+++ b/services/core/java/com/android/server/pm/dex/ArtManagerService.java
@@ -465,14 +465,15 @@
/**
* Dumps the profiles for the given package.
*/
- public void dumpProfiles(AndroidPackage pkg) {
+ public void dumpProfiles(AndroidPackage pkg, boolean dumpClassesAndMethods) {
final int sharedGid = UserHandle.getSharedAppGid(pkg.getUid());
try {
ArrayMap<String, String> packageProfileNames = getPackageProfileNames(pkg);
for (int i = packageProfileNames.size() - 1; i >= 0; i--) {
String codePath = packageProfileNames.keyAt(i);
String profileName = packageProfileNames.valueAt(i);
- mInstaller.dumpProfiles(sharedGid, pkg.getPackageName(), profileName, codePath);
+ mInstaller.dumpProfiles(sharedGid, pkg.getPackageName(), profileName, codePath,
+ dumpClassesAndMethods);
}
} catch (InstallerException e) {
Slog.w(TAG, "Failed to dump profiles", e);
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index 349174d..0311524 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -613,6 +613,10 @@
pm, setupWizardPackage, userId, NEARBY_DEVICES_PERMISSIONS);
}
+ // SearchSelector
+ grantPermissionsToSystemPackage(pm, getDefaultSearchSelectorPackage(), userId,
+ NOTIFICATION_PERMISSIONS);
+
// Camera
grantPermissionsToSystemPackage(pm,
getDefaultSystemHandlerActivityPackage(pm, MediaStore.ACTION_IMAGE_CAPTURE, userId),
@@ -899,15 +903,6 @@
COARSE_BACKGROUND_LOCATION_PERMISSIONS, CONTACTS_PERMISSIONS);
}
- // Content capture
- String contentCapturePackageName =
- mContext.getPackageManager().getContentCaptureServicePackageName();
- if (!TextUtils.isEmpty(contentCapturePackageName)) {
- grantPermissionsToSystemPackage(pm, contentCapturePackageName, userId,
- PHONE_PERMISSIONS, SMS_PERMISSIONS, ALWAYS_LOCATION_PERMISSIONS,
- CONTACTS_PERMISSIONS, STORAGE_PERMISSIONS);
- }
-
// Attention Service
String attentionServicePackageName =
mContext.getPackageManager().getAttentionServicePackageName();
@@ -941,6 +936,10 @@
new Intent(Intent.ACTION_MAIN).addCategory(category), userId);
}
+ private String getDefaultSearchSelectorPackage() {
+ return mContext.getString(R.string.config_defaultSearchSelectorPackageName);
+ }
+
@SafeVarargs
private final void grantPermissionToEachSystemPackage(PackageManagerWrapper pm,
ArrayList<String> packages, int userId, Set<String>... permissions) {
@@ -1025,7 +1024,8 @@
}
for (String packageName : packageNames) {
grantPermissionsToSystemPackage(NO_PM_CACHE, packageName, userId,
- PHONE_PERMISSIONS, ALWAYS_LOCATION_PERMISSIONS, SMS_PERMISSIONS,
+ PHONE_PERMISSIONS, ALWAYS_LOCATION_PERMISSIONS, SMS_PERMISSIONS);
+ grantPermissionsToPackage(NO_PM_CACHE, packageName, userId, false, false,
NOTIFICATION_PERMISSIONS);
}
}
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
index 186eccc..092f3be 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
@@ -2645,12 +2645,9 @@
// Cache newImplicitPermissions before modifing permissionsState as for the
// shared uids the original and new state are the same object
- // TODO(205888750): remove the line for LEGACY_REVIEW once propagated through
- // droidfood
if (!origState.hasPermissionState(permName)
&& (pkg.getImplicitPermissions().contains(permName)
- || (permName.equals(Manifest.permission.ACTIVITY_RECOGNITION)))
- || NOTIFICATION_PERMISSIONS.contains(permName)) {
+ || (permName.equals(Manifest.permission.ACTIVITY_RECOGNITION)))) {
if (pkg.getImplicitPermissions().contains(permName)) {
// If permName is an implicit permission, try to auto-grant
newImplicitPermissions.add(permName);
@@ -2808,12 +2805,14 @@
}
// Remove review flag as it is not necessary anymore
- if (!NOTIFICATION_PERMISSIONS.contains(perm)) {
+ // TODO(b/227186603) re-enable check for notification permission once
+ // droidfood state has been cleared
+ //if (!NOTIFICATION_PERMISSIONS.contains(perm)) {
if ((flags & FLAG_PERMISSION_REVIEW_REQUIRED) != 0) {
flags &= ~FLAG_PERMISSION_REVIEW_REQUIRED;
wasChanged = true;
}
- }
+ //}
if ((flags & FLAG_PERMISSION_REVOKED_COMPAT) != 0
&& !isPermissionSplitFromNonRuntime(permName,
diff --git a/services/core/java/com/android/server/pm/snapshot/PackageDataSnapshot.java b/services/core/java/com/android/server/pm/snapshot/PackageDataSnapshot.java
index b091445..e1e2222 100644
--- a/services/core/java/com/android/server/pm/snapshot/PackageDataSnapshot.java
+++ b/services/core/java/com/android/server/pm/snapshot/PackageDataSnapshot.java
@@ -16,5 +16,22 @@
package com.android.server.pm.snapshot;
+import android.annotation.NonNull;
+import android.content.pm.UserInfo;
+import android.util.ArrayMap;
+
+import com.android.server.pm.SharedUserSetting;
+import com.android.server.pm.parsing.pkg.AndroidPackage;
+import com.android.server.pm.pkg.PackageStateInternal;
+
+import java.util.Collection;
+
public interface PackageDataSnapshot {
+ @NonNull
+ ArrayMap<String, ? extends PackageStateInternal> getPackageStates();
+ @NonNull
+ UserInfo[] getUserInfos();
+ @NonNull
+ Collection<SharedUserSetting> getAllSharedUsers();
+ AndroidPackage getPackage(String packageName);
}
diff --git a/services/core/java/com/android/server/policy/PermissionPolicyService.java b/services/core/java/com/android/server/policy/PermissionPolicyService.java
index 32e7a6a..89ac9e7 100644
--- a/services/core/java/com/android/server/policy/PermissionPolicyService.java
+++ b/services/core/java/com/android/server/policy/PermissionPolicyService.java
@@ -57,6 +57,7 @@
import android.content.pm.PackageManagerInternal;
import android.content.pm.PackageManagerInternal.PackageListObserver;
import android.content.pm.PermissionInfo;
+import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -78,10 +79,12 @@
import android.util.Slog;
import android.util.SparseBooleanArray;
+import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IAppOpsCallback;
import com.android.internal.app.IAppOpsService;
import com.android.internal.infra.AndroidFuture;
+import com.android.internal.policy.AttributeCache;
import com.android.internal.util.IntPair;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.server.FgThread;
@@ -1064,7 +1067,8 @@
ActivityInterceptorInfo info) {
super.onActivityLaunched(taskInfo, activityInfo, info);
if (!shouldShowNotificationDialogOrClearFlags(taskInfo,
- activityInfo.packageName, info.intent, info.checkedOptions, true)) {
+ activityInfo.packageName, info.intent, info.checkedOptions, true)
+ || isNoDisplayActivity(activityInfo)) {
return;
}
UserHandle user = UserHandle.of(taskInfo.userId);
@@ -1139,6 +1143,22 @@
taskInfo, currPkg, intent, null, false);
}
+ private boolean isNoDisplayActivity(@NonNull ActivityInfo aInfo) {
+ final int themeResource = aInfo.getThemeResource();
+ if (themeResource == Resources.ID_NULL) {
+ return false;
+ }
+
+ boolean noDisplay = false;
+ final AttributeCache.Entry ent = AttributeCache.instance()
+ .get(aInfo.packageName, themeResource, R.styleable.Window, 0);
+ if (ent != null) {
+ noDisplay = ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false);
+ }
+
+ return noDisplay;
+ }
+
/**
* Determine if a particular task is in the proper state to show a system-triggered
* permission prompt. A prompt can be shown if the task is just starting, or the task is
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index e0da0e8..4075cdd 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -293,6 +293,7 @@
private final Clock mClock;
private final Injector mInjector;
+ private AppOpsManager mAppOpsManager;
private LightsManager mLightsManager;
private BatteryManagerInternal mBatteryManagerInternal;
private DisplayManagerInternal mDisplayManagerInternal;
@@ -990,6 +991,10 @@
LowPowerStandbyController createLowPowerStandbyController(Context context, Looper looper) {
return new LowPowerStandbyController(context, looper, SystemClock::elapsedRealtime);
}
+
+ AppOpsManager createAppOpsManager(Context context) {
+ return context.getSystemService(AppOpsManager.class);
+ }
}
final Constants mConstants;
@@ -1044,6 +1049,8 @@
mInattentiveSleepWarningOverlayController =
mInjector.createInattentiveSleepWarningController();
+ mAppOpsManager = injector.createAppOpsManager(mContext);
+
mPowerGroupWakefulnessChangeListener = new PowerGroupWakefulnessChangeListener();
// Save brightness values:
@@ -1562,8 +1569,7 @@
}
return true;
}
- if (mContext.getSystemService(AppOpsManager.class).checkOpNoThrow(
- AppOpsManager.OP_TURN_SCREEN_ON, opUid, opPackageName)
+ if (mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_TURN_SCREEN_ON, opUid, opPackageName)
== AppOpsManager.MODE_ALLOWED) {
if (DEBUG_SPEW) {
Slog.d(TAG, "Allowing device wake-up for app with special access " + opPackageName);
diff --git a/services/core/java/com/android/server/trust/TEST_MAPPING b/services/core/java/com/android/server/trust/TEST_MAPPING
index be8ed67..fa46acd 100644
--- a/services/core/java/com/android/server/trust/TEST_MAPPING
+++ b/services/core/java/com/android/server/trust/TEST_MAPPING
@@ -11,5 +11,18 @@
}
]
}
+ ],
+ "trust-tablet": [
+ {
+ "name": "TrustTests",
+ "options": [
+ {
+ "include-filter": "android.trust.test"
+ },
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ }
+ ]
+ }
]
}
\ No newline at end of file
diff --git a/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java b/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java
index 89470ec..5c305c6 100644
--- a/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java
+++ b/services/core/java/com/android/server/vcn/TelephonySubscriptionTracker.java
@@ -29,6 +29,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.net.vcn.VcnManager;
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.ParcelUuid;
@@ -47,6 +48,8 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting.Visibility;
import com.android.internal.util.IndentingPrintWriter;
+import com.android.server.vcn.util.PersistableBundleUtils;
+import com.android.server.vcn.util.PersistableBundleUtils.PersistableBundleWrapper;
import java.util.ArrayList;
import java.util.Collections;
@@ -95,6 +98,10 @@
// TODO (Android T+): Add ability to handle multiple subIds per slot.
@NonNull private final Map<Integer, Integer> mReadySubIdsBySlotId = new HashMap<>();
+
+ @NonNull
+ private final Map<Integer, PersistableBundleWrapper> mSubIdToCarrierConfigMap = new HashMap<>();
+
@NonNull private final OnSubscriptionsChangedListener mSubscriptionChangedListener;
@NonNull
@@ -250,7 +257,10 @@
final TelephonySubscriptionSnapshot newSnapshot =
new TelephonySubscriptionSnapshot(
- mDeps.getActiveDataSubscriptionId(), newSubIdToInfoMap, privilegedPackages);
+ mDeps.getActiveDataSubscriptionId(),
+ newSubIdToInfoMap,
+ mSubIdToCarrierConfigMap,
+ privilegedPackages);
// If snapshot was meaningfully updated, fire the callback
if (!newSnapshot.equals(mCurrentSnapshot)) {
@@ -311,47 +321,77 @@
}
if (SubscriptionManager.isValidSubscriptionId(subId)) {
- final PersistableBundle carrierConfigs = mCarrierConfigManager.getConfigForSubId(subId);
- if (mDeps.isConfigForIdentifiedCarrier(carrierConfigs)) {
+ final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(subId);
+ if (mDeps.isConfigForIdentifiedCarrier(carrierConfig)) {
mReadySubIdsBySlotId.put(slotId, subId);
+
+ final PersistableBundle minimized =
+ PersistableBundleUtils.minimizeBundle(
+ carrierConfig, VcnManager.VCN_RELATED_CARRIER_CONFIG_KEYS);
+ if (minimized != null) {
+ mSubIdToCarrierConfigMap.put(subId, new PersistableBundleWrapper(minimized));
+ }
handleSubscriptionsChanged();
}
} else {
- mReadySubIdsBySlotId.remove(slotId);
+ final Integer oldSubid = mReadySubIdsBySlotId.remove(slotId);
+ if (oldSubid != null) {
+ mSubIdToCarrierConfigMap.remove(oldSubid);
+ }
handleSubscriptionsChanged();
}
}
@VisibleForTesting(visibility = Visibility.PRIVATE)
void setReadySubIdsBySlotId(Map<Integer, Integer> readySubIdsBySlotId) {
+ mReadySubIdsBySlotId.clear();
mReadySubIdsBySlotId.putAll(readySubIdsBySlotId);
}
@VisibleForTesting(visibility = Visibility.PRIVATE)
+ void setSubIdToCarrierConfigMap(
+ Map<Integer, PersistableBundleWrapper> subIdToCarrierConfigMap) {
+ mSubIdToCarrierConfigMap.clear();
+ mSubIdToCarrierConfigMap.putAll(subIdToCarrierConfigMap);
+ }
+
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
Map<Integer, Integer> getReadySubIdsBySlotId() {
return Collections.unmodifiableMap(mReadySubIdsBySlotId);
}
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ Map<Integer, PersistableBundleWrapper> getSubIdToCarrierConfigMap() {
+ return Collections.unmodifiableMap(mSubIdToCarrierConfigMap);
+ }
+
/** TelephonySubscriptionSnapshot is a class containing info about active subscriptions */
public static class TelephonySubscriptionSnapshot {
private final int mActiveDataSubId;
private final Map<Integer, SubscriptionInfo> mSubIdToInfoMap;
+ private final Map<Integer, PersistableBundleWrapper> mSubIdToCarrierConfigMap;
private final Map<ParcelUuid, Set<String>> mPrivilegedPackages;
public static final TelephonySubscriptionSnapshot EMPTY_SNAPSHOT =
new TelephonySubscriptionSnapshot(
- INVALID_SUBSCRIPTION_ID, Collections.emptyMap(), Collections.emptyMap());
+ INVALID_SUBSCRIPTION_ID,
+ Collections.emptyMap(),
+ Collections.emptyMap(),
+ Collections.emptyMap());
@VisibleForTesting(visibility = Visibility.PRIVATE)
TelephonySubscriptionSnapshot(
int activeDataSubId,
@NonNull Map<Integer, SubscriptionInfo> subIdToInfoMap,
+ @NonNull Map<Integer, PersistableBundleWrapper> subIdToCarrierConfigMap,
@NonNull Map<ParcelUuid, Set<String>> privilegedPackages) {
mActiveDataSubId = activeDataSubId;
Objects.requireNonNull(subIdToInfoMap, "subIdToInfoMap was null");
Objects.requireNonNull(privilegedPackages, "privilegedPackages was null");
+ Objects.requireNonNull(subIdToCarrierConfigMap, "subIdToCarrierConfigMap was null");
mSubIdToInfoMap = Collections.unmodifiableMap(subIdToInfoMap);
+ mSubIdToCarrierConfigMap = Collections.unmodifiableMap(subIdToCarrierConfigMap);
final Map<ParcelUuid, Set<String>> unmodifiableInnerSets = new ArrayMap<>();
for (Entry<ParcelUuid, Set<String>> entry : privilegedPackages.entrySet()) {
@@ -423,9 +463,40 @@
: false;
}
+ /**
+ * Retrieves a carrier config for a subscription in the provided group.
+ *
+ * <p>This method will prioritize non-opportunistic subscriptions, but will use the a
+ * carrier config for an opportunistic subscription if no other subscriptions are found.
+ */
+ @Nullable
+ public PersistableBundleWrapper getCarrierConfigForSubGrp(@NonNull ParcelUuid subGrp) {
+ PersistableBundleWrapper result = null;
+
+ for (int subId : getAllSubIdsInGroup(subGrp)) {
+ final PersistableBundleWrapper config = mSubIdToCarrierConfigMap.get(subId);
+ if (config != null) {
+ result = config;
+
+ // Attempt to use (any) non-opportunistic subscription. If this subscription is
+ // opportunistic, continue and try to find a non-opportunistic subscription,
+ // using the opportunistic ones as a last resort.
+ if (!isOpportunistic(subId)) {
+ return config;
+ }
+ }
+ }
+
+ return result;
+ }
+
@Override
public int hashCode() {
- return Objects.hash(mActiveDataSubId, mSubIdToInfoMap, mPrivilegedPackages);
+ return Objects.hash(
+ mActiveDataSubId,
+ mSubIdToInfoMap,
+ mSubIdToCarrierConfigMap,
+ mPrivilegedPackages);
}
@Override
@@ -438,6 +509,7 @@
return mActiveDataSubId == other.mActiveDataSubId
&& mSubIdToInfoMap.equals(other.mSubIdToInfoMap)
+ && mSubIdToCarrierConfigMap.equals(other.mSubIdToCarrierConfigMap)
&& mPrivilegedPackages.equals(other.mPrivilegedPackages);
}
@@ -448,6 +520,7 @@
pw.println("mActiveDataSubId: " + mActiveDataSubId);
pw.println("mSubIdToInfoMap: " + mSubIdToInfoMap);
+ pw.println("mSubIdToCarrierConfigMap: " + mSubIdToCarrierConfigMap);
pw.println("mPrivilegedPackages: " + mPrivilegedPackages);
pw.decreaseIndent();
@@ -458,6 +531,7 @@
return "TelephonySubscriptionSnapshot{ "
+ "mActiveDataSubId=" + mActiveDataSubId
+ ", mSubIdToInfoMap=" + mSubIdToInfoMap
+ + ", mSubIdToCarrierConfigMap=" + mSubIdToCarrierConfigMap
+ ", mPrivilegedPackages=" + mPrivilegedPackages
+ " }";
}
diff --git a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
index cefd8ef..05df22f 100644
--- a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
+++ b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
@@ -61,6 +61,7 @@
import android.net.ipsec.ike.IkeSession;
import android.net.ipsec.ike.IkeSessionCallback;
import android.net.ipsec.ike.IkeSessionConfiguration;
+import android.net.ipsec.ike.IkeSessionConnectionInfo;
import android.net.ipsec.ike.IkeSessionParams;
import android.net.ipsec.ike.IkeTunnelConnectionParams;
import android.net.ipsec.ike.exceptions.IkeException;
@@ -509,6 +510,42 @@
}
}
+ /**
+ * Sent when an IKE session connection information has changed.
+ *
+ * <p>This signal is always fired before EVENT_SETUP_COMPLETED and EVENT_MIGRATION_COMPLETED.
+ *
+ * <p>Only relevant in the Connecting and Connected state.
+ *
+ * @param arg1 The session token for the IKE Session whose connection information has changed,
+ * used to prevent out-of-date signals from propagating.
+ * @param obj @NonNull An EventIkeConnectionInfoChangedInfo instance with relevant data.
+ */
+ private static final int EVENT_IKE_CONNECTION_INFO_CHANGED = 12;
+
+ private static class EventIkeConnectionInfoChangedInfo implements EventInfo {
+ @NonNull public final IkeSessionConnectionInfo ikeConnectionInfo;
+
+ EventIkeConnectionInfoChangedInfo(@NonNull IkeSessionConnectionInfo ikeConnectionInfo) {
+ this.ikeConnectionInfo = ikeConnectionInfo;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(ikeConnectionInfo);
+ }
+
+ @Override
+ public boolean equals(@Nullable Object other) {
+ if (!(other instanceof EventIkeConnectionInfoChangedInfo)) {
+ return false;
+ }
+
+ final EventIkeConnectionInfoChangedInfo rhs = (EventIkeConnectionInfoChangedInfo) other;
+ return Objects.equals(ikeConnectionInfo, rhs.ikeConnectionInfo);
+ }
+ }
+
@VisibleForTesting(visibility = Visibility.PRIVATE)
@NonNull
final DisconnectedState mDisconnectedState = new DisconnectedState();
@@ -624,6 +661,14 @@
private UnderlyingNetworkRecord mUnderlying;
/**
+ * The current IKE Session connection information
+ *
+ * <p>Set in Connected and Migrating states, always @NonNull in Connected, Migrating
+ * states, @Nullable otherwise.
+ */
+ private IkeSessionConnectionInfo mIkeConnectionInfo;
+
+ /**
* The active IKE session.
*
* <p>Set in Connecting or Migrating States, always @NonNull in Connecting, Connected, and
@@ -1197,6 +1242,14 @@
exceptionMessage);
}
+ private void ikeConnectionInfoChanged(
+ int token, @NonNull IkeSessionConnectionInfo ikeConnectionInfo) {
+ sendMessageAndAcquireWakeLock(
+ EVENT_IKE_CONNECTION_INFO_CHANGED,
+ token,
+ new EventIkeConnectionInfoChangedInfo(ikeConnectionInfo));
+ }
+
private void sessionClosed(int token, @Nullable Exception exception) {
if (exception != null) {
notifyStatusCallbackForSessionClosed(exception);
@@ -1313,7 +1366,8 @@
case EVENT_TEARDOWN_TIMEOUT_EXPIRED: // Fallthrough
case EVENT_SUBSCRIPTIONS_CHANGED: // Fallthrough
case EVENT_SAFE_MODE_TIMEOUT_EXCEEDED: // Fallthrough
- case EVENT_MIGRATION_COMPLETED:
+ case EVENT_MIGRATION_COMPLETED: // Fallthrough
+ case EVENT_IKE_CONNECTION_INFO_CHANGED:
logUnexpectedEvent(msg.what);
break;
default:
@@ -1592,6 +1646,7 @@
transitionTo(mDisconnectingState);
break;
case EVENT_SETUP_COMPLETED: // fallthrough
+ case EVENT_IKE_CONNECTION_INFO_CHANGED: // fallthrough
case EVENT_TRANSFORM_CREATED:
// Child setup complete; move to ConnectedState for NetworkAgent registration
deferMessage(msg);
@@ -1614,12 +1669,17 @@
protected void updateNetworkAgent(
@NonNull IpSecTunnelInterface tunnelIface,
@NonNull VcnNetworkAgent agent,
- @NonNull VcnChildSessionConfiguration childConfig) {
+ @NonNull VcnChildSessionConfiguration childConfig,
+ @NonNull IkeSessionConnectionInfo ikeConnectionInfo) {
final NetworkCapabilities caps =
buildNetworkCapabilities(mConnectionConfig, mUnderlying, mIsMobileDataEnabled);
final LinkProperties lp =
buildConnectedLinkProperties(
- mConnectionConfig, tunnelIface, childConfig, mUnderlying);
+ mConnectionConfig,
+ tunnelIface,
+ childConfig,
+ mUnderlying,
+ ikeConnectionInfo);
agent.sendNetworkCapabilities(caps);
agent.sendLinkProperties(lp);
@@ -1630,12 +1690,17 @@
protected VcnNetworkAgent buildNetworkAgent(
@NonNull IpSecTunnelInterface tunnelIface,
- @NonNull VcnChildSessionConfiguration childConfig) {
+ @NonNull VcnChildSessionConfiguration childConfig,
+ @NonNull IkeSessionConnectionInfo ikeConnectionInfo) {
final NetworkCapabilities caps =
buildNetworkCapabilities(mConnectionConfig, mUnderlying, mIsMobileDataEnabled);
final LinkProperties lp =
buildConnectedLinkProperties(
- mConnectionConfig, tunnelIface, childConfig, mUnderlying);
+ mConnectionConfig,
+ tunnelIface,
+ childConfig,
+ mUnderlying,
+ ikeConnectionInfo);
final NetworkAgentConfig nac =
new NetworkAgentConfig.Builder()
.setLegacyType(ConnectivityManager.TYPE_MOBILE)
@@ -1838,7 +1903,11 @@
mChildConfig = ((EventSetupCompletedInfo) msg.obj).childSessionConfig;
setupInterfaceAndNetworkAgent(
- mCurrentToken, mTunnelIface, mChildConfig, oldChildConfig);
+ mCurrentToken,
+ mTunnelIface,
+ mChildConfig,
+ oldChildConfig,
+ mIkeConnectionInfo);
break;
case EVENT_DISCONNECT_REQUESTED:
handleDisconnectRequested((EventDisconnectRequestedInfo) msg.obj);
@@ -1852,6 +1921,10 @@
handleMigrationCompleted(migrationCompletedInfo);
break;
+ case EVENT_IKE_CONNECTION_INFO_CHANGED:
+ mIkeConnectionInfo =
+ ((EventIkeConnectionInfoChangedInfo) msg.obj).ikeConnectionInfo;
+ break;
default:
logUnhandledMessage(msg);
break;
@@ -1875,7 +1948,7 @@
migrationCompletedInfo.outTransform,
IpSecManager.DIRECTION_OUT);
- updateNetworkAgent(mTunnelIface, mNetworkAgent, mChildConfig);
+ updateNetworkAgent(mTunnelIface, mNetworkAgent, mChildConfig, mIkeConnectionInfo);
// Trigger re-validation after migration events.
mConnectivityManager.reportNetworkConnectivity(
@@ -1906,7 +1979,8 @@
// Network not yet set up, or child not yet connected.
if (mNetworkAgent != null && mChildConfig != null) {
// If only network properties changed and agent is active, update properties
- updateNetworkAgent(mTunnelIface, mNetworkAgent, mChildConfig);
+ updateNetworkAgent(
+ mTunnelIface, mNetworkAgent, mChildConfig, mIkeConnectionInfo);
}
}
}
@@ -1915,13 +1989,14 @@
int token,
@NonNull IpSecTunnelInterface tunnelIface,
@NonNull VcnChildSessionConfiguration childConfig,
- @NonNull VcnChildSessionConfiguration oldChildConfig) {
+ @NonNull VcnChildSessionConfiguration oldChildConfig,
+ @NonNull IkeSessionConnectionInfo ikeConnectionInfo) {
setupInterface(token, tunnelIface, childConfig, oldChildConfig);
if (mNetworkAgent == null) {
- mNetworkAgent = buildNetworkAgent(tunnelIface, childConfig);
+ mNetworkAgent = buildNetworkAgent(tunnelIface, childConfig, ikeConnectionInfo);
} else {
- updateNetworkAgent(tunnelIface, mNetworkAgent, childConfig);
+ updateNetworkAgent(tunnelIface, mNetworkAgent, childConfig, ikeConnectionInfo);
// mNetworkAgent not null, so the VCN Network has already been established. Clear
// the failed attempt counter and safe mode alarm since this transition is complete.
@@ -2098,7 +2173,8 @@
@NonNull VcnGatewayConnectionConfig gatewayConnectionConfig,
@NonNull IpSecTunnelInterface tunnelIface,
@NonNull VcnChildSessionConfiguration childConfig,
- @Nullable UnderlyingNetworkRecord underlying) {
+ @Nullable UnderlyingNetworkRecord underlying,
+ @NonNull IkeSessionConnectionInfo ikeConnectionInfo) {
final IkeTunnelConnectionParams ikeTunnelParams =
gatewayConnectionConfig.getTunnelConnectionParams();
final LinkProperties lp = new LinkProperties();
@@ -2139,7 +2215,8 @@
MtuUtils.getMtu(
ikeTunnelParams.getTunnelModeChildSessionParams().getSaProposals(),
gatewayConnectionConfig.getMaxMtu(),
- underlyingMtu));
+ underlyingMtu,
+ ikeConnectionInfo.getLocalAddress() instanceof Inet4Address));
return lp;
}
@@ -2154,7 +2231,7 @@
@Override
public void onOpened(@NonNull IkeSessionConfiguration ikeSessionConfig) {
logDbg("IkeOpened for token " + mToken);
- // Nothing to do here.
+ ikeConnectionInfoChanged(mToken, ikeSessionConfig.getIkeSessionConnectionInfo());
}
@Override
@@ -2174,6 +2251,13 @@
logInfo("IkeError for token " + mToken, exception);
// Non-fatal, log and continue.
}
+
+ @Override
+ public void onIkeSessionConnectionInfoChanged(
+ @NonNull IkeSessionConnectionInfo connectionInfo) {
+ logDbg("onIkeSessionConnectionInfoChanged for token " + mToken);
+ ikeConnectionInfoChanged(mToken, connectionInfo);
+ }
}
/** Implementation of ChildSessionCallback, exposed for testing. */
@@ -2350,6 +2434,11 @@
}
@VisibleForTesting(visibility = Visibility.PRIVATE)
+ IkeSessionConnectionInfo getIkeConnectionInfo() {
+ return mIkeConnectionInfo;
+ }
+
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
boolean isQuitting() {
return mIsQuitting.getValue();
}
diff --git a/services/core/java/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java b/services/core/java/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java
index c96c1ee..2f84fdd 100644
--- a/services/core/java/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java
+++ b/services/core/java/com/android/server/vcn/routeselection/NetworkPriorityClassifier.java
@@ -24,6 +24,7 @@
import static android.net.vcn.VcnUnderlyingNetworkTemplate.MATCH_REQUIRED;
import static com.android.server.VcnManagementService.LOCAL_LOG;
+import static com.android.server.vcn.util.PersistableBundleUtils.PersistableBundleWrapper;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -34,7 +35,6 @@
import android.net.vcn.VcnUnderlyingNetworkTemplate;
import android.net.vcn.VcnWifiUnderlyingNetworkTemplate;
import android.os.ParcelUuid;
-import android.os.PersistableBundle;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Slog;
@@ -81,7 +81,7 @@
ParcelUuid subscriptionGroup,
TelephonySubscriptionSnapshot snapshot,
UnderlyingNetworkRecord currentlySelected,
- PersistableBundle carrierConfig) {
+ PersistableBundleWrapper carrierConfig) {
// mRouteSelectionNetworkRequest requires a network be both VALIDATED and NOT_SUSPENDED
if (networkRecord.isBlocked) {
@@ -119,7 +119,7 @@
ParcelUuid subscriptionGroup,
TelephonySubscriptionSnapshot snapshot,
UnderlyingNetworkRecord currentlySelected,
- PersistableBundle carrierConfig) {
+ PersistableBundleWrapper carrierConfig) {
final NetworkCapabilities caps = networkRecord.networkCapabilities;
final boolean isSelectedUnderlyingNetwork =
currentlySelected != null
@@ -181,7 +181,7 @@
VcnWifiUnderlyingNetworkTemplate networkPriority,
UnderlyingNetworkRecord networkRecord,
UnderlyingNetworkRecord currentlySelected,
- PersistableBundle carrierConfig) {
+ PersistableBundleWrapper carrierConfig) {
final NetworkCapabilities caps = networkRecord.networkCapabilities;
if (!caps.hasTransport(TRANSPORT_WIFI)) {
@@ -204,7 +204,7 @@
private static boolean isWifiRssiAcceptable(
UnderlyingNetworkRecord networkRecord,
UnderlyingNetworkRecord currentlySelected,
- PersistableBundle carrierConfig) {
+ PersistableBundleWrapper carrierConfig) {
final NetworkCapabilities caps = networkRecord.networkCapabilities;
final boolean isSelectedNetwork =
currentlySelected != null
@@ -314,7 +314,7 @@
return false;
}
- static int getWifiEntryRssiThreshold(@Nullable PersistableBundle carrierConfig) {
+ static int getWifiEntryRssiThreshold(@Nullable PersistableBundleWrapper carrierConfig) {
if (carrierConfig != null) {
return carrierConfig.getInt(
VcnManager.VCN_NETWORK_SELECTION_WIFI_ENTRY_RSSI_THRESHOLD_KEY,
@@ -323,7 +323,7 @@
return WIFI_ENTRY_RSSI_THRESHOLD_DEFAULT;
}
- static int getWifiExitRssiThreshold(@Nullable PersistableBundle carrierConfig) {
+ static int getWifiExitRssiThreshold(@Nullable PersistableBundleWrapper carrierConfig) {
if (carrierConfig != null) {
return carrierConfig.getInt(
VcnManager.VCN_NETWORK_SELECTION_WIFI_EXIT_RSSI_THRESHOLD_KEY,
diff --git a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java
index a3babf7..d474c5d 100644
--- a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java
+++ b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java
@@ -21,7 +21,7 @@
import static com.android.server.VcnManagementService.LOCAL_LOG;
import static com.android.server.vcn.routeselection.NetworkPriorityClassifier.getWifiEntryRssiThreshold;
import static com.android.server.vcn.routeselection.NetworkPriorityClassifier.getWifiExitRssiThreshold;
-import static com.android.server.vcn.routeselection.NetworkPriorityClassifier.isOpportunistic;
+import static com.android.server.vcn.util.PersistableBundleUtils.PersistableBundleWrapper;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -37,8 +37,6 @@
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.ParcelUuid;
-import android.os.PersistableBundle;
-import android.telephony.CarrierConfigManager;
import android.telephony.TelephonyCallback;
import android.telephony.TelephonyManager;
import android.util.ArrayMap;
@@ -51,7 +49,6 @@
import com.android.server.vcn.util.LogUtils;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -87,7 +84,7 @@
@Nullable private UnderlyingNetworkListener mRouteSelectionCallback;
@NonNull private TelephonySubscriptionSnapshot mLastSnapshot;
- @Nullable private PersistableBundle mCarrierConfig;
+ @Nullable private PersistableBundleWrapper mCarrierConfig;
private boolean mIsQuitting = false;
@Nullable private UnderlyingNetworkRecord mCurrentRecord;
@@ -124,25 +121,7 @@
.getSystemService(TelephonyManager.class)
.registerTelephonyCallback(new HandlerExecutor(mHandler), mActiveDataSubIdListener);
- // TODO: Listen for changes in carrier config that affect this.
- for (int subId : mLastSnapshot.getAllSubIdsInGroup(mSubscriptionGroup)) {
- PersistableBundle config =
- mVcnContext
- .getContext()
- .getSystemService(CarrierConfigManager.class)
- .getConfigForSubId(subId);
-
- if (config != null) {
- mCarrierConfig = config;
-
- // Attempt to use (any) non-opportunistic subscription. If this subscription is
- // opportunistic, continue and try to find a non-opportunistic subscription, using
- // the opportunistic ones as a last resort.
- if (!isOpportunistic(mLastSnapshot, Collections.singleton(subId))) {
- break;
- }
- }
- }
+ mCarrierConfig = mLastSnapshot.getCarrierConfigForSubGrp(mSubscriptionGroup);
registerOrUpdateNetworkRequests();
}
@@ -334,6 +313,9 @@
final TelephonySubscriptionSnapshot oldSnapshot = mLastSnapshot;
mLastSnapshot = newSnapshot;
+ // Update carrier config
+ mCarrierConfig = mLastSnapshot.getCarrierConfigForSubGrp(mSubscriptionGroup);
+
// Only trigger re-registration if subIds in this group have changed
if (oldSnapshot
.getAllSubIdsInGroup(mSubscriptionGroup)
diff --git a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java
index 06f9280..319680e 100644
--- a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java
+++ b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkRecord.java
@@ -16,6 +16,8 @@
package com.android.server.vcn.routeselection;
+import static com.android.server.vcn.util.PersistableBundleUtils.PersistableBundleWrapper;
+
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.net.LinkProperties;
@@ -23,7 +25,6 @@
import android.net.NetworkCapabilities;
import android.net.vcn.VcnUnderlyingNetworkTemplate;
import android.os.ParcelUuid;
-import android.os.PersistableBundle;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting.Visibility;
@@ -68,7 +69,7 @@
ParcelUuid subscriptionGroup,
TelephonySubscriptionSnapshot snapshot,
UnderlyingNetworkRecord currentlySelected,
- PersistableBundle carrierConfig) {
+ PersistableBundleWrapper carrierConfig) {
// Never changes after the underlying network record is created.
if (mPriorityClass == PRIORITY_CLASS_INVALID) {
mPriorityClass =
@@ -113,7 +114,7 @@
ParcelUuid subscriptionGroup,
TelephonySubscriptionSnapshot snapshot,
UnderlyingNetworkRecord currentlySelected,
- PersistableBundle carrierConfig) {
+ PersistableBundleWrapper carrierConfig) {
return (left, right) -> {
final int leftIndex =
left.getOrCalculatePriorityClass(
@@ -167,7 +168,7 @@
ParcelUuid subscriptionGroup,
TelephonySubscriptionSnapshot snapshot,
UnderlyingNetworkRecord currentlySelected,
- PersistableBundle carrierConfig) {
+ PersistableBundleWrapper carrierConfig) {
pw.println("UnderlyingNetworkRecord:");
pw.increaseIndent();
diff --git a/services/core/java/com/android/server/vcn/util/MtuUtils.java b/services/core/java/com/android/server/vcn/util/MtuUtils.java
index 5d40cca..356c71f 100644
--- a/services/core/java/com/android/server/vcn/util/MtuUtils.java
+++ b/services/core/java/com/android/server/vcn/util/MtuUtils.java
@@ -51,9 +51,20 @@
/**
* Max ESP overhead possible
*
- * <p>60 (Outer IPv4 + options) + 8 (UDP encap) + 4 (SPI) + 4 (Seq) + 2 (Pad + NextHeader)
+ * <p>60 (Outer IPv4 + options) + 8 (UDP encap) + 4 (SPI) + 4 (Seq) + 2 (Pad Length + Next
+ * Header). Note: Payload data, Pad Length and Next Header will need to be padded to be multiple
+ * of the block size of a cipher, and at the same time be aligned on a 4-byte boundary.
*/
- private static final int GENERIC_ESP_OVERHEAD_MAX = 78;
+ private static final int GENERIC_ESP_OVERHEAD_MAX_V4 = 78;
+
+ /**
+ * Max ESP overhead possible
+ *
+ * <p>40 (Outer IPv6) + 4 (SPI) + 4 (Seq) + 2 (Pad Length + Next Header). Note: Payload data,
+ * Pad Length and Next Header will need to be padded to be multiple of the block size of a
+ * cipher, and at the same time be aligned on a 4-byte boundary.
+ */
+ private static final int GENERIC_ESP_OVERHEAD_MAX_V6 = 50;
/** Maximum overheads of authentication algorithms, keyed on IANA-defined constants */
private static final Map<Integer, Integer> AUTH_ALGORITHM_OVERHEAD;
@@ -108,7 +119,10 @@
* </ul>
*/
public static int getMtu(
- @NonNull List<ChildSaProposal> childProposals, int maxMtu, int underlyingMtu) {
+ @NonNull List<ChildSaProposal> childProposals,
+ int maxMtu,
+ int underlyingMtu,
+ boolean isIpv4) {
if (underlyingMtu <= 0) {
return IPV6_MIN_MTU;
}
@@ -145,10 +159,13 @@
}
}
+ final int genericEspOverheadMax =
+ isIpv4 ? GENERIC_ESP_OVERHEAD_MAX_V4 : GENERIC_ESP_OVERHEAD_MAX_V6;
+
// Return minimum of maxMtu, and the adjusted MTUs based on algorithms.
- final int combinedModeMtu = underlyingMtu - maxAuthCryptOverhead - GENERIC_ESP_OVERHEAD_MAX;
+ final int combinedModeMtu = underlyingMtu - maxAuthCryptOverhead - genericEspOverheadMax;
final int normalModeMtu =
- underlyingMtu - maxCryptOverhead - maxAuthOverhead - GENERIC_ESP_OVERHEAD_MAX;
+ underlyingMtu - maxCryptOverhead - maxAuthOverhead - genericEspOverheadMax;
return Math.min(Math.min(maxMtu, combinedModeMtu), normalModeMtu);
}
}
diff --git a/services/core/java/com/android/server/vcn/util/PersistableBundleUtils.java b/services/core/java/com/android/server/vcn/util/PersistableBundleUtils.java
index 1c675c2..08e8eeb 100644
--- a/services/core/java/com/android/server/vcn/util/PersistableBundleUtils.java
+++ b/services/core/java/com/android/server/vcn/util/PersistableBundleUtils.java
@@ -28,11 +28,13 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
+import java.util.TreeSet;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -354,4 +356,182 @@
}
}
}
+
+ /**
+ * Returns a copy of the persistable bundle with only the specified keys
+ *
+ * <p>This allows for holding minimized copies for memory-saving purposes.
+ */
+ @NonNull
+ public static PersistableBundle minimizeBundle(
+ @NonNull PersistableBundle bundle, String... keys) {
+ final PersistableBundle minimized = new PersistableBundle();
+
+ if (bundle == null) {
+ return minimized;
+ }
+
+ for (String key : keys) {
+ if (bundle.containsKey(key)) {
+ final Object value = bundle.get(key);
+ if (value == null) {
+ continue;
+ }
+
+ if (value instanceof Boolean) {
+ minimized.putBoolean(key, (Boolean) value);
+ } else if (value instanceof boolean[]) {
+ minimized.putBooleanArray(key, (boolean[]) value);
+ } else if (value instanceof Double) {
+ minimized.putDouble(key, (Double) value);
+ } else if (value instanceof double[]) {
+ minimized.putDoubleArray(key, (double[]) value);
+ } else if (value instanceof Integer) {
+ minimized.putInt(key, (Integer) value);
+ } else if (value instanceof int[]) {
+ minimized.putIntArray(key, (int[]) value);
+ } else if (value instanceof Long) {
+ minimized.putLong(key, (Long) value);
+ } else if (value instanceof long[]) {
+ minimized.putLongArray(key, (long[]) value);
+ } else if (value instanceof String) {
+ minimized.putString(key, (String) value);
+ } else if (value instanceof String[]) {
+ minimized.putStringArray(key, (String[]) value);
+ } else if (value instanceof PersistableBundle) {
+ minimized.putPersistableBundle(key, (PersistableBundle) value);
+ } else {
+ continue;
+ }
+ }
+ }
+
+ return minimized;
+ }
+
+ /** Builds a stable hashcode */
+ public static int getHashCode(@Nullable PersistableBundle bundle) {
+ if (bundle == null) {
+ return -1;
+ }
+
+ int iterativeHashcode = 0;
+ TreeSet<String> treeSet = new TreeSet<>(bundle.keySet());
+ for (String key : treeSet) {
+ Object val = bundle.get(key);
+ if (val instanceof PersistableBundle) {
+ iterativeHashcode =
+ Objects.hash(iterativeHashcode, key, getHashCode((PersistableBundle) val));
+ } else {
+ iterativeHashcode = Objects.hash(iterativeHashcode, key, val);
+ }
+ }
+
+ return iterativeHashcode;
+ }
+
+ /** Checks for persistable bundle equality */
+ public static boolean isEqual(
+ @Nullable PersistableBundle left, @Nullable PersistableBundle right) {
+ // Check for pointer equality & null equality
+ if (Objects.equals(left, right)) {
+ return true;
+ }
+
+ // If only one of the two is null, but not the other, not equal by definition.
+ if (Objects.isNull(left) != Objects.isNull(right)) {
+ return false;
+ }
+
+ if (!left.keySet().equals(right.keySet())) {
+ return false;
+ }
+
+ for (String key : left.keySet()) {
+ Object leftVal = left.get(key);
+ Object rightVal = right.get(key);
+
+ // Check for equality
+ if (Objects.equals(leftVal, rightVal)) {
+ continue;
+ } else if (Objects.isNull(leftVal) != Objects.isNull(rightVal)) {
+ // If only one of the two is null, but not the other, not equal by definition.
+ return false;
+ } else if (!Objects.equals(leftVal.getClass(), rightVal.getClass())) {
+ // If classes are different, not equal by definition.
+ return false;
+ }
+ if (leftVal instanceof PersistableBundle) {
+ if (!isEqual((PersistableBundle) leftVal, (PersistableBundle) rightVal)) {
+ return false;
+ }
+ } else if (leftVal.getClass().isArray()) {
+ if (leftVal instanceof boolean[]) {
+ if (!Arrays.equals((boolean[]) leftVal, (boolean[]) rightVal)) {
+ return false;
+ }
+ } else if (leftVal instanceof double[]) {
+ if (!Arrays.equals((double[]) leftVal, (double[]) rightVal)) {
+ return false;
+ }
+ } else if (leftVal instanceof int[]) {
+ if (!Arrays.equals((int[]) leftVal, (int[]) rightVal)) {
+ return false;
+ }
+ } else if (leftVal instanceof long[]) {
+ if (!Arrays.equals((long[]) leftVal, (long[]) rightVal)) {
+ return false;
+ }
+ } else if (!Arrays.equals((Object[]) leftVal, (Object[]) rightVal)) {
+ return false;
+ }
+ } else {
+ if (!Objects.equals(leftVal, rightVal)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Wrapper class around PersistableBundles to allow equality comparisons
+ *
+ * <p>This class exposes the minimal getters to retrieve values.
+ */
+ public static class PersistableBundleWrapper {
+ @NonNull private final PersistableBundle mBundle;
+
+ public PersistableBundleWrapper(@NonNull PersistableBundle bundle) {
+ mBundle = Objects.requireNonNull(bundle, "Bundle was null");
+ }
+
+ /**
+ * Retrieves the integer associated with the provided key.
+ *
+ * @param key the string key to query
+ * @param defaultValue the value to return if key does not exist
+ * @return the int value, or the default
+ */
+ public int getInt(String key, int defaultValue) {
+ return mBundle.getInt(key, defaultValue);
+ }
+
+ @Override
+ public int hashCode() {
+ return getHashCode(mBundle);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof PersistableBundleWrapper)) {
+ return false;
+ }
+
+ final PersistableBundleWrapper other = (PersistableBundleWrapper) obj;
+
+ return isEqual(mBundle, other.mBundle);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/wm/ActivityClientController.java b/services/core/java/com/android/server/wm/ActivityClientController.java
index 5fdcd69..4822ddb 100644
--- a/services/core/java/com/android/server/wm/ActivityClientController.java
+++ b/services/core/java/com/android/server/wm/ActivityClientController.java
@@ -1190,10 +1190,29 @@
}
}
+ /**
+ * Removes the outdated home task snapshot.
+ *
+ * @param token The token of the home task, or null if you have the
+ * {@link android.Manifest.permission#MANAGE_ACTIVITY_TASKS}
+ * permission and want us to find the home task token for you.
+ */
@Override
public void invalidateHomeTaskSnapshot(IBinder token) {
+ if (token == null) {
+ ActivityTaskManagerService.enforceTaskPermission("invalidateHomeTaskSnapshot");
+ }
+
synchronized (mGlobalLock) {
- final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
+ final ActivityRecord r;
+ if (token == null) {
+ final Task rootTask =
+ mService.mRootWindowContainer.getDefaultTaskDisplayArea().getRootHomeTask();
+ r = rootTask != null ? rootTask.topRunningActivity() : null;
+ } else {
+ r = ActivityRecord.isInRootTaskLocked(token);
+ }
+
if (r != null && r.isActivityTypeHome()) {
mService.mWindowManager.mTaskSnapshotController.removeSnapshotCache(
r.getTask().mTaskId);
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 1956cee..b6a1784 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -322,6 +322,7 @@
import android.view.WindowManager.LayoutParams;
import android.view.WindowManager.TransitionOldType;
import android.view.animation.Animation;
+import android.window.ITaskFragmentOrganizer;
import android.window.RemoteTransition;
import android.window.SizeConfigurationBuckets;
import android.window.SplashScreen;
@@ -635,6 +636,13 @@
// host Activity the launch-into-pip Activity is originated from.
private ActivityRecord mLaunchIntoPipHostActivity;
+ /**
+ * Sets to the previous {@link ITaskFragmentOrganizer} of the {@link TaskFragment} that the
+ * activity is embedded in before it is reparented to a new Task due to picture-in-picture.
+ */
+ @Nullable
+ ITaskFragmentOrganizer mLastTaskFragmentOrganizerBeforePip;
+
boolean firstWindowDrawn;
/** Whether the visible window(s) of this activity is drawn. */
private boolean mReportedDrawn;
@@ -1531,7 +1539,10 @@
updateAnimatingActivityRegistry();
- if (task == mLastParentBeforePip) {
+ if (task == mLastParentBeforePip && task != null) {
+ // Notify the TaskFragmentOrganizer that the activity is reparented back from pip.
+ mAtmService.mWindowOrganizerController.mTaskFragmentOrganizerController
+ .onActivityReparentToTask(this);
// Activity's reparented back from pip, clear the links once established
clearLastParentBeforePip();
}
@@ -1654,6 +1665,12 @@
: launchIntoPipHostActivity.getTask();
mLastParentBeforePip.mChildPipActivity = this;
mLaunchIntoPipHostActivity = launchIntoPipHostActivity;
+ final TaskFragment organizedTf = launchIntoPipHostActivity == null
+ ? getOrganizedTaskFragment()
+ : launchIntoPipHostActivity.getOrganizedTaskFragment();
+ mLastTaskFragmentOrganizerBeforePip = organizedTf != null
+ ? organizedTf.getTaskFragmentOrganizer()
+ : null;
}
private void clearLastParentBeforePip() {
@@ -1662,6 +1679,7 @@
mLastParentBeforePip = null;
}
mLaunchIntoPipHostActivity = null;
+ mLastTaskFragmentOrganizerBeforePip = null;
}
@Nullable Task getLastParentBeforePip() {
@@ -2452,20 +2470,29 @@
// Obsoleted snapshot.
return false;
}
- final Rect taskBounds = task.getBounds();
- final Point taskSize = snapshot.getTaskSize();
- // Task size has changed? e.g. foldable device.
- if (Math.abs(((float) taskSize.x / Math.max(taskSize.y, 1))
- - ((float) taskBounds.width() / Math.max(taskBounds.height(), 1))) > 0.01f) {
- return false;
- }
final int rotation = mDisplayContent.rotationForActivityInDifferentOrientation(this);
+ final int currentRotation = task.getWindowConfiguration().getRotation();
final int targetRotation = rotation != ROTATION_UNDEFINED
// The display may rotate according to the orientation of this activity.
? rotation
// The activity won't change display orientation.
- : task.getWindowConfiguration().getRotation();
- return snapshot.getRotation() == targetRotation;
+ : currentRotation;
+ if (snapshot.getRotation() != targetRotation) {
+ return false;
+ }
+ final Rect taskBounds = task.getBounds();
+ int w = taskBounds.width();
+ int h = taskBounds.height();
+ final Point taskSize = snapshot.getTaskSize();
+ if ((Math.abs(currentRotation - targetRotation) % 2) == 1) {
+ // Flip the size if the activity will show in 90 degree difference.
+ final int t = w;
+ w = h;
+ h = t;
+ }
+ // Task size might be changed with the same rotation such as on a foldable device.
+ return Math.abs(((float) taskSize.x / Math.max(taskSize.y, 1))
+ - ((float) w / Math.max(h, 1))) <= 0.01f;
}
/**
@@ -5515,8 +5542,8 @@
}
/** @return {@code true} if this activity should be made visible. */
- private boolean shouldBeVisible(boolean behindFullscreenActivity, boolean ignoringKeyguard) {
- updateVisibilityIgnoringKeyguard(behindFullscreenActivity);
+ private boolean shouldBeVisible(boolean behindOccludedContainer, boolean ignoringKeyguard) {
+ updateVisibilityIgnoringKeyguard(behindOccludedContainer);
if (ignoringKeyguard) {
return visibleIgnoringKeyguard;
@@ -5574,20 +5601,20 @@
return differentUidOverlayActivity != null;
}
- void updateVisibilityIgnoringKeyguard(boolean behindFullscreenActivity) {
- visibleIgnoringKeyguard = (!behindFullscreenActivity || mLaunchTaskBehind)
+ void updateVisibilityIgnoringKeyguard(boolean behindOccludedContainer) {
+ visibleIgnoringKeyguard = (!behindOccludedContainer || mLaunchTaskBehind)
&& showToCurrentUser();
}
boolean shouldBeVisible() {
- final Task rootTask = getRootTask();
- if (rootTask == null) {
+ final Task task = getTask();
+ if (task == null) {
return false;
}
- final boolean behindFullscreenActivity = !rootTask.shouldBeVisible(null /* starting */)
- || rootTask.getOccludingActivityAbove(this) != null;
- return shouldBeVisible(behindFullscreenActivity, false /* ignoringKeyguard */);
+ final boolean behindOccludedContainer = !task.shouldBeVisible(null /* starting */)
+ || task.getOccludingActivityAbove(this) != null;
+ return shouldBeVisible(behindOccludedContainer, false /* ignoringKeyguard */);
}
void makeVisibleIfNeeded(ActivityRecord starting, boolean reportToClient) {
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 75d4621..34c083a 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -2809,11 +2809,6 @@
}
}
- if (mPreferredWindowingMode != WINDOWING_MODE_UNDEFINED
- && intentTask.getWindowingMode() != mPreferredWindowingMode) {
- intentTask.setWindowingMode(mPreferredWindowingMode);
- }
-
// Update the target's launch cookie to those specified in the options if set
if (mStartActivity.mLaunchCookie != null) {
intentActivity.mLaunchCookie = mStartActivity.mLaunchCookie;
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index d997707..d254aaf 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -3331,7 +3331,7 @@
}
userId = activity.mUserId;
}
- return DevicePolicyCache.getInstance().isScreenCaptureAllowed(userId, false);
+ return DevicePolicyCache.getInstance().isScreenCaptureAllowed(userId);
}
private void onLocalVoiceInteractionStartedLocked(IBinder activity,
diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java
index cefc871..3bda2e6 100644
--- a/services/core/java/com/android/server/wm/AppTransitionController.java
+++ b/services/core/java/com/android/server/wm/AppTransitionController.java
@@ -562,9 +562,6 @@
leafTask = null;
break;
}
- // The activity may be a child of embedded Task, but we want to find the owner Task.
- // As a result, find the organized TaskFragment first.
- final TaskFragment organizedTaskFragment = r.getOrganizedTaskFragment();
// There are also cases where the Task contains non-embedded activity, such as launching
// split TaskFragments from a non-embedded activity.
// The hierarchy may looks like this:
@@ -575,10 +572,9 @@
// - TaskFragment
// - Activity
// We also want to have the organizer handle the transition for such case.
- final Task task = organizedTaskFragment != null
- ? organizedTaskFragment.getTask()
- : r.getTask();
- if (task == null) {
+ final Task task = r.getTask();
+ // We don't support embedding in PiP, leave the animation to the PipTaskOrganizer.
+ if (task == null || task.inPinnedWindowingMode()) {
leafTask = null;
break;
}
diff --git a/services/core/java/com/android/server/wm/BLASTSyncEngine.java b/services/core/java/com/android/server/wm/BLASTSyncEngine.java
index 3f300bc..ee7d9a9 100644
--- a/services/core/java/com/android/server/wm/BLASTSyncEngine.java
+++ b/services/core/java/com/android/server/wm/BLASTSyncEngine.java
@@ -19,7 +19,7 @@
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_SYNC_ENGINE;
-import static com.android.server.wm.WindowManagerService.H.WINDOW_STATE_BLAST_SYNC_TIMEOUT;
+import static com.android.server.wm.WindowState.BLAST_TIMEOUT_DURATION;
import android.annotation.NonNull;
import android.os.Trace;
@@ -173,7 +173,7 @@
}
};
merged.addTransactionCommittedListener((r) -> { r.run(); }, callback::run);
- mWm.mH.postDelayed(callback, WINDOW_STATE_BLAST_SYNC_TIMEOUT);
+ mWm.mH.postDelayed(callback, BLAST_TIMEOUT_DURATION);
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "onTransactionReady");
mListener.onTransactionReady(mSyncId, merged);
@@ -255,7 +255,7 @@
}
int startSyncSet(TransactionReadyListener listener) {
- return startSyncSet(listener, WindowState.BLAST_TIMEOUT_DURATION, "");
+ return startSyncSet(listener, BLAST_TIMEOUT_DURATION, "");
}
int startSyncSet(TransactionReadyListener listener, long timeoutMs, String name) {
@@ -265,7 +265,7 @@
}
void startSyncSet(SyncGroup s) {
- startSyncSet(s, WindowState.BLAST_TIMEOUT_DURATION);
+ startSyncSet(s, BLAST_TIMEOUT_DURATION);
}
void startSyncSet(SyncGroup s, long timeoutMs) {
diff --git a/services/core/java/com/android/server/wm/DisplayArea.java b/services/core/java/com/android/server/wm/DisplayArea.java
index dfa3b74..863782a 100644
--- a/services/core/java/com/android/server/wm/DisplayArea.java
+++ b/services/core/java/com/android/server/wm/DisplayArea.java
@@ -78,8 +78,11 @@
* Whether this {@link DisplayArea} should ignore fixed-orientation request. If {@code true}, it
* can never specify orientation, but shows the fixed-orientation apps below it in the
* letterbox; otherwise, it rotates based on the fixed-orientation request.
+ *
+ * <p>Note: use {@link #getIgnoreOrientationRequest} to access outside of {@link
+ * #setIgnoreOrientationRequest} since the value can be overridden at runtime on a device level.
*/
- protected boolean mIgnoreOrientationRequest;
+ protected boolean mSetIgnoreOrientationRequest;
DisplayArea(WindowManagerService wms, Type type, String name) {
this(wms, type, name, FEATURE_UNDEFINED);
@@ -140,7 +143,7 @@
@Override
int getOrientation(int candidate) {
mLastOrientationSource = null;
- if (mIgnoreOrientationRequest) {
+ if (getIgnoreOrientationRequest()) {
return SCREEN_ORIENTATION_UNSET;
}
@@ -149,14 +152,15 @@
@Override
boolean handlesOrientationChangeFromDescendant() {
- return !mIgnoreOrientationRequest && super.handlesOrientationChangeFromDescendant();
+ return !getIgnoreOrientationRequest()
+ && super.handlesOrientationChangeFromDescendant();
}
@Override
boolean onDescendantOrientationChanged(WindowContainer requestingContainer) {
// If this is set to ignore the orientation request, we don't propagate descendant
// orientation request.
- return !mIgnoreOrientationRequest
+ return !getIgnoreOrientationRequest()
&& super.onDescendantOrientationChanged(requestingContainer);
}
@@ -167,10 +171,10 @@
* @return Whether the display orientation changed after calling this method.
*/
boolean setIgnoreOrientationRequest(boolean ignoreOrientationRequest) {
- if (mIgnoreOrientationRequest == ignoreOrientationRequest) {
+ if (mSetIgnoreOrientationRequest == ignoreOrientationRequest) {
return false;
}
- mIgnoreOrientationRequest = ignoreOrientationRequest;
+ mSetIgnoreOrientationRequest = ignoreOrientationRequest;
// Check whether we should notify Display to update orientation.
if (mDisplayContent == null) {
@@ -204,7 +208,11 @@
}
boolean getIgnoreOrientationRequest() {
- return mIgnoreOrientationRequest;
+ // Adding an exception for when ignoreOrientationRequest is overridden at runtime for all
+ // DisplayArea-s. For example, this is needed for the Kids Mode since many Kids apps aren't
+ // optimised to support both orientations and it will be hard for kids to understand the
+ // app compat mode.
+ return mSetIgnoreOrientationRequest && !mWmService.isIgnoreOrientationRequestDisabled();
}
/**
@@ -289,8 +297,8 @@
@Override
void dump(PrintWriter pw, String prefix, boolean dumpAll) {
super.dump(pw, prefix, dumpAll);
- if (mIgnoreOrientationRequest) {
- pw.println(prefix + "mIgnoreOrientationRequest=true");
+ if (mSetIgnoreOrientationRequest) {
+ pw.println(prefix + "mSetIgnoreOrientationRequest=true");
}
if (hasRequestedOverrideConfiguration()) {
pw.println(prefix + "overrideConfig=" + getRequestedOverrideConfiguration());
@@ -600,7 +608,7 @@
@Override
int getOrientation(int candidate) {
mLastOrientationSource = null;
- if (mIgnoreOrientationRequest) {
+ if (getIgnoreOrientationRequest()) {
return SCREEN_ORIENTATION_UNSET;
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 4660757..dc44186 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -358,6 +358,8 @@
float mInitialPhysicalXDpi = 0.0f;
float mInitialPhysicalYDpi = 0.0f;
+ private Point mStableDisplaySize;
+
DisplayCutout mInitialDisplayCutout;
private final RotationCache<DisplayCutout, WmDisplayCutout> mDisplayCutoutCache
= new RotationCache<>(this::calculateDisplayCutoutForRotationUncached);
@@ -379,6 +381,8 @@
*/
int mBaseDisplayWidth = 0;
int mBaseDisplayHeight = 0;
+ DisplayCutout mBaseDisplayCutout;
+ RoundedCorners mBaseRoundedCorners;
boolean mIsSizeForced = false;
/**
@@ -1485,7 +1489,8 @@
@Override
boolean handlesOrientationChangeFromDescendant() {
- return !mIgnoreOrientationRequest && !getDisplayRotation().isFixedToUserRotation();
+ return !getIgnoreOrientationRequest()
+ && !getDisplayRotation().isFixedToUserRotation();
}
/**
@@ -2078,7 +2083,8 @@
}
WmDisplayCutout calculateDisplayCutoutForRotation(int rotation) {
- return mDisplayCutoutCache.getOrCompute(mInitialDisplayCutout, rotation);
+ return mDisplayCutoutCache.getOrCompute(
+ mIsSizeForced ? mBaseDisplayCutout : mInitialDisplayCutout, rotation);
}
static WmDisplayCutout calculateDisplayCutoutForRotationAndDisplaySizeUncached(
@@ -2101,11 +2107,13 @@
private WmDisplayCutout calculateDisplayCutoutForRotationUncached(
DisplayCutout cutout, int rotation) {
return calculateDisplayCutoutForRotationAndDisplaySizeUncached(cutout, rotation,
- mInitialDisplayWidth, mInitialDisplayHeight);
+ mIsSizeForced ? mBaseDisplayWidth : mInitialDisplayWidth,
+ mIsSizeForced ? mBaseDisplayHeight : mInitialDisplayHeight);
}
RoundedCorners calculateRoundedCornersForRotation(int rotation) {
- return mRoundedCornerCache.getOrCompute(mInitialRoundedCorners, rotation);
+ return mRoundedCornerCache.getOrCompute(
+ mIsSizeForced ? mBaseRoundedCorners : mInitialRoundedCorners, rotation);
}
private RoundedCorners calculateRoundedCornersForRotationUncached(
@@ -2118,7 +2126,10 @@
return roundedCorners;
}
- return roundedCorners.rotate(rotation, mInitialDisplayWidth, mInitialDisplayHeight);
+ return roundedCorners.rotate(
+ rotation,
+ mIsSizeForced ? mBaseDisplayWidth : mInitialDisplayWidth,
+ mIsSizeForced ? mBaseDisplayHeight : mInitialDisplayHeight);
}
PrivacyIndicatorBounds calculatePrivacyIndicatorBoundsForRotation(int rotation) {
@@ -2719,6 +2730,7 @@
mInitialRoundedCorners = mDisplayInfo.roundedCorners;
mCurrentPrivacyIndicatorBounds = new PrivacyIndicatorBounds(new Rect[4],
mDisplayInfo.rotation);
+ mStableDisplaySize = mWmService.mDisplayManager.getStableDisplaySize();
}
/**
@@ -2814,6 +2826,10 @@
mBaseDisplayDensity = baseDensity;
mBaseDisplayPhysicalXDpi = baseXDpi;
mBaseDisplayPhysicalYDpi = baseYDpi;
+ if (mIsSizeForced) {
+ mBaseDisplayCutout = loadDisplayCutout(baseWidth, baseHeight);
+ mBaseRoundedCorners = loadRoundedCorners(baseWidth, baseHeight);
+ }
if (mMaxUiWidth > 0 && mBaseDisplayWidth > mMaxUiWidth) {
final float ratio = mMaxUiWidth / (float) mBaseDisplayWidth;
@@ -2904,6 +2920,24 @@
mWmService.mDisplayWindowSettings.setForcedSize(this, width, height);
}
+ DisplayCutout loadDisplayCutout(int displayWidth, int displayHeight) {
+ if (mDisplayPolicy == null) {
+ return null;
+ }
+ return DisplayCutout.fromResourcesRectApproximation(
+ mDisplayPolicy.getSystemUiContext().getResources(), mDisplayInfo.uniqueId,
+ mStableDisplaySize.x, mStableDisplaySize.y, displayWidth, displayHeight);
+ }
+
+ RoundedCorners loadRoundedCorners(int displayWidth, int displayHeight) {
+ if (mDisplayPolicy == null) {
+ return null;
+ }
+ return RoundedCorners.fromResources(
+ mDisplayPolicy.getSystemUiContext().getResources(), mDisplayInfo.uniqueId,
+ mStableDisplaySize.x, mStableDisplaySize.y, displayWidth, displayHeight);
+ }
+
@Override
void getStableRect(Rect out) {
final InsetsState state = mDisplayContent.getInsetsStateController().getRawInsetsState();
@@ -4859,7 +4893,7 @@
@Override
int getOrientation(int candidate) {
- if (mIgnoreOrientationRequest) {
+ if (getIgnoreOrientationRequest()) {
return SCREEN_ORIENTATION_UNSET;
}
@@ -6098,14 +6132,29 @@
@Override
boolean setIgnoreOrientationRequest(boolean ignoreOrientationRequest) {
- if (mIgnoreOrientationRequest == ignoreOrientationRequest) return false;
+ if (mSetIgnoreOrientationRequest == ignoreOrientationRequest) return false;
final boolean rotationChanged = super.setIgnoreOrientationRequest(ignoreOrientationRequest);
mWmService.mDisplayWindowSettings.setIgnoreOrientationRequest(
- this, mIgnoreOrientationRequest);
+ this, mSetIgnoreOrientationRequest);
return rotationChanged;
}
/**
+ * Updates orientation if necessary after ignore orientation request override logic in {@link
+ * WindowManagerService#isIgnoreOrientationRequestDisabled} changes at runtime.
+ */
+ void onIsIgnoreOrientationRequestDisabledChanged() {
+ if (mFocusedApp != null) {
+ // We record the last focused TDA that respects orientation request, check if this
+ // change may affect it.
+ onLastFocusedTaskDisplayAreaChanged(mFocusedApp.getDisplayArea());
+ }
+ if (mSetIgnoreOrientationRequest) {
+ updateOrientation();
+ }
+ }
+
+ /**
* Locates the appropriate target window for scroll capture. The search progresses top to
* bottom.
* If {@code searchBehind} is non-null, the search will only consider windows behind this one.
diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java
index 43ff580..5aacb09 100644
--- a/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/services/core/java/com/android/server/wm/DisplayRotation.java
@@ -1683,7 +1683,7 @@
mSensorRotation = (listener == null || !listener.mEnabled)
? -2 /* disabled */ : dr.mLastSensorRotation;
final DisplayContent dc = dr.mDisplayContent;
- mIgnoreOrientationRequest = dc.mIgnoreOrientationRequest;
+ mIgnoreOrientationRequest = dc.getIgnoreOrientationRequest();
final TaskDisplayArea requestingTda = dc.getOrientationRequestingTaskDisplayArea();
mNonDefaultRequestingTaskDisplayArea = requestingTda == null
? "none" : requestingTda != dc.getDefaultTaskDisplayArea()
diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java
index c162e8e..bb15d76 100644
--- a/services/core/java/com/android/server/wm/LetterboxUiController.java
+++ b/services/core/java/com/android/server/wm/LetterboxUiController.java
@@ -332,25 +332,29 @@
if (windowSurface != null && windowSurface.isValid()) {
Transaction transaction = mActivityRecord.getSyncTransaction();
+ final InsetsState insetsState = mainWindow.getInsetsState();
+ final InsetsSource taskbarInsetsSource =
+ insetsState.peekSource(InsetsState.ITYPE_EXTRA_NAVIGATION_BAR);
+
if (!isLetterboxedNotForDisplayCutout(mainWindow)
- || !mLetterboxConfiguration.isLetterboxActivityCornersRounded()) {
+ || !mLetterboxConfiguration.isLetterboxActivityCornersRounded()
+ || taskbarInsetsSource == null) {
transaction
.setWindowCrop(windowSurface, null)
.setCornerRadius(windowSurface, 0);
return;
}
- final InsetsState insetsState = mainWindow.getInsetsState();
- final InsetsSource taskbarInsetsSource =
- insetsState.getSource(InsetsState.ITYPE_EXTRA_NAVIGATION_BAR);
-
Rect cropBounds = null;
// Rounded corners should be displayed above the taskbar. When taskbar is hidden,
// an insets frame is equal to a navigation bar which shouldn't affect position of
// rounded corners since apps are expected to handle navigation bar inset.
// This condition checks whether the taskbar is visible.
- if (taskbarInsetsSource.getFrame().height() >= mExpandedTaskBarHeight) {
+ // Do not crop the taskbar inset if the window is in immersive mode - the user can
+ // swipe to show/hide the taskbar as an overlay.
+ if (taskbarInsetsSource.getFrame().height() >= mExpandedTaskBarHeight
+ && taskbarInsetsSource.isVisible()) {
cropBounds = new Rect(mActivityRecord.getBounds());
// Activity bounds are in screen coordinates while (0,0) for activity's surface
// control is at the top left corner of an app window so offsetting bounds
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 22714c6..ca4c450 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -643,9 +643,9 @@
}
}
- void setSecureSurfaceState(int userId) {
+ void refreshSecureSurfaceState() {
forAllWindows((w) -> {
- if (w.mHasSurface && userId == w.mShowUserId) {
+ if (w.mHasSurface) {
w.mWinAnimator.setSecureLocked(w.isSecureLocked());
}
}, true /* traverseTopToBottom */);
@@ -2097,11 +2097,14 @@
r.setWindowingMode(intermediateWindowingMode);
r.mWaitForEnteringPinnedMode = true;
rootTask.forAllTaskFragments(tf -> {
- // When the Task is entering picture-in-picture, we should clear all override from
- // the client organizer, so the PIP activity can get the correct config from the
- // Task, and prevent conflict with the PipTaskOrganizer.
- if (tf.isOrganizedTaskFragment()) {
- tf.resetAdjacentTaskFragment();
+ if (!tf.isOrganizedTaskFragment()) {
+ return;
+ }
+ tf.resetAdjacentTaskFragment();
+ if (tf.getTopNonFinishingActivity() != null) {
+ // When the Task is entering picture-in-picture, we should clear all override
+ // from the client organizer, so the PIP activity can get the correct config
+ // from the Task, and prevent conflict with the PipTaskOrganizer.
tf.updateRequestedOverrideConfiguration(EMPTY);
}
});
@@ -2116,7 +2119,8 @@
// to the root pinned task
r.supportsEnterPipOnTaskSwitch = false;
- if (organizedTf != null && organizedTf.mClearedTaskFragmentForPip) {
+ if (organizedTf != null && organizedTf.mClearedTaskFragmentForPip
+ && organizedTf.isTaskVisibleRequested()) {
// Dispatch the pending info to TaskFragmentOrganizer before PIP animation.
// Otherwise, it will keep waiting for the empty TaskFragment to be non-empty.
mService.mTaskFragmentOrganizerController.dispatchPendingInfoChangedEvent(
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 9ea566e..f97f768 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -1086,6 +1086,12 @@
updateTaskDescription();
}
mSupportsPictureInPicture = info.supportsPictureInPicture();
+
+ // Re-adding the task to Recents once updated
+ if (inRecents) {
+ mTaskSupervisor.mRecentTasks.remove(this);
+ mTaskSupervisor.mRecentTasks.add(this);
+ }
}
/** Sets the original minimal width and height. */
@@ -1169,7 +1175,7 @@
// Call this again after super onParentChanged in-case the surface wasn't created yet
// (happens when the task is first inserted into the hierarchy). It's a no-op if it
// already ran fully within super.onParentChanged
- updateTaskOrganizerState(false /* forceUpdate */);
+ updateTaskOrganizerState();
// TODO(b/168037178): The check for null display content and setting it to null doesn't
// really make sense here...
@@ -1945,7 +1951,7 @@
}
saveLaunchingStateIfNeeded();
- final boolean taskOrgChanged = updateTaskOrganizerState(false /* forceUpdate */);
+ final boolean taskOrgChanged = updateTaskOrganizerState();
if (taskOrgChanged) {
updateSurfacePosition(getSyncTransaction());
if (!isOrganized()) {
@@ -4263,21 +4269,18 @@
return true;
}
- boolean updateTaskOrganizerState(boolean forceUpdate) {
- return updateTaskOrganizerState(forceUpdate, false /* skipTaskAppeared */);
+ boolean updateTaskOrganizerState() {
+ return updateTaskOrganizerState(false /* skipTaskAppeared */);
}
/**
* Called when the task state changes (ie. from windowing mode change) an the task organizer
* state should also be updated.
*
- * @param forceUpdate Updates the task organizer to the one currently specified in the task
- * org controller for the task's windowing mode, ignoring the cached
- * windowing mode checks.
* @param skipTaskAppeared Skips calling taskAppeared for the new organizer if it has changed
* @return {@code true} if task organizer changed.
*/
- boolean updateTaskOrganizerState(boolean forceUpdate, boolean skipTaskAppeared) {
+ boolean updateTaskOrganizerState(boolean skipTaskAppeared) {
if (getSurfaceControl() == null) {
// Can't call onTaskAppeared without a surfacecontrol, so defer this until next one
// is created.
@@ -4289,7 +4292,10 @@
final TaskOrganizerController controller = mWmService.mAtmService.mTaskOrganizerController;
final ITaskOrganizer organizer = controller.getTaskOrganizer();
- if (!forceUpdate && mTaskOrganizer == organizer) {
+ // Do not change to different organizer if the task is created by organizer because only
+ // the creator knows how to manage it.
+ if (mCreatedByOrganizer && mTaskOrganizer != null && organizer != null
+ && mTaskOrganizer != organizer) {
return false;
}
return setTaskOrganizer(organizer, skipTaskAppeared);
@@ -5047,21 +5053,9 @@
positionChildAtTop(rTask);
}
Task task = null;
- if (!newTask && isOrhasTask) {
- // Starting activity cannot be occluding activity, otherwise starting window could be
- // remove immediately without transferring to starting activity.
- final ActivityRecord occludingActivity = getOccludingActivityAbove(r);
- if (occludingActivity != null) {
- // Here it is! Now, if this is not yet visible (occluded by another task) to the
- // user, then just add it without starting; it will get started when the user
- // navigates back to it.
- ProtoLog.i(WM_DEBUG_ADD_REMOVE, "Adding activity %s to task %s "
- + "callers: %s", r, task,
- new RuntimeException("here").fillInStackTrace());
- rTask.positionChildAtTop(r);
- ActivityOptions.abort(options);
- return;
- }
+ if (!newTask && isOrhasTask && !r.shouldBeVisible()) {
+ ActivityOptions.abort(options);
+ return;
}
// Place a new activity at top of root task, so it is next to interact with the user.
@@ -5691,9 +5685,7 @@
return false;
}
- // See if there is an occluding activity on-top of this one.
- final ActivityRecord occludingActivity = getOccludingActivityAbove(r);
- if (occludingActivity != null) return false;
+ if (!r.shouldBeVisible()) return false;
if (r.finishing) Slog.e(TAG, "willActivityBeVisible: Returning false,"
+ " would have returned true for r=" + r);
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java
index 7a7bf1f..73a755d 100644
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
@@ -640,7 +640,7 @@
@Override
int getOrientation(int candidate) {
mLastOrientationSource = null;
- if (mIgnoreOrientationRequest) {
+ if (getIgnoreOrientationRequest()) {
return SCREEN_ORIENTATION_UNSET;
}
if (!canSpecifyOrientation()) {
@@ -977,6 +977,11 @@
candidateTask.reparent(this, onTop);
}
}
+ // Update windowing mode if necessary, e.g. launch into a different windowing mode.
+ if (windowingMode != WINDOWING_MODE_UNDEFINED && candidateTask.isRootTask()
+ && candidateTask.getWindowingMode() != windowingMode) {
+ candidateTask.setWindowingMode(windowingMode);
+ }
return candidateTask.getRootTask();
}
return new Task.Builder(mAtmService)
@@ -1912,7 +1917,7 @@
// Only allow to specify orientation if this TDA is not set to ignore orientation request,
// and it is the last focused one on this logical display that can request orientation
// request.
- return !mIgnoreOrientationRequest
+ return !getIgnoreOrientationRequest()
&& mDisplayContent.getOrientationRequestingTaskDisplayArea() == this;
}
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java
index e034654..1beb32c 100644
--- a/services/core/java/com/android/server/wm/TaskFragment.java
+++ b/services/core/java/com/android/server/wm/TaskFragment.java
@@ -519,15 +519,20 @@
return false;
}
+ boolean isAllowedToEmbedActivity(@NonNull ActivityRecord a) {
+ return isAllowedToEmbedActivity(a, mTaskFragmentOrganizerUid);
+ }
+
/**
* Checks if the organized task fragment is allowed to have the specified activity, which is
* allowed if an activity allows embedding in untrusted mode, or if the trusted mode can be
* enabled.
* @see #isAllowedToEmbedActivityInTrustedMode(ActivityRecord)
+ * @param uid uid of the TaskFragment organizer.
*/
- boolean isAllowedToEmbedActivity(@NonNull ActivityRecord a) {
+ boolean isAllowedToEmbedActivity(@NonNull ActivityRecord a, int uid) {
return isAllowedToEmbedActivityInUntrustedMode(a)
- || isAllowedToEmbedActivityInTrustedMode(a);
+ || isAllowedToEmbedActivityInTrustedMode(a, uid);
}
/**
@@ -544,20 +549,25 @@
== FLAG_ALLOW_UNTRUSTED_ACTIVITY_EMBEDDING;
}
+ boolean isAllowedToEmbedActivityInTrustedMode(@NonNull ActivityRecord a) {
+ return isAllowedToEmbedActivityInTrustedMode(a, mTaskFragmentOrganizerUid);
+ }
+
/**
* Checks if the organized task fragment is allowed to embed activity in fully trusted mode,
* which means that all transactions are allowed. This is supported in the following cases:
* <li>the activity belongs to the same app as the organizer host;</li>
* <li>the activity has declared the organizer host as trusted explicitly via known
* certificate.</li>
+ * @param uid uid of the TaskFragment organizer.
*/
- boolean isAllowedToEmbedActivityInTrustedMode(@NonNull ActivityRecord a) {
- if (UserHandle.getAppId(mTaskFragmentOrganizerUid) == SYSTEM_UID) {
+ boolean isAllowedToEmbedActivityInTrustedMode(@NonNull ActivityRecord a, int uid) {
+ if (UserHandle.getAppId(uid) == SYSTEM_UID) {
// The system is trusted to embed other apps securely and for all users.
return true;
}
- if (mTaskFragmentOrganizerUid == a.getUid()) {
+ if (uid == a.getUid()) {
// Activities from the same UID can be embedded freely by the host.
return true;
}
@@ -570,7 +580,7 @@
}
AndroidPackage hostPackage = mAtmService.getPackageManagerInternalLocked()
- .getPackage(mTaskFragmentOrganizerUid);
+ .getPackage(uid);
return hostPackage != null && hostPackage.getSigningDetails().hasAncestorOrSelfWithDigest(
knownActivityEmbeddingCerts);
@@ -581,7 +591,8 @@
* @see #isAllowedToEmbedActivityInTrustedMode(ActivityRecord)
*/
boolean isAllowedToBeEmbeddedInTrustedMode() {
- return forAllActivities(this::isAllowedToEmbedActivityInTrustedMode);
+ final Predicate<ActivityRecord> callback = this::isAllowedToEmbedActivityInTrustedMode;
+ return forAllActivities(callback);
}
/**
@@ -2302,11 +2313,32 @@
return mTaskFragmentOrganizer != null;
}
+ /** Whether the Task should be visible. */
+ boolean isTaskVisibleRequested() {
+ final Task task = getTask();
+ return task != null && task.isVisibleRequested();
+ }
+
boolean isReadyToTransit() {
+ // We only wait when this is organized to give the organizer a chance to update.
+ if (!isOrganizedTaskFragment()) {
+ return true;
+ }
// We don't want to start the transition if the organized TaskFragment is empty, unless
// it is requested to be removed.
- return !isOrganizedTaskFragment() || getTopNonFinishingActivity() != null
- || mIsRemovalRequested;
+ if (getTopNonFinishingActivity() != null || mIsRemovalRequested) {
+ return true;
+ }
+ // Organizer shouldn't change embedded TaskFragment in PiP.
+ if (isEmbeddedTaskFragmentInPip()) {
+ return true;
+ }
+ // The TaskFragment becomes empty because the last running activity enters PiP when the Task
+ // is minimized.
+ if (mClearedTaskFragmentForPip && !isTaskVisibleRequested()) {
+ return true;
+ }
+ return false;
}
/** Clear {@link #mLastPausedActivity} for all {@link TaskFragment} children */
@@ -2424,8 +2456,19 @@
mIsRemovalRequested = false;
resetAdjacentTaskFragment();
cleanUp();
+ final boolean shouldExecuteAppTransition =
+ mClearedTaskFragmentForPip && isTaskVisibleRequested();
super.removeImmediately();
sendTaskFragmentVanished();
+ if (shouldExecuteAppTransition && mDisplayContent != null) {
+ // When the Task is still visible, and the TaskFragment is removed because the last
+ // running activity is reparenting to PiP, it is possible that no activity is getting
+ // paused or resumed (having an embedded activity in split), thus we need to relayout
+ // and execute it explicitly.
+ mAtmService.addWindowLayoutReasons(
+ ActivityTaskManagerService.LAYOUT_REASON_VISIBILITY_CHANGED);
+ mDisplayContent.executeAppTransition();
+ }
}
/** Called on remove to cleanup. */
diff --git a/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java b/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
index bd351ac..eaf2526 100644
--- a/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
+++ b/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
@@ -51,6 +51,7 @@
*/
public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerController.Stub {
private static final String TAG = "TaskFragmentOrganizerController";
+ private static final long TEMPORARY_ACTIVITY_TOKEN_TIMEOUT_MS = 5000;
private final ActivityTaskManagerService mAtmService;
private final WindowManagerGlobalLock mGlobalLock;
@@ -78,10 +79,14 @@
private class TaskFragmentOrganizerState implements IBinder.DeathRecipient {
private final ArrayList<TaskFragment> mOrganizedTaskFragments = new ArrayList<>();
private final ITaskFragmentOrganizer mOrganizer;
+ private final int mOrganizerPid;
+ private final int mOrganizerUid;
private final Map<TaskFragment, TaskFragmentInfo> mLastSentTaskFragmentInfos =
new WeakHashMap<>();
private final Map<TaskFragment, Configuration> mLastSentTaskFragmentParentConfigs =
new WeakHashMap<>();
+ private final Map<IBinder, ActivityRecord> mTemporaryActivityTokens =
+ new WeakHashMap<>();
/**
* Map from Task Id to {@link RemoteAnimationDefinition}.
@@ -91,8 +96,10 @@
private final SparseArray<RemoteAnimationDefinition> mRemoteAnimationDefinitions =
new SparseArray<>();
- TaskFragmentOrganizerState(ITaskFragmentOrganizer organizer) {
+ TaskFragmentOrganizerState(ITaskFragmentOrganizer organizer, int pid, int uid) {
mOrganizer = organizer;
+ mOrganizerPid = pid;
+ mOrganizerUid = uid;
try {
mOrganizer.asBinder().linkToDeath(this, 0 /*flags*/);
} catch (RemoteException e) {
@@ -134,23 +141,23 @@
mOrganizer.asBinder().unlinkToDeath(this, 0 /*flags*/);
}
- void onTaskFragmentAppeared(ITaskFragmentOrganizer organizer, TaskFragment tf) {
+ void onTaskFragmentAppeared(TaskFragment tf) {
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "TaskFragment appeared name=%s", tf.getName());
final TaskFragmentInfo info = tf.getTaskFragmentInfo();
try {
- organizer.onTaskFragmentAppeared(info);
+ mOrganizer.onTaskFragmentAppeared(info);
mLastSentTaskFragmentInfos.put(tf, info);
tf.mTaskFragmentAppearedSent = true;
} catch (RemoteException e) {
Slog.d(TAG, "Exception sending onTaskFragmentAppeared callback", e);
}
- onTaskFragmentParentInfoChanged(organizer, tf);
+ onTaskFragmentParentInfoChanged(tf);
}
- void onTaskFragmentVanished(ITaskFragmentOrganizer organizer, TaskFragment tf) {
+ void onTaskFragmentVanished(TaskFragment tf) {
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "TaskFragment vanished name=%s", tf.getName());
try {
- organizer.onTaskFragmentVanished(tf.getTaskFragmentInfo());
+ mOrganizer.onTaskFragmentVanished(tf.getTaskFragmentInfo());
} catch (RemoteException e) {
Slog.d(TAG, "Exception sending onTaskFragmentVanished callback", e);
}
@@ -159,10 +166,10 @@
mLastSentTaskFragmentParentConfigs.remove(tf);
}
- void onTaskFragmentInfoChanged(ITaskFragmentOrganizer organizer, TaskFragment tf) {
+ void onTaskFragmentInfoChanged(TaskFragment tf) {
// Parent config may have changed. The controller will check if there is any important
// config change for the organizer.
- onTaskFragmentParentInfoChanged(organizer, tf);
+ onTaskFragmentParentInfoChanged(tf);
// Check if the info is different from the last reported info.
final TaskFragmentInfo info = tf.getTaskFragmentInfo();
@@ -174,14 +181,14 @@
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "TaskFragment info changed name=%s",
tf.getName());
try {
- organizer.onTaskFragmentInfoChanged(tf.getTaskFragmentInfo());
+ mOrganizer.onTaskFragmentInfoChanged(tf.getTaskFragmentInfo());
mLastSentTaskFragmentInfos.put(tf, info);
} catch (RemoteException e) {
Slog.d(TAG, "Exception sending onTaskFragmentInfoChanged callback", e);
}
}
- void onTaskFragmentParentInfoChanged(ITaskFragmentOrganizer organizer, TaskFragment tf) {
+ void onTaskFragmentParentInfoChanged(TaskFragment tf) {
// Check if the parent info is different from the last reported parent info.
if (tf.getParent() == null || tf.getParent().asTask() == null) {
mLastSentTaskFragmentParentConfigs.remove(tf);
@@ -197,30 +204,86 @@
"TaskFragment parent info changed name=%s parentTaskId=%d",
tf.getName(), parent.mTaskId);
try {
- organizer.onTaskFragmentParentInfoChanged(tf.getFragmentToken(), parentConfig);
+ mOrganizer.onTaskFragmentParentInfoChanged(tf.getFragmentToken(), parentConfig);
mLastSentTaskFragmentParentConfigs.put(tf, new Configuration(parentConfig));
} catch (RemoteException e) {
Slog.d(TAG, "Exception sending onTaskFragmentParentInfoChanged callback", e);
}
}
- void onTaskFragmentError(ITaskFragmentOrganizer organizer, IBinder errorCallbackToken,
- Throwable exception) {
+ void onTaskFragmentError(IBinder errorCallbackToken, Throwable exception) {
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER,
"Sending TaskFragment error exception=%s", exception.toString());
final Bundle exceptionBundle = putExceptionInBundle(exception);
try {
- organizer.onTaskFragmentError(errorCallbackToken, exceptionBundle);
+ mOrganizer.onTaskFragmentError(errorCallbackToken, exceptionBundle);
} catch (RemoteException e) {
Slog.d(TAG, "Exception sending onTaskFragmentError callback", e);
}
}
+
+ void onActivityReparentToTask(ActivityRecord activity) {
+ if (activity.finishing) {
+ Slog.d(TAG, "Reparent activity=" + activity.token + " is finishing");
+ return;
+ }
+ final Task task = activity.getTask();
+ if (task == null || task.effectiveUid != mOrganizerUid) {
+ Slog.d(TAG, "Reparent activity=" + activity.token
+ + " is not in a task belong to the organizer app.");
+ return;
+ }
+ if (!task.isAllowedToEmbedActivity(activity, mOrganizerUid)) {
+ Slog.d(TAG, "Reparent activity=" + activity.token
+ + " is not allowed to be embedded.");
+ return;
+ }
+
+ final IBinder activityToken;
+ if (activity.getPid() == mOrganizerPid) {
+ // We only pass the actual token if the activity belongs to the organizer process.
+ activityToken = activity.token;
+ } else {
+ // For security, we can't pass the actual token if the activity belongs to a
+ // different process. In this case, we will pass a temporary token that organizer
+ // can use to reparent through WindowContainerTransaction.
+ activityToken = new Binder("TemporaryActivityToken");
+ mTemporaryActivityTokens.put(activityToken, activity);
+ final Runnable timeout = () -> {
+ synchronized (mGlobalLock) {
+ mTemporaryActivityTokens.remove(activityToken);
+ }
+ };
+ mAtmService.mWindowManager.mH.postDelayed(timeout,
+ TEMPORARY_ACTIVITY_TOKEN_TIMEOUT_MS);
+ }
+ ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "Activity=%s reparent to taskId=%d",
+ activity.token, task.mTaskId);
+ try {
+ mOrganizer.onActivityReparentToTask(task.mTaskId, activity.intent, activityToken);
+ } catch (RemoteException e) {
+ Slog.d(TAG, "Exception sending onActivityReparentToTask callback", e);
+ }
+ }
+ }
+
+ @Nullable
+ ActivityRecord getReparentActivityFromTemporaryToken(
+ @Nullable ITaskFragmentOrganizer organizer, @Nullable IBinder activityToken) {
+ if (organizer == null || activityToken == null) {
+ return null;
+ }
+ final TaskFragmentOrganizerState state = mTaskFragmentOrganizerState.get(
+ organizer.asBinder());
+ return state != null
+ ? state.mTemporaryActivityTokens.remove(activityToken)
+ : null;
}
@Override
public void registerOrganizer(ITaskFragmentOrganizer organizer) {
final int pid = Binder.getCallingPid();
- final long uid = Binder.getCallingUid();
+ final int uid = Binder.getCallingUid();
synchronized (mGlobalLock) {
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER,
"Register task fragment organizer=%s uid=%d pid=%d",
@@ -230,7 +293,7 @@
"Replacing existing organizer currently unsupported");
}
mTaskFragmentOrganizerState.put(organizer.asBinder(),
- new TaskFragmentOrganizerState(organizer));
+ new TaskFragmentOrganizerState(organizer, pid, uid));
}
}
@@ -321,8 +384,10 @@
PendingTaskFragmentEvent pendingEvent = getPendingTaskFragmentEvent(taskFragment,
PendingTaskFragmentEvent.EVENT_APPEARED);
if (pendingEvent == null) {
- pendingEvent = new PendingTaskFragmentEvent(taskFragment, organizer,
- PendingTaskFragmentEvent.EVENT_APPEARED);
+ pendingEvent = new PendingTaskFragmentEvent.Builder(
+ PendingTaskFragmentEvent.EVENT_APPEARED, organizer)
+ .setTaskFragment(taskFragment)
+ .build();
mPendingTaskFragmentEvents.add(pendingEvent);
}
}
@@ -347,7 +412,9 @@
}
PendingTaskFragmentEvent pendingEvent = getLastPendingLifecycleEvent(taskFragment);
if (pendingEvent == null) {
- pendingEvent = new PendingTaskFragmentEvent(taskFragment, organizer, eventType);
+ pendingEvent = new PendingTaskFragmentEvent.Builder(eventType, organizer)
+ .setTaskFragment(taskFragment)
+ .build();
} else {
if (pendingEvent.mEventType == PendingTaskFragmentEvent.EVENT_VANISHED) {
// Skipped the info changed event if vanished event is pending.
@@ -374,8 +441,10 @@
if (!taskFragment.mTaskFragmentAppearedSent) {
return;
}
- PendingTaskFragmentEvent pendingEvent = new PendingTaskFragmentEvent(taskFragment,
- organizer, PendingTaskFragmentEvent.EVENT_VANISHED);
+ final PendingTaskFragmentEvent pendingEvent = new PendingTaskFragmentEvent.Builder(
+ PendingTaskFragmentEvent.EVENT_VANISHED, organizer)
+ .setTaskFragment(taskFragment)
+ .build();
mPendingTaskFragmentEvents.add(pendingEvent);
state.removeTaskFragment(taskFragment);
}
@@ -384,8 +453,43 @@
Throwable exception) {
validateAndGetState(organizer);
Slog.w(TAG, "onTaskFragmentError ", exception);
- PendingTaskFragmentEvent pendingEvent = new PendingTaskFragmentEvent(organizer,
- errorCallbackToken, exception, PendingTaskFragmentEvent.EVENT_ERROR);
+ final PendingTaskFragmentEvent pendingEvent = new PendingTaskFragmentEvent.Builder(
+ PendingTaskFragmentEvent.EVENT_ERROR, organizer)
+ .setErrorCallbackToken(errorCallbackToken)
+ .setException(exception)
+ .build();
+ mPendingTaskFragmentEvents.add(pendingEvent);
+ }
+
+ void onActivityReparentToTask(ActivityRecord activity) {
+ final ITaskFragmentOrganizer organizer;
+ if (activity.mLastTaskFragmentOrganizerBeforePip != null) {
+ // If the activity is previously embedded in an organized TaskFragment.
+ organizer = activity.mLastTaskFragmentOrganizerBeforePip;
+ } else {
+ // Find the topmost TaskFragmentOrganizer.
+ final Task task = activity.getTask();
+ final TaskFragment[] organizedTf = new TaskFragment[1];
+ task.forAllLeafTaskFragments(tf -> {
+ if (tf.isOrganizedTaskFragment()) {
+ organizedTf[0] = tf;
+ return true;
+ }
+ return false;
+ });
+ if (organizedTf[0] == null) {
+ return;
+ }
+ organizer = organizedTf[0].getTaskFragmentOrganizer();
+ }
+ if (!mTaskFragmentOrganizerState.containsKey(organizer.asBinder())) {
+ Slog.w(TAG, "The last TaskFragmentOrganizer no longer exists");
+ return;
+ }
+ final PendingTaskFragmentEvent pendingEvent = new PendingTaskFragmentEvent.Builder(
+ PendingTaskFragmentEvent.EVENT_ACTIVITY_REPARENT_TO_TASK, organizer)
+ .setActivity(activity)
+ .build();
mPendingTaskFragmentEvents.add(pendingEvent);
}
@@ -422,13 +526,15 @@
static final int EVENT_INFO_CHANGED = 2;
static final int EVENT_PARENT_INFO_CHANGED = 3;
static final int EVENT_ERROR = 4;
+ static final int EVENT_ACTIVITY_REPARENT_TO_TASK = 5;
@IntDef(prefix = "EVENT_", value = {
EVENT_APPEARED,
EVENT_VANISHED,
EVENT_INFO_CHANGED,
EVENT_PARENT_INFO_CHANGED,
- EVENT_ERROR
+ EVENT_ERROR,
+ EVENT_ACTIVITY_REPARENT_TO_TASK
})
@Retention(RetentionPolicy.SOURCE)
public @interface EventType {}
@@ -436,34 +542,30 @@
@EventType
private final int mEventType;
private final ITaskFragmentOrganizer mTaskFragmentOrg;
+ @Nullable
private final TaskFragment mTaskFragment;
- private final IBinder mErrorCallback;
+ @Nullable
+ private final IBinder mErrorCallbackToken;
+ @Nullable
private final Throwable mException;
+ @Nullable
+ private final ActivityRecord mActivity;
// Set when the event is deferred due to the host task is invisible. The defer time will
// be the last active time of the host task.
private long mDeferTime;
- private PendingTaskFragmentEvent(TaskFragment taskFragment,
- ITaskFragmentOrganizer taskFragmentOrg, @EventType int eventType) {
- this(taskFragment, taskFragmentOrg, null /* errorCallback */,
- null /* exception */, eventType);
-
- }
-
- private PendingTaskFragmentEvent(ITaskFragmentOrganizer taskFragmentOrg,
- IBinder errorCallback, Throwable exception, @EventType int eventType) {
- this(null /* taskFragment */, taskFragmentOrg, errorCallback, exception,
- eventType);
- }
-
- private PendingTaskFragmentEvent(TaskFragment taskFragment,
- ITaskFragmentOrganizer taskFragmentOrg, IBinder errorCallback, Throwable exception,
- @EventType int eventType) {
- mTaskFragment = taskFragment;
- mTaskFragmentOrg = taskFragmentOrg;
- mErrorCallback = errorCallback;
- mException = exception;
+ private PendingTaskFragmentEvent(@EventType int eventType,
+ ITaskFragmentOrganizer taskFragmentOrg,
+ @Nullable TaskFragment taskFragment,
+ @Nullable IBinder errorCallbackToken,
+ @Nullable Throwable exception,
+ @Nullable ActivityRecord activity) {
mEventType = eventType;
+ mTaskFragmentOrg = taskFragmentOrg;
+ mTaskFragment = taskFragment;
+ mErrorCallbackToken = errorCallbackToken;
+ mException = exception;
+ mActivity = activity;
}
/**
@@ -481,6 +583,50 @@
return false;
}
}
+
+ private static class Builder {
+ @EventType
+ private final int mEventType;
+ private final ITaskFragmentOrganizer mTaskFragmentOrg;
+ @Nullable
+ private TaskFragment mTaskFragment;
+ @Nullable
+ private IBinder mErrorCallbackToken;
+ @Nullable
+ private Throwable mException;
+ @Nullable
+ private ActivityRecord mActivity;
+
+ Builder(@EventType int eventType, ITaskFragmentOrganizer taskFragmentOrg) {
+ mEventType = eventType;
+ mTaskFragmentOrg = taskFragmentOrg;
+ }
+
+ Builder setTaskFragment(@Nullable TaskFragment taskFragment) {
+ mTaskFragment = taskFragment;
+ return this;
+ }
+
+ Builder setErrorCallbackToken(@Nullable IBinder errorCallbackToken) {
+ mErrorCallbackToken = errorCallbackToken;
+ return this;
+ }
+
+ Builder setException(@Nullable Throwable exception) {
+ mException = exception;
+ return this;
+ }
+
+ Builder setActivity(@Nullable ActivityRecord activity) {
+ mActivity = activity;
+ return this;
+ }
+
+ PendingTaskFragmentEvent build() {
+ return new PendingTaskFragmentEvent(mEventType, mTaskFragmentOrg, mTaskFragment,
+ mErrorCallbackToken, mException, mActivity);
+ }
+ }
}
@Nullable
@@ -518,8 +664,13 @@
// longer has activities. As a result, the organizer will never get this info changed event
// and will not delete the TaskFragment because the organizer thinks the TaskFragment still
// has running activities.
+ // Another case is when an organized TaskFragment became empty because the last running
+ // activity is reparented to a new Task due to enter PiP. We also want to notify the
+ // organizer, so it can remove the empty TaskFragment and update the paired TaskFragment
+ // without causing the extra delay.
return event.mEventType == PendingTaskFragmentEvent.EVENT_INFO_CHANGED
- && task.topRunningActivity() == null && lastInfo != null
+ && (task.topRunningActivity() == null || info.isTaskFragmentClearedForPip())
+ && lastInfo != null
&& lastInfo.getRunningActivityCount() > 0 && info.getRunningActivityCount() == 0;
}
@@ -591,20 +742,22 @@
}
switch (event.mEventType) {
case PendingTaskFragmentEvent.EVENT_APPEARED:
- state.onTaskFragmentAppeared(taskFragmentOrg, taskFragment);
+ state.onTaskFragmentAppeared(taskFragment);
break;
case PendingTaskFragmentEvent.EVENT_VANISHED:
- state.onTaskFragmentVanished(taskFragmentOrg, taskFragment);
+ state.onTaskFragmentVanished(taskFragment);
break;
case PendingTaskFragmentEvent.EVENT_INFO_CHANGED:
- state.onTaskFragmentInfoChanged(taskFragmentOrg, taskFragment);
+ state.onTaskFragmentInfoChanged(taskFragment);
break;
case PendingTaskFragmentEvent.EVENT_PARENT_INFO_CHANGED:
- state.onTaskFragmentParentInfoChanged(taskFragmentOrg, taskFragment);
+ state.onTaskFragmentParentInfoChanged(taskFragment);
break;
case PendingTaskFragmentEvent.EVENT_ERROR:
- state.onTaskFragmentError(taskFragmentOrg, event.mErrorCallback,
- event.mException);
+ state.onTaskFragmentError(event.mErrorCallbackToken, event.mException);
+ break;
+ case PendingTaskFragmentEvent.EVENT_ACTIVITY_REPARENT_TO_TASK:
+ state.onActivityReparentToTask(event.mActivity);
}
}
diff --git a/services/core/java/com/android/server/wm/TaskOrganizerController.java b/services/core/java/com/android/server/wm/TaskOrganizerController.java
index 9bf988f..6e84681 100644
--- a/services/core/java/com/android/server/wm/TaskOrganizerController.java
+++ b/services/core/java/com/android/server/wm/TaskOrganizerController.java
@@ -257,7 +257,7 @@
// organizer is disposed off to avoid inconsistent behavior.
t.removeImmediately();
} else {
- t.updateTaskOrganizerState(true /* forceUpdate */);
+ t.updateTaskOrganizerState();
}
if (mOrganizedTasks.contains(t)) {
// updateTaskOrganizerState should remove the task from the list, but still
@@ -381,8 +381,7 @@
final TaskOrganizerState state = mTaskOrganizerStates.get(organizer.asBinder());
mService.mRootWindowContainer.forAllTasks((task) -> {
boolean returnTask = !task.mCreatedByOrganizer;
- task.updateTaskOrganizerState(true /* forceUpdate */,
- returnTask /* skipTaskAppeared */);
+ task.updateTaskOrganizerState(returnTask /* skipTaskAppeared */);
if (returnTask) {
SurfaceControl outSurfaceControl = state.addTaskWithoutCallback(task,
"TaskOrganizerController.registerTaskOrganizer");
@@ -1001,6 +1000,19 @@
}
}
+ @Override
+ public void setIsIgnoreOrientationRequestDisabled(boolean isDisabled) {
+ enforceTaskPermission("setIsIgnoreOrientationRequestDisabled()");
+ final long origId = Binder.clearCallingIdentity();
+ try {
+ synchronized (mGlobalLock) {
+ mService.mWindowManager.setIsIgnoreOrientationRequestDisabled(isDisabled);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(origId);
+ }
+ }
+
public boolean handleInterceptBackPressedOnTaskRoot(Task task) {
if (task == null || !task.isOrganized()
|| !mInterceptBackPressedOnRootTasks.contains(task.mTaskId)) {
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 2f4dc51..41d31b2 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -989,6 +989,8 @@
final LetterboxConfiguration mLetterboxConfiguration;
+ private boolean mIsIgnoreOrientationRequestDisabled;
+
final InputManagerService mInputManager;
final DisplayManagerInternal mDisplayManagerInternal;
final DisplayManager mDisplayManager;
@@ -2009,15 +2011,15 @@
* the device policy cache.
*/
@Override
- public void refreshScreenCaptureDisabled(int userId) {
+ public void refreshScreenCaptureDisabled() {
int callingUid = Binder.getCallingUid();
if (callingUid != SYSTEM_UID) {
throw new SecurityException("Only system can call refreshScreenCaptureDisabled.");
}
synchronized (mGlobalLock) {
- // Update secure surface for all windows belonging to this user.
- mRoot.setSecureSurfaceState(userId);
+ // Refresh secure surface for all windows.
+ mRoot.refreshSecureSurfaceState();
}
}
@@ -4088,6 +4090,36 @@
}
}
+ /**
+ * Controls whether ignore orientation request logic in {@link DisplayArea} is disabled
+ * at runtime.
+ *
+ * <p>Note: this assumes that {@link #mGlobalLock} is held by the caller.
+ *
+ * @param isDisabled when {@code true}, the system always ignores the value of {@link
+ * DisplayArea#getIgnoreOrientationRequest} and app requested orientation is
+ * respected.
+ */
+ void setIsIgnoreOrientationRequestDisabled(boolean isDisabled) {
+ if (isDisabled == mIsIgnoreOrientationRequestDisabled) {
+ return;
+ }
+ mIsIgnoreOrientationRequestDisabled = isDisabled;
+ for (int i = mRoot.getChildCount() - 1; i >= 0; i--) {
+ mRoot.getChildAt(i).onIsIgnoreOrientationRequestDisabledChanged();
+ }
+ }
+
+ /**
+ * Whether the system ignores the value of {@link DisplayArea#getIgnoreOrientationRequest} and
+ * app requested orientation is respected.
+ *
+ * <p>Note: this assumes that {@link #mGlobalLock} is held by the caller.
+ */
+ boolean isIgnoreOrientationRequestDisabled() {
+ return mIsIgnoreOrientationRequestDisabled;
+ }
+
@Override
public void freezeRotation(int rotation) {
freezeDisplayRotation(Display.DEFAULT_DISPLAY, rotation);
diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java
index 67f7ff7..efed92d 100644
--- a/services/core/java/com/android/server/wm/WindowOrganizerController.java
+++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java
@@ -705,7 +705,14 @@
}
case HIERARCHY_OP_TYPE_REPARENT_ACTIVITY_TO_TASK_FRAGMENT: {
final IBinder fragmentToken = hop.getNewParent();
- final ActivityRecord activity = ActivityRecord.forTokenLocked(hop.getContainer());
+ final IBinder activityToken = hop.getContainer();
+ ActivityRecord activity = ActivityRecord.forTokenLocked(activityToken);
+ if (activity == null) {
+ // The token may be a temporary token if the activity doesn't belong to
+ // the organizer process.
+ activity = mTaskFragmentOrganizerController
+ .getReparentActivityFromTemporaryToken(organizer, activityToken);
+ }
final TaskFragment parent = mLaunchTaskFragments.get(fragmentToken);
if (parent == null || activity == null) {
final Throwable exception = new IllegalArgumentException(
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 238f96f..c6288a7 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -2040,8 +2040,7 @@
if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SECURE) != 0) {
return true;
}
- return !DevicePolicyCache.getInstance().isScreenCaptureAllowed(mShowUserId,
- mOwnerCanAddInternalSystemWindow);
+ return !DevicePolicyCache.getInstance().isScreenCaptureAllowed(mShowUserId);
}
/**
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceManagementResourcesProvider.java b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceManagementResourcesProvider.java
index 6aef90c..cc32c4d 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceManagementResourcesProvider.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceManagementResourcesProvider.java
@@ -141,11 +141,11 @@
String drawableId, String drawableSource, String drawableStyle,
ParcelableResource updatableResource) {
synchronized (mLock) {
- Map<String, Map<String, ParcelableResource>> drawablesForId =
- mUpdatedDrawablesForSource.get(drawableId);
if (!mUpdatedDrawablesForSource.containsKey(drawableId)) {
mUpdatedDrawablesForSource.put(drawableId, new HashMap<>());
}
+ Map<String, Map<String, ParcelableResource>> drawablesForId =
+ mUpdatedDrawablesForSource.get(drawableId);
if (!drawablesForId.containsKey(drawableSource)) {
mUpdatedDrawablesForSource.get(drawableId).put(drawableSource, new HashMap<>());
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyCacheImpl.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyCacheImpl.java
index a301799..304d148 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyCacheImpl.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyCacheImpl.java
@@ -18,6 +18,7 @@
import android.annotation.UserIdInt;
import android.app.admin.DevicePolicyCache;
import android.app.admin.DevicePolicyManager;
+import android.os.UserHandle;
import android.util.IndentingPrintWriter;
import android.util.SparseBooleanArray;
import android.util.SparseIntArray;
@@ -37,8 +38,12 @@
*/
private final Object mLock = new Object();
+ /**
+ * Indicates which user is screen capture disallowed on. Can be {@link UserHandle#USER_NULL},
+ * {@link UserHandle#USER_ALL} or a concrete user ID.
+ */
@GuardedBy("mLock")
- private final SparseBooleanArray mScreenCaptureDisabled = new SparseBooleanArray();
+ private int mScreenCaptureDisallowedUser = UserHandle.USER_NULL;
@GuardedBy("mLock")
private final SparseIntArray mPasswordQuality = new SparseIntArray();
@@ -57,7 +62,6 @@
public void onUserRemoved(int userHandle) {
synchronized (mLock) {
- mScreenCaptureDisabled.delete(userHandle);
mPasswordQuality.delete(userHandle);
mPermissionPolicy.delete(userHandle);
mCanGrantSensorsPermissions.delete(userHandle);
@@ -65,15 +69,22 @@
}
@Override
- public boolean isScreenCaptureAllowed(int userHandle, boolean ownerCanAddInternalSystemWindow) {
+ public boolean isScreenCaptureAllowed(int userHandle) {
synchronized (mLock) {
- return !mScreenCaptureDisabled.get(userHandle) || ownerCanAddInternalSystemWindow;
+ return mScreenCaptureDisallowedUser != UserHandle.USER_ALL
+ && mScreenCaptureDisallowedUser != userHandle;
}
}
- public void setScreenCaptureAllowed(int userHandle, boolean allowed) {
+ public int getScreenCaptureDisallowedUser() {
synchronized (mLock) {
- mScreenCaptureDisabled.put(userHandle, !allowed);
+ return mScreenCaptureDisallowedUser;
+ }
+ }
+
+ public void setScreenCaptureDisallowedUser(int userHandle) {
+ synchronized (mLock) {
+ mScreenCaptureDisallowedUser = userHandle;
}
}
@@ -125,7 +136,7 @@
public void dump(IndentingPrintWriter pw) {
pw.println("Device policy cache:");
pw.increaseIndent();
- pw.println("Screen capture disabled: " + mScreenCaptureDisabled.toString());
+ pw.println("Screen capture disallowed user: " + mScreenCaptureDisallowedUser);
pw.println("Password quality: " + mPasswordQuality.toString());
pw.println("Permission policy: " + mPermissionPolicy.toString());
pw.println("Admin can grant sensors permission: "
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 18bffeb..837d3b0 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -1963,6 +1963,7 @@
mOwners.removeProfileOwner(userHandle);
mOwners.writeProfileOwner(userHandle);
+ pushScreenCapturePolicy(userHandle);
DevicePolicyData policy = mUserData.get(userHandle);
if (policy != null) {
@@ -3183,8 +3184,9 @@
@Override
void handleStartUser(int userId) {
- updateScreenCaptureDisabled(userId,
- getScreenCaptureDisabled(null, userId, false));
+ synchronized (getLockObject()) {
+ pushScreenCapturePolicy(userId);
+ }
pushUserRestrictions(userId);
// When system user is started (device boot), load cache for all users.
// This is to mitigate the potential race between loading the cache and keyguard
@@ -6919,7 +6921,6 @@
notifyResetProtectionPolicyChanged(frpAgentUid);
}
mLockSettingsInternal.refreshStrongAuthTimeout(parentId);
- updateScreenCaptureDisabled(parentId, getScreenCaptureDisabled(null, parentId, false));
Slogf.i(LOG_TAG, "Cleaning up device-wide policies done.");
}
@@ -7686,10 +7687,7 @@
if (ap.disableScreenCapture != disabled) {
ap.disableScreenCapture = disabled;
saveSettingsLocked(caller.getUserId());
- final int affectedUserId = parent
- ? getProfileParentId(caller.getUserId())
- : caller.getUserId();
- updateScreenCaptureDisabled(affectedUserId, disabled);
+ pushScreenCapturePolicy(caller.getUserId());
}
}
DevicePolicyEventLogger
@@ -7699,6 +7697,38 @@
.write();
}
+ // Push the screen capture policy for a given userId. If screen capture is disabled by the
+ // DO or COPE PO on the parent profile, then this takes precedence as screen capture will
+ // be disabled device-wide.
+ private void pushScreenCapturePolicy(int adminUserId) {
+ // Update screen capture device-wide if disabled by the DO or COPE PO on the parent profile.
+ ActiveAdmin admin =
+ getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceParentLocked(
+ UserHandle.USER_SYSTEM);
+ if (admin != null && admin.disableScreenCapture) {
+ setScreenCaptureDisabled(UserHandle.USER_ALL);
+ } else {
+ // Otherwise, update screen capture only for the calling user.
+ admin = getProfileOwnerAdminLocked(adminUserId);
+ if (admin != null && admin.disableScreenCapture) {
+ setScreenCaptureDisabled(adminUserId);
+ } else {
+ setScreenCaptureDisabled(UserHandle.USER_NULL);
+ }
+ }
+ }
+
+ // Set the latest screen capture policy, overriding any existing ones.
+ // userHandle can be one of USER_ALL, USER_NULL or a concrete userId.
+ private void setScreenCaptureDisabled(int userHandle) {
+ int current = mPolicyCache.getScreenCaptureDisallowedUser();
+ if (userHandle == current) {
+ return;
+ }
+ mPolicyCache.setScreenCaptureDisallowedUser(userHandle);
+ updateScreenCaptureDisabled();
+ }
+
/**
* Returns whether or not screen capture is disabled for a given admin, or disabled for any
* active admin (if given admin is null).
@@ -7708,7 +7738,6 @@
if (!mHasFeature) {
return false;
}
-
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
@@ -7716,29 +7745,13 @@
Preconditions.checkCallAuthorization(
isProfileOwnerOfOrganizationOwnedDevice(getCallerIdentity().getUserId()));
}
-
- synchronized (getLockObject()) {
- if (who != null) {
- ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle, parent);
- return (admin != null) && admin.disableScreenCapture;
- }
-
- final int affectedUserId = parent ? getProfileParentId(userHandle) : userHandle;
- List<ActiveAdmin> admins = getActiveAdminsForAffectedUserLocked(affectedUserId);
- for (ActiveAdmin admin: admins) {
- if (admin.disableScreenCapture) {
- return true;
- }
- }
- return false;
- }
+ return !mPolicyCache.isScreenCaptureAllowed(userHandle);
}
- private void updateScreenCaptureDisabled(int userHandle, boolean disabled) {
- mPolicyCache.setScreenCaptureAllowed(userHandle, !disabled);
+ private void updateScreenCaptureDisabled() {
mHandler.post(() -> {
try {
- mInjector.getIWindowManager().refreshScreenCaptureDisabled(userHandle);
+ mInjector.getIWindowManager().refreshScreenCaptureDisabled();
} catch (RemoteException e) {
Slogf.w(LOG_TAG, "Unable to notify WindowManager.", e);
}
@@ -8504,6 +8517,13 @@
}
}
+ private boolean isDeviceOwnerUserId(int userId) {
+ synchronized (getLockObject()) {
+ return mOwners.hasDeviceOwner()
+ && mOwners.getDeviceOwnerUserId() == userId;
+ }
+ }
+
private boolean isDeviceOwnerPackage(String packageName, int userId) {
synchronized (getLockObject()) {
return mOwners.hasDeviceOwner()
@@ -8690,6 +8710,7 @@
}
ActiveAdmin getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked(int userId) {
+ ensureLocked();
ActiveAdmin admin = getDeviceOwnerAdminLocked();
if (admin == null) {
admin = getProfileOwnerOfOrganizationOwnedDeviceLocked(userId);
@@ -8697,6 +8718,16 @@
return admin;
}
+ ActiveAdmin getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceParentLocked(int userId) {
+ ensureLocked();
+ ActiveAdmin admin = getDeviceOwnerAdminLocked();
+ if (admin != null) {
+ return admin;
+ }
+ admin = getProfileOwnerOfOrganizationOwnedDeviceLocked(userId);
+ return admin != null ? admin.getParentActiveAdmin() : null;
+ }
+
@Override
public void clearDeviceOwner(String packageName) {
Objects.requireNonNull(packageName, "packageName is null");
@@ -15151,6 +15182,7 @@
saveSettingsLocked(userHandle);
updateMaximumTimeToLockLocked(userHandle);
policy.mRemovingAdmins.remove(adminReceiver);
+ pushScreenCapturePolicy(userHandle);
Slogf.i(LOG_TAG, "Device admin " + adminReceiver + " removed from user " + userHandle);
}
@@ -18236,7 +18268,7 @@
private void updateNetworkPreferenceForUser(int userId,
List<PreferentialNetworkServiceConfig> preferentialNetworkServiceConfigs) {
- if (!isManagedProfile(userId)) {
+ if (!isManagedProfile(userId) && !isDeviceOwnerUserId(userId)) {
return;
}
List<ProfileNetworkPreference> preferences = new ArrayList<>();
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 2b431b6..dc2b6f8 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -1459,8 +1459,9 @@
Slog.i(TAG, SECONDARY_ZYGOTE_PRELOAD);
TimingsTraceAndSlog traceLog = TimingsTraceAndSlog.newAsyncLog();
traceLog.traceBegin(SECONDARY_ZYGOTE_PRELOAD);
- if (!Process.ZYGOTE_PROCESS.preloadDefault(Build.SUPPORTED_32_BIT_ABIS[0])) {
- Slog.e(TAG, "Unable to preload default resources");
+ String[] abis32 = Build.SUPPORTED_32_BIT_ABIS;
+ if (abis32.length > 0 && !Process.ZYGOTE_PROCESS.preloadDefault(abis32[0])) {
+ Slog.e(TAG, "Unable to preload default resources for secondary");
}
traceLog.traceEnd();
} catch (Exception ex) {
diff --git a/services/tests/PackageManagerComponentOverrideTests/src/com/android/server/pm/test/override/PackageManagerComponentLabelIconOverrideTest.kt b/services/tests/PackageManagerComponentOverrideTests/src/com/android/server/pm/test/override/PackageManagerComponentLabelIconOverrideTest.kt
index 7b15224..9c0f713 100644
--- a/services/tests/PackageManagerComponentOverrideTests/src/com/android/server/pm/test/override/PackageManagerComponentLabelIconOverrideTest.kt
+++ b/services/tests/PackageManagerComponentOverrideTests/src/com/android/server/pm/test/override/PackageManagerComponentLabelIconOverrideTest.kt
@@ -30,6 +30,7 @@
import com.android.server.pm.parsing.pkg.PackageImpl
import com.android.server.pm.parsing.pkg.ParsedPackage
import com.android.server.pm.resolution.ComponentResolver
+import com.android.server.pm.snapshot.PackageDataSnapshot
import com.android.server.pm.test.override.PackageManagerComponentLabelIconOverrideTest.Companion.Params.AppType
import com.android.server.testutils.TestHandler
import com.android.server.testutils.mock
@@ -361,8 +362,8 @@
whenever(this.isCallerRecents(anyInt())) { false }
}
val mockAppsFilter: AppsFilterImpl = mockThrowOnUnmocked {
- whenever(this.shouldFilterApplication(anyInt(), any<PackageSetting>(),
- any<PackageSetting>(), anyInt())) { false }
+ whenever(this.shouldFilterApplication(any<PackageDataSnapshot>(), anyInt(),
+ any<PackageSetting>(), any<PackageSetting>(), anyInt())) { false }
whenever(this.snapshot()) { this@mockThrowOnUnmocked }
whenever(registerObserver(any())).thenCallRealMethod()
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java b/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
index 617321b..cc64797 100644
--- a/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
@@ -35,6 +35,8 @@
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
+import android.graphics.Point;
+import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManagerInternal.RefreshRateRange;
import android.os.Binder;
import android.os.Handler;
@@ -93,6 +95,11 @@
@Mock
private LogicalLight mMockedBacklight;
+ @Mock
+ private DisplayManager mMockDisplayManager;
+ @Mock
+ private Point mMockDisplayStableSize;
+
private Handler mHandler;
private TestListener mListener = new TestListener();
@@ -123,6 +130,8 @@
mListener, mInjector);
spyOn(mAdapter);
doReturn(mMockedContext).when(mAdapter).getOverlayContext();
+ doReturn(mMockDisplayManager).when(mMockedContext).getSystemService(DisplayManager.class);
+ doReturn(mMockDisplayStableSize).when(mMockDisplayManager).getStableDisplaySize();
TypedArray mockNitsRange = createFloatTypedArray(DISPLAY_RANGE_NITS);
when(mMockedResources.obtainTypedArray(R.array.config_screenBrightnessNits))
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/MockSystem.kt b/services/tests/mockingservicestests/src/com/android/server/pm/MockSystem.kt
index 353c8e2..55745cd 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/MockSystem.kt
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/MockSystem.kt
@@ -69,6 +69,7 @@
import com.android.server.pm.pkg.parsing.ParsingPackage
import com.android.server.pm.pkg.parsing.ParsingPackageUtils
import com.android.server.pm.resolution.ComponentResolver
+import com.android.server.pm.snapshot.PackageDataSnapshot
import com.android.server.pm.verify.domain.DomainVerificationManagerInternal
import com.android.server.sdksandbox.SdkSandboxManagerLocal
import com.android.server.testutils.TestHandler
@@ -329,7 +330,7 @@
}
whenever(mocks.injector.sharedLibrariesImpl) { mSharedLibraries }
// everything visible by default
- whenever(mocks.appsFilter.shouldFilterApplication(
+ whenever(mocks.appsFilter.shouldFilterApplication(any(PackageDataSnapshot::class.java),
anyInt(), nullable(), nullable(), anyInt())) { false }
val displayManager: DisplayManager = mock()
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt b/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt
index 3ba9ca5..b9d6b2c 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt
@@ -23,6 +23,7 @@
import android.util.ArrayMap
import android.util.SparseArray
import com.android.server.pm.pkg.PackageStateInternal
+import com.android.server.pm.snapshot.PackageDataSnapshot
import com.android.server.testutils.any
import com.android.server.testutils.eq
import com.android.server.testutils.nullable
@@ -389,6 +390,7 @@
private fun mockAllowList(pkgSetting: PackageStateInternal, list: SparseArray<IntArray>?) {
whenever(rule.mocks().appsFilter.getVisibilityAllowList(
+ any(PackageDataSnapshot::class.java),
argThat { it?.packageName == pkgSetting.packageName }, any(IntArray::class.java),
any() as ArrayMap<String, out PackageStateInternal>
))
diff --git a/services/tests/mockingservicestests/src/com/android/server/tare/ScribeTest.java b/services/tests/mockingservicestests/src/com/android/server/tare/ScribeTest.java
index c2cf2ff..14f95e9 100644
--- a/services/tests/mockingservicestests/src/com/android/server/tare/ScribeTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/tare/ScribeTest.java
@@ -107,7 +107,7 @@
@Test
public void testWriteHighLevelStateToDisk() {
long lastReclamationTime = System.currentTimeMillis();
- long remainingConsumableNarcs = 2000L;
+ long remainingConsumableCakes = 2000L;
long consumptionLimit = 500_000L;
when(mIrs.getConsumptionLimitLocked()).thenReturn(consumptionLimit);
@@ -118,20 +118,20 @@
ledger.recordTransaction(new Ledger.Transaction(0, 1000L, 1, null, -5000, 3000));
mScribeUnderTest.setLastReclamationTimeLocked(lastReclamationTime);
mScribeUnderTest.setConsumptionLimitLocked(consumptionLimit);
- mScribeUnderTest.adjustRemainingConsumableNarcsLocked(
- remainingConsumableNarcs - consumptionLimit);
+ mScribeUnderTest.adjustRemainingConsumableCakesLocked(
+ remainingConsumableCakes - consumptionLimit);
assertEquals(lastReclamationTime, mScribeUnderTest.getLastReclamationTimeLocked());
- assertEquals(remainingConsumableNarcs,
- mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(remainingConsumableCakes,
+ mScribeUnderTest.getRemainingConsumableCakesLocked());
assertEquals(consumptionLimit, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
mScribeUnderTest.writeImmediatelyForTesting();
mScribeUnderTest.loadFromDiskLocked();
assertEquals(lastReclamationTime, mScribeUnderTest.getLastReclamationTimeLocked());
- assertEquals(remainingConsumableNarcs,
- mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(remainingConsumableCakes,
+ mScribeUnderTest.getRemainingConsumableCakesLocked());
assertEquals(consumptionLimit, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
}
@@ -234,32 +234,32 @@
@Test
public void testChangingConsumable() {
assertEquals(0, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
- assertEquals(0, mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(0, mScribeUnderTest.getRemainingConsumableCakesLocked());
// Limit increased, so remaining value should be adjusted as well
mScribeUnderTest.setConsumptionLimitLocked(1000);
assertEquals(1000, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
- assertEquals(1000, mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(1000, mScribeUnderTest.getRemainingConsumableCakesLocked());
// Limit decreased below remaining, so remaining value should be adjusted as well
mScribeUnderTest.setConsumptionLimitLocked(500);
assertEquals(500, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
- assertEquals(500, mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(500, mScribeUnderTest.getRemainingConsumableCakesLocked());
- mScribeUnderTest.adjustRemainingConsumableNarcsLocked(-100);
+ mScribeUnderTest.adjustRemainingConsumableCakesLocked(-100);
assertEquals(500, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
- assertEquals(400, mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(400, mScribeUnderTest.getRemainingConsumableCakesLocked());
// Limit increased, so remaining value should be adjusted by the difference as well
mScribeUnderTest.setConsumptionLimitLocked(1000);
assertEquals(1000, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
- assertEquals(900, mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(900, mScribeUnderTest.getRemainingConsumableCakesLocked());
// Limit decreased, but above remaining, so remaining value should left alone
mScribeUnderTest.setConsumptionLimitLocked(950);
assertEquals(950, mScribeUnderTest.getSatiatedConsumptionLimitLocked());
- assertEquals(900, mScribeUnderTest.getRemainingConsumableNarcsLocked());
+ assertEquals(900, mScribeUnderTest.getRemainingConsumableCakesLocked());
}
private void assertLedgersEqual(Ledger expected, Ledger actual) {
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClientTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClientTest.java
index aba93b0..f08d0ef6 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClientTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClientTest.java
@@ -18,6 +18,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.inOrder;
@@ -26,8 +27,13 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.app.ActivityManager;
+import android.app.ActivityTaskManager;
+import android.content.ComponentName;
+import android.hardware.biometrics.common.ICancellationSignal;
import android.hardware.biometrics.common.OperationContext;
import android.hardware.biometrics.face.ISession;
+import android.hardware.face.Face;
import android.os.IBinder;
import android.os.RemoteException;
import android.platform.test.annotations.Presubmit;
@@ -53,6 +59,9 @@
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
+import java.util.ArrayList;
+import java.util.List;
+
@Presubmit
@SmallTest
public class FaceAuthenticationClientTest {
@@ -82,6 +91,10 @@
private ClientMonitorCallback mCallback;
@Mock
private Sensor.HalSessionCallback mHalSessionCallback;
+ @Mock
+ private ActivityTaskManager mActivityTaskManager;
+ @Mock
+ private ICancellationSignal mCancellationSignal;
@Captor
private ArgumentCaptor<OperationContext> mOperationContextCaptor;
@@ -116,6 +129,25 @@
verify(mHal, never()).authenticate(anyLong());
}
+ @Test
+ public void cancelsAuthWhenNotInForeground() throws Exception {
+ final ActivityManager.RunningTaskInfo topTask = new ActivityManager.RunningTaskInfo();
+ topTask.topActivity = new ComponentName("other", "thing");
+ when(mActivityTaskManager.getTasks(anyInt())).thenReturn(List.of(topTask));
+ when(mHal.authenticateWithContext(anyLong(), any())).thenReturn(mCancellationSignal);
+
+ final FaceAuthenticationClient client = createClient();
+ client.start(mCallback);
+ client.onAuthenticated(new Face("friendly", 1 /* faceId */, 2 /* deviceId */),
+ true /* authenticated */, new ArrayList<>());
+
+ verify(mCancellationSignal).cancel();
+ }
+
+ private FaceAuthenticationClient createClient() throws RemoteException {
+ return createClient(2 /* version */);
+ }
+
private FaceAuthenticationClient createClient(int version) throws RemoteException {
when(mHal.getInterfaceVersion()).thenReturn(version);
@@ -126,6 +158,11 @@
false /* requireConfirmation */, 9 /* sensorId */,
mBiometricLogger, mBiometricContext, true /* isStrongBiometric */,
mUsageStats, mLockoutCache, false /* allowBackgroundAuthentication */,
- false /* isKeyguardBypassEnabled */, null /* sensorPrivacyManager */);
+ false /* isKeyguardBypassEnabled */, null /* sensorPrivacyManager */) {
+ @Override
+ protected ActivityTaskManager getActivityTaskManager() {
+ return mActivityTaskManager;
+ }
+ };
}
}
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClientTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClientTest.java
index 7463022..1a49f8a 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClientTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClientTest.java
@@ -31,7 +31,11 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.app.ActivityManager;
+import android.app.ActivityTaskManager;
+import android.content.ComponentName;
import android.hardware.biometrics.BiometricManager;
+import android.hardware.biometrics.common.ICancellationSignal;
import android.hardware.biometrics.common.OperationContext;
import android.hardware.biometrics.fingerprint.ISession;
import android.hardware.biometrics.fingerprint.PointerContext;
@@ -66,6 +70,7 @@
import org.mockito.junit.MockitoRule;
import java.util.ArrayList;
+import java.util.List;
import java.util.function.Consumer;
@Presubmit
@@ -111,6 +116,10 @@
@Mock
private Sensor.HalSessionCallback mHalSessionCallback;
@Mock
+ private ActivityTaskManager mActivityTaskManager;
+ @Mock
+ private ICancellationSignal mCancellationSignal;
+ @Mock
private Probe mLuxProbe;
@Captor
private ArgumentCaptor<OperationContext> mOperationContextCaptor;
@@ -288,11 +297,36 @@
verify(mSideFpsController).hide(anyInt());
}
+ @Test
+ public void cancelsAuthWhenNotInForeground() throws Exception {
+ final ActivityManager.RunningTaskInfo topTask = new ActivityManager.RunningTaskInfo();
+ topTask.topActivity = new ComponentName("other", "thing");
+ when(mActivityTaskManager.getTasks(anyInt())).thenReturn(List.of(topTask));
+ when(mHal.authenticateWithContext(anyLong(), any())).thenReturn(mCancellationSignal);
+
+ final FingerprintAuthenticationClient client = createClientWithoutBackgroundAuth();
+ client.start(mCallback);
+ client.onAuthenticated(new Fingerprint("friendly", 1 /* fingerId */, 2 /* deviceId */),
+ true /* authenticated */, new ArrayList<>());
+
+ verify(mCancellationSignal).cancel();
+ }
+
private FingerprintAuthenticationClient createClient() throws RemoteException {
- return createClient(100);
+ return createClient(100 /* version */, true /* allowBackgroundAuthentication */);
+ }
+
+ private FingerprintAuthenticationClient createClientWithoutBackgroundAuth()
+ throws RemoteException {
+ return createClient(100 /* version */, false /* allowBackgroundAuthentication */);
}
private FingerprintAuthenticationClient createClient(int version) throws RemoteException {
+ return createClient(version, true /* allowBackgroundAuthentication */);
+ }
+
+ private FingerprintAuthenticationClient createClient(int version,
+ boolean allowBackgroundAuthentication) throws RemoteException {
when(mHal.getInterfaceVersion()).thenReturn(version);
final AidlSession aidl = new AidlSession(version, mHal, USER_ID, mHalSessionCallback);
@@ -302,7 +336,11 @@
9 /* sensorId */, mBiometricLogger, mBiometricContext,
true /* isStrongBiometric */,
null /* taskStackListener */, mLockoutCache,
- mUdfpsOverlayController, mSideFpsController,
- true /* allowBackgroundAuthentication */, mSensorProps);
+ mUdfpsOverlayController, mSideFpsController, allowBackgroundAuthentication, mSensorProps) {
+ @Override
+ protected ActivityTaskManager getActivityTaskManager() {
+ return mActivityTaskManager;
+ }
+ };
}
}
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
index 45d101a..545361c 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -4992,8 +4992,8 @@
.thenReturn(12345 /* some UID in user 0 */);
// Make personal apps look suspended
dpms.getUserData(UserHandle.USER_SYSTEM).mAppsSuspended = true;
-
- clearInvocations(getServices().iwindowManager);
+ // Screen capture
+ dpm.setScreenCaptureDisabled(admin1, true);
dpm.wipeData(0);
verify(getServices().userManagerInternal).removeUserEvenWhenDisallowed(CALLER_USER_HANDLE);
@@ -5004,6 +5004,8 @@
verify(getServices().userManager).setUserRestriction(
UserManager.DISALLOW_ADD_USER, false, UserHandle.SYSTEM);
+ clearInvocations(getServices().iwindowManager);
+
// Some device-wide policies are getting cleaned-up after the user is removed.
mContext.binder.callingUid = DpmMockContext.SYSTEM_UID;
sendBroadcastWithUser(dpms, Intent.ACTION_USER_REMOVED, CALLER_USER_HANDLE);
@@ -5020,9 +5022,10 @@
MockUtils.checkIntentAction(
DevicePolicyManager.ACTION_RESET_PROTECTION_POLICY_CHANGED),
MockUtils.checkUserHandle(UserHandle.USER_SYSTEM));
- // Refresh strong auth timeout and screen capture
+ // Refresh strong auth timeout
verify(getServices().lockSettingsInternal).refreshStrongAuthTimeout(UserHandle.USER_SYSTEM);
- verify(getServices().iwindowManager).refreshScreenCaptureDisabled(UserHandle.USER_SYSTEM);
+ // Refresh screen capture
+ verify(getServices().iwindowManager).refreshScreenCaptureDisabled();
// Unsuspend personal apps
verify(getServices().packageManagerInternal)
.unsuspendForSuspendingPackage(PLATFORM_PACKAGE_NAME, UserHandle.USER_SYSTEM);
diff --git a/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java b/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java
index 3be2aac..c43e6ab 100644
--- a/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java
@@ -30,6 +30,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManagerInternal;
import android.content.pm.Signature;
import android.content.pm.SigningDetails;
import android.content.pm.UserInfo;
@@ -53,6 +54,7 @@
import com.android.server.pm.pkg.component.ParsedIntentInfoImpl;
import com.android.server.pm.pkg.component.ParsedProviderImpl;
import com.android.server.pm.pkg.parsing.ParsingPackage;
+import com.android.server.pm.snapshot.PackageDataSnapshot;
import com.android.server.utils.WatchableTester;
import org.junit.Before;
@@ -99,9 +101,11 @@
@Mock
AppsFilterImpl.FeatureConfig mFeatureConfigMock;
@Mock
- AppsFilterImpl.StateProvider mStateProvider;
+ PackageDataSnapshot mSnapshot;
@Mock
Executor mMockExecutor;
+ @Mock
+ PackageManagerInternal mPmInternal;
private ArrayMap<String, PackageSetting> mExisting = new ArrayMap<>();
private Collection<SharedUserSetting> mSharedUserSettings = new ArraySet<>();
@@ -201,12 +205,10 @@
mExisting = new ArrayMap<>();
MockitoAnnotations.initMocks(this);
- doAnswer(invocation -> {
- ((AppsFilterImpl.StateProvider.CurrentStateCallback) invocation.getArgument(0))
- .currentState(mExisting, mSharedUserSettings, USER_INFO_LIST);
- return new Object();
- }).when(mStateProvider)
- .runWithState(any(AppsFilterImpl.StateProvider.CurrentStateCallback.class));
+ when(mSnapshot.getPackageStates()).thenAnswer(x -> mExisting);
+ when(mSnapshot.getAllSharedUsers()).thenReturn(mSharedUserSettings);
+ when(mSnapshot.getUserInfos()).thenReturn(USER_INFO_LIST);
+ when(mPmInternal.snapshot()).thenReturn(mSnapshot);
doAnswer(invocation -> {
((Runnable) invocation.getArgument(0)).run();
@@ -223,11 +225,11 @@
@Test
public void testSystemReadyPropogates() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
verify(mFeatureConfigMock).onSystemReady();
}
@@ -235,13 +237,13 @@
@Test
public void testQueriesAction_FilterMatches() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addBasicAndroid");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
PackageSetting target = simulateAddPackage(appsFilter,
@@ -251,14 +253,16 @@
pkg("com.some.other.package", new Intent("TEST_ACTION")), DUMMY_CALLING_APPID);
watcher.verifyChangeReported("add package");
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterAplication");
}
+
@Test
public void testQueriesProtectedAction_FilterDoesNotMatch() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
@@ -271,7 +275,7 @@
simulateAddPackage(appsFilter, android, 1000,
b -> b.setSigningDetails(frameworkSigningDetails));
watcher.verifyChangeReported("addPackage");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
final int activityUid = DUMMY_TARGET_APPID;
@@ -292,14 +296,14 @@
pkg("com.calling.wildcard", new Intent("*")), wildcardUid);
watcher.verifyChangeReported("addPackage");
- assertFalse(appsFilter.shouldFilterApplication(callingUid, calling, targetActivity,
- SYSTEM_USER));
- assertTrue(appsFilter.shouldFilterApplication(callingUid, calling, targetReceiver,
- SYSTEM_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, callingUid, calling,
+ targetActivity, SYSTEM_USER));
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, callingUid, calling,
+ targetReceiver, SYSTEM_USER));
- assertFalse(appsFilter.shouldFilterApplication(
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot,
wildcardUid, callingWildCard, targetActivity, SYSTEM_USER));
- assertTrue(appsFilter.shouldFilterApplication(
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot,
wildcardUid, callingWildCard, targetReceiver, SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterApplication");
}
@@ -307,13 +311,13 @@
@Test
public void testQueriesProvider_FilterMatches() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addPackage");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
PackageSetting target = simulateAddPackage(appsFilter,
@@ -324,19 +328,19 @@
DUMMY_CALLING_APPID);
watcher.verifyChangeReported("addPackage");
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling,
+ target, SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterApplication");
}
@Test
public void testOnUserUpdated_FilterMatches() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkgWithProvider("com.some.package", "com.some.authority"), DUMMY_TARGET_APPID);
@@ -346,41 +350,31 @@
for (int subjectUserId : USER_ARRAY) {
for (int otherUserId : USER_ARRAY) {
- assertFalse(appsFilter.shouldFilterApplication(
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot,
UserHandle.getUid(DUMMY_CALLING_APPID, subjectUserId), calling, target,
otherUserId));
}
}
// adds new user
- doAnswer(invocation -> {
- ((AppsFilterImpl.StateProvider.CurrentStateCallback) invocation.getArgument(0))
- .currentState(mExisting, mSharedUserSettings, USER_INFO_LIST_WITH_ADDED);
- return new Object();
- }).when(mStateProvider)
- .runWithState(any(AppsFilterImpl.StateProvider.CurrentStateCallback.class));
- appsFilter.onUserCreated(ADDED_USER);
+ when(mSnapshot.getUserInfos()).thenReturn(USER_INFO_LIST_WITH_ADDED);
+ appsFilter.onUserCreated(mSnapshot, ADDED_USER);
for (int subjectUserId : USER_ARRAY_WITH_ADDED) {
for (int otherUserId : USER_ARRAY_WITH_ADDED) {
- assertFalse(appsFilter.shouldFilterApplication(
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot,
UserHandle.getUid(DUMMY_CALLING_APPID, subjectUserId), calling, target,
otherUserId));
}
}
// delete user
- doAnswer(invocation -> {
- ((AppsFilterImpl.StateProvider.CurrentStateCallback) invocation.getArgument(0))
- .currentState(mExisting, mSharedUserSettings, USER_INFO_LIST);
- return new Object();
- }).when(mStateProvider)
- .runWithState(any(AppsFilterImpl.StateProvider.CurrentStateCallback.class));
+ when(mSnapshot.getUserInfos()).thenReturn(USER_INFO_LIST);
appsFilter.onUserDeleted(ADDED_USER);
for (int subjectUserId : USER_ARRAY) {
for (int otherUserId : USER_ARRAY) {
- assertFalse(appsFilter.shouldFilterApplication(
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot,
UserHandle.getUid(DUMMY_CALLING_APPID, subjectUserId), calling, target,
otherUserId));
}
@@ -390,13 +384,13 @@
@Test
public void testQueriesDifferentProvider_Filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addPackage");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
PackageSetting target = simulateAddPackage(appsFilter,
@@ -407,18 +401,18 @@
DUMMY_CALLING_APPID);
watcher.verifyChangeReported("addPackage");
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling,
+ target, SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterApplication");
}
@Test
public void testQueriesProviderWithSemiColon_FilterMatches() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkgWithProvider("com.some.package", "com.some.authority;com.some.other.authority"),
@@ -427,34 +421,34 @@
pkgQueriesProvider("com.some.other.package", "com.some.authority"),
DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling,
+ target, SYSTEM_USER));
}
@Test
public void testQueriesAction_NoMatchingAction_Filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package", new Intent("TEST_ACTION")), DUMMY_CALLING_APPID);
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling,
+ target, SYSTEM_USER));
}
@Test
public void testQueriesAction_NoMatchingActionFilterLowSdk_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
@@ -465,35 +459,37 @@
DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testNoQueries_Filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testNoUsesLibrary_Filters() throws Exception {
- final AppsFilterImpl appsFilter = new AppsFilterImpl(mStateProvider, mFeatureConfigMock,
+ final AppsFilterImpl appsFilter = new AppsFilterImpl(mFeatureConfigMock,
new String[]{}, /* systemAppsQueryable */ false, /* overlayProvider */ null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
final Signature mockSignature = Mockito.mock(Signature.class);
final SigningDetails mockSigningDetails = new SigningDetails(
@@ -508,18 +504,19 @@
final PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testUsesLibrary_DoesntFilter() throws Exception {
- final AppsFilterImpl appsFilter = new AppsFilterImpl(mStateProvider, mFeatureConfigMock,
+ final AppsFilterImpl appsFilter = new AppsFilterImpl(mFeatureConfigMock,
new String[]{}, /* systemAppsQueryable */ false, /* overlayProvider */ null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
final Signature mockSignature = Mockito.mock(Signature.class);
final SigningDetails mockSigningDetails = new SigningDetails(
@@ -535,18 +532,19 @@
pkg("com.some.other.package").addUsesLibrary("com.some.shared_library"),
DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testUsesOptionalLibrary_DoesntFilter() throws Exception {
- final AppsFilterImpl appsFilter = new AppsFilterImpl(mStateProvider, mFeatureConfigMock,
+ final AppsFilterImpl appsFilter = new AppsFilterImpl(mFeatureConfigMock,
new String[]{}, /* systemAppsQueryable */ false, /* overlayProvider */ null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
final Signature mockSignature = Mockito.mock(Signature.class);
final SigningDetails mockSigningDetails = new SigningDetails(
@@ -562,18 +560,19 @@
pkg("com.some.other.package").addUsesOptionalLibrary("com.some.shared_library"),
DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testUsesLibrary_ShareUid_DoesntFilter() throws Exception {
- final AppsFilterImpl appsFilter = new AppsFilterImpl(mStateProvider, mFeatureConfigMock,
+ final AppsFilterImpl appsFilter = new AppsFilterImpl(mFeatureConfigMock,
new String[]{}, /* systemAppsQueryable */ false, /* overlayProvider */ null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
final Signature mockSignature = Mockito.mock(Signature.class);
final SigningDetails mockSigningDetails = new SigningDetails(
@@ -589,22 +588,23 @@
pkg("com.some.other.package_a").setSharedUserId("com.some.uid"),
DUMMY_CALLING_APPID);
simulateAddPackage(appsFilter, pkg("com.some.other.package_b")
- .setSharedUserId("com.some.uid").addUsesLibrary("com.some.shared_library"),
+ .setSharedUserId("com.some.uid").addUsesLibrary("com.some.shared_library"),
DUMMY_CALLING_APPID);
// Although package_a doesn't use library, it should be granted visibility. It's because
// package_a shares userId with package_b, and package_b uses that shared library.
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testForceQueryable_SystemDoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package").setForceQueryable(true), DUMMY_TARGET_APPID,
@@ -612,36 +612,38 @@
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testForceQueryable_NonSystemFilters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package").setForceQueryable(true), DUMMY_TARGET_APPID);
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testForceQueryableByDevice_SystemCaller_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock,
+ new AppsFilterImpl(mFeatureConfigMock,
new String[]{"com.some.package"}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID,
@@ -649,17 +651,18 @@
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testSystemSignedTarget_DoesntFilter() throws CertificateException {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
final Signature frameworkSignature = Mockito.mock(Signature.class);
final SigningDetails frameworkSigningDetails =
@@ -679,36 +682,38 @@
pkg("com.some.other.package"), DUMMY_CALLING_APPID,
b -> b.setSigningDetails(otherSigningDetails));
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testForceQueryableByDevice_NonSystemCaller_Filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock,
+ new AppsFilterImpl(mFeatureConfigMock,
new String[]{"com.some.package"}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testSystemQueryable_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{},
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{},
true /* system force queryable */, null, mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID,
@@ -716,25 +721,27 @@
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testQueriesPackage_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package", "com.some.package"), DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
@@ -742,49 +749,52 @@
when(mFeatureConfigMock.packageIsEnabled(any(AndroidPackage.class)))
.thenReturn(false);
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(
appsFilter, pkg("com.some.package"), DUMMY_TARGET_APPID);
PackageSetting calling = simulateAddPackage(
appsFilter, pkg("com.some.other.package"), DUMMY_CALLING_APPID);
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testSystemUid_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
- assertFalse(appsFilter.shouldFilterApplication(SYSTEM_USER, null, target, SYSTEM_USER));
- assertFalse(appsFilter.shouldFilterApplication(Process.FIRST_APPLICATION_UID - 1,
- null, target, SYSTEM_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, SYSTEM_USER, null, target,
+ SYSTEM_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot,
+ Process.FIRST_APPLICATION_UID - 1, null, target, SYSTEM_USER));
}
@Test
public void testSystemUidSecondaryUser_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
- assertFalse(appsFilter.shouldFilterApplication(0, null, target, SECONDARY_USER));
- assertFalse(appsFilter.shouldFilterApplication(
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, 0, null, target,
+ SECONDARY_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot,
UserHandle.getUid(SECONDARY_USER, Process.FIRST_APPLICATION_UID - 1),
null, target, SECONDARY_USER));
}
@@ -792,25 +802,25 @@
@Test
public void testNonSystemUid_NoCallingSetting_Filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter,
pkg("com.some.package"), DUMMY_TARGET_APPID);
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, null, target,
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, null, target,
SYSTEM_USER));
}
@Test
public void testNoTargetPackage_filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = new PackageSettingBuilder()
.setAppId(DUMMY_TARGET_APPID)
@@ -821,8 +831,9 @@
PackageSetting calling = simulateAddPackage(appsFilter,
pkg("com.some.other.package", new Intent("TEST_ACTION")), DUMMY_CALLING_APPID);
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
@@ -838,7 +849,6 @@
ParsingPackage actor = pkg("com.some.package.actor");
final AppsFilterImpl appsFilter = new AppsFilterImpl(
- mStateProvider,
mFeatureConfigMock,
new String[]{},
false,
@@ -868,7 +878,7 @@
},
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
// Packages must be added in actor -> overlay -> target order so that the implicit
// visibility of the actor into the overlay can be tested
@@ -878,33 +888,33 @@
simulateAddPackage(appsFilter, overlay, DUMMY_OVERLAY_APPID);
// Actor can not see overlay (yet)
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_ACTOR_APPID, actorSetting,
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_ACTOR_APPID, actorSetting,
overlaySetting, SYSTEM_USER));
PackageSetting targetSetting = simulateAddPackage(appsFilter, target, DUMMY_TARGET_APPID);
// Actor can see both target and overlay
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_ACTOR_APPID, actorSetting,
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_ACTOR_APPID, actorSetting,
targetSetting, SYSTEM_USER));
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_ACTOR_APPID, actorSetting,
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_ACTOR_APPID, actorSetting,
overlaySetting, SYSTEM_USER));
// But target/overlay can't see each other
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_TARGET_APPID, targetSetting,
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_TARGET_APPID, targetSetting,
overlaySetting, SYSTEM_USER));
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_OVERLAY_APPID, overlaySetting,
- targetSetting, SYSTEM_USER));
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_OVERLAY_APPID,
+ overlaySetting, targetSetting, SYSTEM_USER));
// And can't see the actor
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_TARGET_APPID, targetSetting,
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_TARGET_APPID, targetSetting,
actorSetting, SYSTEM_USER));
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_OVERLAY_APPID, overlaySetting,
- actorSetting, SYSTEM_USER));
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_OVERLAY_APPID,
+ overlaySetting, actorSetting, SYSTEM_USER));
- appsFilter.removePackage(targetSetting, false /* isReplace */);
+ appsFilter.removePackage(mSnapshot, targetSetting, false /* isReplace */);
// Actor loses visibility to the overlay via removal of the target
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_ACTOR_APPID, actorSetting,
+ assertTrue(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_ACTOR_APPID, actorSetting,
overlaySetting, SYSTEM_USER));
}
@@ -928,7 +938,6 @@
null /*settingBuilder*/);
final AppsFilterImpl appsFilter = new AppsFilterImpl(
- mStateProvider,
mFeatureConfigMock,
new String[]{},
false,
@@ -959,7 +968,7 @@
},
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting targetSetting = simulateAddPackage(appsFilter, target, DUMMY_TARGET_APPID);
SharedUserSetting actorSharedSetting = new SharedUserSetting("actorSharedUser",
@@ -971,19 +980,19 @@
simulateAddPackage(ps2, appsFilter, actorSharedSetting);
// actorTwo can see both target and overlay
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_ACTOR_APPID, actorSharedSetting,
- targetSetting, SYSTEM_USER));
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_ACTOR_APPID, actorSharedSetting,
- overlaySetting, SYSTEM_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_ACTOR_APPID,
+ actorSharedSetting, targetSetting, SYSTEM_USER));
+ assertFalse(appsFilter.shouldFilterApplication(mSnapshot, DUMMY_ACTOR_APPID,
+ actorSharedSetting, overlaySetting, SYSTEM_USER));
}
@Test
public void testInitiatingApp_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter, pkg("com.some.package"),
DUMMY_TARGET_APPID);
@@ -991,17 +1000,18 @@
DUMMY_CALLING_APPID,
withInstallSource(target.getPackageName(), null, null, null, false));
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testUninstalledInitiatingApp_Filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter, pkg("com.some.package"),
DUMMY_TARGET_APPID);
@@ -1009,20 +1019,21 @@
DUMMY_CALLING_APPID,
withInstallSource(target.getPackageName(), null, null, null, true));
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
}
@Test
public void testOriginatingApp_Filters() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addBasicAndroid");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
PackageSetting target = simulateAddPackage(appsFilter, pkg("com.some.package"),
@@ -1033,21 +1044,22 @@
false));
watcher.verifyChangeReported("add package");
- assertTrue(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertTrue(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterAplication");
}
@Test
public void testInstallingApp_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addBasicAndroid");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
PackageSetting target = simulateAddPackage(appsFilter, pkg("com.some.package"),
@@ -1058,21 +1070,22 @@
false));
watcher.verifyChangeReported("add package");
- assertFalse(appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, calling, target,
- SYSTEM_USER));
+ assertFalse(
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, calling, target,
+ SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterAplication");
}
@Test
public void testInstrumentation_DoesntFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addBasicAndroid");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
PackageSetting target = simulateAddPackage(appsFilter, pkg("com.some.package"),
@@ -1084,24 +1097,24 @@
watcher.verifyChangeReported("add package");
assertFalse(
- appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, instrumentation, target,
- SYSTEM_USER));
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, instrumentation,
+ target, SYSTEM_USER));
assertFalse(
- appsFilter.shouldFilterApplication(DUMMY_TARGET_APPID, target, instrumentation,
- SYSTEM_USER));
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_TARGET_APPID, target,
+ instrumentation, SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterAplication");
}
@Test
public void testWhoCanSee() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addBasicAndroid");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
final int systemAppId = Process.FIRST_APPLICATION_UID - 1;
@@ -1123,14 +1136,14 @@
watcher.verifyChangeReported("add package");
final SparseArray<int[]> systemFilter =
- appsFilter.getVisibilityAllowList(system, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, system, USER_ARRAY, mExisting);
watcher.verifyNoChangeReported("getVisibility");
assertThat(toList(systemFilter.get(SYSTEM_USER)),
contains(seesNothingAppId, hasProviderAppId, queriesProviderAppId));
watcher.verifyNoChangeReported("getVisibility");
final SparseArray<int[]> seesNothingFilter =
- appsFilter.getVisibilityAllowList(seesNothing, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, seesNothing, USER_ARRAY, mExisting);
watcher.verifyNoChangeReported("getVisibility");
assertThat(toList(seesNothingFilter.get(SYSTEM_USER)),
contains(seesNothingAppId));
@@ -1140,12 +1153,13 @@
watcher.verifyNoChangeReported("getVisibility");
final SparseArray<int[]> hasProviderFilter =
- appsFilter.getVisibilityAllowList(hasProvider, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, hasProvider, USER_ARRAY, mExisting);
assertThat(toList(hasProviderFilter.get(SYSTEM_USER)),
contains(hasProviderAppId, queriesProviderAppId));
SparseArray<int[]> queriesProviderFilter =
- appsFilter.getVisibilityAllowList(queriesProvider, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, queriesProvider, USER_ARRAY,
+ mExisting);
watcher.verifyNoChangeReported("getVisibility");
assertThat(toList(queriesProviderFilter.get(SYSTEM_USER)),
contains(queriesProviderAppId));
@@ -1158,7 +1172,8 @@
// ensure implicit access is included in the filter
queriesProviderFilter =
- appsFilter.getVisibilityAllowList(queriesProvider, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, queriesProvider, USER_ARRAY,
+ mExisting);
watcher.verifyNoChangeReported("getVisibility");
assertThat(toList(queriesProviderFilter.get(SYSTEM_USER)),
contains(hasProviderAppId, queriesProviderAppId));
@@ -1168,13 +1183,13 @@
@Test
public void testOnChangeReport() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange");
watcher.register();
simulateAddBasicAndroid(appsFilter);
watcher.verifyChangeReported("addBasic");
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
watcher.verifyChangeReported("systemReady");
final int systemAppId = Process.FIRST_APPLICATION_UID - 1;
@@ -1196,13 +1211,13 @@
watcher.verifyChangeReported("addPackage");
final SparseArray<int[]> systemFilter =
- appsFilter.getVisibilityAllowList(system, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, system, USER_ARRAY, mExisting);
assertThat(toList(systemFilter.get(SYSTEM_USER)),
contains(seesNothingAppId, hasProviderAppId, queriesProviderAppId));
watcher.verifyNoChangeReported("get");
final SparseArray<int[]> seesNothingFilter =
- appsFilter.getVisibilityAllowList(seesNothing, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, seesNothing, USER_ARRAY, mExisting);
assertThat(toList(seesNothingFilter.get(SYSTEM_USER)),
contains(seesNothingAppId));
assertThat(toList(seesNothingFilter.get(SECONDARY_USER)),
@@ -1210,13 +1225,14 @@
watcher.verifyNoChangeReported("get");
final SparseArray<int[]> hasProviderFilter =
- appsFilter.getVisibilityAllowList(hasProvider, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, hasProvider, USER_ARRAY, mExisting);
assertThat(toList(hasProviderFilter.get(SYSTEM_USER)),
contains(hasProviderAppId, queriesProviderAppId));
watcher.verifyNoChangeReported("get");
SparseArray<int[]> queriesProviderFilter =
- appsFilter.getVisibilityAllowList(queriesProvider, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, queriesProvider, USER_ARRAY,
+ mExisting);
assertThat(toList(queriesProviderFilter.get(SYSTEM_USER)),
contains(queriesProviderAppId));
watcher.verifyNoChangeReported("get");
@@ -1228,23 +1244,24 @@
// ensure implicit access is included in the filter
queriesProviderFilter =
- appsFilter.getVisibilityAllowList(queriesProvider, USER_ARRAY, mExisting);
+ appsFilter.getVisibilityAllowList(mSnapshot, queriesProvider, USER_ARRAY,
+ mExisting);
assertThat(toList(queriesProviderFilter.get(SYSTEM_USER)),
contains(hasProviderAppId, queriesProviderAppId));
watcher.verifyNoChangeReported("get");
// remove a package
- appsFilter.removePackage(seesNothing, false /* isReplace */);
+ appsFilter.removePackage(mSnapshot, seesNothing, false /* isReplace */);
watcher.verifyChangeReported("removePackage");
}
@Test
public void testOnChangeReportedFilter() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
final WatchableTester watcher = new WatchableTester(appsFilter, "onChange filter");
watcher.register();
@@ -1256,21 +1273,21 @@
watcher.verifyChangeReported("addPackage");
assertFalse(
- appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, instrumentation, target,
- SYSTEM_USER));
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, instrumentation,
+ target, SYSTEM_USER));
assertFalse(
- appsFilter.shouldFilterApplication(DUMMY_TARGET_APPID, target, instrumentation,
- SYSTEM_USER));
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_TARGET_APPID, target,
+ instrumentation, SYSTEM_USER));
watcher.verifyNoChangeReported("shouldFilterApplication");
}
@Test
public void testAppsFilterRead() throws Exception {
final AppsFilterImpl appsFilter =
- new AppsFilterImpl(mStateProvider, mFeatureConfigMock, new String[]{}, false, null,
+ new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null,
mMockExecutor);
simulateAddBasicAndroid(appsFilter);
- appsFilter.onSystemReady();
+ appsFilter.onSystemReady(mPmInternal);
PackageSetting target = simulateAddPackage(appsFilter, pkg("com.some.package"),
DUMMY_TARGET_APPID);
@@ -1288,25 +1305,29 @@
AppsFilterSnapshot snapshot = appsFilter.snapshot();
assertFalse(
- snapshot.shouldFilterApplication(DUMMY_CALLING_APPID, instrumentation, target,
+ snapshot.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, instrumentation,
+ target,
SYSTEM_USER));
assertFalse(
- snapshot.shouldFilterApplication(DUMMY_TARGET_APPID, target, instrumentation,
+ snapshot.shouldFilterApplication(mSnapshot, DUMMY_TARGET_APPID, target,
+ instrumentation,
SYSTEM_USER));
SparseArray<int[]> queriesProviderFilter =
- snapshot.getVisibilityAllowList(queriesProvider, USER_ARRAY, mExisting);
+ snapshot.getVisibilityAllowList(mSnapshot, queriesProvider, USER_ARRAY, mExisting);
assertThat(toList(queriesProviderFilter.get(SYSTEM_USER)), contains(queriesProviderAppId));
assertTrue(snapshot.canQueryPackage(instrumentation.getPkg(),
target.getPackageName()));
// New changes don't affect the snapshot
- appsFilter.removePackage(target, false);
+ appsFilter.removePackage(mSnapshot, target, false);
assertTrue(
- appsFilter.shouldFilterApplication(DUMMY_CALLING_APPID, instrumentation, target,
+ appsFilter.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, instrumentation,
+ target,
SYSTEM_USER));
assertFalse(
- snapshot.shouldFilterApplication(DUMMY_CALLING_APPID, instrumentation, target,
+ snapshot.shouldFilterApplication(mSnapshot, DUMMY_CALLING_APPID, instrumentation,
+ target,
SYSTEM_USER));
}
@@ -1343,7 +1364,7 @@
}
private PackageSetting simulateAddPackage(AppsFilterImpl filter,
- ParsingPackage newPkgBuilder, int appId, @Nullable WithSettingBuilder action,
+ ParsingPackage newPkgBuilder, int appId, @Nullable WithSettingBuilder action,
@Nullable SharedUserSetting sharedUserSetting) {
final PackageSetting setting =
getPackageSettingFromParsingPackage(newPkgBuilder, appId, action);
@@ -1373,7 +1394,7 @@
setting.setSharedUserAppId(sharedUserSetting.mAppId);
mSharedUserSettings.add(sharedUserSetting);
}
- filter.addPackage(setting);
+ filter.addPackage(mSnapshot, setting);
}
private WithSettingBuilder withInstallSource(String initiatingPackageName,
diff --git a/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java b/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java
index e4ee4d06..fdf9354 100644
--- a/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java
@@ -266,6 +266,11 @@
public void sendIntentSender(IntentSender intent) {
// Placeholder for spying.
}
+
+ @Override
+ public String getPackageName() {
+ return SYSTEM_PACKAGE_NAME;
+ }
}
/** ShortcutService with injection override methods. */
@@ -704,6 +709,7 @@
protected UriPermissionOwner mUriPermissionOwner;
+ protected static final String SYSTEM_PACKAGE_NAME = "android";
protected static final String CALLING_PACKAGE_1 = "com.android.test.1";
protected static final int CALLING_UID_1 = 10001;
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
index f4ab3db..39220a4 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
@@ -1516,7 +1516,7 @@
private Settings makeSettings() {
return new Settings(InstrumentationRegistry.getContext().getFilesDir(),
mRuntimePermissionsPersistence, mPermissionDataProvider,
- mDomainVerificationManager, new PackageManagerTracedLock());
+ mDomainVerificationManager, null, new PackageManagerTracedLock());
}
private void verifyKeySetMetaData(Settings settings)
diff --git a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
index fbcad62..f2495e1 100644
--- a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
@@ -18,6 +18,8 @@
import static android.app.ActivityManager.PROCESS_STATE_BOUND_TOP;
import static android.app.ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE;
+import static android.app.AppOpsManager.MODE_ALLOWED;
+import static android.app.AppOpsManager.MODE_ERRORED;
import static android.os.PowerManagerInternal.WAKEFULNESS_ASLEEP;
import static android.os.PowerManagerInternal.WAKEFULNESS_AWAKE;
import static android.os.PowerManagerInternal.WAKEFULNESS_DOZING;
@@ -46,6 +48,7 @@
import static org.mockito.Mockito.when;
import android.app.ActivityManagerInternal;
+import android.app.AppOpsManager;
import android.attention.AttentionManagerInternal;
import android.content.Context;
import android.content.ContextWrapper;
@@ -140,6 +143,7 @@
@Mock private WirelessChargerDetector mWirelessChargerDetectorMock;
@Mock private AmbientDisplayConfiguration mAmbientDisplayConfigurationMock;
@Mock private SystemPropertiesWrapper mSystemPropertiesMock;
+ @Mock private AppOpsManager mAppOpsManagerMock;
@Mock
private InattentiveSleepWarningController mInattentiveSleepWarningControllerMock;
@@ -297,6 +301,11 @@
return new LowPowerStandbyController(context, mTestLooper.getLooper(),
SystemClock::elapsedRealtime);
}
+
+ @Override
+ AppOpsManager createAppOpsManager(Context context) {
+ return mAppOpsManagerMock;
+ }
});
return mService;
}
@@ -461,7 +470,7 @@
}
@Test
- public void testWakefulnessAwake_AcquireCausesWakeup() {
+ public void testWakefulnessAwake_AcquireCausesWakeup_turnScreenOnAllowed() {
createService();
startSystem();
forceSleep();
@@ -469,6 +478,8 @@
IBinder token = new Binder();
String tag = "acq_causes_wakeup";
String packageName = "pkg.name";
+ when(mAppOpsManagerMock.checkOpNoThrow(AppOpsManager.OP_TURN_SCREEN_ON,
+ Binder.getCallingUid(), packageName)).thenReturn(MODE_ALLOWED);
// First, ensure that a normal full wake lock does not cause a wakeup
int flags = PowerManager.FULL_WAKE_LOCK;
@@ -493,6 +504,27 @@
}
@Test
+ public void testWakefulnessAwake_AcquireCausesWakeup_turnScreenOnDenied() {
+ createService();
+ startSystem();
+ forceSleep();
+
+ IBinder token = new Binder();
+ String tag = "acq_causes_wakeup";
+ String packageName = "pkg.name";
+ when(mAppOpsManagerMock.checkOpNoThrow(AppOpsManager.OP_TURN_SCREEN_ON,
+ Binder.getCallingUid(), packageName)).thenReturn(MODE_ERRORED);
+
+
+ // Verify that flag has no effect when OP_TURN_SCREEN_ON is not allowed
+ int flags = PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP;
+ mService.getBinderServiceInstance().acquireWakeLock(token, flags, tag, packageName,
+ null /* workSource */, null /* historyTag */, Display.INVALID_DISPLAY, null);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ mService.getBinderServiceInstance().releaseWakeLock(token, 0 /* flags */);
+ }
+
+ @Test
public void testWakefulnessAwake_IPowerManagerWakeUp() {
createService();
startSystem();
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 55147f3..d65e27d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -1896,10 +1896,13 @@
final ActivityRecord activity = createActivityWithTask();
final Task task = activity.getTask();
final Rect taskBounds = task.getBounds();
+ final int currentRotation = mDisplayContent.getRotation();
+ final int w = taskBounds.width();
+ final int h = taskBounds.height();
final TaskSnapshot snapshot = new TaskSnapshotPersisterTestBase.TaskSnapshotBuilder()
.setTopActivityComponent(activity.mActivityComponent)
- .setRotation(activity.getWindowConfiguration().getRotation())
- .setTaskSize(taskBounds.width(), taskBounds.height())
+ .setRotation(currentRotation)
+ .setTaskSize(w, h)
.build();
assertTrue(activity.isSnapshotCompatible(snapshot));
@@ -1909,6 +1912,18 @@
activity.getWindowConfiguration().setBounds(taskBounds);
assertFalse(activity.isSnapshotCompatible(snapshot));
+
+ // Flipped size should be accepted if the activity will show with 90 degree rotation.
+ final int targetRotation = currentRotation + 1;
+ doReturn(targetRotation).when(mDisplayContent)
+ .rotationForActivityInDifferentOrientation(any());
+ final TaskSnapshot rotatedSnapshot = new TaskSnapshotPersisterTestBase.TaskSnapshotBuilder()
+ .setTopActivityComponent(activity.mActivityComponent)
+ .setRotation(targetRotation)
+ .setTaskSize(h, w)
+ .build();
+ task.getWindowConfiguration().getBounds().set(0, 0, w, h);
+ assertTrue(activity.isSnapshotCompatible(rotatedSnapshot));
}
@Test
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
index 118f159..32d201f 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
@@ -854,7 +854,8 @@
final Rect[] bounds = new Rect[]{zeroRect, new Rect(left, top, right, bottom), zeroRect,
zeroRect};
final DisplayCutout.CutoutPathParserInfo info = new DisplayCutout.CutoutPathParserInfo(
- displayWidth, displayHeight, density, "", Surface.ROTATION_0, 1f);
+ displayWidth, displayHeight, displayWidth, displayHeight, density, "",
+ Surface.ROTATION_0, 1f, 1f);
final DisplayCutout cutout = new WmDisplayCutout(
DisplayCutout.constructDisplayCutout(bounds, Insets.NONE, info), null)
.computeSafeInsets(displayWidth, displayHeight).getDisplayCutout();
@@ -874,7 +875,8 @@
final Rect[] bounds90 = new Rect[]{new Rect(top, left, bottom, right), zeroRect, zeroRect,
zeroRect};
final DisplayCutout.CutoutPathParserInfo info90 = new DisplayCutout.CutoutPathParserInfo(
- displayWidth, displayHeight, density, "", Surface.ROTATION_90, 1f);
+ displayWidth, displayHeight, displayWidth, displayHeight, density, "",
+ Surface.ROTATION_90, 1f, 1f);
assertEquals(new WmDisplayCutout(
DisplayCutout.constructDisplayCutout(bounds90, Insets.NONE, info90), null)
.computeSafeInsets(displayHeight, displayWidth).getDisplayCutout(),
@@ -2172,7 +2174,7 @@
assertEquals(windowingMode, windowConfig.getWindowingMode());
// test misc display overrides
- assertEquals(ignoreOrientationRequests, testDisplayContent.mIgnoreOrientationRequest);
+ assertEquals(ignoreOrientationRequests, testDisplayContent.mSetIgnoreOrientationRequest);
assertEquals(fixedOrientationLetterboxRatio,
mWm.mLetterboxConfiguration.getFixedOrientationLetterboxAspectRatio(),
0 /* delta */);
@@ -2213,7 +2215,7 @@
assertEquals(windowingMode, windowConfig.getWindowingMode());
// test misc display overrides
- assertEquals(ignoreOrientationRequests, testDisplayContent.mIgnoreOrientationRequest);
+ assertEquals(ignoreOrientationRequests, testDisplayContent.mSetIgnoreOrientationRequest);
assertEquals(fixedOrientationLetterboxRatio,
mWm.mLetterboxConfiguration.getFixedOrientationLetterboxAspectRatio(),
0 /* delta */);
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
index a297608..4425962 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
@@ -26,6 +26,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -38,6 +39,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import android.content.Intent;
@@ -63,6 +65,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
/**
* Build/Install/Run:
@@ -223,6 +226,85 @@
}
@Test
+ public void testOnActivityReparentToTask_activityInOrganizerProcess_useActivityToken() {
+ // Make sure the activity pid/uid is the same as the organizer caller.
+ final int pid = Binder.getCallingPid();
+ final int uid = Binder.getCallingUid();
+ mController.registerOrganizer(mIOrganizer);
+ final ActivityRecord activity = createActivityRecord(mDisplayContent);
+ final Task task = activity.getTask();
+ activity.info.applicationInfo.uid = uid;
+ doReturn(pid).when(activity).getPid();
+ task.effectiveUid = uid;
+
+ // No need to notify organizer if it is not embedded.
+ mController.onActivityReparentToTask(activity);
+ mController.dispatchPendingEvents();
+
+ verify(mOrganizer, never()).onActivityReparentToTask(anyInt(), any(), any());
+
+ // Notify organizer if it was embedded before entered Pip.
+ activity.mLastTaskFragmentOrganizerBeforePip = mIOrganizer;
+ mController.onActivityReparentToTask(activity);
+ mController.dispatchPendingEvents();
+
+ verify(mOrganizer).onActivityReparentToTask(task.mTaskId, activity.intent, activity.token);
+
+ // Notify organizer if there is any embedded in the Task.
+ final TaskFragment taskFragment = new TaskFragmentBuilder(mAtm)
+ .setParentTask(task)
+ .setOrganizer(mOrganizer)
+ .build();
+ taskFragment.setTaskFragmentOrganizer(mOrganizer.getOrganizerToken(), uid,
+ DEFAULT_TASK_FRAGMENT_ORGANIZER_PROCESS_NAME);
+ activity.reparent(taskFragment, POSITION_TOP);
+ activity.mLastTaskFragmentOrganizerBeforePip = null;
+ mController.onActivityReparentToTask(activity);
+ mController.dispatchPendingEvents();
+
+ verify(mOrganizer, times(2))
+ .onActivityReparentToTask(task.mTaskId, activity.intent, activity.token);
+ }
+
+ @Test
+ public void testOnActivityReparentToTask_activityNotInOrganizerProcess_useTemporaryToken() {
+ final int pid = Binder.getCallingPid();
+ final int uid = Binder.getCallingUid();
+ mTaskFragment.setTaskFragmentOrganizer(mOrganizer.getOrganizerToken(), uid,
+ DEFAULT_TASK_FRAGMENT_ORGANIZER_PROCESS_NAME);
+ mAtm.mWindowOrganizerController.mLaunchTaskFragments.put(mFragmentToken, mTaskFragment);
+ mController.registerOrganizer(mIOrganizer);
+ mOrganizer.applyTransaction(mTransaction);
+ final Task task = createTask(mDisplayContent);
+ task.addChild(mTaskFragment, POSITION_TOP);
+ final ActivityRecord activity = createActivityRecord(task);
+
+ // Make sure the activity belongs to the same app, but it is in a different pid.
+ activity.info.applicationInfo.uid = uid;
+ doReturn(pid + 1).when(activity).getPid();
+ task.effectiveUid = uid;
+ final ArgumentCaptor<IBinder> token = ArgumentCaptor.forClass(IBinder.class);
+
+ // Notify organizer if it was embedded before entered Pip.
+ // Create a temporary token since the activity doesn't belong to the same process.
+ activity.mLastTaskFragmentOrganizerBeforePip = mIOrganizer;
+ mController.onActivityReparentToTask(activity);
+ mController.dispatchPendingEvents();
+
+ // Allow organizer to reparent activity in other process using the temporary token.
+ verify(mOrganizer).onActivityReparentToTask(eq(task.mTaskId), eq(activity.intent),
+ token.capture());
+ final IBinder temporaryToken = token.getValue();
+ assertNotEquals(activity.token, temporaryToken);
+ mTransaction.reparentActivityToTaskFragment(mFragmentToken, temporaryToken);
+ mAtm.mWindowOrganizerController.applyTransaction(mTransaction);
+
+ assertEquals(mTaskFragment, activity.getTaskFragment());
+ // The temporary token can only be used once.
+ assertNull(mController.getReparentActivityFromTemporaryToken(mIOrganizer, temporaryToken));
+ }
+
+ @Test
public void testRegisterRemoteAnimations() {
mController.registerOrganizer(mIOrganizer);
mController.registerRemoteAnimations(mIOrganizer, TASK_ID, mDefinition);
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 54fa4e4..3c14777 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
@@ -19,17 +19,22 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
+import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.any;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.never;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
import static com.android.server.wm.ActivityRecord.State.RESUMED;
+import static com.android.server.wm.WindowContainer.POSITION_TOP;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.clearInvocations;
import android.content.res.Configuration;
@@ -61,6 +66,7 @@
public class TaskFragmentTest extends WindowTestsBase {
private TaskFragmentOrganizer mOrganizer;
+ private ITaskFragmentOrganizer mIOrganizer;
private TaskFragment mTaskFragment;
private SurfaceControl mLeash;
@Mock
@@ -70,10 +76,10 @@
public void setup() {
MockitoAnnotations.initMocks(this);
mOrganizer = new TaskFragmentOrganizer(Runnable::run);
- final ITaskFragmentOrganizer iOrganizer =
- ITaskFragmentOrganizer.Stub.asInterface(mOrganizer.getOrganizerToken().asBinder());
+ mIOrganizer = ITaskFragmentOrganizer.Stub.asInterface(mOrganizer.getOrganizerToken()
+ .asBinder());
mAtm.mWindowOrganizerController.mTaskFragmentOrganizerController
- .registerOrganizer(iOrganizer);
+ .registerOrganizer(mIOrganizer);
mTaskFragment = new TaskFragmentBuilder(mAtm)
.setCreateParentTask()
.setOrganizer(mOrganizer)
@@ -239,6 +245,8 @@
assertEquals(taskBounds, taskFragment.getBounds());
assertEquals(taskBounds, activity.getBounds());
assertEquals(Configuration.EMPTY, taskFragment.getRequestedOverrideConfiguration());
+ // Because the whole Task is entering PiP, no need to record for future reparent.
+ assertNull(activity.mLastTaskFragmentOrganizerBeforePip);
}
@Test
@@ -257,6 +265,9 @@
.createActivityCount(1)
.build();
final ActivityRecord activity0 = taskFragment0.getTopMostActivity();
+ final ActivityRecord activity1 = taskFragment1.getTopMostActivity();
+ activity0.setVisibility(true /* visible */, false /* deferHidingClient */);
+ activity1.setVisibility(true /* visible */, false /* deferHidingClient */);
spyOn(mAtm.mTaskFragmentOrganizerController);
// Move activity to pinned.
@@ -269,8 +280,76 @@
final TaskFragmentInfo info = taskFragment0.getTaskFragmentInfo();
assertTrue(info.isTaskFragmentClearedForPip());
assertTrue(info.isEmpty());
+
+ // Notify organizer because the Task is still visible.
+ assertTrue(task.isVisibleRequested());
verify(mAtm.mTaskFragmentOrganizerController)
.dispatchPendingInfoChangedEvent(taskFragment0);
+ // Make sure the organizer is recorded so that it can be reused when the activity is
+ // reparented back on exiting PiP.
+ assertEquals(mIOrganizer, activity0.mLastTaskFragmentOrganizerBeforePip);
+ }
+
+ @Test
+ public void testEmbeddedActivityExitPip_notifyOrganizer() {
+ final Task task = createTask(mDisplayContent);
+ final TaskFragment taskFragment = new TaskFragmentBuilder(mAtm)
+ .setParentTask(task)
+ .setOrganizer(mOrganizer)
+ .setFragmentToken(new Binder())
+ .createActivityCount(1)
+ .build();
+ new TaskFragmentBuilder(mAtm)
+ .setParentTask(task)
+ .setOrganizer(mOrganizer)
+ .setFragmentToken(new Binder())
+ .createActivityCount(1)
+ .build();
+ final ActivityRecord activity = taskFragment.getTopMostActivity();
+ mRootWindowContainer.moveActivityToPinnedRootTask(activity,
+ null /* launchIntoPipHostActivity */, "test");
+ spyOn(mAtm.mTaskFragmentOrganizerController);
+ assertEquals(mIOrganizer, activity.mLastTaskFragmentOrganizerBeforePip);
+
+ // Move the activity back to its original Task.
+ activity.reparent(task, POSITION_TOP);
+
+ // Notify the organizer about the reparent.
+ verify(mAtm.mTaskFragmentOrganizerController).onActivityReparentToTask(activity);
+ assertNull(activity.mLastTaskFragmentOrganizerBeforePip);
+ }
+
+ @Test
+ public void testIsReadyToTransit() {
+ final TaskFragment taskFragment = new TaskFragmentBuilder(mAtm)
+ .setCreateParentTask()
+ .setOrganizer(mOrganizer)
+ .setFragmentToken(new Binder())
+ .build();
+ final Task task = taskFragment.getTask();
+
+ // Not ready when it is empty.
+ assertFalse(taskFragment.isReadyToTransit());
+
+ // Ready when it is not empty.
+ final ActivityRecord activity = createActivityRecord(mDisplayContent);
+ doNothing().when(activity).setDropInputMode(anyInt());
+ activity.reparent(taskFragment, WindowContainer.POSITION_TOP);
+ assertTrue(taskFragment.isReadyToTransit());
+
+ // Ready when the Task is in PiP.
+ taskFragment.removeChild(activity);
+ task.setWindowingMode(WINDOWING_MODE_PINNED);
+ assertTrue(taskFragment.isReadyToTransit());
+
+ // Ready when the TaskFragment is empty because of PiP, and the Task is invisible.
+ task.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+ taskFragment.mClearedTaskFragmentForPip = true;
+ assertTrue(taskFragment.isReadyToTransit());
+
+ // Not ready if the task is still visible when the TaskFragment becomes empty.
+ doReturn(true).when(task).isVisibleRequested();
+ assertFalse(taskFragment.isReadyToTransit());
}
@Test
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
index 832bd2d..40ca250 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
@@ -370,13 +370,16 @@
// Ensure events dispatch to organizer.
mWm.mAtmService.mTaskOrganizerController.dispatchPendingEvents();
assertContainsTasks(existingTasks2, rootTask);
- verify(organizer2, times(1)).onTaskAppeared(any(RunningTaskInfo.class),
+ verify(organizer2, never()).onTaskAppeared(any(RunningTaskInfo.class),
any(SurfaceControl.class));
verify(organizer2, times(0)).onTaskVanished(any());
- // Removed tasks from the original organizer
- assertTaskVanished(organizer, true /* expectVanished */, rootTask, rootTask2);
- assertTrue(rootTask2.isOrganized());
+ // The non-CreatedByOrganizer task is removed from the original organizer.
+ assertTaskVanished(organizer, true /* expectVanished */, rootTask);
+ assertEquals(organizer2, rootTask.mTaskOrganizer);
+ // The CreatedByOrganizer task should be still organized by the original organizer.
+ assertEquals(organizer, rootTask2.mTaskOrganizer);
+ clearInvocations(organizer);
// Now we unregister the second one, the first one should automatically be reregistered
// so we verify that it's now seeing changes.
mWm.mAtmService.mTaskOrganizerController.unregisterTaskOrganizer(organizer2);
@@ -385,9 +388,13 @@
verify(organizer, times(2))
.onTaskAppeared(any(RunningTaskInfo.class), any(SurfaceControl.class));
- assertFalse(rootTask2.isOrganized());
- assertTaskVanished(organizer2, true /* expectVanished */, rootTask,
- rootTask2);
+
+ // Unregister the first one. The CreatedByOrganizer task created by it must be removed.
+ mWm.mAtmService.mTaskOrganizerController.unregisterTaskOrganizer(organizer);
+ assertFalse(rootTask2.isAttached());
+ assertFalse(task2.isAttached());
+ // Normal task should keep.
+ assertTrue(task.isAttached());
}
@Test
diff --git a/services/translation/java/com/android/server/translation/TranslationManagerServiceImpl.java b/services/translation/java/com/android/server/translation/TranslationManagerServiceImpl.java
index 97d5215..eafcef2 100644
--- a/services/translation/java/com/android/server/translation/TranslationManagerServiceImpl.java
+++ b/services/translation/java/com/android/server/translation/TranslationManagerServiceImpl.java
@@ -41,10 +41,10 @@
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.service.translation.TranslationServiceInfo;
+import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;
-import android.util.SparseArray;
import android.view.autofill.AutofillId;
import android.view.inputmethod.InputMethodInfo;
import android.view.translation.ITranslationServiceCallback;
@@ -71,7 +71,8 @@
import java.util.List;
final class TranslationManagerServiceImpl extends
- AbstractPerUserSystemService<TranslationManagerServiceImpl, TranslationManagerService> {
+ AbstractPerUserSystemService<TranslationManagerServiceImpl, TranslationManagerService>
+ implements IBinder.DeathRecipient {
private static final String TAG = "TranslationManagerServiceImpl";
@SuppressLint("IsLoggableTagLength")
@@ -100,10 +101,10 @@
private final ArraySet<IBinder> mWaitingFinishedCallbackActivities = new ArraySet<>();
/**
- * Key is translated activity uid, value is the specification and state for the translation.
+ * Key is translated activity token, value is the specification and state for the translation.
*/
@GuardedBy("mLock")
- private final SparseArray<ActiveTranslation> mActiveTranslations = new SparseArray<>();
+ private final ArrayMap<IBinder, ActiveTranslation> mActiveTranslations = new ArrayMap<>();
protected TranslationManagerServiceImpl(
@NonNull TranslationManagerService master,
@@ -190,25 +191,24 @@
}
}
- private int getActivityUidByComponentName(Context context, ComponentName componentName,
- int userId) {
- int translationActivityUid = -1;
+ private int getAppUidByComponentName(Context context, ComponentName componentName, int userId) {
+ int translatedAppUid = -1;
try {
if (componentName != null) {
- translationActivityUid = context.getPackageManager().getApplicationInfoAsUser(
+ translatedAppUid = context.getPackageManager().getApplicationInfoAsUser(
componentName.getPackageName(), 0, userId).uid;
}
} catch (PackageManager.NameNotFoundException e) {
Slog.d(TAG, "Cannot find packageManager for" + componentName);
}
- return translationActivityUid;
+ return translatedAppUid;
}
@GuardedBy("mLock")
public void onTranslationFinishedLocked(boolean activityDestroyed, IBinder token,
ComponentName componentName) {
- final int translationActivityUid =
- getActivityUidByComponentName(getContext(), componentName, getUserId());
+ final int translatedAppUid =
+ getAppUidByComponentName(getContext(), componentName, getUserId());
final String packageName = componentName.getPackageName();
if (activityDestroyed) {
// In the Activity destroy case, we only calls onTranslationFinished() in
@@ -216,13 +216,13 @@
// should remove the waiting callback to avoid callback twice.
invokeCallbacks(STATE_UI_TRANSLATION_FINISHED,
/* sourceSpec= */ null, /* targetSpec= */ null,
- packageName, translationActivityUid);
+ packageName, translatedAppUid);
mWaitingFinishedCallbackActivities.remove(token);
} else {
if (mWaitingFinishedCallbackActivities.contains(token)) {
invokeCallbacks(STATE_UI_TRANSLATION_FINISHED,
/* sourceSpec= */ null, /* targetSpec= */ null,
- packageName, translationActivityUid);
+ packageName, translatedAppUid);
mWaitingFinishedCallbackActivities.remove(token);
}
}
@@ -259,49 +259,162 @@
}
ComponentName componentName = mActivityTaskManagerInternal.getActivityName(activityToken);
- int translationActivityUid =
- getActivityUidByComponentName(getContext(), componentName, getUserId());
+ int translatedAppUid =
+ getAppUidByComponentName(getContext(), componentName, getUserId());
String packageName = componentName.getPackageName();
- if (state != STATE_UI_TRANSLATION_FINISHED) {
- invokeCallbacks(state, sourceSpec, targetSpec, packageName, translationActivityUid);
- updateActiveTranslations(state, sourceSpec, targetSpec, packageName,
- translationActivityUid);
- } else {
- if (mActiveTranslations.contains(translationActivityUid)) {
- mActiveTranslations.delete(translationActivityUid);
- } else {
- Slog.w(TAG, "Finishing translation for activity with uid=" + translationActivityUid
- + " but no active translation was found for it");
+
+ invokeCallbacksIfNecessaryLocked(state, sourceSpec, targetSpec, packageName, activityToken,
+ translatedAppUid);
+ updateActiveTranslationsLocked(state, sourceSpec, targetSpec, packageName, activityToken,
+ translatedAppUid);
+ }
+
+ @GuardedBy("mLock")
+ private void updateActiveTranslationsLocked(int state, TranslationSpec sourceSpec,
+ TranslationSpec targetSpec, String packageName, IBinder activityToken,
+ int translatedAppUid) {
+ // We keep track of active translations and their state so that we can:
+ // 1. Trigger callbacks that are registered after translation has started.
+ // See registerUiTranslationStateCallbackLocked().
+ // 2. NOT trigger callbacks when the state didn't change.
+ // See invokeCallbacksIfNecessaryLocked().
+ ActiveTranslation activeTranslation = mActiveTranslations.get(activityToken);
+ switch (state) {
+ case STATE_UI_TRANSLATION_STARTED: {
+ if (activeTranslation == null) {
+ try {
+ activityToken.linkToDeath(this, /* flags= */ 0);
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Failed to call linkToDeath for translated app with uid="
+ + translatedAppUid + "; activity is already dead", e);
+
+ // Apps with registered callbacks were just notified that translation
+ // started. We should let them know translation is finished too.
+ invokeCallbacks(STATE_UI_TRANSLATION_FINISHED, sourceSpec, targetSpec,
+ packageName, translatedAppUid);
+ return;
+ }
+ mActiveTranslations.put(activityToken,
+ new ActiveTranslation(sourceSpec, targetSpec, translatedAppUid,
+ packageName));
+ }
+ break;
}
+
+ case STATE_UI_TRANSLATION_PAUSED: {
+ if (activeTranslation != null) {
+ activeTranslation.isPaused = true;
+ }
+ break;
+ }
+
+ case STATE_UI_TRANSLATION_RESUMED: {
+ if (activeTranslation != null) {
+ activeTranslation.isPaused = false;
+ }
+ break;
+ }
+
+ case STATE_UI_TRANSLATION_FINISHED: {
+ if (activeTranslation != null) {
+ mActiveTranslations.remove(activityToken);
+ }
+ break;
+ }
+ }
+
+ if (DEBUG) {
+ Slog.d(TAG,
+ "Updating to translation state=" + state + " for app with uid="
+ + translatedAppUid + " packageName=" + packageName);
}
}
@GuardedBy("mLock")
- private void updateActiveTranslations(int state, TranslationSpec sourceSpec,
- TranslationSpec targetSpec, String packageName, int translationActivityUid) {
- // Keep track of active translations so that we can trigger callbacks that are
- // registered after translation has started.
- switch (state) {
- case STATE_UI_TRANSLATION_STARTED: {
- ActiveTranslation activeTranslation = new ActiveTranslation(sourceSpec,
- targetSpec, packageName);
- mActiveTranslations.put(translationActivityUid, activeTranslation);
- break;
+ private void invokeCallbacksIfNecessaryLocked(int state, TranslationSpec sourceSpec,
+ TranslationSpec targetSpec, String packageName, IBinder activityToken,
+ int translatedAppUid) {
+ boolean shouldInvokeCallbacks = true;
+ int stateForCallbackInvocation = state;
+
+ ActiveTranslation activeTranslation = mActiveTranslations.get(activityToken);
+ if (activeTranslation == null) {
+ if (state != STATE_UI_TRANSLATION_STARTED) {
+ shouldInvokeCallbacks = false;
+ Slog.w(TAG,
+ "Updating to translation state=" + state + " for app with uid="
+ + translatedAppUid + " packageName=" + packageName
+ + " but no active translation was found for it");
}
- case STATE_UI_TRANSLATION_PAUSED:
- case STATE_UI_TRANSLATION_RESUMED: {
- ActiveTranslation activeTranslation = mActiveTranslations.get(
- translationActivityUid);
- if (activeTranslation != null) {
- activeTranslation.isPaused = (state == STATE_UI_TRANSLATION_PAUSED);
- } else {
- Slog.w(TAG, "Pausing or resuming translation for activity with uid="
- + translationActivityUid
- + " but no active translation was found for it");
+ } else {
+ switch (state) {
+ case STATE_UI_TRANSLATION_STARTED: {
+ boolean specsAreIdentical = activeTranslation.sourceSpec.getLocale().equals(
+ sourceSpec.getLocale())
+ && activeTranslation.targetSpec.getLocale().equals(
+ targetSpec.getLocale());
+ if (specsAreIdentical) {
+ if (activeTranslation.isPaused) {
+ // Ideally UiTranslationManager.resumeTranslation() should be first
+ // used to resume translation, but for the purposes of invoking the
+ // callback, we want to call onResumed() instead of onStarted(). This
+ // way there can only be one call to onStarted() for the lifetime of
+ // a translated activity and this will simplify the number of states
+ // apps have to handle.
+ stateForCallbackInvocation = STATE_UI_TRANSLATION_RESUMED;
+ } else {
+ // Don't invoke callbacks if the state or specs didn't change. For a
+ // given activity, startTranslation() will be called every time there
+ // are new views to be translated, but we don't need to repeatedly
+ // notify apps about it.
+ shouldInvokeCallbacks = false;
+ }
+ }
+ break;
}
- break;
+
+ case STATE_UI_TRANSLATION_PAUSED: {
+ if (activeTranslation.isPaused) {
+ // Don't invoke callbacks if the state didn't change.
+ shouldInvokeCallbacks = false;
+ }
+ break;
+ }
+
+ case STATE_UI_TRANSLATION_RESUMED: {
+ if (!activeTranslation.isPaused) {
+ // Don't invoke callbacks if the state didn't change. Either
+ // resumeTranslation() was called consecutive times, or right after
+ // startTranslation(). The latter case shouldn't happen normally, so we
+ // don't want apps to have to handle that particular transition.
+ shouldInvokeCallbacks = false;
+ }
+ break;
+ }
+
+ case STATE_UI_TRANSLATION_FINISHED: {
+ // Note: Here finishTranslation() was called but we don't want to invoke
+ // onFinished() on the callbacks. They will be invoked when
+ // UiTranslationManager.onTranslationFinished() is called (see
+ // onTranslationFinishedLocked()).
+ shouldInvokeCallbacks = false;
+ break;
+ }
}
}
+
+ if (DEBUG) {
+ Slog.d(TAG,
+ (shouldInvokeCallbacks ? "" : "NOT ")
+ + "Invoking callbacks for translation state="
+ + stateForCallbackInvocation + " for app with uid=" + translatedAppUid
+ + " packageName=" + packageName);
+ }
+
+ if (shouldInvokeCallbacks) {
+ invokeCallbacks(stateForCallbackInvocation, sourceSpec, targetSpec, packageName,
+ translatedAppUid);
+ }
}
@GuardedBy("mLock")
@@ -343,15 +456,14 @@
private void invokeCallbacks(
int state, TranslationSpec sourceSpec, TranslationSpec targetSpec, String packageName,
- int translationActivityUid) {
+ int translatedAppUid) {
Bundle result = createResultForCallback(state, sourceSpec, targetSpec, packageName);
if (mCallbacks.getRegisteredCallbackCount() == 0) {
return;
}
List<InputMethodInfo> enabledInputMethods = getEnabledInputMethods();
mCallbacks.broadcast((callback, uid) -> {
- invokeCallback((int) uid, translationActivityUid, callback, result,
- enabledInputMethods);
+ invokeCallback((int) uid, translatedAppUid, callback, result, enabledInputMethods);
});
}
@@ -374,9 +486,9 @@
}
private void invokeCallback(
- int callbackSourceUid, int translationActivityUid, IRemoteCallback callback,
+ int callbackSourceUid, int translatedAppUid, IRemoteCallback callback,
Bundle result, List<InputMethodInfo> enabledInputMethods) {
- if (callbackSourceUid == translationActivityUid) {
+ if (callbackSourceUid == translatedAppUid) {
// Invoke callback for the application being translated.
try {
callback.sendResult(result);
@@ -417,29 +529,26 @@
// Trigger the callback for already active translations.
List<InputMethodInfo> enabledInputMethods = getEnabledInputMethods();
for (int i = 0; i < mActiveTranslations.size(); i++) {
- int activeTranslationUid = mActiveTranslations.keyAt(i);
ActiveTranslation activeTranslation = mActiveTranslations.valueAt(i);
- if (activeTranslation == null) {
- continue;
- }
+ int translatedAppUid = activeTranslation.translatedAppUid;
String packageName = activeTranslation.packageName;
if (DEBUG) {
Slog.d(TAG, "Triggering callback for sourceUid=" + sourceUid
- + " for translated activity with uid=" + activeTranslationUid
+ + " for translated app with uid=" + translatedAppUid
+ "packageName=" + packageName + " isPaused=" + activeTranslation.isPaused);
}
Bundle startedResult = createResultForCallback(STATE_UI_TRANSLATION_STARTED,
activeTranslation.sourceSpec, activeTranslation.targetSpec,
packageName);
- invokeCallback(sourceUid, activeTranslationUid, callback, startedResult,
+ invokeCallback(sourceUid, translatedAppUid, callback, startedResult,
enabledInputMethods);
if (activeTranslation.isPaused) {
// Also send event so callback owners know that translation was started then paused.
Bundle pausedResult = createResultForCallback(STATE_UI_TRANSLATION_PAUSED,
activeTranslation.sourceSpec, activeTranslation.targetSpec,
packageName);
- invokeCallback(sourceUid, activeTranslationUid, callback, pausedResult,
+ invokeCallback(sourceUid, translatedAppUid, callback, pausedResult,
enabledInputMethods);
}
}
@@ -492,13 +601,34 @@
public final TranslationSpec sourceSpec;
public final TranslationSpec targetSpec;
public final String packageName;
+ public final int translatedAppUid;
public boolean isPaused = false;
private ActiveTranslation(TranslationSpec sourceSpec, TranslationSpec targetSpec,
- String packageName) {
+ int translatedAppUid, String packageName) {
this.sourceSpec = sourceSpec;
this.targetSpec = targetSpec;
+ this.translatedAppUid = translatedAppUid;
this.packageName = packageName;
}
}
+
+ @Override
+ public void binderDied() {
+ // Don't need to implement this with binderDied(IBinder) implemented.
+ }
+
+ @Override
+ public void binderDied(IBinder who) {
+ synchronized (mLock) {
+ mWaitingFinishedCallbackActivities.remove(who);
+ ActiveTranslation activeTranslation = mActiveTranslations.remove(who);
+ if (activeTranslation != null) {
+ // Let apps with registered callbacks know about the activity's death.
+ invokeCallbacks(STATE_UI_TRANSLATION_FINISHED, activeTranslation.sourceSpec,
+ activeTranslation.targetSpec, activeTranslation.packageName,
+ activeTranslation.translatedAppUid);
+ }
+ }
+ }
}
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 1b07e9a..6ea416b 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -556,6 +556,7 @@
protected boolean mCurrentUsbFunctionsReceived;
protected int mUsbSpeed;
protected int mCurrentGadgetHalVersion;
+ protected boolean mPendingBootAccessoryHandshakeBroadcast;
/**
* The persistent property which stores whether adb is enabled or not.
@@ -1113,7 +1114,13 @@
if (DEBUG) {
Slog.v(TAG, "Accessory handshake timeout");
}
- broadcastUsbAccessoryHandshake();
+ if (mBootCompleted) {
+ broadcastUsbAccessoryHandshake();
+ } else {
+ if (DEBUG) Slog.v(TAG, "Pending broadcasting intent as "
+ + "not boot completed yet.");
+ mPendingBootAccessoryHandshakeBroadcast = true;
+ }
break;
}
case MSG_INCREASE_SENDSTRING_COUNT: {
@@ -1137,8 +1144,11 @@
if (mCurrentAccessory != null) {
mUsbDeviceManager.getCurrentSettings().accessoryAttached(mCurrentAccessory);
broadcastUsbAccessoryHandshake();
+ } else if (mPendingBootAccessoryHandshakeBroadcast) {
+ broadcastUsbAccessoryHandshake();
}
+ mPendingBootAccessoryHandshakeBroadcast = false;
updateUsbNotification(false);
updateAdbNotification(false);
updateUsbFunctions();
diff --git a/services/usb/java/com/android/server/usb/UsbDirectMidiDevice.java b/services/usb/java/com/android/server/usb/UsbDirectMidiDevice.java
index 04c52f7..177e819 100644
--- a/services/usb/java/com/android/server/usb/UsbDirectMidiDevice.java
+++ b/services/usb/java/com/android/server/usb/UsbDirectMidiDevice.java
@@ -16,6 +16,7 @@
package com.android.server.usb;
+import android.annotation.NonNull;
import android.content.Context;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
@@ -28,10 +29,12 @@
import android.media.midi.MidiManager;
import android.media.midi.MidiReceiver;
import android.os.Bundle;
+import android.service.usb.UsbDirectMidiDeviceProto;
import android.util.Log;
import com.android.internal.midi.MidiEventScheduler;
import com.android.internal.midi.MidiEventScheduler.MidiEvent;
+import com.android.internal.util.dump.DualDumpOutputStream;
import com.android.server.usb.descriptors.UsbDescriptorParser;
import com.android.server.usb.descriptors.UsbEndpointDescriptor;
import com.android.server.usb.descriptors.UsbInterfaceDescriptor;
@@ -52,6 +55,7 @@
private static final boolean DEBUG = false;
private Context mContext;
+ private String mName;
private UsbDevice mUsbDevice;
private UsbDescriptorParser mParser;
private ArrayList<UsbInterfaceDescriptor> mUsbInterfaces;
@@ -477,7 +481,7 @@
} else {
name += " MIDI 1.0";
}
- Log.e(TAG, name);
+ mName = name;
properties.putString(MidiDeviceInfo.PROPERTY_NAME, name);
properties.putString(MidiDeviceInfo.PROPERTY_MANUFACTURER, manufacturer);
properties.putString(MidiDeviceInfo.PROPERTY_PRODUCT, product);
@@ -573,4 +577,21 @@
}
return true;
}
+
+ /**
+ * Write a description of the device to a dump stream.
+ */
+ public void dump(@NonNull DualDumpOutputStream dump, @NonNull String idName, long id) {
+ long token = dump.start(idName, id);
+
+ dump.write("num_inputs", UsbDirectMidiDeviceProto.NUM_INPUTS, mNumInputs);
+ dump.write("num_outputs", UsbDirectMidiDeviceProto.NUM_OUTPUTS, mNumOutputs);
+ dump.write("is_universal", UsbDirectMidiDeviceProto.IS_UNIVERSAL, mIsUniversalMidiDevice);
+ dump.write("name", UsbDirectMidiDeviceProto.NAME, mName);
+ if (mIsUniversalMidiDevice) {
+ mMidiBlockParser.dump(dump, "block_parser", UsbDirectMidiDeviceProto.BLOCK_PARSER);
+ }
+
+ dump.end(token);
+ }
}
diff --git a/services/usb/java/com/android/server/usb/UsbHostManager.java b/services/usb/java/com/android/server/usb/UsbHostManager.java
index dd58d38..b1c85fe 100644
--- a/services/usb/java/com/android/server/usb/UsbHostManager.java
+++ b/services/usb/java/com/android/server/usb/UsbHostManager.java
@@ -588,6 +588,12 @@
for (ConnectionRecord rec : mConnections) {
rec.dump(dump, "connections", UsbHostManagerProto.CONNECTIONS);
}
+
+ for (ArrayList<UsbDirectMidiDevice> directMidiDevices : mMidiDevices.values()) {
+ for (UsbDirectMidiDevice directMidiDevice : directMidiDevices) {
+ directMidiDevice.dump(dump, "midi_devices", UsbHostManagerProto.MIDI_DEVICES);
+ }
+ }
}
dump.end(token);
diff --git a/services/usb/java/com/android/server/usb/descriptors/UsbMidiBlockParser.java b/services/usb/java/com/android/server/usb/descriptors/UsbMidiBlockParser.java
index 37bd0f8..eb08304 100644
--- a/services/usb/java/com/android/server/usb/descriptors/UsbMidiBlockParser.java
+++ b/services/usb/java/com/android/server/usb/descriptors/UsbMidiBlockParser.java
@@ -15,10 +15,15 @@
*/
package com.android.server.usb.descriptors;
+import android.annotation.NonNull;
import android.hardware.usb.UsbConstants;
import android.hardware.usb.UsbDeviceConnection;
+import android.service.usb.UsbGroupTerminalBlockProto;
+import android.service.usb.UsbMidiBlockParserProto;
import android.util.Log;
+import com.android.internal.util.dump.DualDumpOutputStream;
+
import java.util.ArrayList;
/**
@@ -70,6 +75,34 @@
mMaxOutputBandwidth = stream.unpackUsbShort();
return mLength;
}
+
+ /**
+ * Write the state of the block to a dump stream.
+ */
+ public void dump(@NonNull DualDumpOutputStream dump, @NonNull String idName, long id) {
+ long token = dump.start(idName, id);
+
+ dump.write("length", UsbGroupTerminalBlockProto.LENGTH, mLength);
+ dump.write("descriptor_type", UsbGroupTerminalBlockProto.DESCRIPTOR_TYPE,
+ mDescriptorType);
+ dump.write("descriptor_subtype", UsbGroupTerminalBlockProto.DESCRIPTOR_SUBTYPE,
+ mDescriptorSubtype);
+ dump.write("group_block_id", UsbGroupTerminalBlockProto.GROUP_BLOCK_ID, mGroupBlockId);
+ dump.write("group_terminal_block_type",
+ UsbGroupTerminalBlockProto.GROUP_TERMINAL_BLOCK_TYPE, mGroupTerminalBlockType);
+ dump.write("group_terminal", UsbGroupTerminalBlockProto.GROUP_TERMINAL,
+ mGroupTerminal);
+ dump.write("num_group_terminals", UsbGroupTerminalBlockProto.NUM_GROUP_TERMINALS,
+ mNumGroupTerminals);
+ dump.write("block_item", UsbGroupTerminalBlockProto.BLOCK_ITEM, mBlockItem);
+ dump.write("midi_protocol", UsbGroupTerminalBlockProto.MIDI_PROTOCOL, mMidiProtocol);
+ dump.write("max_input_bandwidth", UsbGroupTerminalBlockProto.MAX_INPUT_BANDWIDTH,
+ mMaxInputBandwidth);
+ dump.write("max_output_bandwidth", UsbGroupTerminalBlockProto.MAX_OUTPUT_BANDWIDTH,
+ mMaxOutputBandwidth);
+
+ dump.end(token);
+ }
}
private ArrayList<GroupTerminalBlock> mGroupTerminalBlocks =
@@ -170,4 +203,24 @@
}
return DEFAULT_MIDI_TYPE;
}
+
+ /**
+ * Write the state of the parser to a dump stream.
+ */
+ public void dump(@NonNull DualDumpOutputStream dump, @NonNull String idName, long id) {
+ long token = dump.start(idName, id);
+
+ dump.write("length", UsbMidiBlockParserProto.LENGTH, mHeaderLength);
+ dump.write("descriptor_type", UsbMidiBlockParserProto.DESCRIPTOR_TYPE,
+ mHeaderDescriptorType);
+ dump.write("descriptor_subtype", UsbMidiBlockParserProto.DESCRIPTOR_SUBTYPE,
+ mHeaderDescriptorSubtype);
+ dump.write("total_length", UsbMidiBlockParserProto.TOTAL_LENGTH, mTotalLength);
+ for (GroupTerminalBlock groupTerminalBlock : mGroupTerminalBlocks) {
+ groupTerminalBlock.dump(dump, "block", UsbMidiBlockParserProto.BLOCK);
+ }
+
+ dump.end(token);
+ }
+
}
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 9c886aa..e21301e 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -176,7 +176,7 @@
* This flag specifies whether VoLTE availability is based on provisioning. By default this is
* false.
* Used for UCE to determine if EAB provisioning checks should be based on provisioning.
- * @deprecated Use {@link Ims#KEY_MMTEL_REQUIRES_PROVISIONING_BUNDLE} instead.
+ * @deprecated Use {@link Ims#KEY_CARRIER_RCS_PROVISIONING_REQUIRED_BOOL} instead.
*/
@Deprecated
public static final String
@@ -908,6 +908,9 @@
* Combines VoLTE, VT, VoWiFI calling provisioning into one parameter.
* @deprecated Use {@link Ims#KEY_MMTEL_REQUIRES_PROVISIONING_BUNDLE} instead for
* finer-grained control.
+ * changing carrier_volte_provisioning_required_bool requires changes to
+ * mmtel_requires_provisioning_bundle and vice versa
+ * {@link Ims#KEY_MMTEL_REQUIRES_PROVISIONING_BUNDLE}
*/
@Deprecated
public static final String KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL
@@ -2901,11 +2904,11 @@
* <p>
* 4 threshold integers must be within the boundaries [-140 dB, -44 dB], and the levels are:
* <UL>
- * <LI>"NONE: [-140, threshold1]"</LI>
- * <LI>"POOR: (threshold1, threshold2]"</LI>
- * <LI>"MODERATE: (threshold2, threshold3]"</LI>
- * <LI>"GOOD: (threshold3, threshold4]"</LI>
- * <LI>"EXCELLENT: (threshold4, -44]"</LI>
+ * <LI>"NONE: [-140, threshold1)"</LI>
+ * <LI>"POOR: [threshold1, threshold2)"</LI>
+ * <LI>"MODERATE: [threshold2, threshold3)"</LI>
+ * <LI>"GOOD: [threshold3, threshold4)"</LI>
+ * <LI>"EXCELLENT: [threshold4, -44]"</LI>
* </UL>
* <p>
* This key is considered invalid if the format is violated. If the key is invalid or
@@ -2921,11 +2924,11 @@
* <p>
* 4 threshold integers must be within the boundaries [-43 dB, 20 dB], and the levels are:
* <UL>
- * <LI>"NONE: [-43, threshold1]"</LI>
- * <LI>"POOR: (threshold1, threshold2]"</LI>
- * <LI>"MODERATE: (threshold2, threshold3]"</LI>
- * <LI>"GOOD: (threshold3, threshold4]"</LI>
- * <LI>"EXCELLENT: (threshold4, 20]"</LI>
+ * <LI>"NONE: [-43, threshold1)"</LI>
+ * <LI>"POOR: [threshold1, threshold2)"</LI>
+ * <LI>"MODERATE: [threshold2, threshold3)"</LI>
+ * <LI>"GOOD: [threshold3, threshold4)"</LI>
+ * <LI>"EXCELLENT: [threshold4, 20]"</LI>
* </UL>
* <p>
* This key is considered invalid if the format is violated. If the key is invalid or
@@ -2942,11 +2945,11 @@
* <p>
* 4 threshold integers must be within the boundaries [-23 dB, 40 dB], and the levels are:
* <UL>
- * <LI>"NONE: [-23, threshold1]"</LI>
- * <LI>"POOR: (threshold1, threshold2]"</LI>
- * <LI>"MODERATE: (threshold2, threshold3]"</LI>
- * <LI>"GOOD: (threshold3, threshold4]"</LI>
- * <LI>"EXCELLENT: (threshold4, 40]"</LI>
+ * <LI>"NONE: [-23, threshold1)"</LI>
+ * <LI>"POOR: [threshold1, threshold2)"</LI>
+ * <LI>"MODERATE: [threshold2, threshold3)"</LI>
+ * <LI>"GOOD: [threshold3, threshold4)"</LI>
+ * <LI>"EXCELLENT: [threshold4, 40]"</LI>
* </UL>
* <p>
* This key is considered invalid if the format is violated. If the key is invalid or
@@ -5437,6 +5440,10 @@
* </ul>
* <p> The values are defined in
* {@link android.telephony.ims.stub.ImsRegistrationImplBase.ImsRegistrationTech}
+ *
+ * changing mmtel_requires_provisioning_bundle requires changes to
+ * carrier_volte_provisioning_required_bool and vice versa
+ * {@link Ims#KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL}
*/
public static final String KEY_MMTEL_REQUIRES_PROVISIONING_BUNDLE =
KEY_PREFIX + "mmtel_requires_provisioning_bundle";
diff --git a/telephony/java/android/telephony/CellSignalStrengthNr.java b/telephony/java/android/telephony/CellSignalStrengthNr.java
index f5ba3ab..38becc6 100644
--- a/telephony/java/android/telephony/CellSignalStrengthNr.java
+++ b/telephony/java/android/telephony/CellSignalStrengthNr.java
@@ -438,13 +438,13 @@
int level;
if (measure == CellInfo.UNAVAILABLE) {
level = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
- } else if (measure > thresholds[3]) {
+ } else if (measure >= thresholds[3]) {
level = SIGNAL_STRENGTH_GREAT;
- } else if (measure > thresholds[2]) {
+ } else if (measure >= thresholds[2]) {
level = SIGNAL_STRENGTH_GOOD;
- } else if (measure > thresholds[1]) {
+ } else if (measure >= thresholds[1]) {
level = SIGNAL_STRENGTH_MODERATE;
- } else if (measure > thresholds[0]) {
+ } else if (measure >= thresholds[0]) {
level = SIGNAL_STRENGTH_POOR;
} else {
level = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
diff --git a/telephony/java/android/telephony/ims/ImsRcsManager.java b/telephony/java/android/telephony/ims/ImsRcsManager.java
index 3415868..e00ea0e 100644
--- a/telephony/java/android/telephony/ims/ImsRcsManager.java
+++ b/telephony/java/android/telephony/ims/ImsRcsManager.java
@@ -18,6 +18,7 @@
import android.Manifest;
import android.annotation.CallbackExecutor;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.RequiresFeature;
import android.annotation.RequiresPermission;
@@ -43,6 +44,8 @@
import com.android.internal.telephony.IIntegerConsumer;
import com.android.internal.telephony.ITelephony;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -87,6 +90,46 @@
"android.telephony.ims.action.SHOW_CAPABILITY_DISCOVERY_OPT_IN";
/**
+ * This carrier supports User Capability Exchange as, defined by the framework using a
+ * presence server. If set, the RcsFeature should support capability exchange. If not set, this
+ * RcsFeature should not publish capabilities or service capability requests.
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = "CAPABILITY_TYPE_", flag = true, value = {
+ CAPABILITY_TYPE_NONE,
+ CAPABILITY_TYPE_OPTIONS_UCE,
+ CAPABILITY_TYPE_PRESENCE_UCE
+ })
+ public @interface RcsImsCapabilityFlag {}
+
+ /**
+ * Undefined capability type for initialization
+ */
+ public static final int CAPABILITY_TYPE_NONE = 0;
+
+ /**
+ * This carrier supports User Capability Exchange using SIP OPTIONS as defined by the
+ * framework. If set, the RcsFeature should support capability exchange using SIP OPTIONS.
+ * If not set, this RcsFeature should not service capability requests.
+ */
+ public static final int CAPABILITY_TYPE_OPTIONS_UCE = 1 << 0;
+
+ /**
+ * This carrier supports User Capability Exchange using a presence server as defined by the
+ * framework. If set, the RcsFeature should support capability exchange using a presence
+ * server. If not set, this RcsFeature should not publish capabilities or service capability
+ * requests using presence.
+ */
+ public static final int CAPABILITY_TYPE_PRESENCE_UCE = 1 << 1;
+
+ /**
+ * This is used to check the upper range of RCS capability
+ * @hide
+ */
+ public static final int CAPABILITY_TYPE_MAX = CAPABILITY_TYPE_PRESENCE_UCE + 1;
+
+ /**
* An application can use {@link #addOnAvailabilityChangedListener} to register a
* {@link OnAvailabilityChangedListener}, which will notify the user when the RCS feature
* availability status updates from the ImsService.
@@ -104,7 +147,7 @@
*
* @param capabilities The new availability of the capabilities.
*/
- void onAvailabilityChanged(@RcsUceAdapter.RcsImsCapabilityFlag int capabilities);
+ void onAvailabilityChanged(@RcsImsCapabilityFlag int capabilities);
}
/**
@@ -486,7 +529,7 @@
*/
@SystemApi
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- public boolean isCapable(@RcsUceAdapter.RcsImsCapabilityFlag int capability,
+ public boolean isCapable(@RcsImsCapabilityFlag int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int radioTech) throws ImsException {
IImsRcsController imsRcsController = getIImsRcsController();
if (imsRcsController == null) {
@@ -522,7 +565,7 @@
*/
@SystemApi
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
- public boolean isAvailable(@RcsUceAdapter.RcsImsCapabilityFlag int capability,
+ public boolean isAvailable(@RcsImsCapabilityFlag int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int radioTech)
throws ImsException {
IImsRcsController imsRcsController = getIImsRcsController();
diff --git a/telephony/java/android/telephony/ims/ProvisioningManager.java b/telephony/java/android/telephony/ims/ProvisioningManager.java
index 677c1a9..2833489 100644
--- a/telephony/java/android/telephony/ims/ProvisioningManager.java
+++ b/telephony/java/android/telephony/ims/ProvisioningManager.java
@@ -38,7 +38,6 @@
import android.telephony.ims.aidl.IImsConfigCallback;
import android.telephony.ims.aidl.IRcsConfigCallback;
import android.telephony.ims.feature.MmTelFeature;
-import android.telephony.ims.feature.RcsFeature;
import android.telephony.ims.stub.ImsConfigImplBase;
import android.telephony.ims.stub.ImsRegistrationImplBase;
@@ -970,7 +969,7 @@
/**
* Callback for IMS provisioning feature changes.
*/
- public static class FeatureProvisioningCallback {
+ public abstract static class FeatureProvisioningCallback {
private static class CallbackBinder extends IFeatureProvisioningCallback.Stub {
@@ -1024,12 +1023,10 @@
* specified, or {@code false} if the capability is not provisioned for the technology
* specified.
*/
- public void onFeatureProvisioningChanged(
+ public abstract void onFeatureProvisioningChanged(
@MmTelFeature.MmTelCapabilities.MmTelCapability int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int tech,
- boolean isProvisioned) {
- // Base Implementation
- }
+ boolean isProvisioned);
/**
* The IMS RCS provisioning has changed for a specific capability and IMS
@@ -1041,12 +1038,10 @@
* specified, or {@code false} if the capability is not provisioned for the technology
* specified.
*/
- public void onRcsFeatureProvisioningChanged(
- @RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag int capability,
+ public abstract void onRcsFeatureProvisioningChanged(
+ @ImsRcsManager.RcsImsCapabilityFlag int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int tech,
- boolean isProvisioned) {
- // Base Implementation
- }
+ boolean isProvisioned);
/**@hide*/
public final IFeatureProvisioningCallback getBinder() {
@@ -1505,7 +1500,7 @@
* Get the provisioning status for the IMS RCS capability specified.
*
* If provisioning is not required for the queried
- * {@link RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag} this method will always return
+ * {@link ImsRcsManager.RcsImsCapabilityFlag} this method will always return
* {@code true}.
*
* @see CarrierConfigManager.Ims#KEY_CARRIER_RCS_PROVISIONING_REQUIRED_BOOL
@@ -1522,7 +1517,7 @@
@WorkerThread
@RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public boolean getRcsProvisioningStatusForCapability(
- @RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag int capability) {
+ @ImsRcsManager.RcsImsCapabilityFlag int capability) {
try {
return getITelephony().getRcsProvisioningStatusForCapability(mSubId, capability,
ImsRegistrationImplBase.REGISTRATION_TECH_LTE);
@@ -1535,7 +1530,7 @@
* Get the provisioning status for the IMS RCS capability specified.
*
* If provisioning is not required for the queried
- * {@link RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag} this method
+ * {@link ImsRcsManager.RcsImsCapabilityFlag} this method
* will always return {@code true}.
*
* <p> Requires Permission:
@@ -1553,7 +1548,7 @@
@WorkerThread
@RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE)
public boolean getRcsProvisioningStatusForCapability(
- @RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag int capability,
+ @ImsRcsManager.RcsImsCapabilityFlag int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int tech) {
try {
return getITelephony().getRcsProvisioningStatusForCapability(mSubId, capability, tech);
@@ -1590,7 +1585,7 @@
@WorkerThread
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
public void setRcsProvisioningStatusForCapability(
- @RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag int capability,
+ @ImsRcsManager.RcsImsCapabilityFlag int capability,
boolean isProvisioned) {
try {
getITelephony().setRcsProvisioningStatusForCapability(mSubId, capability,
@@ -1622,7 +1617,7 @@
@WorkerThread
@RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
public void setRcsProvisioningStatusForCapability(
- @RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag int capability,
+ @ImsRcsManager.RcsImsCapabilityFlag int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int tech, boolean isProvisioned) {
try {
getITelephony().setRcsProvisioningStatusForCapability(mSubId, capability,
@@ -1676,7 +1671,7 @@
*/
@RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE)
public boolean isRcsProvisioningRequiredForCapability(
- @RcsFeature.RcsImsCapabilities.RcsImsCapabilityFlag int capability,
+ @ImsRcsManager.RcsImsCapabilityFlag int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int tech) {
try {
return getITelephony().isRcsProvisioningRequiredForCapability(mSubId, capability, tech);
diff --git a/telephony/java/android/telephony/ims/RcsUceAdapter.java b/telephony/java/android/telephony/ims/RcsUceAdapter.java
index 154bb11..91dc38f 100644
--- a/telephony/java/android/telephony/ims/RcsUceAdapter.java
+++ b/telephony/java/android/telephony/ims/RcsUceAdapter.java
@@ -55,20 +55,28 @@
* This carrier supports User Capability Exchange as, defined by the framework using
* SIP OPTIONS. If set, the RcsFeature should support capability exchange. If not set, this
* RcsFeature should not publish capabilities or service capability requests.
+ * @deprecated Use {@link ImsRcsManager#CAPABILITY_TYPE_OPTIONS_UCE} instead.
* @hide
*/
+ @Deprecated
public static final int CAPABILITY_TYPE_OPTIONS_UCE = 1 << 0;
/**
* This carrier supports User Capability Exchange as, defined by the framework using a
* presence server. If set, the RcsFeature should support capability exchange. If not set, this
* RcsFeature should not publish capabilities or service capability requests.
+ * @deprecated Use {@link ImsRcsManager#CAPABILITY_TYPE_PRESENCE_UCE} instead.
* @hide
*/
+ @Deprecated
@SystemApi
public static final int CAPABILITY_TYPE_PRESENCE_UCE = 1 << 1;
- /**@hide*/
+ /**
+ * @deprecated Use {@link ImsRcsManager.RcsImsCapabilityFlag} instead.
+ * @hide
+ */
+ @Deprecated
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = "CAPABILITY_TYPE_", value = {
CAPABILITY_TYPE_OPTIONS_UCE,
diff --git a/telephony/java/android/telephony/ims/feature/MmTelFeature.java b/telephony/java/android/telephony/ims/feature/MmTelFeature.java
index ad2e9e1..fb0e659 100644
--- a/telephony/java/android/telephony/ims/feature/MmTelFeature.java
+++ b/telephony/java/android/telephony/ims/feature/MmTelFeature.java
@@ -396,7 +396,7 @@
/**
* Undefined capability type for initialization
* This is used to check the upper range of MmTel capability
- * {@hide}
+ * @hide
*/
public static final int CAPABILITY_TYPE_NONE = 0;
@@ -427,7 +427,7 @@
/**
* This is used to check the upper range of MmTel capability
- * {@hide}
+ * @hide
*/
public static final int CAPABILITY_TYPE_MAX = CAPABILITY_TYPE_CALL_COMPOSER + 1;
@@ -738,7 +738,7 @@
* Enabling/Disabling a capability here indicates that the capability should be registered or
* deregistered (depending on the capability change) and become available or unavailable to
* the framework.
- * * @hide
+ * @hide
*/
@Override
@SystemApi
diff --git a/telephony/java/android/telephony/ims/feature/RcsFeature.java b/telephony/java/android/telephony/ims/feature/RcsFeature.java
index 70e4ef1..843827b 100644
--- a/telephony/java/android/telephony/ims/feature/RcsFeature.java
+++ b/telephony/java/android/telephony/ims/feature/RcsFeature.java
@@ -24,7 +24,7 @@
import android.content.Context;
import android.net.Uri;
import android.os.RemoteException;
-import android.telephony.ims.RcsUceAdapter;
+import android.telephony.ims.ImsRcsManager;
import android.telephony.ims.aidl.CapabilityExchangeAidlWrapper;
import android.telephony.ims.aidl.ICapabilityExchangeEventListener;
import android.telephony.ims.aidl.IImsCapabilityCallback;
@@ -59,7 +59,9 @@
/**
* Base implementation of the RcsFeature APIs. Any ImsService wishing to support RCS should extend
* this class and provide implementations of the RcsFeature methods that they support.
+ * @hide
*/
+@SystemApi
public class RcsFeature extends ImsFeature {
private static final String LOG_TAG = "RcsFeature";
@@ -184,18 +186,22 @@
* Contains the capabilities defined and supported by a {@link RcsFeature} in the
* form of a bitmask. The capabilities that are used in the RcsFeature are
* defined as:
- * {RcsUceAdapter.RcsImsCapabilityFlag#CAPABILITY_TYPE_OPTIONS_UCE}
- * {RcsUceAdapter.RcsImsCapabilityFlag#CAPABILITY_TYPE_PRESENCE_UCE}
+ * {@link ImsRcsManager.RcsImsCapabilityFlag#CAPABILITY_TYPE_OPTIONS_UCE}
+ * {@link ImsRcsManager.RcsImsCapabilityFlag#CAPABILITY_TYPE_PRESENCE_UCE}
*
* The enabled capabilities of this RcsFeature will be set by the framework
- * using {#changeEnabledCapabilities(CapabilityChangeRequest, CapabilityCallbackProxy)}.
+ * using {@link #changeEnabledCapabilities(CapabilityChangeRequest, CapabilityCallbackProxy)}.
* After the capabilities have been set, the RcsFeature may then perform the necessary bring up
* of the capability and notify the capability status as true using
- * {#notifyCapabilitiesStatusChanged(RcsImsCapabilities)}. This will signal to the
+ * {@link #notifyCapabilitiesStatusChanged(RcsImsCapabilities)}. This will signal to the
* framework that the capability is available for usage.
*/
public static class RcsImsCapabilities extends Capabilities {
- /** @hide*/
+
+ /**
+ * Use {@link ImsRcsManager.RcsImsCapabilityFlag} instead in case used for public API
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = "CAPABILITY_TYPE_", flag = true, value = {
CAPABILITY_TYPE_NONE,
@@ -226,7 +232,7 @@
/**
* This is used to check the upper range of RCS capability
- * {@hide}
+ * @hide
*/
public static final int CAPABILITY_TYPE_MAX = CAPABILITY_TYPE_PRESENCE_UCE + 1;
@@ -234,10 +240,8 @@
* Create a new {@link RcsImsCapabilities} instance with the provided capabilities.
* @param capabilities The capabilities that are supported for RCS in the form of a
* bitfield.
- * @hide
*/
- @SystemApi
- public RcsImsCapabilities(@RcsUceAdapter.RcsImsCapabilityFlag int capabilities) {
+ public RcsImsCapabilities(@ImsRcsManager.RcsImsCapabilityFlag int capabilities) {
super(capabilities);
}
@@ -249,30 +253,18 @@
super(capabilities.getMask());
}
- /**
- * @hide
- */
@Override
- @SystemApi
- public void addCapabilities(@RcsUceAdapter.RcsImsCapabilityFlag int capabilities) {
+ public void addCapabilities(@ImsRcsManager.RcsImsCapabilityFlag int capabilities) {
super.addCapabilities(capabilities);
}
- /**
- * @hide
- */
@Override
- @SystemApi
- public void removeCapabilities(@RcsUceAdapter.RcsImsCapabilityFlag int capabilities) {
+ public void removeCapabilities(@ImsRcsManager.RcsImsCapabilityFlag int capabilities) {
super.removeCapabilities(capabilities);
}
- /**
- * @hide
- */
@Override
- @SystemApi
- public boolean isCapable(@RcsUceAdapter.RcsImsCapabilityFlag int capabilities) {
+ public boolean isCapable(@ImsRcsManager.RcsImsCapabilityFlag int capabilities) {
return super.isCapable(capabilities);
}
}
@@ -288,9 +280,7 @@
* Method stubs called from the framework will be called asynchronously. To specify the
* {@link Executor} that the methods stubs will be called, use
* {@link RcsFeature#RcsFeature(Executor)} instead.
- * @hide
*/
- @SystemApi
public RcsFeature() {
super();
// Run on the Binder threads that call them.
@@ -302,9 +292,7 @@
* framework.
* @param executor The executor for the framework to use when executing the methods overridden
* by the implementation of RcsFeature.
- * @hide
*/
- @SystemApi
public RcsFeature(@NonNull Executor executor) {
super();
if (executor == null) {
@@ -335,10 +323,8 @@
* requests. To change the status of the capabilities
* {@link #notifyCapabilitiesStatusChanged(RcsImsCapabilities)} should be called.
* @return A copy of the current RcsFeature capability status.
- * @hide
*/
@Override
- @SystemApi
public @NonNull final RcsImsCapabilities queryCapabilityStatus() {
return new RcsImsCapabilities(super.queryCapabilityStatus());
}
@@ -348,9 +334,7 @@
* this signals to the framework that the capability has been initialized and is ready.
* Call {@link #queryCapabilityStatus()} to return the current capability status.
* @param capabilities The current capability status of the RcsFeature.
- * @hide
*/
- @SystemApi
public final void notifyCapabilitiesStatusChanged(@NonNull RcsImsCapabilities capabilities) {
if (capabilities == null) {
throw new IllegalArgumentException("RcsImsCapabilities must be non-null!");
@@ -367,11 +351,9 @@
* @param capability The capability that we are querying the configuration for.
* @param radioTech The radio technology type that we are querying.
* @return true if the capability is enabled, false otherwise.
- * @hide
*/
- @SystemApi
public boolean queryCapabilityConfiguration(
- @RcsUceAdapter.RcsImsCapabilityFlag int capability,
+ @ImsRcsManager.RcsImsCapabilityFlag int capability,
@ImsRegistrationImplBase.ImsRegistrationTech int radioTech) {
// Base Implementation - Override to provide functionality
return false;
@@ -392,10 +374,8 @@
* be called for each capability change that resulted in an error.
* @param request The request to change the capability.
* @param callback To notify the framework that the result of the capability changes.
- * @hide
*/
@Override
- @SystemApi
public void changeEnabledCapabilities(@NonNull CapabilityChangeRequest request,
@NonNull CapabilityCallbackProxy callback) {
// Base Implementation - Override to provide functionality
@@ -415,9 +395,7 @@
* event to the framework.
* @return An instance of {@link RcsCapabilityExchangeImplBase} that implements capability
* exchange if it is supported by the device.
- * @hide
*/
- @SystemApi
public @NonNull RcsCapabilityExchangeImplBase createCapabilityExchangeImpl(
@NonNull CapabilityExchangeEventListener listener) {
// Base Implementation, override to implement functionality
@@ -427,28 +405,20 @@
/**
* Remove the given CapabilityExchangeImplBase instance.
* @param capExchangeImpl The {@link RcsCapabilityExchangeImplBase} instance to be destroyed.
- * @hide
*/
- @SystemApi
public void destroyCapabilityExchangeImpl(
@NonNull RcsCapabilityExchangeImplBase capExchangeImpl) {
// Override to implement the process of destroying RcsCapabilityExchangeImplBase instance.
}
- /**{@inheritDoc}
- * @hide
- */
+ /**{@inheritDoc}*/
@Override
- @SystemApi
public void onFeatureRemoved() {
}
- /**{@inheritDoc}
- * @hide
- */
+ /**{@inheritDoc}*/
@Override
- @SystemApi
public void onFeatureReady() {
}
diff --git a/telephony/java/android/telephony/ims/stub/ImsRegistrationImplBase.java b/telephony/java/android/telephony/ims/stub/ImsRegistrationImplBase.java
index ac5565b..593f080 100644
--- a/telephony/java/android/telephony/ims/stub/ImsRegistrationImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/ImsRegistrationImplBase.java
@@ -93,7 +93,7 @@
/**
* This is used to check the upper range of registration tech
- * {@hide}
+ * @hide
*/
public static final int REGISTRATION_TECH_MAX = REGISTRATION_TECH_NR + 1;
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
index 75f1337..7f309e1 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
@@ -102,28 +102,59 @@
}
}
-fun FlickerTestParameter.navBarLayerRotatesAndScales() {
+/**
+ * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start
+ * of the SF trace
+ */
+fun FlickerTestParameter.navBarLayerPositionStart() {
assertLayersStart {
val display = this.entry.displays.minByOrNull { it.id }
- ?: throw RuntimeException("There is no display!")
- this.visibleRegion(FlickerComponentName.NAV_BAR)
- .coversExactly(WindowUtils.getNavigationBarPosition(display))
- }
- assertLayersEnd {
- val display = this.entry.displays.minByOrNull { it.id }
- ?: throw RuntimeException("There is no display!")
+ ?: throw RuntimeException("There is no display!")
this.visibleRegion(FlickerComponentName.NAV_BAR)
.coversExactly(WindowUtils.getNavigationBarPosition(display))
}
}
-fun FlickerTestParameter.statusBarLayerRotatesScales() {
+/**
+ * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the end
+ * of the SF trace
+ */
+fun FlickerTestParameter.navBarLayerPositionEnd() {
+ assertLayersEnd {
+ val display = this.entry.displays.minByOrNull { it.id }
+ ?: throw RuntimeException("There is no display!")
+ this.visibleRegion(FlickerComponentName.NAV_BAR)
+ .coversExactly(WindowUtils.getNavigationBarPosition(display))
+ }
+}
+
+/**
+ * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start
+ * and end of the SF trace
+ */
+fun FlickerTestParameter.navBarLayerRotatesAndScales() {
+ navBarLayerPositionStart()
+ navBarLayerPositionEnd()
+}
+
+/**
+ * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start
+ * of the SF trace
+ */
+fun FlickerTestParameter.statusBarLayerPositionStart() {
assertLayersStart {
val display = this.entry.displays.minByOrNull { it.id }
?: throw RuntimeException("There is no display!")
this.visibleRegion(FlickerComponentName.STATUS_BAR)
.coversExactly(WindowUtils.getStatusBarPosition(display))
}
+}
+
+/**
+ * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the end
+ * of the SF trace
+ */
+fun FlickerTestParameter.statusBarLayerPositionEnd() {
assertLayersEnd {
val display = this.entry.displays.minByOrNull { it.id }
?: throw RuntimeException("There is no display!")
@@ -133,6 +164,15 @@
}
/**
+ * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start
+ * and end of the SF trace
+ */
+fun FlickerTestParameter.statusBarLayerRotatesScales() {
+ statusBarLayerPositionStart()
+ statusBarLayerPositionEnd()
+}
+
+/**
* Asserts that:
* [originalLayer] is visible at the start of the trace
* [originalLayer] becomes invisible during the trace and (in the same entry) [newLayer]
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
index d1319ac..20a2e22 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
@@ -98,6 +98,12 @@
super.statusBarLayerRotatesScales()
}
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 229762973)
+ @Test
+ override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
+ super.visibleLayersShownMoreThanOneConsecutiveEntry()
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt
index f5fb106..d00fd7d 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt
@@ -101,11 +101,10 @@
}
/** {@inheritDoc} */
- @Presubmit
+ @FlakyTest(bugId = 229762973)
@Test
- override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
+ override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
super.visibleLayersShownMoreThanOneConsecutiveEntry()
- }
companion object {
/**
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.kt
index 535612a..93b987e 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.kt
@@ -41,6 +41,16 @@
waitIMEShown(device, wmHelper)
}
+ override fun launchViaIntent(
+ wmHelper: WindowManagerStateHelper,
+ expectedWindowName: String,
+ action: String?,
+ stringExtras: Map<String, String>
+ ) {
+ super.launchViaIntent(wmHelper, expectedWindowName, action, stringExtras)
+ waitIMEShown(uiDevice, wmHelper)
+ }
+
override fun open() {
val expectedPackage = if (rotation.isRotated()) {
imePackageName
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt
index 8daf4ca..a8cbc5d 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt
@@ -18,12 +18,14 @@
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.RequiresDevice
+import androidx.test.filters.FlakyTest
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.dsl.FlickerBuilder
import org.junit.FixMethodOrder
+import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
@@ -31,6 +33,8 @@
/**
* Test cold launching an app from a notification from the lock screen.
*
+ * This test assumes the device doesn't have AOD enabled
+ *
* To run this test: `atest FlickerTests:OpenAppFromLockNotificationCold`
*/
@RequiresDevice
@@ -65,6 +69,22 @@
}
}
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 229735718)
+ @Test
+ override fun entireScreenCovered() = super.entireScreenCovered()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 203538234)
+ @Test
+ override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
+ super.visibleWindowsShownMoreThanOneConsecutiveEntry()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 203538234)
+ @Test
+ override fun appWindowBecomesTopWindow() = super.appWindowBecomesTopWindow()
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt
index 8eb182a..cd8dea0 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt
@@ -18,6 +18,7 @@
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.RequiresDevice
+import androidx.test.filters.FlakyTest
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
@@ -33,6 +34,8 @@
/**
* Test warm launching an app from a notification from the lock screen.
*
+ * This test assumes the device doesn't have AOD enabled
+ *
* To run this test: `atest FlickerTests:OpenAppFromLockNotificationWarm`
*/
@RequiresDevice
@@ -97,6 +100,17 @@
}
}
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 229735718)
+ @Test
+ override fun entireScreenCovered() = super.entireScreenCovered()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 203538234)
+ @Test
+ override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
+ super.visibleWindowsShownMoreThanOneConsecutiveEntry()
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt
index 28a914b..bc637f8 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWithLockOverlayApp.kt
@@ -18,6 +18,7 @@
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.RequiresDevice
+import androidx.test.filters.FlakyTest
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
@@ -103,6 +104,11 @@
}
}
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 229735718)
+ @Test
+ override fun entireScreenCovered() = super.entireScreenCovered()
+
companion object {
/**
* Creates the test configurations.
@@ -113,7 +119,7 @@
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getParams(): Collection<FlickerTestParameter> {
- return com.android.server.wm.flicker.FlickerTestParameterFactory.getInstance()
+ return FlickerTestParameterFactory.getInstance()
.getConfigNonRotationTests(repetitions = 3)
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockTransition.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockTransition.kt
index f47e272..fe80162 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockTransition.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockTransition.kt
@@ -20,6 +20,7 @@
import androidx.test.filters.FlakyTest
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.navBarLayerPositionEnd
import com.android.server.wm.traces.common.FlickerComponentName
import org.junit.Test
@@ -99,4 +100,27 @@
@FlakyTest(bugId = 203538234)
@Test
override fun appWindowBecomesVisible() = super.appWindowBecomesVisible()
+
+ /**
+ * Checks the position of the navigation bar at the start and end of the transition
+ *
+ * Differently from the normal usage of this assertion, check only the final state of the
+ * transition because the display is off at the start and the NavBar is never visible
+ */
+ @Presubmit
+ @Test
+ override fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd()
+
+ /**
+ * Checks that the status bar layer is visible at the end of the trace
+ *
+ * It is not possible to check at the start because the screen is off
+ */
+ @Presubmit
+ @Test
+ override fun statusBarLayerIsVisible() {
+ testSpec.assertLayersEnd {
+ this.isVisible(FlickerComponentName.STATUS_BAR)
+ }
+ }
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt
index ee018ec..5022dd8 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt
@@ -32,6 +32,8 @@
/**
* Test cold launching an app from a notification.
*
+ * This test assumes the device doesn't have AOD enabled
+ *
* To run this test: `atest FlickerTests:OpenAppFromNotificationCold`
*/
@RequiresDevice
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt
index 74f1fd7..812f6859 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationWarm.kt
@@ -20,6 +20,7 @@
import android.platform.test.annotations.RequiresDevice
import android.view.WindowInsets
import android.view.WindowManager
+import androidx.test.filters.FlakyTest
import androidx.test.uiautomator.By
import androidx.test.uiautomator.Until
import com.android.launcher3.tapl.LauncherInstrumentation
@@ -29,8 +30,10 @@
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.NotificationAppHelper
+import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -40,6 +43,8 @@
/**
* Test cold launching an app from a notification.
*
+ * This test assumes the device doesn't have AOD enabled
+ *
* To run this test: `atest FlickerTests:OpenAppFromNotificationWarm`
*/
@RequiresDevice
@@ -160,6 +165,21 @@
}
}
+ /** {@inheritDoc} */
+ @Postsubmit
+ @Test
+ override fun appWindowBecomesTopWindow() {
+ Assume.assumeFalse(isShellTransitionsEnabled)
+ super.appWindowBecomesTopWindow()
+ }
+
+ @FlakyTest(bugId = 229738092)
+ @Test
+ fun appWindowBecomesTopWindow_ShellTransit() {
+ Assume.assumeTrue(isShellTransitionsEnabled)
+ super.appWindowBecomesTopWindow()
+ }
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromOverviewTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromOverviewTest.kt
index 6e33f66..2226fd1 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromOverviewTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromOverviewTest.kt
@@ -26,9 +26,11 @@
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.traces.common.WindowManagerConditionsFactory
+import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -132,6 +134,41 @@
@Test
override fun appWindowBecomesVisible() = super.appWindowBecomesVisible_warmStart()
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 229735718)
+ @Test
+ override fun entireScreenCovered() = super.entireScreenCovered()
+
+ /** {@inheritDoc} */
+ @Presubmit
+ @Test
+ override fun appWindowReplacesLauncherAsTopWindow() {
+ Assume.assumeFalse(isShellTransitionsEnabled)
+ super.appWindowReplacesLauncherAsTopWindow()
+ }
+
+ @FlakyTest(bugId = 229738092)
+ @Test
+ fun appWindowReplacesLauncherAsTopWindow_ShellTransit() {
+ Assume.assumeTrue(isShellTransitionsEnabled)
+ super.appWindowReplacesLauncherAsTopWindow()
+ }
+
+ /** {@inheritDoc} */
+ @Presubmit
+ @Test
+ override fun appWindowBecomesTopWindow() {
+ Assume.assumeFalse(isShellTransitionsEnabled)
+ super.appWindowBecomesTopWindow()
+ }
+
+ @FlakyTest(bugId = 229738092)
+ @Test
+ fun appWindowBecomesTopWindow_ShellTransit() {
+ Assume.assumeTrue(isShellTransitionsEnabled)
+ super.appWindowBecomesTopWindow()
+ }
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt
index f357177..55eb3c3 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppNonResizeableTest.kt
@@ -16,6 +16,7 @@
package com.android.server.wm.flicker.launch
+import android.platform.test.annotations.Postsubmit
import androidx.test.filters.FlakyTest
import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDevice
@@ -27,6 +28,7 @@
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
import com.android.server.wm.flicker.helpers.WindowUtils
+import com.android.server.wm.flicker.navBarLayerPositionEnd
import com.android.server.wm.traces.common.FlickerComponentName
import org.junit.FixMethodOrder
import org.junit.Test
@@ -37,6 +39,8 @@
/**
* Test launching an app while the device is locked
*
+ * This test assumes the device doesn't have AOD enabled
+ *
* To run this test: `atest FlickerTests:OpenAppNonResizeableTest`
*
* Actions:
@@ -103,8 +107,7 @@
/**
* Checks that the status bar layer is visible at the end of the trace
*
- * It is not possible to check at the start because the animation is working differently
- * in devices with and without blur (b/202936526)
+ * It is not possible to check at the start because the screen is off
*/
@Presubmit
@Test
@@ -115,7 +118,7 @@
}
/** {@inheritDoc} */
- @FlakyTest(bugId = 202936526)
+ @FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
@@ -131,10 +134,15 @@
}
}
- /** {@inheritDoc} */
- @FlakyTest
+ /**
+ * Checks the position of the navigation bar at the start and end of the transition
+ *
+ * Differently from the normal usage of this assertion, check only the final state of the
+ * transition because the display is off at the start and the NavBar is never visible
+ */
+ @Postsubmit
@Test
- override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
+ override fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd()
/** {@inheritDoc} */
@FlakyTest
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt
index 48f6aeb..97528c0 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppWarmTest.kt
@@ -130,6 +130,10 @@
@Test
override fun appWindowBecomesVisible() = super.appWindowBecomesVisible_warmStart()
+ @FlakyTest(bugId = 229735718)
+ @Test
+ override fun entireScreenCovered() = super.entireScreenCovered()
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java
index 1c957d4d..8419276 100644
--- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java
+++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java
@@ -30,6 +30,7 @@
import android.os.SystemClock;
import android.platform.test.annotations.RootPermissionTest;
import android.platform.test.rule.UnlockScreenRule;
+import android.util.Log;
import android.view.WindowInsets;
import android.view.WindowInsetsAnimation;
import android.view.inputmethod.InputMethodManager;
@@ -40,16 +41,19 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.ArrayList;
import java.util.List;
@RootPermissionTest
@RunWith(AndroidJUnit4.class)
public final class ImeOpenCloseStressTest {
+ private static final String TAG = "ImeOpenCloseStressTest";
private static final int NUM_TEST_ITERATIONS = 10;
@Rule
@@ -58,32 +62,103 @@
@Rule
public ScreenCaptureRule mScreenCaptureRule =
new ScreenCaptureRule("/sdcard/InputMethodStressTest");
+ private Instrumentation mInstrumentation;
+
+ @Before
+ public void setUp() {
+ mInstrumentation = InstrumentationRegistry.getInstrumentation();
+ }
@Test
- public void test() {
- Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
- Intent intent = new Intent()
- .setAction(Intent.ACTION_MAIN)
- .setClass(instrumentation.getContext(), TestActivity.class)
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- TestActivity activity = (TestActivity) instrumentation.startActivitySync(intent);
+ public void testShowHide_waitingVisibilityChange() {
+ TestActivity activity = TestActivity.start();
EditText editText = activity.getEditText();
waitOnMainUntil("activity should gain focus", editText::hasWindowFocus);
for (int i = 0; i < NUM_TEST_ITERATIONS; i++) {
String msgPrefix = "Iteration #" + i + " ";
- instrumentation.runOnMainSync(activity::showIme);
+ Log.i(TAG, msgPrefix + "start");
+ mInstrumentation.runOnMainSync(activity::showIme);
+ waitOnMainUntil(msgPrefix + "IME should be visible", () -> isImeShown(editText));
+ mInstrumentation.runOnMainSync(activity::hideIme);
+ waitOnMainUntil(msgPrefix + "IME should be hidden", () -> !isImeShown(editText));
+ }
+ }
+
+ @Test
+ public void testShowHide_waitingAnimationEnd() {
+ TestActivity activity = TestActivity.start();
+ activity.enableAnimationMonitoring();
+ EditText editText = activity.getEditText();
+ waitOnMainUntil("activity should gain focus", editText::hasWindowFocus);
+ for (int i = 0; i < NUM_TEST_ITERATIONS; i++) {
+ String msgPrefix = "Iteration #" + i + " ";
+ Log.i(TAG, msgPrefix + "start");
+ mInstrumentation.runOnMainSync(activity::showIme);
waitOnMainUntil(msgPrefix + "IME should be visible",
() -> !activity.isAnimating() && isImeShown(editText));
- instrumentation.runOnMainSync(activity::hideIme);
+ mInstrumentation.runOnMainSync(activity::hideIme);
waitOnMainUntil(msgPrefix + "IME should be hidden",
() -> !activity.isAnimating() && !isImeShown(editText));
- // b/b/221483132, wait until IMS and IMMS handles IMM#notifyImeHidden.
- // There is no good signal, so we just wait a second.
- SystemClock.sleep(1000);
}
}
+ @Test
+ public void testShowHide_intervalAfterHide() {
+ // Regression test for b/221483132
+ TestActivity activity = TestActivity.start();
+ EditText editText = activity.getEditText();
+ // Intervals = 10, 20, 30, ..., 100, 150, 200, ...
+ List<Integer> intervals = new ArrayList<>();
+ for (int i = 10; i < 100; i += 10) intervals.add(i);
+ for (int i = 100; i < 1000; i += 50) intervals.add(i);
+ waitOnMainUntil("activity should gain focus", editText::hasWindowFocus);
+ for (int intervalMillis : intervals) {
+ String msgPrefix = "Interval = " + intervalMillis + " ";
+ Log.i(TAG, msgPrefix + " start");
+ mInstrumentation.runOnMainSync(activity::hideIme);
+ SystemClock.sleep(intervalMillis);
+ mInstrumentation.runOnMainSync(activity::showIme);
+ waitOnMainUntil(msgPrefix + "IME should be visible",
+ () -> isImeShown(editText));
+ }
+ }
+
+ @Test
+ public void testShowHideInSameFrame() {
+ TestActivity activity = TestActivity.start();
+ activity.enableAnimationMonitoring();
+ EditText editText = activity.getEditText();
+ waitOnMainUntil("activity should gain focus", editText::hasWindowFocus);
+
+ // hidden -> show -> hide
+ mInstrumentation.runOnMainSync(() -> {
+ Log.i(TAG, "Calling showIme() and hideIme()");
+ activity.showIme();
+ activity.hideIme();
+ });
+ // Wait until IMMS / IMS handles messages.
+ SystemClock.sleep(1000);
+ mInstrumentation.waitForIdleSync();
+ waitOnMainUntil("IME should be invisible after show/hide", () -> !isImeShown(editText));
+
+ mInstrumentation.runOnMainSync(activity::showIme);
+ waitOnMainUntil("IME should be visible",
+ () -> !activity.isAnimating() && isImeShown(editText));
+ mInstrumentation.waitForIdleSync();
+
+ // shown -> hide -> show
+ mInstrumentation.runOnMainSync(() -> {
+ Log.i(TAG, "Calling hideIme() and showIme()");
+ activity.hideIme();
+ activity.showIme();
+ });
+ // Wait until IMMS / IMS handles messages.
+ SystemClock.sleep(1000);
+ mInstrumentation.waitForIdleSync();
+ waitOnMainUntil("IME should be visible after hide/show",
+ () -> !activity.isAnimating() && isImeShown(editText));
+ }
+
public static class TestActivity extends Activity {
private EditText mEditText;
@@ -111,6 +186,15 @@
}
};
+ public static TestActivity start() {
+ Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+ Intent intent = new Intent()
+ .setAction(Intent.ACTION_MAIN)
+ .setClass(instrumentation.getContext(), TestActivity.class)
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ return (TestActivity) instrumentation.startActivitySync(intent);
+ }
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -120,9 +204,6 @@
mEditText = new EditText(this);
rootView.addView(mEditText, new LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
setContentView(rootView);
- // Enable WindowInsetsAnimation.
- getWindow().setDecorFitsSystemWindows(false);
- mEditText.setWindowInsetsAnimationCallback(mWindowInsetsAnimationCallback);
}
public EditText getEditText() {
@@ -130,16 +211,27 @@
}
public void showIme() {
+ Log.i(TAG, "TestActivity.showIme");
mEditText.requestFocus();
InputMethodManager imm = getSystemService(InputMethodManager.class);
imm.showSoftInput(mEditText, 0);
}
public void hideIme() {
+ Log.i(TAG, "TestActivity.hideIme");
InputMethodManager imm = getSystemService(InputMethodManager.class);
imm.hideSoftInputFromWindow(mEditText.getWindowToken(), 0);
}
+ public void enableAnimationMonitoring() {
+ // Enable WindowInsetsAnimation.
+ // Note that this has a side effect of disabling InsetsAnimationThreadControlRunner.
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
+ getWindow().setDecorFitsSystemWindows(false);
+ mEditText.setWindowInsetsAnimationCallback(mWindowInsetsAnimationCallback);
+ });
+ }
+
public boolean isAnimating() {
return mIsAnimating;
}
diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java
index 29c52cf..90fd08b 100644
--- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java
+++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/NotificationTest.java
@@ -20,6 +20,8 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assume.assumeFalse;
+
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -28,6 +30,7 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.graphics.drawable.Icon;
import android.platform.test.annotations.RootPermissionTest;
import android.platform.test.rule.UnlockScreenRule;
@@ -89,6 +92,9 @@
mContext = InstrumentationRegistry.getInstrumentation().getContext();
mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
mNotificationManager = mContext.getSystemService(NotificationManager.class);
+ PackageManager pm = mContext.getPackageManager();
+ // Do not run on Automotive.
+ assumeFalse(pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE));
}
@After
diff --git a/tests/TrustTests/TEST_MAPPING b/tests/TrustTests/TEST_MAPPING
index b9c46bf..23923ee 100644
--- a/tests/TrustTests/TEST_MAPPING
+++ b/tests/TrustTests/TEST_MAPPING
@@ -11,5 +11,18 @@
}
]
}
+ ],
+ "trust-tablet": [
+ {
+ "name": "TrustTests",
+ "options": [
+ {
+ "include-filter": "android.trust.test"
+ },
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ }
+ ]
+ }
]
}
\ No newline at end of file
diff --git a/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java b/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java
index 5f606e1..09080be 100644
--- a/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java
+++ b/tests/vcn/java/com/android/server/vcn/TelephonySubscriptionTrackerTest.java
@@ -26,6 +26,7 @@
import static com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionSnapshot;
import static com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionTrackerCallback;
+import static com.android.server.vcn.util.PersistableBundleUtils.PersistableBundleWrapper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -50,9 +51,11 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.net.vcn.VcnManager;
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.ParcelUuid;
+import android.os.PersistableBundle;
import android.os.test.TestLooper;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionInfo;
@@ -104,6 +107,26 @@
TEST_SUBID_TO_INFO_MAP = Collections.unmodifiableMap(subIdToGroupMap);
}
+ private static final String TEST_CARRIER_CONFIG_KEY_1 = "TEST_CARRIER_CONFIG_KEY_1";
+ private static final String TEST_CARRIER_CONFIG_KEY_2 = "TEST_CARRIER_CONFIG_KEY_2";
+ private static final PersistableBundle TEST_CARRIER_CONFIG = new PersistableBundle();
+ private static final PersistableBundleWrapper TEST_CARRIER_CONFIG_WRAPPER;
+ private static final Map<Integer, PersistableBundleWrapper> TEST_SUBID_TO_CARRIER_CONFIG_MAP;
+
+ static {
+ TEST_CARRIER_CONFIG.putString(
+ VcnManager.VCN_NETWORK_SELECTION_WIFI_ENTRY_RSSI_THRESHOLD_KEY,
+ VcnManager.VCN_NETWORK_SELECTION_WIFI_ENTRY_RSSI_THRESHOLD_KEY);
+ TEST_CARRIER_CONFIG.putString(
+ VcnManager.VCN_NETWORK_SELECTION_WIFI_EXIT_RSSI_THRESHOLD_KEY,
+ VcnManager.VCN_NETWORK_SELECTION_WIFI_EXIT_RSSI_THRESHOLD_KEY);
+ TEST_CARRIER_CONFIG_WRAPPER = new PersistableBundleWrapper(TEST_CARRIER_CONFIG);
+
+ final Map<Integer, PersistableBundleWrapper> subIdToCarrierConfigMap = new HashMap<>();
+ subIdToCarrierConfigMap.put(TEST_SUBSCRIPTION_ID_1, TEST_CARRIER_CONFIG_WRAPPER);
+ TEST_SUBID_TO_CARRIER_CONFIG_MAP = Collections.unmodifiableMap(subIdToCarrierConfigMap);
+ }
+
@NonNull private final Context mContext;
@NonNull private final TestLooper mTestLooper;
@NonNull private final Handler mHandler;
@@ -144,6 +167,9 @@
doReturn(mCarrierConfigManager)
.when(mContext)
.getSystemService(Context.CARRIER_CONFIG_SERVICE);
+ doReturn(TEST_CARRIER_CONFIG)
+ .when(mCarrierConfigManager)
+ .getConfigForSubId(eq(TEST_SUBSCRIPTION_ID_1));
// subId 1, 2 are in same subGrp, only subId 1 is active
doReturn(TEST_PARCEL_UUID).when(TEST_SUBINFO_1).getGroupUuid();
@@ -227,14 +253,24 @@
private TelephonySubscriptionSnapshot buildExpectedSnapshot(
Map<Integer, SubscriptionInfo> subIdToInfoMap,
Map<ParcelUuid, Set<String>> privilegedPackages) {
- return new TelephonySubscriptionSnapshot(0, subIdToInfoMap, privilegedPackages);
+ return buildExpectedSnapshot(0, subIdToInfoMap, privilegedPackages);
}
private TelephonySubscriptionSnapshot buildExpectedSnapshot(
int activeSubId,
Map<Integer, SubscriptionInfo> subIdToInfoMap,
Map<ParcelUuid, Set<String>> privilegedPackages) {
- return new TelephonySubscriptionSnapshot(activeSubId, subIdToInfoMap, privilegedPackages);
+ return buildExpectedSnapshot(
+ activeSubId, subIdToInfoMap, TEST_SUBID_TO_CARRIER_CONFIG_MAP, privilegedPackages);
+ }
+
+ private TelephonySubscriptionSnapshot buildExpectedSnapshot(
+ int activeSubId,
+ Map<Integer, SubscriptionInfo> subIdToInfoMap,
+ Map<Integer, PersistableBundleWrapper> subIdToCarrierConfigMap,
+ Map<ParcelUuid, Set<String>> privilegedPackages) {
+ return new TelephonySubscriptionSnapshot(
+ activeSubId, subIdToInfoMap, subIdToCarrierConfigMap, privilegedPackages);
}
private void verifyNoActiveSubscriptions() {
@@ -245,6 +281,8 @@
private void setupReadySubIds() {
mTelephonySubscriptionTracker.setReadySubIdsBySlotId(
Collections.singletonMap(TEST_SIM_SLOT_INDEX, TEST_SUBSCRIPTION_ID_1));
+ mTelephonySubscriptionTracker.setSubIdToCarrierConfigMap(
+ Collections.singletonMap(TEST_SUBSCRIPTION_ID_1, TEST_CARRIER_CONFIG_WRAPPER));
}
private void setPrivilegedPackagesForMock(@NonNull List<String> privilegedPackages) {
@@ -300,6 +338,7 @@
readySubIdsBySlotId.put(TEST_SIM_SLOT_INDEX + 1, TEST_SUBSCRIPTION_ID_1);
mTelephonySubscriptionTracker.setReadySubIdsBySlotId(readySubIdsBySlotId);
+ mTelephonySubscriptionTracker.setSubIdToCarrierConfigMap(TEST_SUBID_TO_CARRIER_CONFIG_MAP);
doReturn(1).when(mTelephonyManager).getActiveModemCount();
List<CarrierPrivilegesCallback> carrierPrivilegesCallbacks =
@@ -464,8 +503,16 @@
mTelephonySubscriptionTracker.onReceive(mContext, buildTestBroadcastIntent(false));
mTestLooper.dispatchAll();
- verify(mCallback).onNewSnapshot(eq(buildExpectedSnapshot(emptyMap())));
+ verify(mCallback)
+ .onNewSnapshot(
+ eq(
+ buildExpectedSnapshot(
+ 0, TEST_SUBID_TO_INFO_MAP, emptyMap(), emptyMap())));
assertNull(mTelephonySubscriptionTracker.getReadySubIdsBySlotId().get(TEST_SIM_SLOT_INDEX));
+ assertNull(
+ mTelephonySubscriptionTracker
+ .getSubIdToCarrierConfigMap()
+ .get(TEST_SUBSCRIPTION_ID_1));
}
@Test
@@ -493,7 +540,7 @@
public void testTelephonySubscriptionSnapshotGetGroupForSubId() throws Exception {
final TelephonySubscriptionSnapshot snapshot =
new TelephonySubscriptionSnapshot(
- TEST_SUBSCRIPTION_ID_1, TEST_SUBID_TO_INFO_MAP, emptyMap());
+ TEST_SUBSCRIPTION_ID_1, TEST_SUBID_TO_INFO_MAP, emptyMap(), emptyMap());
assertEquals(TEST_PARCEL_UUID, snapshot.getGroupForSubId(TEST_SUBSCRIPTION_ID_1));
assertEquals(TEST_PARCEL_UUID, snapshot.getGroupForSubId(TEST_SUBSCRIPTION_ID_2));
@@ -503,7 +550,7 @@
public void testTelephonySubscriptionSnapshotGetAllSubIdsInGroup() throws Exception {
final TelephonySubscriptionSnapshot snapshot =
new TelephonySubscriptionSnapshot(
- TEST_SUBSCRIPTION_ID_1, TEST_SUBID_TO_INFO_MAP, emptyMap());
+ TEST_SUBSCRIPTION_ID_1, TEST_SUBID_TO_INFO_MAP, emptyMap(), emptyMap());
assertEquals(
new ArraySet<>(Arrays.asList(TEST_SUBSCRIPTION_ID_1, TEST_SUBSCRIPTION_ID_2)),
diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
index 841b81c..15d4f10 100644
--- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
+++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionConnectedStateTest.java
@@ -56,6 +56,7 @@
import android.net.NetworkAgent;
import android.net.NetworkCapabilities;
import android.net.ipsec.ike.ChildSaProposal;
+import android.net.ipsec.ike.IkeSessionConnectionInfo;
import android.net.ipsec.ike.exceptions.IkeException;
import android.net.ipsec.ike.exceptions.IkeInternalException;
import android.net.ipsec.ike.exceptions.IkeProtocolException;
@@ -216,14 +217,23 @@
@Test
public void testMigration() throws Exception {
triggerChildOpened();
+ mTestLooper.dispatchAll();
+ assertEquals(mIkeConnectionInfo, mGatewayConnection.getIkeConnectionInfo());
mGatewayConnection
.getUnderlyingNetworkControllerCallback()
.onSelectedUnderlyingNetworkChanged(TEST_UNDERLYING_NETWORK_RECORD_2);
+
+ final IkeSessionConnectionInfo newIkeConnectionInfo =
+ new IkeSessionConnectionInfo(
+ TEST_ADDR_V4, TEST_ADDR_V4_2, TEST_UNDERLYING_NETWORK_RECORD_2.network);
+ getIkeSessionCallback().onIkeSessionConnectionInfoChanged(newIkeConnectionInfo);
getChildSessionCallback()
.onIpSecTransformsMigrated(makeDummyIpSecTransform(), makeDummyIpSecTransform());
mTestLooper.dispatchAll();
+ assertEquals(newIkeConnectionInfo, mGatewayConnection.getIkeConnectionInfo());
+
verify(mIpSecSvc, times(2))
.setNetworkForTunnelInterface(
eq(TEST_IPSEC_TUNNEL_RESOURCE_ID),
@@ -246,7 +256,8 @@
MtuUtils.getMtu(
saProposals,
mConfig.getMaxMtu(),
- TEST_UNDERLYING_NETWORK_RECORD_2.linkProperties.getMtu());
+ TEST_UNDERLYING_NETWORK_RECORD_2.linkProperties.getMtu(),
+ true /* isIpv4 */);
verify(mNetworkAgent).sendLinkProperties(
argThat(lp -> expectedMtu == lp.getMtu()
&& TEST_TCP_BUFFER_SIZES_2.equals(lp.getTcpBufferSizes())));
@@ -269,6 +280,7 @@
.when(mMockChildSessionConfig)
.getInternalDnsServers();
+ getIkeSessionCallback().onOpened(mIkeSessionConfiguration);
getChildSessionCallback().onOpened(mMockChildSessionConfig);
}
@@ -298,6 +310,7 @@
mTestLooper.dispatchAll();
assertEquals(mGatewayConnection.mConnectedState, mGatewayConnection.getCurrentState());
+ assertEquals(mIkeConnectionInfo, mGatewayConnection.getIkeConnectionInfo());
final ArgumentCaptor<LinkProperties> lpCaptor =
ArgumentCaptor.forClass(LinkProperties.class);
diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java
index b9dfda3..6a9a1e2 100644
--- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java
+++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java
@@ -213,7 +213,8 @@
VcnGatewayConnectionConfigTest.buildTestConfig(),
tunnelIface,
childSessionConfig,
- record);
+ record,
+ mIkeConnectionInfo);
verify(mDeps).getUnderlyingIfaceMtu(LOOPBACK_IFACE);
@@ -226,7 +227,8 @@
VcnGatewayConnectionConfigTest.buildTestConfig(),
tunnelIface,
childSessionConfig,
- record);
+ record,
+ mIkeConnectionInfo);
verify(mDeps, times(2)).getUnderlyingIfaceMtu(LOOPBACK_IFACE);
diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java
index 5628321..785bff1 100644
--- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java
+++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java
@@ -47,6 +47,8 @@
import android.net.NetworkCapabilities;
import android.net.ipsec.ike.ChildSessionCallback;
import android.net.ipsec.ike.IkeSessionCallback;
+import android.net.ipsec.ike.IkeSessionConfiguration;
+import android.net.ipsec.ike.IkeSessionConnectionInfo;
import android.net.vcn.VcnGatewayConnectionConfig;
import android.net.vcn.VcnGatewayConnectionConfigTest;
import android.os.ParcelUuid;
@@ -80,6 +82,13 @@
doReturn(TEST_SUB_GRP).when(TEST_SUB_INFO).getGroupUuid();
}
+ protected static final InetAddress TEST_ADDR = InetAddresses.parseNumericAddress("2001:db8::1");
+ protected static final InetAddress TEST_ADDR_2 =
+ InetAddresses.parseNumericAddress("2001:db8::2");
+ protected static final InetAddress TEST_ADDR_V4 =
+ InetAddresses.parseNumericAddress("192.0.2.1");
+ protected static final InetAddress TEST_ADDR_V4_2 =
+ InetAddresses.parseNumericAddress("192.0.2.2");
protected static final InetAddress TEST_DNS_ADDR =
InetAddresses.parseNumericAddress("2001:DB8:0:1::");
protected static final InetAddress TEST_DNS_ADDR_2 =
@@ -129,6 +138,7 @@
new TelephonySubscriptionSnapshot(
TEST_SUB_ID,
Collections.singletonMap(TEST_SUB_ID, TEST_SUB_INFO),
+ Collections.EMPTY_MAP,
Collections.EMPTY_MAP);
@NonNull protected final Context mContext;
@@ -148,6 +158,9 @@
@NonNull protected final IpSecService mIpSecSvc;
@NonNull protected final ConnectivityManager mConnMgr;
+ @NonNull protected final IkeSessionConnectionInfo mIkeConnectionInfo;
+ @NonNull protected final IkeSessionConfiguration mIkeSessionConfiguration;
+
protected VcnIkeSession mMockIkeSession;
protected VcnGatewayConnection mGatewayConnection;
@@ -173,6 +186,10 @@
VcnTestUtils.setupSystemService(
mContext, mConnMgr, Context.CONNECTIVITY_SERVICE, ConnectivityManager.class);
+ mIkeConnectionInfo =
+ new IkeSessionConnectionInfo(TEST_ADDR, TEST_ADDR_2, mock(Network.class));
+ mIkeSessionConfiguration = new IkeSessionConfiguration.Builder(mIkeConnectionInfo).build();
+
doReturn(mContext).when(mVcnContext).getContext();
doReturn(mTestLooper.getLooper()).when(mVcnContext).getLooper();
doReturn(mVcnNetworkProvider).when(mVcnContext).getVcnNetworkProvider();
diff --git a/tests/vcn/java/com/android/server/vcn/routeselection/NetworkPriorityClassifierTest.java b/tests/vcn/java/com/android/server/vcn/routeselection/NetworkPriorityClassifierTest.java
index 6c849b5..b0d6895 100644
--- a/tests/vcn/java/com/android/server/vcn/routeselection/NetworkPriorityClassifierTest.java
+++ b/tests/vcn/java/com/android/server/vcn/routeselection/NetworkPriorityClassifierTest.java
@@ -30,6 +30,7 @@
import static com.android.server.vcn.routeselection.NetworkPriorityClassifier.checkMatchesPriorityRule;
import static com.android.server.vcn.routeselection.NetworkPriorityClassifier.checkMatchesWifiPriorityRule;
import static com.android.server.vcn.routeselection.UnderlyingNetworkControllerTest.getLinkPropertiesWithName;
+import static com.android.server.vcn.util.PersistableBundleUtils.PersistableBundleWrapper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -309,7 +310,9 @@
wifiNetworkPriority,
mWifiNetworkRecord,
selectedNetworkRecord,
- carrierConfig));
+ carrierConfig == null
+ ? null
+ : new PersistableBundleWrapper(carrierConfig)));
}
@Test
diff --git a/tests/vcn/java/com/android/server/vcn/util/MtuUtilsTest.java b/tests/vcn/java/com/android/server/vcn/util/MtuUtilsTest.java
index 29511f7..e9e7078 100644
--- a/tests/vcn/java/com/android/server/vcn/util/MtuUtilsTest.java
+++ b/tests/vcn/java/com/android/server/vcn/util/MtuUtilsTest.java
@@ -46,34 +46,85 @@
@RunWith(AndroidJUnit4.class)
@SmallTest
public class MtuUtilsTest {
- @Test
- public void testUnderlyingMtuZero() {
+ private void verifyUnderlyingMtuZero(boolean isIpv4) {
assertEquals(
- IPV6_MIN_MTU, getMtu(emptyList(), ETHER_MTU /* maxMtu */, 0 /* underlyingMtu */));
+ IPV6_MIN_MTU,
+ getMtu(emptyList(), ETHER_MTU /* maxMtu */, 0 /* underlyingMtu */, isIpv4));
}
@Test
- public void testClampsToMaxMtu() {
- assertEquals(0, getMtu(emptyList(), 0 /* maxMtu */, IPV6_MIN_MTU /* underlyingMtu */));
+ public void testUnderlyingMtuZeroV4() {
+ verifyUnderlyingMtuZero(true /* isIpv4 */);
}
@Test
- public void testNormalModeAlgorithmLessThanUnderlyingMtu() {
- final List<ChildSaProposal> saProposals =
- Arrays.asList(
- new ChildSaProposal.Builder()
- .addEncryptionAlgorithm(
- ENCRYPTION_ALGORITHM_AES_CBC, KEY_LEN_AES_256)
- .addIntegrityAlgorithm(INTEGRITY_ALGORITHM_HMAC_SHA2_256_128)
- .build());
+ public void testUnderlyingMtuZeroV6() {
+ verifyUnderlyingMtuZero(false /* isIpv4 */);
+ }
+ private void verifyClampsToMaxMtu(boolean isIpv4) {
+ assertEquals(
+ 0, getMtu(emptyList(), 0 /* maxMtu */, IPV6_MIN_MTU /* underlyingMtu */, isIpv4));
+ }
+
+ @Test
+ public void testClampsToMaxMtuV4() {
+ verifyClampsToMaxMtu(true /* isIpv4 */);
+ }
+
+ @Test
+ public void testClampsToMaxMtuV6() {
+ verifyClampsToMaxMtu(false /* isIpv4 */);
+ }
+
+ private List<ChildSaProposal> buildChildSaProposalsWithNormalModeAlgo() {
+ return Arrays.asList(
+ new ChildSaProposal.Builder()
+ .addEncryptionAlgorithm(ENCRYPTION_ALGORITHM_AES_CBC, KEY_LEN_AES_256)
+ .addIntegrityAlgorithm(INTEGRITY_ALGORITHM_HMAC_SHA2_256_128)
+ .build());
+ }
+
+ private void verifyNormalModeAlgorithmLessThanUnderlyingMtu(boolean isIpv4) {
final int actualMtu =
- getMtu(saProposals, ETHER_MTU /* maxMtu */, ETHER_MTU /* underlyingMtu */);
+ getMtu(
+ buildChildSaProposalsWithNormalModeAlgo(),
+ ETHER_MTU /* maxMtu */,
+ ETHER_MTU /* underlyingMtu */,
+ isIpv4);
assertTrue(ETHER_MTU > actualMtu);
}
@Test
- public void testCombinedModeAlgorithmLessThanUnderlyingMtu() {
+ public void testNormalModeAlgorithmLessThanUnderlyingMtuV4() {
+ verifyNormalModeAlgorithmLessThanUnderlyingMtu(true /* isIpv4 */);
+ }
+
+ @Test
+ public void testNormalModeAlgorithmLessThanUnderlyingMtuV6() {
+ verifyNormalModeAlgorithmLessThanUnderlyingMtu(false /* isIpv4 */);
+ }
+
+ @Test
+ public void testMtuIpv4LessThanMtuIpv6() {
+ final int actualMtuV4 =
+ getMtu(
+ buildChildSaProposalsWithNormalModeAlgo(),
+ ETHER_MTU /* maxMtu */,
+ ETHER_MTU /* underlyingMtu */,
+ true /* isIpv4 */);
+
+ final int actualMtuV6 =
+ getMtu(
+ buildChildSaProposalsWithNormalModeAlgo(),
+ ETHER_MTU /* maxMtu */,
+ ETHER_MTU /* underlyingMtu */,
+ false /* isIpv4 */);
+
+ assertTrue(actualMtuV4 < actualMtuV6);
+ }
+
+ private void verifyCombinedModeAlgorithmLessThanUnderlyingMtu(boolean isIpv4) {
final List<ChildSaProposal> saProposals =
Arrays.asList(
new ChildSaProposal.Builder()
@@ -86,7 +137,17 @@
.build());
final int actualMtu =
- getMtu(saProposals, ETHER_MTU /* maxMtu */, ETHER_MTU /* underlyingMtu */);
+ getMtu(saProposals, ETHER_MTU /* maxMtu */, ETHER_MTU /* underlyingMtu */, isIpv4);
assertTrue(ETHER_MTU > actualMtu);
}
+
+ @Test
+ public void testCombinedModeAlgorithmLessThanUnderlyingMtuV4() {
+ verifyCombinedModeAlgorithmLessThanUnderlyingMtu(true /* isIpv4 */);
+ }
+
+ @Test
+ public void testCombinedModeAlgorithmLessThanUnderlyingMtuV6() {
+ verifyCombinedModeAlgorithmLessThanUnderlyingMtu(false /* isIpv4 */);
+ }
}
diff --git a/tests/vcn/java/com/android/server/vcn/util/PersistableBundleUtilsTest.java b/tests/vcn/java/com/android/server/vcn/util/PersistableBundleUtilsTest.java
index a44a734..294f5c1 100644
--- a/tests/vcn/java/com/android/server/vcn/util/PersistableBundleUtilsTest.java
+++ b/tests/vcn/java/com/android/server/vcn/util/PersistableBundleUtilsTest.java
@@ -18,6 +18,8 @@
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import android.os.PersistableBundle;
@@ -211,4 +213,84 @@
assertEquals(testInt, result);
}
+
+ private PersistableBundle getTestBundle() {
+ final PersistableBundle bundle = new PersistableBundle();
+
+ bundle.putBoolean(TEST_KEY + "Boolean", true);
+ bundle.putBooleanArray(TEST_KEY + "BooleanArray", new boolean[] {true, false});
+ bundle.putDouble(TEST_KEY + "Double", 0.1);
+ bundle.putDoubleArray(TEST_KEY + "DoubleArray", new double[] {0.1, 0.2, 0.3});
+ bundle.putInt(TEST_KEY + "Int", 1);
+ bundle.putIntArray(TEST_KEY + "IntArray", new int[] {1, 2});
+ bundle.putLong(TEST_KEY + "Long", 5L);
+ bundle.putLongArray(TEST_KEY + "LongArray", new long[] {0L, -1L, -2L});
+ bundle.putString(TEST_KEY + "String", "TEST");
+ bundle.putStringArray(TEST_KEY + "StringArray", new String[] {"foo", "bar", "bas"});
+ bundle.putPersistableBundle(
+ TEST_KEY + "PersistableBundle",
+ new TestClass(1, TEST_INT_ARRAY, TEST_STRING_PREFIX, new PersistableBundle())
+ .toPersistableBundle());
+
+ return bundle;
+ }
+
+ @Test
+ public void testMinimizeBundle() throws Exception {
+ final String[] minimizedKeys =
+ new String[] {
+ TEST_KEY + "Boolean",
+ TEST_KEY + "BooleanArray",
+ TEST_KEY + "Double",
+ TEST_KEY + "DoubleArray",
+ TEST_KEY + "Int",
+ TEST_KEY + "IntArray",
+ TEST_KEY + "Long",
+ TEST_KEY + "LongArray",
+ TEST_KEY + "String",
+ TEST_KEY + "StringArray",
+ TEST_KEY + "PersistableBundle"
+ };
+
+ final PersistableBundle testBundle = getTestBundle();
+ testBundle.putBoolean(TEST_KEY + "Boolean2", true);
+
+ final PersistableBundle minimized =
+ PersistableBundleUtils.minimizeBundle(testBundle, minimizedKeys);
+
+ // Verify that the minimized bundle is NOT the same in size OR values due to the extra
+ // Boolean2 key
+ assertFalse(PersistableBundleUtils.isEqual(testBundle, minimized));
+
+ // Verify that removing the extra key from the source bundle results in equality.
+ testBundle.remove(TEST_KEY + "Boolean2");
+ assertTrue(PersistableBundleUtils.isEqual(testBundle, minimized));
+ }
+
+ @Test
+ public void testEquality_identical() throws Exception {
+ final PersistableBundle left = getTestBundle();
+ final PersistableBundle right = getTestBundle();
+
+ assertTrue(PersistableBundleUtils.isEqual(left, right));
+ }
+
+ @Test
+ public void testEquality_different() throws Exception {
+ final PersistableBundle left = getTestBundle();
+ final PersistableBundle right = getTestBundle();
+
+ left.putBoolean(TEST_KEY + "Boolean2", true);
+ assertFalse(PersistableBundleUtils.isEqual(left, right));
+
+ left.remove(TEST_KEY + "Boolean2");
+ assertTrue(PersistableBundleUtils.isEqual(left, right));
+ }
+
+ @Test
+ public void testEquality_null() throws Exception {
+ assertFalse(PersistableBundleUtils.isEqual(getTestBundle(), null));
+ assertFalse(PersistableBundleUtils.isEqual(null, getTestBundle()));
+ assertTrue(PersistableBundleUtils.isEqual(null, null));
+ }
}